Documentation ¶
Index ¶
- Constants
- Variables
- func BucketAlreadyExistsError(n string) *influxdb.Error
- func CorruptURMError(err error) *influxdb.Error
- func ErrBucketNotFoundByName(n string) *influxdb.Error
- func ErrCorruptBucket(err error) *influxdb.Error
- func ErrCorruptID(err error) *influxdb.Error
- func ErrCorruptOrg(err error) *influxdb.Error
- func ErrCorruptUser(err error) *influxdb.Error
- func ErrInternalServiceError(err error) *influxdb.Error
- func ErrUnprocessableBucket(err error) *influxdb.Error
- func ErrUnprocessableMapping(err error) *influxdb.Error
- func ErrUnprocessableOrg(err error) *influxdb.Error
- func ErrUnprocessableUser(err error) *influxdb.Error
- func InvalidOrgIDError(err error) *influxdb.Error
- func InvalidUserIDError(err error) *influxdb.Error
- func NewBucketResponse(b *influxdb.Bucket) *bucketResponse
- func NewDuplicateReadBucketService(log *zap.Logger, oldSvc, newSvc influxdb.BucketService) influxdb.BucketService
- func NewDuplicateReadOrganizationService(log *zap.Logger, oldSvc, newSvc influxdb.OrganizationService) influxdb.OrganizationService
- func NewDuplicateReadPasswordsService(log *zap.Logger, oldSvc, newSvc influxdb.PasswordsService) influxdb.PasswordsService
- func NewDuplicateReadTenantService(log *zap.Logger, oldSvc, newSvc influxdb.TenantService) influxdb.TenantService
- func NewDuplicateReadUserResourceMappingService(log *zap.Logger, oldSvc, newSvc influxdb.UserResourceMappingService) influxdb.UserResourceMappingService
- func NewDuplicateReadUserService(log *zap.Logger, oldSvc, newSvc influxdb.UserService) influxdb.UserService
- func NewOnboardService(st *Store, as influxdb.AuthorizationService) influxdb.OnboardingService
- func NewOnboardingResponse(results *influxdb.OnboardingResults) *onboardingResponse
- func NewService(st *Store) influxdb.TenantService
- func NewURMHandler(log *zap.Logger, rt influxdb.ResourceType, idLookupKey string, ...) http.Handler
- func NonUniqueMappingError(userID influxdb.ID) error
- func OrgAlreadyExistsError(name string) error
- func OrgNotFoundByName(name string) error
- func UnavailablePasswordServiceError(err error) *influxdb.Error
- func UnavailableURMServiceError(err error) *influxdb.Error
- func UnexpectedUserBucketError(err error) *influxdb.Error
- func UnexpectedUserIndexError(err error) *influxdb.Error
- func UserAlreadyExistsError(n string) *influxdb.Error
- func ValidResource(api *kit.API, ...) kit.Middleware
- type AggregateError
- type AuthedBucketService
- func (s *AuthedBucketService) CreateBucket(ctx context.Context, b *influxdb.Bucket) error
- func (s *AuthedBucketService) DeleteBucket(ctx context.Context, id influxdb.ID) error
- func (s *AuthedBucketService) FindBucket(ctx context.Context, filter influxdb.BucketFilter) (*influxdb.Bucket, error)
- func (s *AuthedBucketService) FindBucketByID(ctx context.Context, id influxdb.ID) (*influxdb.Bucket, error)
- func (s *AuthedBucketService) FindBucketByName(ctx context.Context, orgID influxdb.ID, n string) (*influxdb.Bucket, error)
- func (s *AuthedBucketService) FindBuckets(ctx context.Context, filter influxdb.BucketFilter, opt ...influxdb.FindOptions) ([]*influxdb.Bucket, int, error)
- func (s *AuthedBucketService) UpdateBucket(ctx context.Context, id influxdb.ID, upd influxdb.BucketUpdate) (*influxdb.Bucket, error)
- type AuthedOnboardSvc
- func (s *AuthedOnboardSvc) IsOnboarding(ctx context.Context) (bool, error)
- func (s *AuthedOnboardSvc) OnboardInitialUser(ctx context.Context, req *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
- func (s *AuthedOnboardSvc) OnboardUser(ctx context.Context, req *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
- type AuthedOrgService
- func (s *AuthedOrgService) CreateOrganization(ctx context.Context, o *influxdb.Organization) error
- func (s *AuthedOrgService) DeleteOrganization(ctx context.Context, id influxdb.ID) error
- func (s *AuthedOrgService) FindOrganization(ctx context.Context, filter influxdb.OrganizationFilter) (*influxdb.Organization, error)
- func (s *AuthedOrgService) FindOrganizationByID(ctx context.Context, id influxdb.ID) (*influxdb.Organization, error)
- func (s *AuthedOrgService) FindOrganizations(ctx context.Context, filter influxdb.OrganizationFilter, ...) ([]*influxdb.Organization, int, error)
- func (s *AuthedOrgService) UpdateOrganization(ctx context.Context, id influxdb.ID, upd influxdb.OrganizationUpdate) (*influxdb.Organization, error)
- type AuthedPasswordService
- func (s *AuthedPasswordService) CompareAndSetPassword(ctx context.Context, userID influxdb.ID, old string, new string) error
- func (s *AuthedPasswordService) ComparePassword(ctx context.Context, userID influxdb.ID, password string) error
- func (s *AuthedPasswordService) SetPassword(ctx context.Context, userID influxdb.ID, password string) error
- type AuthedURMService
- func (s *AuthedURMService) CreateUserResourceMapping(ctx context.Context, m *influxdb.UserResourceMapping) error
- func (s *AuthedURMService) DeleteUserResourceMapping(ctx context.Context, resourceID influxdb.ID, userID influxdb.ID) error
- func (s *AuthedURMService) FindUserResourceMappings(ctx context.Context, filter influxdb.UserResourceMappingFilter, ...) ([]*influxdb.UserResourceMapping, int, error)
- type AuthedUserService
- func (s *AuthedUserService) CreateUser(ctx context.Context, o *influxdb.User) error
- func (s *AuthedUserService) DeleteUser(ctx context.Context, id influxdb.ID) error
- func (s *AuthedUserService) FindUser(ctx context.Context, filter influxdb.UserFilter) (*influxdb.User, error)
- func (s *AuthedUserService) FindUserByID(ctx context.Context, id influxdb.ID) (*influxdb.User, error)
- func (s *AuthedUserService) FindUsers(ctx context.Context, filter influxdb.UserFilter, opt ...influxdb.FindOptions) ([]*influxdb.User, int, error)
- func (s *AuthedUserService) UpdateUser(ctx context.Context, id influxdb.ID, upd influxdb.UserUpdate) (*influxdb.User, error)
- type BucketClientService
- func (s *BucketClientService) CreateBucket(ctx context.Context, b *influxdb.Bucket) error
- func (s *BucketClientService) DeleteBucket(ctx context.Context, id influxdb.ID) error
- func (s *BucketClientService) FindBucket(ctx context.Context, filter influxdb.BucketFilter) (*influxdb.Bucket, error)
- func (s *BucketClientService) FindBucketByID(ctx context.Context, id influxdb.ID) (*influxdb.Bucket, error)
- func (s *BucketClientService) FindBucketByName(ctx context.Context, orgID influxdb.ID, name string) (*influxdb.Bucket, error)
- func (s *BucketClientService) FindBuckets(ctx context.Context, filter influxdb.BucketFilter, opt ...influxdb.FindOptions) ([]*influxdb.Bucket, int, error)
- func (s *BucketClientService) UpdateBucket(ctx context.Context, id influxdb.ID, upd influxdb.BucketUpdate) (*influxdb.Bucket, error)
- type BucketFilter
- type BucketHandler
- type BucketLogger
- func (l *BucketLogger) CreateBucket(ctx context.Context, u *influxdb.Bucket) (err error)
- func (l *BucketLogger) DeleteBucket(ctx context.Context, id influxdb.ID) (err error)
- func (l *BucketLogger) FindBucket(ctx context.Context, filter influxdb.BucketFilter) (u *influxdb.Bucket, err error)
- func (l *BucketLogger) FindBucketByID(ctx context.Context, id influxdb.ID) (u *influxdb.Bucket, err error)
- func (l *BucketLogger) FindBucketByName(ctx context.Context, orgID influxdb.ID, name string) (u *influxdb.Bucket, err error)
- func (l *BucketLogger) FindBuckets(ctx context.Context, filter influxdb.BucketFilter, opt ...influxdb.FindOptions) (buckets []*influxdb.Bucket, n int, err error)
- func (l *BucketLogger) UpdateBucket(ctx context.Context, id influxdb.ID, upd influxdb.BucketUpdate) (u *influxdb.Bucket, err error)
- type BucketMetrics
- func (m *BucketMetrics) CreateBucket(ctx context.Context, b *influxdb.Bucket) error
- func (m *BucketMetrics) DeleteBucket(ctx context.Context, id influxdb.ID) error
- func (m *BucketMetrics) FindBucket(ctx context.Context, filter influxdb.BucketFilter) (*influxdb.Bucket, error)
- func (m *BucketMetrics) FindBucketByID(ctx context.Context, id influxdb.ID) (*influxdb.Bucket, error)
- func (m *BucketMetrics) FindBucketByName(ctx context.Context, orgID influxdb.ID, name string) (*influxdb.Bucket, error)
- func (m *BucketMetrics) FindBuckets(ctx context.Context, filter influxdb.BucketFilter, opt ...influxdb.FindOptions) ([]*influxdb.Bucket, int, error)
- func (m *BucketMetrics) UpdateBucket(ctx context.Context, id influxdb.ID, upd influxdb.BucketUpdate) (*influxdb.Bucket, error)
- type MetricsOption
- type OnboardClientService
- func (s *OnboardClientService) IsOnboarding(ctx context.Context) (bool, error)
- func (s *OnboardClientService) OnboardInitialUser(ctx context.Context, or *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
- func (s *OnboardClientService) OnboardUser(ctx context.Context, or *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
- type OnboardHandler
- type OnboardService
- func (s *OnboardService) IsOnboarding(ctx context.Context) (bool, error)
- func (s *OnboardService) OnboardInitialUser(ctx context.Context, req *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
- func (s *OnboardService) OnboardUser(ctx context.Context, req *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
- type OnboardingLogger
- func (l *OnboardingLogger) IsOnboarding(ctx context.Context) (available bool, err error)
- func (l *OnboardingLogger) OnboardInitialUser(ctx context.Context, req *influxdb.OnboardingRequest) (res *influxdb.OnboardingResults, err error)
- func (l *OnboardingLogger) OnboardUser(ctx context.Context, req *influxdb.OnboardingRequest) (res *influxdb.OnboardingResults, err error)
- type OnboardingMetrics
- func (m *OnboardingMetrics) IsOnboarding(ctx context.Context) (bool, error)
- func (m *OnboardingMetrics) OnboardInitialUser(ctx context.Context, req *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
- func (m *OnboardingMetrics) OnboardUser(ctx context.Context, req *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
- type OrgClientService
- func (s *OrgClientService) CreateOrganization(ctx context.Context, o *influxdb.Organization) error
- func (s *OrgClientService) DeleteOrganization(ctx context.Context, id influxdb.ID) error
- func (s *OrgClientService) FindOrganization(ctx context.Context, filter influxdb.OrganizationFilter) (*influxdb.Organization, error)
- func (s *OrgClientService) FindOrganizationByID(ctx context.Context, id influxdb.ID) (*influxdb.Organization, error)
- func (s *OrgClientService) FindOrganizations(ctx context.Context, filter influxdb.OrganizationFilter, ...) ([]*influxdb.Organization, int, error)
- func (s *OrgClientService) UpdateOrganization(ctx context.Context, id influxdb.ID, upd influxdb.OrganizationUpdate) (*influxdb.Organization, error)
- type OrgHandler
- type OrgLogger
- func (l *OrgLogger) CreateOrganization(ctx context.Context, u *influxdb.Organization) (err error)
- func (l *OrgLogger) DeleteOrganization(ctx context.Context, id influxdb.ID) (err error)
- func (l *OrgLogger) FindOrganization(ctx context.Context, filter influxdb.OrganizationFilter) (u *influxdb.Organization, err error)
- func (l *OrgLogger) FindOrganizationByID(ctx context.Context, id influxdb.ID) (u *influxdb.Organization, err error)
- func (l *OrgLogger) FindOrganizations(ctx context.Context, filter influxdb.OrganizationFilter, ...) (orgs []*influxdb.Organization, n int, err error)
- func (l *OrgLogger) UpdateOrganization(ctx context.Context, id influxdb.ID, upd influxdb.OrganizationUpdate) (u *influxdb.Organization, err error)
- type OrgMetrics
- func (m *OrgMetrics) CreateOrganization(ctx context.Context, b *influxdb.Organization) error
- func (m *OrgMetrics) DeleteOrganization(ctx context.Context, id influxdb.ID) error
- func (m *OrgMetrics) FindOrganization(ctx context.Context, filter influxdb.OrganizationFilter) (*influxdb.Organization, error)
- func (m *OrgMetrics) FindOrganizationByID(ctx context.Context, id influxdb.ID) (*influxdb.Organization, error)
- func (m *OrgMetrics) FindOrganizations(ctx context.Context, filter influxdb.OrganizationFilter, ...) ([]*influxdb.Organization, int, error)
- func (m *OrgMetrics) UpdateOrganization(ctx context.Context, id influxdb.ID, upd influxdb.OrganizationUpdate) (*influxdb.Organization, error)
- type PasswordClientService
- func (s *PasswordClientService) CompareAndSetPassword(ctx context.Context, userID influxdb.ID, old string, new string) error
- func (s *PasswordClientService) ComparePassword(ctx context.Context, userID influxdb.ID, password string) error
- func (s *PasswordClientService) SetPassword(ctx context.Context, userID influxdb.ID, password string) error
- type PasswordLogger
- func (l *PasswordLogger) CompareAndSetPassword(ctx context.Context, userID influxdb.ID, old, new string) (err error)
- func (l *PasswordLogger) ComparePassword(ctx context.Context, userID influxdb.ID, password string) (err error)
- func (l *PasswordLogger) SetPassword(ctx context.Context, userID influxdb.ID, password string) (err error)
- type PasswordMetrics
- func (m *PasswordMetrics) CompareAndSetPassword(ctx context.Context, userID influxdb.ID, old, new string) error
- func (m *PasswordMetrics) ComparePassword(ctx context.Context, userID influxdb.ID, password string) error
- func (m *PasswordMetrics) SetPassword(ctx context.Context, userID influxdb.ID, password string) error
- type Service
- func (s *Service) CompareAndSetPassword(ctx context.Context, userID influxdb.ID, old, new string) error
- func (s *Service) ComparePassword(ctx context.Context, userID influxdb.ID, password string) error
- func (s *Service) CreateBucket(ctx context.Context, b *influxdb.Bucket) error
- func (s *Service) CreateOrganization(ctx context.Context, o *influxdb.Organization) error
- func (s *Service) CreateUser(ctx context.Context, u *influxdb.User) error
- func (s *Service) CreateUserResourceMapping(ctx context.Context, m *influxdb.UserResourceMapping) error
- func (s *Service) DeleteBucket(ctx context.Context, id influxdb.ID) error
- func (s *Service) DeleteOrganization(ctx context.Context, id influxdb.ID) error
- func (s *Service) DeleteUser(ctx context.Context, id influxdb.ID) error
- func (s *Service) DeleteUserResourceMapping(ctx context.Context, resourceID, userID influxdb.ID) error
- func (s *Service) FindBucket(ctx context.Context, filter influxdb.BucketFilter) (*influxdb.Bucket, error)
- func (s *Service) FindBucketByID(ctx context.Context, id influxdb.ID) (*influxdb.Bucket, error)
- func (s *Service) FindBucketByName(ctx context.Context, orgID influxdb.ID, name string) (*influxdb.Bucket, error)
- func (s *Service) FindBuckets(ctx context.Context, filter influxdb.BucketFilter, opt ...influxdb.FindOptions) ([]*influxdb.Bucket, int, error)
- func (s *Service) FindOrganization(ctx context.Context, filter influxdb.OrganizationFilter) (*influxdb.Organization, error)
- func (s *Service) FindOrganizationByID(ctx context.Context, id influxdb.ID) (*influxdb.Organization, error)
- func (s *Service) FindOrganizations(ctx context.Context, filter influxdb.OrganizationFilter, ...) ([]*influxdb.Organization, int, error)
- func (s *Service) FindUser(ctx context.Context, filter influxdb.UserFilter) (*influxdb.User, error)
- func (s *Service) FindUserByID(ctx context.Context, id influxdb.ID) (*influxdb.User, error)
- func (s *Service) FindUserResourceMappings(ctx context.Context, filter influxdb.UserResourceMappingFilter, ...) ([]*influxdb.UserResourceMapping, int, error)
- func (s *Service) FindUsers(ctx context.Context, filter influxdb.UserFilter, opt ...influxdb.FindOptions) ([]*influxdb.User, int, error)
- func (s *Service) SetPassword(ctx context.Context, userID influxdb.ID, password string) error
- func (s *Service) UpdateBucket(ctx context.Context, id influxdb.ID, upd influxdb.BucketUpdate) (*influxdb.Bucket, error)
- func (s *Service) UpdateOrganization(ctx context.Context, id influxdb.ID, upd influxdb.OrganizationUpdate) (*influxdb.Organization, error)
- func (s *Service) UpdateUser(ctx context.Context, id influxdb.ID, upd influxdb.UserUpdate) (*influxdb.User, error)
- type Store
- func (s *Store) CreateBucket(ctx context.Context, tx kv.Tx, bucket *influxdb.Bucket) error
- func (s *Store) CreateOrg(ctx context.Context, tx kv.Tx, o *influxdb.Organization) error
- func (s *Store) CreateURM(ctx context.Context, tx kv.Tx, urm *influxdb.UserResourceMapping) error
- func (s *Store) CreateUser(ctx context.Context, tx kv.Tx, u *influxdb.User) error
- func (s *Store) DeleteBucket(ctx context.Context, tx kv.Tx, id influxdb.ID) error
- func (s *Store) DeleteOrg(ctx context.Context, tx kv.Tx, id influxdb.ID) error
- func (s *Store) DeletePassword(ctx context.Context, tx kv.Tx, id influxdb.ID) error
- func (s *Store) DeleteURM(ctx context.Context, tx kv.Tx, resourceID, userID influxdb.ID) error
- func (s *Store) DeleteUser(ctx context.Context, tx kv.Tx, id influxdb.ID) error
- func (s *Store) GetBucket(ctx context.Context, tx kv.Tx, id influxdb.ID) (*influxdb.Bucket, error)
- func (s *Store) GetBucketByName(ctx context.Context, tx kv.Tx, orgID influxdb.ID, n string) (*influxdb.Bucket, error)
- func (s *Store) GetOrg(ctx context.Context, tx kv.Tx, id influxdb.ID) (*influxdb.Organization, error)
- func (s *Store) GetOrgByName(ctx context.Context, tx kv.Tx, n string) (*influxdb.Organization, error)
- func (s *Store) GetPassword(ctx context.Context, tx kv.Tx, id influxdb.ID) (string, error)
- func (s *Store) GetURM(ctx context.Context, tx kv.Tx, resourceID, userID influxdb.ID) (*influxdb.UserResourceMapping, error)
- func (s *Store) GetUser(ctx context.Context, tx kv.Tx, id influxdb.ID) (*influxdb.User, error)
- func (s *Store) GetUserByName(ctx context.Context, tx kv.Tx, n string) (*influxdb.User, error)
- func (s *Store) ListBuckets(ctx context.Context, tx kv.Tx, filter BucketFilter, ...) ([]*influxdb.Bucket, error)
- func (s *Store) ListOrgs(ctx context.Context, tx kv.Tx, opt ...influxdb.FindOptions) ([]*influxdb.Organization, error)
- func (s *Store) ListURMs(ctx context.Context, tx kv.Tx, filter influxdb.UserResourceMappingFilter, ...) ([]*influxdb.UserResourceMapping, error)
- func (s *Store) ListUsers(ctx context.Context, tx kv.Tx, opt ...influxdb.FindOptions) ([]*influxdb.User, error)
- func (s *Store) SetPassword(ctx context.Context, tx kv.Tx, id influxdb.ID, password string) error
- func (s *Store) Update(ctx context.Context, fn func(kv.Tx) error) error
- func (s *Store) UpdateBucket(ctx context.Context, tx kv.Tx, id influxdb.ID, upd influxdb.BucketUpdate) (*influxdb.Bucket, error)
- func (s *Store) UpdateOrg(ctx context.Context, tx kv.Tx, id influxdb.ID, upd influxdb.OrganizationUpdate) (*influxdb.Organization, error)
- func (s *Store) UpdateUser(ctx context.Context, tx kv.Tx, id influxdb.ID, upd influxdb.UserUpdate) (*influxdb.User, error)
- func (s *Store) View(ctx context.Context, fn func(kv.Tx) error) error
- type URMLogger
- func (l *URMLogger) CreateUserResourceMapping(ctx context.Context, u *influxdb.UserResourceMapping) (err error)
- func (l *URMLogger) DeleteUserResourceMapping(ctx context.Context, resourceID, userID influxdb.ID) (err error)
- func (l *URMLogger) FindUserResourceMappings(ctx context.Context, filter influxdb.UserResourceMappingFilter, ...) (urms []*influxdb.UserResourceMapping, n int, err error)
- type UrmMetrics
- func (m *UrmMetrics) CreateUserResourceMapping(ctx context.Context, urm *influxdb.UserResourceMapping) error
- func (m *UrmMetrics) DeleteUserResourceMapping(ctx context.Context, resourceID, userID influxdb.ID) error
- func (m *UrmMetrics) FindUserResourceMappings(ctx context.Context, filter influxdb.UserResourceMappingFilter, ...) ([]*influxdb.UserResourceMapping, int, error)
- type UserClientService
- func (s *UserClientService) CreateUser(ctx context.Context, u *influxdb.User) error
- func (s *UserClientService) DeleteUser(ctx context.Context, id influxdb.ID) error
- func (s *UserClientService) FindMe(ctx context.Context, id influxdb.ID) (*influxdb.User, error)
- func (s *UserClientService) FindUser(ctx context.Context, filter influxdb.UserFilter) (*influxdb.User, error)
- func (s *UserClientService) FindUserByID(ctx context.Context, id influxdb.ID) (*influxdb.User, error)
- func (s *UserClientService) FindUsers(ctx context.Context, filter influxdb.UserFilter, opt ...influxdb.FindOptions) ([]*influxdb.User, int, error)
- func (s *UserClientService) UpdateUser(ctx context.Context, id influxdb.ID, upd influxdb.UserUpdate) (*influxdb.User, error)
- type UserHandler
- type UserLogger
- func (l *UserLogger) CreateUser(ctx context.Context, u *influxdb.User) (err error)
- func (l *UserLogger) DeleteUser(ctx context.Context, id influxdb.ID) (err error)
- func (l *UserLogger) FindUser(ctx context.Context, filter influxdb.UserFilter) (u *influxdb.User, err error)
- func (l *UserLogger) FindUserByID(ctx context.Context, id influxdb.ID) (u *influxdb.User, err error)
- func (l *UserLogger) FindUsers(ctx context.Context, filter influxdb.UserFilter, opt ...influxdb.FindOptions) (users []*influxdb.User, n int, err error)
- func (l *UserLogger) UpdateUser(ctx context.Context, id influxdb.ID, upd influxdb.UserUpdate) (u *influxdb.User, err error)
- type UserMetrics
- func (m *UserMetrics) CreateUser(ctx context.Context, u *influxdb.User) error
- func (m *UserMetrics) DeleteUser(ctx context.Context, id influxdb.ID) error
- func (m *UserMetrics) FindUser(ctx context.Context, filter influxdb.UserFilter) (*influxdb.User, error)
- func (m *UserMetrics) FindUserByID(ctx context.Context, id influxdb.ID) (*influxdb.User, error)
- func (m *UserMetrics) FindUsers(ctx context.Context, filter influxdb.UserFilter, opt ...influxdb.FindOptions) ([]*influxdb.User, int, error)
- func (m *UserMetrics) UpdateUser(ctx context.Context, id influxdb.ID, upd influxdb.UserUpdate) (*influxdb.User, error)
Constants ¶
const MaxIDGenerationN = 100
const ReservedIDs = 1000
Variables ¶
var ( // ErrNameisEmpty is when a name is empty ErrNameisEmpty = &influxdb.Error{ Code: influxdb.EInvalid, Msg: "name is empty", } // NotUniqueIDError is used when attempting to create an org or bucket that already // exists. NotUniqueIDError = &influxdb.Error{ Code: influxdb.EConflict, Msg: "ID already exists", } // ErrFailureGeneratingID occurs ony when the random number generator // cannot generate an ID in MaxIDGenerationN times. ErrFailureGeneratingID = &influxdb.Error{ Code: influxdb.EInternal, Msg: "unable to generate valid id", } // ErrOnboardingNotAllowed occurs when request to onboard comes in and we are not allowing this request ErrOnboardingNotAllowed = &influxdb.Error{ Code: influxdb.EConflict, Msg: "onboarding has already been completed", } ErrOnboardInvalid = &influxdb.Error{ Code: influxdb.EEmptyValue, Msg: "onboard failed, missing value", } ErrNotFound = &influxdb.Error{ Code: influxdb.ENotFound, Msg: "not found", } )
var ( ErrBucketNotFound = &influxdb.Error{ Code: influxdb.ENotFound, Msg: "bucket not found", } ErrBucketNameNotUnique = &influxdb.Error{ Code: influxdb.EConflict, Msg: "bucket name is not unique", } )
var ( // ErrInvalidURMID is used when the service was provided // an invalid ID format. ErrInvalidURMID = &influxdb.Error{ Code: influxdb.EInvalid, Msg: "provided user resource mapping ID has invalid format", } // ErrURMNotFound is used when the user resource mapping is not found. ErrURMNotFound = &influxdb.Error{ Msg: "user to resource mapping not found", Code: influxdb.ENotFound, } )
var ( // ErrUserNotFound is used when the user is not found. ErrUserNotFound = &influxdb.Error{ Msg: "user not found", Code: influxdb.ENotFound, } // EIncorrectPassword is returned when any password operation fails in which // we do not want to leak information. EIncorrectPassword = &influxdb.Error{ Code: influxdb.EForbidden, Msg: "your username or password is incorrect", } // EIncorrectUser is returned when any user is failed to be found which indicates // the userID provided is for a user that does not exist. EIncorrectUser = &influxdb.Error{ Code: influxdb.EForbidden, Msg: "your userID is incorrect", } // EShortPassword is used when a password is less than the minimum // acceptable password length. EShortPassword = &influxdb.Error{ Code: influxdb.EInvalid, Msg: "passwords must be at least 8 characters long", } )
var (
// ErrOrgNotFound is used when the user is not found.
ErrOrgNotFound = &influxdb.Error{
Msg: "organization not found",
Code: influxdb.ENotFound,
}
)
Functions ¶
func BucketAlreadyExistsError ¶
func BucketAlreadyExistsError(n string) *influxdb.Error
BucketAlreadyExistsError is used when attempting to create a user with a name that already exists.
func CorruptURMError ¶
func CorruptURMError(err error) *influxdb.Error
CorruptURMError is used when the config cannot be unmarshalled from the bytes stored in the kv.
func ErrBucketNotFoundByName ¶
func ErrBucketNotFoundByName(n string) *influxdb.Error
ErrBucketNotFoundByName is used when the user is not found.
func ErrCorruptBucket ¶
func ErrCorruptBucket(err error) *influxdb.Error
ErrCorruptBucket is used when the user cannot be unmarshalled from the bytes stored in the kv.
func ErrCorruptID ¶
func ErrCorruptID(err error) *influxdb.Error
ErrCorruptID the ID stored in the Store is corrupt.
func ErrCorruptOrg ¶
func ErrCorruptOrg(err error) *influxdb.Error
ErrCorruptOrg is used when the user cannot be unmarshalled from the bytes stored in the kv.
func ErrCorruptUser ¶
func ErrCorruptUser(err error) *influxdb.Error
ErrCorruptUser is used when the user cannot be unmarshalled from the bytes stored in the kv.
func ErrInternalServiceError ¶
func ErrInternalServiceError(err error) *influxdb.Error
ErrInternalServiceError is used when the error comes from an internal system.
func ErrUnprocessableBucket ¶
func ErrUnprocessableBucket(err error) *influxdb.Error
ErrUnprocessableBucket is used when a org is not able to be processed.
func ErrUnprocessableMapping ¶
func ErrUnprocessableMapping(err error) *influxdb.Error
ErrUnprocessableMapping is used when a user resource mapping is not able to be converted to JSON.
func ErrUnprocessableOrg ¶
func ErrUnprocessableOrg(err error) *influxdb.Error
ErrUnprocessableOrg is used when a org is not able to be processed.
func ErrUnprocessableUser ¶
func ErrUnprocessableUser(err error) *influxdb.Error
ErrUnprocessableUser is used when a user is not able to be processed.
func InvalidOrgIDError ¶
func InvalidOrgIDError(err error) *influxdb.Error
InvalidOrgIDError is used when a service was provided an invalid ID. This is some sort of internal server error.
func InvalidUserIDError ¶
func InvalidUserIDError(err error) *influxdb.Error
InvalidUserIDError is used when a service was provided an invalid ID. This is some sort of internal server error.
func NewBucketResponse ¶
func NewBucketResponse(b *influxdb.Bucket) *bucketResponse
func NewDuplicateReadBucketService ¶
func NewDuplicateReadBucketService(log *zap.Logger, oldSvc, newSvc influxdb.BucketService) influxdb.BucketService
NewDuplicateReadBucketService returns a service that duplicates the reads to oldSvc and newSvc.
func NewDuplicateReadOrganizationService ¶
func NewDuplicateReadOrganizationService(log *zap.Logger, oldSvc, newSvc influxdb.OrganizationService) influxdb.OrganizationService
NewDuplicateReadOrganizationService returns a service that duplicates the reads to oldSvc and newSvc.
func NewDuplicateReadPasswordsService ¶
func NewDuplicateReadPasswordsService(log *zap.Logger, oldSvc, newSvc influxdb.PasswordsService) influxdb.PasswordsService
NewDuplicateReadPasswordsService returns a service that duplicates the reads to oldSvc and newSvc.
func NewDuplicateReadTenantService ¶
func NewDuplicateReadTenantService(log *zap.Logger, oldSvc, newSvc influxdb.TenantService) influxdb.TenantService
NewDuplicateReadTenantService returns a tenant service that duplicates the reads to oldSvc and newSvc. The foreseen use case is to compare two service versions, an old one and a new one. The resulting influxdb.TenantService:
- forwards writes to the old service;
- reads from the old one, if no error is encountered, it reads from the new one;
- compares the results obtained and logs the difference, if any.
func NewDuplicateReadUserResourceMappingService ¶
func NewDuplicateReadUserResourceMappingService(log *zap.Logger, oldSvc, newSvc influxdb.UserResourceMappingService) influxdb.UserResourceMappingService
NewDuplicateReadUserResourceMappingService returns a service that duplicates the reads to oldSvc and newSvc.
func NewDuplicateReadUserService ¶
func NewDuplicateReadUserService(log *zap.Logger, oldSvc, newSvc influxdb.UserService) influxdb.UserService
NewDuplicateReadUserService returns a service that duplicates the reads to oldSvc and newSvc.
func NewOnboardService ¶
func NewOnboardService(st *Store, as influxdb.AuthorizationService) influxdb.OnboardingService
func NewOnboardingResponse ¶
func NewOnboardingResponse(results *influxdb.OnboardingResults) *onboardingResponse
func NewService ¶
func NewService(st *Store) influxdb.TenantService
func NewURMHandler ¶
func NewURMHandler(log *zap.Logger, rt influxdb.ResourceType, idLookupKey string, uSvc influxdb.UserService, urmSvc influxdb.UserResourceMappingService) http.Handler
NewURMHandler generates a mountable handler for URMs. It needs to know how it will be looking up your resource id this system assumes you are using chi syntax for query string params `/orgs/{id}/` so it can use chi.URLParam().
func NonUniqueMappingError ¶
func NonUniqueMappingError(userID influxdb.ID) error
NonUniqueMappingError is an internal error when a user already has been mapped to a resource
func OrgAlreadyExistsError ¶
OrgAlreadyExistsError is used when creating a new organization with a name that has already been used. Organization names must be unique.
func OrgNotFoundByName ¶
func UnavailablePasswordServiceError ¶
func UnavailablePasswordServiceError(err error) *influxdb.Error
UnavailablePasswordServiceError is used if we aren't able to add the password to the store, it means the store is not available at the moment (e.g. network).
func UnavailableURMServiceError ¶
func UnavailableURMServiceError(err error) *influxdb.Error
UnavailableURMServiceError is used if we aren't able to interact with the store, it means the store is not available at the moment (e.g. network).
func UnexpectedUserBucketError ¶
func UnexpectedUserBucketError(err error) *influxdb.Error
UnexpectedUserBucketError is used when the error comes from an internal system.
func UnexpectedUserIndexError ¶
func UnexpectedUserIndexError(err error) *influxdb.Error
UnexpectedUserIndexError is used when the error comes from an internal system.
func UserAlreadyExistsError ¶
func UserAlreadyExistsError(n string) *influxdb.Error
UserAlreadyExistsError is used when attempting to create a user with a name that already exists.
func ValidResource ¶
func ValidResource(api *kit.API, lookupOrgByResourceID func(context.Context, influxdb.ID) (influxdb.ID, error)) kit.Middleware
ValidResource make sure a resource exists when a sub system needs to be mounted to an api
Types ¶
type AggregateError ¶
type AggregateError struct {
// contains filtered or unexported fields
}
AggregateError enables composing multiple errors. This is ideal in the case that you are applying functions with side effects to a slice of elements. E.g., deleting/updating a slice of resources.
func NewAggregateError ¶
func NewAggregateError() *AggregateError
NewAggregateError returns a new AggregateError.
func (*AggregateError) Add ¶
func (e *AggregateError) Add(err error)
Add adds an error to the aggregate.
func (*AggregateError) Err ¶
func (e *AggregateError) Err() error
Err returns a proper error from this aggregate error.
type AuthedBucketService ¶
type AuthedBucketService struct {
// contains filtered or unexported fields
}
AuthedBucketService wraps a influxdb.BucketService and authorizes actions against it appropriately.
func NewAuthedBucketService ¶
func NewAuthedBucketService(s influxdb.BucketService, u influxdb.UserResourceMappingService) *AuthedBucketService
NewAuthedBucketService constructs an instance of an authorizing bucket serivce.
func (*AuthedBucketService) CreateBucket ¶
func (s *AuthedBucketService) CreateBucket(ctx context.Context, b *influxdb.Bucket) error
CreateBucket checks to see if the authorizer on context has write access to the global buckets resource.
func (*AuthedBucketService) DeleteBucket ¶
func (s *AuthedBucketService) DeleteBucket(ctx context.Context, id influxdb.ID) error
DeleteBucket checks to see if the authorizer on context has write access to the bucket provided.
func (*AuthedBucketService) FindBucket ¶
func (s *AuthedBucketService) FindBucket(ctx context.Context, filter influxdb.BucketFilter) (*influxdb.Bucket, error)
FindBucket retrieves the bucket and checks to see if the authorizer on context has read access to the bucket.
func (*AuthedBucketService) FindBucketByID ¶
func (s *AuthedBucketService) FindBucketByID(ctx context.Context, id influxdb.ID) (*influxdb.Bucket, error)
FindBucketByID checks to see if the authorizer on context has read access to the id provided.
func (*AuthedBucketService) FindBucketByName ¶
func (s *AuthedBucketService) FindBucketByName(ctx context.Context, orgID influxdb.ID, n string) (*influxdb.Bucket, error)
FindBucketByName returns a bucket by name for a particular organization.
func (*AuthedBucketService) FindBuckets ¶
func (s *AuthedBucketService) FindBuckets(ctx context.Context, filter influxdb.BucketFilter, opt ...influxdb.FindOptions) ([]*influxdb.Bucket, int, error)
FindBuckets retrieves all buckets that match the provided filter and then filters the list down to only the resources that are authorized.
func (*AuthedBucketService) UpdateBucket ¶
func (s *AuthedBucketService) UpdateBucket(ctx context.Context, id influxdb.ID, upd influxdb.BucketUpdate) (*influxdb.Bucket, error)
UpdateBucket checks to see if the authorizer on context has write access to the bucket provided.
type AuthedOnboardSvc ¶
type AuthedOnboardSvc struct {
// contains filtered or unexported fields
}
AuthedOnboardSvc wraps a influxdb.OnboardingService and authorizes actions against it appropriately.
func NewAuthedOnboardSvc ¶
func NewAuthedOnboardSvc(s influxdb.OnboardingService) *AuthedOnboardSvc
NewAuthedOnboardSvc constructs an instance of an authorizing org serivce.
func (*AuthedOnboardSvc) IsOnboarding ¶
func (s *AuthedOnboardSvc) IsOnboarding(ctx context.Context) (bool, error)
IsOnboarding pass through. this is handled by the underlieing service layer
func (*AuthedOnboardSvc) OnboardInitialUser ¶
func (s *AuthedOnboardSvc) OnboardInitialUser(ctx context.Context, req *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
OnboardInitialUser pass through. this is handled by the underlieing service layer
func (*AuthedOnboardSvc) OnboardUser ¶
func (s *AuthedOnboardSvc) OnboardUser(ctx context.Context, req *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
OnboardUser needs to confirm this user has access to do global create for multiple resources
type AuthedOrgService ¶
type AuthedOrgService struct {
// contains filtered or unexported fields
}
AuthedOrgService wraps a influxdb.OrganizationService and authorizes actions against it appropriately.
func NewAuthedOrgService ¶
func NewAuthedOrgService(s influxdb.OrganizationService) *AuthedOrgService
NewAuthedOrgService constructs an instance of an authorizing org serivce.
func (*AuthedOrgService) CreateOrganization ¶
func (s *AuthedOrgService) CreateOrganization(ctx context.Context, o *influxdb.Organization) error
CreateOrganization checks to see if the authorizer on context has write access to the global orgs resource.
func (*AuthedOrgService) DeleteOrganization ¶
func (s *AuthedOrgService) DeleteOrganization(ctx context.Context, id influxdb.ID) error
DeleteOrganization checks to see if the authorizer on context has write access to the organization provided.
func (*AuthedOrgService) FindOrganization ¶
func (s *AuthedOrgService) FindOrganization(ctx context.Context, filter influxdb.OrganizationFilter) (*influxdb.Organization, error)
FindOrganization retrieves the organization and checks to see if the authorizer on context has read access to the org.
func (*AuthedOrgService) FindOrganizationByID ¶
func (s *AuthedOrgService) FindOrganizationByID(ctx context.Context, id influxdb.ID) (*influxdb.Organization, error)
FindOrganizationByID checks to see if the authorizer on context has read access to the id provided.
func (*AuthedOrgService) FindOrganizations ¶
func (s *AuthedOrgService) FindOrganizations(ctx context.Context, filter influxdb.OrganizationFilter, opt ...influxdb.FindOptions) ([]*influxdb.Organization, int, error)
FindOrganizations retrieves all organizations that match the provided filter and then filters the list down to only the resources that are authorized.
func (*AuthedOrgService) UpdateOrganization ¶
func (s *AuthedOrgService) UpdateOrganization(ctx context.Context, id influxdb.ID, upd influxdb.OrganizationUpdate) (*influxdb.Organization, error)
UpdateOrganization checks to see if the authorizer on context has write access to the organization provided.
type AuthedPasswordService ¶
type AuthedPasswordService struct {
// contains filtered or unexported fields
}
AuthedPasswordService is a new authorization middleware for a password service.
func NewAuthedPasswordService ¶
func NewAuthedPasswordService(svc influxdb.PasswordsService) *AuthedPasswordService
NewAuthedPasswordService wraps an existing password service with auth middlware.
func (*AuthedPasswordService) CompareAndSetPassword ¶
func (s *AuthedPasswordService) CompareAndSetPassword(ctx context.Context, userID influxdb.ID, old string, new string) error
CompareAndSetPassword checks the password and if they match updates to the new password.
func (*AuthedPasswordService) ComparePassword ¶
func (s *AuthedPasswordService) ComparePassword(ctx context.Context, userID influxdb.ID, password string) error
ComparePassword checks if the password matches the password recorded. Passwords that do not match return errors.
func (*AuthedPasswordService) SetPassword ¶
func (s *AuthedPasswordService) SetPassword(ctx context.Context, userID influxdb.ID, password string) error
SetPassword overrides the password of a known user.
type AuthedURMService ¶
type AuthedURMService struct {
// contains filtered or unexported fields
}
func NewAuthedURMService ¶
func NewAuthedURMService(orgSvc influxdb.OrganizationService, s influxdb.UserResourceMappingService) *AuthedURMService
func (*AuthedURMService) CreateUserResourceMapping ¶
func (s *AuthedURMService) CreateUserResourceMapping(ctx context.Context, m *influxdb.UserResourceMapping) error
func (*AuthedURMService) DeleteUserResourceMapping ¶
func (s *AuthedURMService) DeleteUserResourceMapping(ctx context.Context, resourceID influxdb.ID, userID influxdb.ID) error
func (*AuthedURMService) FindUserResourceMappings ¶
func (s *AuthedURMService) FindUserResourceMappings(ctx context.Context, filter influxdb.UserResourceMappingFilter, opt ...influxdb.FindOptions) ([]*influxdb.UserResourceMapping, int, error)
type AuthedUserService ¶
type AuthedUserService struct {
// contains filtered or unexported fields
}
AuthedUserService wraps a influxdb.UserService and authorizes actions against it appropriately.
func NewAuthedUserService ¶
func NewAuthedUserService(s influxdb.UserService) *AuthedUserService
NewAuthedUserService constructs an instance of an authorizing user serivce.
func (*AuthedUserService) CreateUser ¶
func (s *AuthedUserService) CreateUser(ctx context.Context, o *influxdb.User) error
CreateUser checks to see if the authorizer on context has write access to the global users resource.
func (*AuthedUserService) DeleteUser ¶
func (s *AuthedUserService) DeleteUser(ctx context.Context, id influxdb.ID) error
DeleteUser checks to see if the authorizer on context has write access to the user provided.
func (*AuthedUserService) FindUser ¶
func (s *AuthedUserService) FindUser(ctx context.Context, filter influxdb.UserFilter) (*influxdb.User, error)
FindUser retrieves the user and checks to see if the authorizer on context has read access to the user.
func (*AuthedUserService) FindUserByID ¶
func (s *AuthedUserService) FindUserByID(ctx context.Context, id influxdb.ID) (*influxdb.User, error)
FindUserByID checks to see if the authorizer on context has read access to the id provided.
func (*AuthedUserService) FindUsers ¶
func (s *AuthedUserService) FindUsers(ctx context.Context, filter influxdb.UserFilter, opt ...influxdb.FindOptions) ([]*influxdb.User, int, error)
FindUsers retrieves all users that match the provided filter and then filters the list down to only the resources that are authorized.
func (*AuthedUserService) UpdateUser ¶
func (s *AuthedUserService) UpdateUser(ctx context.Context, id influxdb.ID, upd influxdb.UserUpdate) (*influxdb.User, error)
UpdateUser checks to see if the authorizer on context has write access to the user provided.
type BucketClientService ¶
type BucketClientService struct { Client *httpc.Client // OpPrefix is an additional property for error // find bucket service, when finds nothing. OpPrefix string }
BucketClientService connects to Influx via HTTP using tokens to manage buckets
func (*BucketClientService) CreateBucket ¶
func (s *BucketClientService) CreateBucket(ctx context.Context, b *influxdb.Bucket) error
CreateBucket creates a new bucket and sets b.ID with the new identifier.
func (*BucketClientService) DeleteBucket ¶
func (s *BucketClientService) DeleteBucket(ctx context.Context, id influxdb.ID) error
DeleteBucket removes a bucket by ID.
func (*BucketClientService) FindBucket ¶
func (s *BucketClientService) FindBucket(ctx context.Context, filter influxdb.BucketFilter) (*influxdb.Bucket, error)
FindBucket returns the first bucket that matches filter.
func (*BucketClientService) FindBucketByID ¶
func (s *BucketClientService) FindBucketByID(ctx context.Context, id influxdb.ID) (*influxdb.Bucket, error)
FindBucketByID returns a single bucket by ID.
func (*BucketClientService) FindBucketByName ¶
func (s *BucketClientService) FindBucketByName(ctx context.Context, orgID influxdb.ID, name string) (*influxdb.Bucket, error)
FindBucketByName returns a single bucket by name
func (*BucketClientService) FindBuckets ¶
func (s *BucketClientService) FindBuckets(ctx context.Context, filter influxdb.BucketFilter, opt ...influxdb.FindOptions) ([]*influxdb.Bucket, int, error)
FindBuckets returns a list of buckets that match filter and the total count of matching buckets. Additional options provide pagination & sorting.
func (*BucketClientService) UpdateBucket ¶
func (s *BucketClientService) UpdateBucket(ctx context.Context, id influxdb.ID, upd influxdb.BucketUpdate) (*influxdb.Bucket, error)
UpdateBucket updates a single bucket with changeset. Returns the new bucket state after update.
type BucketFilter ¶
type BucketFilter struct { Name *string OrganizationID *influxdb.ID }
type BucketHandler ¶
BucketHandler represents an HTTP API handler for users.
func NewHTTPBucketHandler ¶
func NewHTTPBucketHandler(log *zap.Logger, bucketSvc influxdb.BucketService, urmHandler, labelHandler http.Handler) *BucketHandler
NewHTTPBucketHandler constructs a new http server.
func (*BucketHandler) Prefix ¶
func (h *BucketHandler) Prefix() string
type BucketLogger ¶
type BucketLogger struct {
// contains filtered or unexported fields
}
func NewBucketLogger ¶
func NewBucketLogger(log *zap.Logger, s influxdb.BucketService) *BucketLogger
NewBucketLogger returns a logging service middleware for the Bucket Service.
func (*BucketLogger) CreateBucket ¶
func (l *BucketLogger) CreateBucket(ctx context.Context, u *influxdb.Bucket) (err error)
func (*BucketLogger) DeleteBucket ¶
func (l *BucketLogger) DeleteBucket(ctx context.Context, id influxdb.ID) (err error)
func (*BucketLogger) FindBucket ¶
func (l *BucketLogger) FindBucket(ctx context.Context, filter influxdb.BucketFilter) (u *influxdb.Bucket, err error)
func (*BucketLogger) FindBucketByID ¶
func (l *BucketLogger) FindBucketByID(ctx context.Context, id influxdb.ID) (u *influxdb.Bucket, err error)
func (*BucketLogger) FindBucketByName ¶
func (l *BucketLogger) FindBucketByName(ctx context.Context, orgID influxdb.ID, name string) (u *influxdb.Bucket, err error)
func (*BucketLogger) FindBuckets ¶
func (l *BucketLogger) FindBuckets(ctx context.Context, filter influxdb.BucketFilter, opt ...influxdb.FindOptions) (buckets []*influxdb.Bucket, n int, err error)
func (*BucketLogger) UpdateBucket ¶
func (l *BucketLogger) UpdateBucket(ctx context.Context, id influxdb.ID, upd influxdb.BucketUpdate) (u *influxdb.Bucket, err error)
type BucketMetrics ¶
type BucketMetrics struct {
// contains filtered or unexported fields
}
func NewBucketMetrics ¶
func NewBucketMetrics(reg prometheus.Registerer, s influxdb.BucketService, opts ...MetricsOption) *BucketMetrics
NewBucketMetrics returns a metrics service middleware for the Bucket Service.
func (*BucketMetrics) CreateBucket ¶
func (m *BucketMetrics) CreateBucket(ctx context.Context, b *influxdb.Bucket) error
Creates a new bucket and sets b.ID with the new identifier.
func (*BucketMetrics) DeleteBucket ¶
func (m *BucketMetrics) DeleteBucket(ctx context.Context, id influxdb.ID) error
Removes a bucket by ID.
func (*BucketMetrics) FindBucket ¶
func (m *BucketMetrics) FindBucket(ctx context.Context, filter influxdb.BucketFilter) (*influxdb.Bucket, error)
Returns the first bucket that matches filter.
func (*BucketMetrics) FindBucketByID ¶
func (m *BucketMetrics) FindBucketByID(ctx context.Context, id influxdb.ID) (*influxdb.Bucket, error)
Returns a single bucket by ID.
func (*BucketMetrics) FindBucketByName ¶
func (m *BucketMetrics) FindBucketByName(ctx context.Context, orgID influxdb.ID, name string) (*influxdb.Bucket, error)
FindBucketByName finds a Bucket given its name and Organization ID
func (*BucketMetrics) FindBuckets ¶
func (m *BucketMetrics) FindBuckets(ctx context.Context, filter influxdb.BucketFilter, opt ...influxdb.FindOptions) ([]*influxdb.Bucket, int, error)
FindBuckets returns a list of buckets that match filter and the total count of matching buckets.
func (*BucketMetrics) UpdateBucket ¶
func (m *BucketMetrics) UpdateBucket(ctx context.Context, id influxdb.ID, upd influxdb.BucketUpdate) (*influxdb.Bucket, error)
Updates a single bucket with changeset and returns the new bucket state after update.
type MetricsOption ¶
type MetricsOption func(*metricOpts)
MetricsOption is an option used by a metric middleware.
func WithSuffix ¶
func WithSuffix(suffix string) MetricsOption
WithSuffix returns a metric option that applies a suffix to the service name of the metric.
type OnboardClientService ¶
OnboardClientService connects to Influx via HTTP to perform onboarding operations
func (*OnboardClientService) IsOnboarding ¶
func (s *OnboardClientService) IsOnboarding(ctx context.Context) (bool, error)
IsOnboarding determine if onboarding request is allowed.
func (*OnboardClientService) OnboardInitialUser ¶
func (s *OnboardClientService) OnboardInitialUser(ctx context.Context, or *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
OnboardInitialUser OnboardingResults.
func (*OnboardClientService) OnboardUser ¶
func (s *OnboardClientService) OnboardUser(ctx context.Context, or *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
type OnboardHandler ¶
OnboardHandler represents an HTTP API handler for users.
func NewHTTPOnboardHandler ¶
func NewHTTPOnboardHandler(log *zap.Logger, onboardSvc influxdb.OnboardingService) *OnboardHandler
NewHTTPOnboardHandler constructs a new http server.
func (*OnboardHandler) Prefix ¶
func (h *OnboardHandler) Prefix() string
type OnboardService ¶
type OnboardService struct {
// contains filtered or unexported fields
}
func (*OnboardService) IsOnboarding ¶
func (s *OnboardService) IsOnboarding(ctx context.Context) (bool, error)
IsOnboarding determine if onboarding request is allowed.
func (*OnboardService) OnboardInitialUser ¶
func (s *OnboardService) OnboardInitialUser(ctx context.Context, req *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
OnboardInitialUser allows us to onboard a new user if is onboarding is allowd
func (*OnboardService) OnboardUser ¶
func (s *OnboardService) OnboardUser(ctx context.Context, req *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
OnboardUser allows us to onboard a new user if is onboarding is allowd
type OnboardingLogger ¶
type OnboardingLogger struct {
// contains filtered or unexported fields
}
func NewOnboardingLogger ¶
func NewOnboardingLogger(log *zap.Logger, s influxdb.OnboardingService) *OnboardingLogger
NewOnboardingLogger returns a logging service middleware for the Bucket Service.
func (*OnboardingLogger) IsOnboarding ¶
func (l *OnboardingLogger) IsOnboarding(ctx context.Context) (available bool, err error)
func (*OnboardingLogger) OnboardInitialUser ¶
func (l *OnboardingLogger) OnboardInitialUser(ctx context.Context, req *influxdb.OnboardingRequest) (res *influxdb.OnboardingResults, err error)
func (*OnboardingLogger) OnboardUser ¶
func (l *OnboardingLogger) OnboardUser(ctx context.Context, req *influxdb.OnboardingRequest) (res *influxdb.OnboardingResults, err error)
type OnboardingMetrics ¶
type OnboardingMetrics struct {
// contains filtered or unexported fields
}
func NewOnboardingMetrics ¶
func NewOnboardingMetrics(reg prometheus.Registerer, s influxdb.OnboardingService, opts ...MetricsOption) *OnboardingMetrics
NewOnboardingMetrics returns a metrics service middleware for the User Service.
func (*OnboardingMetrics) IsOnboarding ¶
func (m *OnboardingMetrics) IsOnboarding(ctx context.Context) (bool, error)
func (*OnboardingMetrics) OnboardInitialUser ¶
func (m *OnboardingMetrics) OnboardInitialUser(ctx context.Context, req *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
func (*OnboardingMetrics) OnboardUser ¶
func (m *OnboardingMetrics) OnboardUser(ctx context.Context, req *influxdb.OnboardingRequest) (*influxdb.OnboardingResults, error)
type OrgClientService ¶
type OrgClientService struct { Client *httpc.Client // OpPrefix is for not found errors. OpPrefix string }
OrgClientService connects to Influx via HTTP using tokens to manage organizations
func (*OrgClientService) CreateOrganization ¶
func (s *OrgClientService) CreateOrganization(ctx context.Context, o *influxdb.Organization) error
CreateOrganization creates an organization.
func (*OrgClientService) DeleteOrganization ¶
func (s *OrgClientService) DeleteOrganization(ctx context.Context, id influxdb.ID) error
DeleteOrganization removes organization id over HTTP.
func (*OrgClientService) FindOrganization ¶
func (s *OrgClientService) FindOrganization(ctx context.Context, filter influxdb.OrganizationFilter) (*influxdb.Organization, error)
FindOrganization gets a single organization matching the filter using HTTP.
func (*OrgClientService) FindOrganizationByID ¶
func (s *OrgClientService) FindOrganizationByID(ctx context.Context, id influxdb.ID) (*influxdb.Organization, error)
FindOrganizationByID gets a single organization with a given id using HTTP.
func (*OrgClientService) FindOrganizations ¶
func (s *OrgClientService) FindOrganizations(ctx context.Context, filter influxdb.OrganizationFilter, opt ...influxdb.FindOptions) ([]*influxdb.Organization, int, error)
FindOrganizations returns all organizations that match the filter via HTTP.
func (*OrgClientService) UpdateOrganization ¶
func (s *OrgClientService) UpdateOrganization(ctx context.Context, id influxdb.ID, upd influxdb.OrganizationUpdate) (*influxdb.Organization, error)
UpdateOrganization updates the organization over HTTP.
type OrgHandler ¶
OrgHandler represents an HTTP API handler for organizations.
func NewHTTPOrgHandler ¶
func NewHTTPOrgHandler(log *zap.Logger, orgService influxdb.OrganizationService, urm http.Handler, labelHandler http.Handler, secretHandler http.Handler) *OrgHandler
NewHTTPOrgHandler constructs a new http server.
func (*OrgHandler) Prefix ¶
func (h *OrgHandler) Prefix() string
type OrgLogger ¶
type OrgLogger struct {
// contains filtered or unexported fields
}
func NewOrgLogger ¶
NewOrgLogger returns a logging service middleware for the Organization Service.
func (*OrgLogger) CreateOrganization ¶
func (*OrgLogger) DeleteOrganization ¶
func (*OrgLogger) FindOrganization ¶
func (*OrgLogger) FindOrganizationByID ¶
func (*OrgLogger) FindOrganizations ¶
type OrgMetrics ¶
type OrgMetrics struct {
// contains filtered or unexported fields
}
func NewOrgMetrics ¶
func NewOrgMetrics(reg prometheus.Registerer, s influxdb.OrganizationService, opts ...MetricsOption) *OrgMetrics
NewOrgMetrics returns a metrics service middleware for the Organization Service.
func (*OrgMetrics) CreateOrganization ¶
func (m *OrgMetrics) CreateOrganization(ctx context.Context, b *influxdb.Organization) error
func (*OrgMetrics) DeleteOrganization ¶
func (m *OrgMetrics) DeleteOrganization(ctx context.Context, id influxdb.ID) error
func (*OrgMetrics) FindOrganization ¶
func (m *OrgMetrics) FindOrganization(ctx context.Context, filter influxdb.OrganizationFilter) (*influxdb.Organization, error)
func (*OrgMetrics) FindOrganizationByID ¶
func (m *OrgMetrics) FindOrganizationByID(ctx context.Context, id influxdb.ID) (*influxdb.Organization, error)
func (*OrgMetrics) FindOrganizations ¶
func (m *OrgMetrics) FindOrganizations(ctx context.Context, filter influxdb.OrganizationFilter, opt ...influxdb.FindOptions) ([]*influxdb.Organization, int, error)
func (*OrgMetrics) UpdateOrganization ¶
func (m *OrgMetrics) UpdateOrganization(ctx context.Context, id influxdb.ID, upd influxdb.OrganizationUpdate) (*influxdb.Organization, error)
type PasswordClientService ¶
PasswordClientService is an http client to speak to the password service.
func (*PasswordClientService) CompareAndSetPassword ¶
func (s *PasswordClientService) CompareAndSetPassword(ctx context.Context, userID influxdb.ID, old string, new string) error
CompareAndSetPassword compares the old and new password and submits the new password if possoble. Note: is not implemented.
func (*PasswordClientService) ComparePassword ¶
func (s *PasswordClientService) ComparePassword(ctx context.Context, userID influxdb.ID, password string) error
ComparePassword compares the user new password with existing. Note: is not implemented.
func (*PasswordClientService) SetPassword ¶
func (s *PasswordClientService) SetPassword(ctx context.Context, userID influxdb.ID, password string) error
SetPassword sets the user's password.
type PasswordLogger ¶
type PasswordLogger struct {
// contains filtered or unexported fields
}
func NewPasswordLogger ¶
func NewPasswordLogger(log *zap.Logger, s influxdb.PasswordsService) *PasswordLogger
NewPasswordLogger returns a logging service middleware for the Password Service.
func (*PasswordLogger) CompareAndSetPassword ¶
func (l *PasswordLogger) CompareAndSetPassword(ctx context.Context, userID influxdb.ID, old, new string) (err error)
func (*PasswordLogger) ComparePassword ¶
func (l *PasswordLogger) ComparePassword(ctx context.Context, userID influxdb.ID, password string) (err error)
func (*PasswordLogger) SetPassword ¶
func (l *PasswordLogger) SetPassword(ctx context.Context, userID influxdb.ID, password string) (err error)
type PasswordMetrics ¶
type PasswordMetrics struct {
// contains filtered or unexported fields
}
func NewPasswordMetrics ¶
func NewPasswordMetrics(reg prometheus.Registerer, s influxdb.PasswordsService, opts ...MetricsOption) *PasswordMetrics
NewPasswordMetrics returns a metrics service middleware for the Password Service.
func (*PasswordMetrics) CompareAndSetPassword ¶
func (m *PasswordMetrics) CompareAndSetPassword(ctx context.Context, userID influxdb.ID, old, new string) error
func (*PasswordMetrics) ComparePassword ¶
func (m *PasswordMetrics) ComparePassword(ctx context.Context, userID influxdb.ID, password string) error
func (*PasswordMetrics) SetPassword ¶
func (m *PasswordMetrics) SetPassword(ctx context.Context, userID influxdb.ID, password string) error
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) CompareAndSetPassword ¶
func (s *Service) CompareAndSetPassword(ctx context.Context, userID influxdb.ID, old, new string) error
CompareAndSetPassword checks the password and if they match updates to the new password.
func (*Service) ComparePassword ¶
ComparePassword checks if the password matches the password recorded. Passwords that do not match return errors.
func (*Service) CreateBucket ¶
CreateBucket creates a new bucket and sets b.ID with the new identifier.
func (*Service) CreateOrganization ¶
Creates a new organization and sets b.ID with the new identifier.
func (*Service) CreateUser ¶
Creates a new user and sets u.ID with the new identifier.
func (*Service) CreateUserResourceMapping ¶
func (s *Service) CreateUserResourceMapping(ctx context.Context, m *influxdb.UserResourceMapping) error
CreateUserResourceMapping creates a user resource mapping.
func (*Service) DeleteBucket ¶
DeleteBucket removes a bucket by ID.
func (*Service) DeleteOrganization ¶
DeleteOrganization removes a organization by ID and its dependent resources.
func (*Service) DeleteUser ¶
Removes a user by ID.
func (*Service) DeleteUserResourceMapping ¶
func (s *Service) DeleteUserResourceMapping(ctx context.Context, resourceID, userID influxdb.ID) error
DeleteUserResourceMapping deletes a user resource mapping.
func (*Service) FindBucket ¶
func (s *Service) FindBucket(ctx context.Context, filter influxdb.BucketFilter) (*influxdb.Bucket, error)
FindBucket returns the first bucket that matches filter.
func (*Service) FindBucketByID ¶
FindBucketByID returns a single bucket by ID.
func (*Service) FindBucketByName ¶
func (*Service) FindBuckets ¶
func (s *Service) FindBuckets(ctx context.Context, filter influxdb.BucketFilter, opt ...influxdb.FindOptions) ([]*influxdb.Bucket, int, error)
FindBuckets returns a list of buckets that match filter and the total count of matching buckets. Additional options provide pagination & sorting.
func (*Service) FindOrganization ¶
func (s *Service) FindOrganization(ctx context.Context, filter influxdb.OrganizationFilter) (*influxdb.Organization, error)
Returns the first organization that matches filter.
func (*Service) FindOrganizationByID ¶
func (s *Service) FindOrganizationByID(ctx context.Context, id influxdb.ID) (*influxdb.Organization, error)
Returns a single organization by ID.
func (*Service) FindOrganizations ¶
func (s *Service) FindOrganizations(ctx context.Context, filter influxdb.OrganizationFilter, opt ...influxdb.FindOptions) ([]*influxdb.Organization, int, error)
Returns a list of organizations that match filter and the total count of matching organizations. Additional options provide pagination & sorting.
func (*Service) FindUserByID ¶
Returns a single user by ID.
func (*Service) FindUserResourceMappings ¶
func (s *Service) FindUserResourceMappings(ctx context.Context, filter influxdb.UserResourceMappingFilter, opt ...influxdb.FindOptions) ([]*influxdb.UserResourceMapping, int, error)
FindUserResourceMappings returns a list of UserResourceMappings that match filter and the total count of matching mappings.
func (*Service) FindUsers ¶
func (s *Service) FindUsers(ctx context.Context, filter influxdb.UserFilter, opt ...influxdb.FindOptions) ([]*influxdb.User, int, error)
Returns a list of users that match filter and the total count of matching users. Additional options provide pagination & sorting. {
func (*Service) SetPassword ¶
SetPassword overrides the password of a known user.
func (*Service) UpdateBucket ¶
func (s *Service) UpdateBucket(ctx context.Context, id influxdb.ID, upd influxdb.BucketUpdate) (*influxdb.Bucket, error)
UpdateBucket updates a single bucket with changeset. Returns the new bucket state after update.
type Store ¶
type Store struct { IDGen influxdb.IDGenerator // contains filtered or unexported fields }
func NewReadOnlyStore ¶
NewReadOnlyStore returns a Store that cannot update the underlying kv.Store.
func (*Store) CreateBucket ¶
func (*Store) CreateURM ¶
NOTE(affo): On URM creation, we check that the user exists. We do not check that the resource it is pointing to exists. This decision takes into account that different resources could not be in the same store. To perform that kind of check, we must rely on the service layer. However, we do not want having the storage layer depend on the service layer above.
func (*Store) CreateUser ¶
func (*Store) DeleteBucket ¶
func (*Store) DeletePassword ¶
func (*Store) DeleteUser ¶
func (*Store) GetBucketByName ¶
func (*Store) GetOrgByName ¶
func (*Store) GetPassword ¶
func (*Store) GetUserByName ¶
func (*Store) ListBuckets ¶
func (*Store) SetPassword ¶
func (*Store) UpdateBucket ¶
func (*Store) UpdateUser ¶
type URMLogger ¶
type URMLogger struct {
// contains filtered or unexported fields
}
func NewURMLogger ¶
NewUrmLogger returns a logging service middleware for the User Resource Mapping Service.
func (*URMLogger) CreateUserResourceMapping ¶
func (*URMLogger) DeleteUserResourceMapping ¶
type UrmMetrics ¶
type UrmMetrics struct {
// contains filtered or unexported fields
}
func NewUrmMetrics ¶
func NewUrmMetrics(reg prometheus.Registerer, s influxdb.UserResourceMappingService, opts ...MetricsOption) *UrmMetrics
NewUrmMetrics returns a metrics service middleware for the User Resource Mapping Service.
func (*UrmMetrics) CreateUserResourceMapping ¶
func (m *UrmMetrics) CreateUserResourceMapping(ctx context.Context, urm *influxdb.UserResourceMapping) error
func (*UrmMetrics) DeleteUserResourceMapping ¶
func (m *UrmMetrics) DeleteUserResourceMapping(ctx context.Context, resourceID, userID influxdb.ID) error
func (*UrmMetrics) FindUserResourceMappings ¶
func (m *UrmMetrics) FindUserResourceMappings(ctx context.Context, filter influxdb.UserResourceMappingFilter, opt ...influxdb.FindOptions) ([]*influxdb.UserResourceMapping, int, error)
type UserClientService ¶
type UserClientService struct { Client *httpc.Client // OpPrefix is the ops of not found error. OpPrefix string }
UserService connects to Influx via HTTP using tokens to manage users
func (*UserClientService) CreateUser ¶
func (s *UserClientService) CreateUser(ctx context.Context, u *influxdb.User) error
CreateUser creates a new user and sets u.ID with the new identifier.
func (*UserClientService) DeleteUser ¶
func (s *UserClientService) DeleteUser(ctx context.Context, id influxdb.ID) error
DeleteUser removes a user by ID.
func (*UserClientService) FindMe ¶
func (s *UserClientService) FindMe(ctx context.Context, id influxdb.ID) (*influxdb.User, error)
FindMe returns user information about the owner of the token
func (*UserClientService) FindUser ¶
func (s *UserClientService) FindUser(ctx context.Context, filter influxdb.UserFilter) (*influxdb.User, error)
FindUser returns the first user that matches filter.
func (*UserClientService) FindUserByID ¶
func (s *UserClientService) FindUserByID(ctx context.Context, id influxdb.ID) (*influxdb.User, error)
FindUserByID returns a single user by ID.
func (*UserClientService) FindUsers ¶
func (s *UserClientService) FindUsers(ctx context.Context, filter influxdb.UserFilter, opt ...influxdb.FindOptions) ([]*influxdb.User, int, error)
FindUsers returns a list of users that match filter and the total count of matching users. Additional options provide pagination & sorting.
func (*UserClientService) UpdateUser ¶
func (s *UserClientService) UpdateUser(ctx context.Context, id influxdb.ID, upd influxdb.UserUpdate) (*influxdb.User, error)
UpdateUser updates a single user with changeset. Returns the new user state after update.
type UserHandler ¶
UserHandler represents an HTTP API handler for users.
func NewHTTPUserHandler ¶
func NewHTTPUserHandler(log *zap.Logger, userService influxdb.UserService, passwordService influxdb.PasswordsService) *UserHandler
NewHTTPUserHandler constructs a new http server.
func (*UserHandler) MeResourceHandler ¶
func (h *UserHandler) MeResourceHandler() *resourceHandler
func (*UserHandler) UserResourceHandler ¶
func (h *UserHandler) UserResourceHandler() *resourceHandler
type UserLogger ¶
type UserLogger struct {
// contains filtered or unexported fields
}
func NewUserLogger ¶
func NewUserLogger(log *zap.Logger, s influxdb.UserService) *UserLogger
NewUserLogger returns a logging service middleware for the User Service.
func (*UserLogger) CreateUser ¶
func (l *UserLogger) CreateUser(ctx context.Context, u *influxdb.User) (err error)
func (*UserLogger) DeleteUser ¶
func (l *UserLogger) DeleteUser(ctx context.Context, id influxdb.ID) (err error)
func (*UserLogger) FindUser ¶
func (l *UserLogger) FindUser(ctx context.Context, filter influxdb.UserFilter) (u *influxdb.User, err error)
func (*UserLogger) FindUserByID ¶
func (l *UserLogger) FindUserByID(ctx context.Context, id influxdb.ID) (u *influxdb.User, err error)
func (*UserLogger) FindUsers ¶
func (l *UserLogger) FindUsers(ctx context.Context, filter influxdb.UserFilter, opt ...influxdb.FindOptions) (users []*influxdb.User, n int, err error)
func (*UserLogger) UpdateUser ¶
func (l *UserLogger) UpdateUser(ctx context.Context, id influxdb.ID, upd influxdb.UserUpdate) (u *influxdb.User, err error)
type UserMetrics ¶
type UserMetrics struct {
// contains filtered or unexported fields
}
func NewUserMetrics ¶
func NewUserMetrics(reg prometheus.Registerer, s influxdb.UserService, opts ...MetricsOption) *UserMetrics
NewUserMetrics returns a metrics service middleware for the User Service.
func (*UserMetrics) CreateUser ¶
func (m *UserMetrics) CreateUser(ctx context.Context, u *influxdb.User) error
func (*UserMetrics) DeleteUser ¶
func (m *UserMetrics) DeleteUser(ctx context.Context, id influxdb.ID) error
func (*UserMetrics) FindUser ¶
func (m *UserMetrics) FindUser(ctx context.Context, filter influxdb.UserFilter) (*influxdb.User, error)
func (*UserMetrics) FindUserByID ¶
func (m *UserMetrics) FindUserByID(ctx context.Context, id influxdb.ID) (*influxdb.User, error)
func (*UserMetrics) FindUsers ¶
func (m *UserMetrics) FindUsers(ctx context.Context, filter influxdb.UserFilter, opt ...influxdb.FindOptions) ([]*influxdb.User, int, error)
func (*UserMetrics) UpdateUser ¶
func (m *UserMetrics) UpdateUser(ctx context.Context, id influxdb.ID, upd influxdb.UserUpdate) (*influxdb.User, error)
Source Files ¶
- duplicate_reads.go
- error.go
- error_bucket.go
- error_org.go
- error_urm.go
- error_user.go
- http_client_bucket.go
- http_client_onboarding.go
- http_client_org.go
- http_client_user.go
- http_handler_urm.go
- http_server.go
- http_server_bucket.go
- http_server_onboarding.go
- http_server_org.go
- http_server_user.go
- metrics_options.go
- middleware_bucket_auth.go
- middleware_bucket_logging.go
- middleware_bucket_metrics.go
- middleware_onboarding_auth.go
- middleware_onboarding_logging.go
- middleware_onboarding_metrics.go
- middleware_org_auth.go
- middleware_org_logging.go
- middleware_org_metrics.go
- middleware_urm_auth.go
- middleware_urm_logging.go
- middleware_urm_metrics.go
- middleware_user_auth.go
- middleware_user_logging.go
- middleware_user_metrics.go
- service.go
- service_bucket.go
- service_onboarding.go
- service_org.go
- service_urm.go
- service_user.go
- storage.go
- storage_bucket.go
- storage_org.go
- storage_urm.go
- storage_user.go