From bd52ed365904df4a45ccc2ef0fcfc54afcf3d1fa Mon Sep 17 00:00:00 2001 From: Michael Desa Date: Fri, 18 Jan 2019 11:45:22 -0500 Subject: [PATCH] fix(authorizer): allow default source orgID to be in the sources list --- authorizer/source.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/authorizer/source.go b/authorizer/source.go index 37c74fa397..cd89f409bb 100644 --- a/authorizer/source.go +++ b/authorizer/source.go @@ -4,6 +4,7 @@ import ( "context" "github.com/influxdata/influxdb" + "github.com/influxdata/influxdb/bolt" ) var _ influxdb.SourceService = (*SourceService)(nil) @@ -96,6 +97,13 @@ func (s *SourceService) FindSources(ctx context.Context, opts influxdb.FindOptio return nil, 0, err } + // TODO(desa): this is a totaly hack and needs to be fixed. + // Specifically, we need to remove the concept of a default source. + if src.OrganizationID.String() == bolt.DefaultSourceOrganizationID { + sources = append(sources, src) + continue + } + if influxdb.ErrorCode(err) == influxdb.EUnauthorized { continue }