Merge pull request #11287 from influxdata/fix/default-source-org

fix(authorizer): allow default source orgID to be in the sources list
pull/11269/head
Michael Desa 2019-01-18 13:27:13 -05:00 committed by GitHub
commit 4863708c58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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
}