Documentation ¶
Index ¶
- Variables
- type Credentials
- type ExtSvcAccountsService
- func (esa *ExtSvcAccountsService) DeleteExtSvcCredentials(ctx context.Context, orgID int64, extSvcSlug string) error
- func (esa *ExtSvcAccountsService) EnableExtSvcAccount(ctx context.Context, cmd *sa.EnableExtSvcAccountCmd) error
- func (esa *ExtSvcAccountsService) GetExtSvcCredentials(ctx context.Context, orgID int64, extSvcSlug string) (*Credentials, error)
- func (esa *ExtSvcAccountsService) GetExternalServiceNames(ctx context.Context) ([]string, error)
- func (esa *ExtSvcAccountsService) HasExternalService(ctx context.Context, name string) (bool, error)
- func (esa *ExtSvcAccountsService) ManageExtSvcAccount(ctx context.Context, cmd *sa.ManageExtSvcAccountCmd) (int64, error)
- func (esa *ExtSvcAccountsService) RemoveExtSvcAccount(ctx context.Context, orgID int64, extSvcSlug string) error
- func (esa *ExtSvcAccountsService) RemoveExternalService(ctx context.Context, name string) error
- func (esa *ExtSvcAccountsService) RetrieveExtSvcAccount(ctx context.Context, orgID, saID int64) (*sa.ExtSvcAccount, error)
- func (esa *ExtSvcAccountsService) SaveExtSvcCredentials(ctx context.Context, cmd *SaveCredentialsCmd) error
- func (esa *ExtSvcAccountsService) SaveExternalService(ctx context.Context, cmd *extsvcauth.ExternalServiceRegistration) (*extsvcauth.ExternalService, error)
- type SaveCredentialsCmd
Constants ¶
This section is empty.
Variables ¶
var ( ErrCannotBeDeleted = errutil.BadRequest("extsvcaccounts.ErrCannotBeDeleted", errutil.WithPublicMessage("external service account cannot be deleted")) ErrCannotBeUpdated = errutil.BadRequest("extsvcaccounts.ErrCannotBeUpdated", errutil.WithPublicMessage("external service account cannot be updated")) ErrCannotCreateToken = errutil.BadRequest("extsvcaccounts.ErrCannotCreateToken", errutil.WithPublicMessage("cannot add external service account token")) ErrCannotDeleteToken = errutil.BadRequest("extsvcaccounts.ErrCannotDeleteToken", errutil.WithPublicMessage("cannot delete external service account token")) ErrCannotListTokens = errutil.BadRequest("extsvcaccounts.ErrCannotListTokens", errutil.WithPublicMessage("cannot list external service account tokens")) ErrCredentialsGenFailed = errutil.Internal("extsvcaccounts.ErrCredentialsGenFailed") ErrCredentialsNotFound = errutil.NotFound("extsvcaccounts.ErrCredentialsNotFound") ErrInvalidName = errutil.BadRequest("extsvcaccounts.ErrInvalidName", errutil.WithPublicMessage("only external service account names can be prefixed with 'extsvc-'")) )
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct {
Secret string
}
Credentials represents the credentials associated to an external service
type ExtSvcAccountsService ¶
type ExtSvcAccountsService struct {
// contains filtered or unexported fields
}
func ProvideExtSvcAccountsService ¶
func ProvideExtSvcAccountsService(acSvc ac.Service, bus bus.Bus, db db.DB, features featuremgmt.FeatureToggles, reg prometheus.Registerer, saSvc *manager.ServiceAccountsService, secretsSvc secrets.Service, tracer tracing.Tracer) *ExtSvcAccountsService
func (*ExtSvcAccountsService) DeleteExtSvcCredentials ¶
func (esa *ExtSvcAccountsService) DeleteExtSvcCredentials(ctx context.Context, orgID int64, extSvcSlug string) error
DeleteExtSvcCredentials removes the credentials of an External Service from an encrypted storage
func (*ExtSvcAccountsService) EnableExtSvcAccount ¶
func (esa *ExtSvcAccountsService) EnableExtSvcAccount(ctx context.Context, cmd *sa.EnableExtSvcAccountCmd) error
EnableExtSvcAccount enables or disables the service account associated to an external service
func (*ExtSvcAccountsService) GetExtSvcCredentials ¶
func (esa *ExtSvcAccountsService) GetExtSvcCredentials(ctx context.Context, orgID int64, extSvcSlug string) (*Credentials, error)
GetExtSvcCredentials get the credentials of an External Service from an encrypted storage
func (*ExtSvcAccountsService) GetExternalServiceNames ¶
func (esa *ExtSvcAccountsService) GetExternalServiceNames(ctx context.Context) ([]string, error)
GetExternalServiceNames get the names of External Service in store
func (*ExtSvcAccountsService) HasExternalService ¶
func (esa *ExtSvcAccountsService) HasExternalService(ctx context.Context, name string) (bool, error)
HasExternalService returns whether an external service has been saved with that name.
func (*ExtSvcAccountsService) ManageExtSvcAccount ¶
func (esa *ExtSvcAccountsService) ManageExtSvcAccount(ctx context.Context, cmd *sa.ManageExtSvcAccountCmd) (int64, error)
ManageExtSvcAccount creates, updates or deletes the service account associated with an external service
func (*ExtSvcAccountsService) RemoveExtSvcAccount ¶
func (*ExtSvcAccountsService) RemoveExternalService ¶
func (esa *ExtSvcAccountsService) RemoveExternalService(ctx context.Context, name string) error
func (*ExtSvcAccountsService) RetrieveExtSvcAccount ¶
func (esa *ExtSvcAccountsService) RetrieveExtSvcAccount(ctx context.Context, orgID, saID int64) (*sa.ExtSvcAccount, error)
RetrieveExtSvcAccount fetches an external service account by ID
func (*ExtSvcAccountsService) SaveExtSvcCredentials ¶
func (esa *ExtSvcAccountsService) SaveExtSvcCredentials(ctx context.Context, cmd *SaveCredentialsCmd) error
SaveExtSvcCredentials stores the credentials of an External Service in an encrypted storage
func (*ExtSvcAccountsService) SaveExternalService ¶
func (esa *ExtSvcAccountsService) SaveExternalService(ctx context.Context, cmd *extsvcauth.ExternalServiceRegistration) (*extsvcauth.ExternalService, error)
SaveExternalService creates, updates or delete a service account (and its token) with the requested permissions.