extsvcaccounts

package
v11.1.4-modfix Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 (esa *ExtSvcAccountsService) RemoveExtSvcAccount(ctx context.Context, orgID int64, extSvcSlug string) error

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

SaveExternalService creates, updates or delete a service account (and its token) with the requested permissions.

type SaveCredentialsCmd

type SaveCredentialsCmd struct {
	ExtSvcSlug string
	OrgID      int64
	Secret     string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL