database

package
v0.0.1-test Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServiceAccountAlreadyExists    = errors.New("service account already exists")
	ErrServiceAccountTokenNotFound    = errors.New("service account token not found")
	ErrInvalidTokenExpiration         = errors.New("invalid SecondsToLive value")
	ErrDuplicateToken                 = errors.New("service account token with given name already exists in the organization")
	ErrServiceAccountAndTokenMismatch = errors.New("API token does not belong to the given service account")
)

Functions

func ServiceAccountDeletions

func ServiceAccountDeletions() []string

Types

type ServiceAccountsStoreImpl

type ServiceAccountsStoreImpl struct {
	// contains filtered or unexported fields
}

func ProvideServiceAccountsStore

func ProvideServiceAccountsStore(store *sqlstore.SQLStore, apiKeyService apikey.Service,
	kvStore kvstore.KVStore, orgService org.Service) *ServiceAccountsStoreImpl

func (*ServiceAccountsStoreImpl) AddServiceAccountToken

func (s *ServiceAccountsStoreImpl) AddServiceAccountToken(ctx context.Context, serviceAccountId int64, cmd *serviceaccounts.AddServiceAccountTokenCommand) error

func (*ServiceAccountsStoreImpl) CreateServiceAccount

CreateServiceAccount creates service account

func (*ServiceAccountsStoreImpl) CreateServiceAccountFromApikey

func (s *ServiceAccountsStoreImpl) CreateServiceAccountFromApikey(ctx context.Context, key *apikey.APIKey) error

func (*ServiceAccountsStoreImpl) DeleteServiceAccount

func (s *ServiceAccountsStoreImpl) DeleteServiceAccount(ctx context.Context, orgId, serviceAccountId int64) error

DeleteServiceAccount deletes service account and all associated tokens

func (*ServiceAccountsStoreImpl) DeleteServiceAccountToken

func (s *ServiceAccountsStoreImpl) DeleteServiceAccountToken(ctx context.Context, orgId, serviceAccountId, tokenId int64) error

func (*ServiceAccountsStoreImpl) GetAPIKeysMigrationStatus

func (s *ServiceAccountsStoreImpl) GetAPIKeysMigrationStatus(ctx context.Context, orgId int64) (status *serviceaccounts.APIKeysMigrationStatus, err error)

func (*ServiceAccountsStoreImpl) GetUsageMetrics

func (s *ServiceAccountsStoreImpl) GetUsageMetrics(ctx context.Context) (*serviceaccounts.Stats, error)

func (*ServiceAccountsStoreImpl) HideApiKeysTab

func (s *ServiceAccountsStoreImpl) HideApiKeysTab(ctx context.Context, orgId int64) error

func (*ServiceAccountsStoreImpl) ListTokens

func (*ServiceAccountsStoreImpl) MigrateApiKey

func (s *ServiceAccountsStoreImpl) MigrateApiKey(ctx context.Context, orgId int64, keyId int64) error

func (*ServiceAccountsStoreImpl) MigrateApiKeysToServiceAccounts

func (s *ServiceAccountsStoreImpl) MigrateApiKeysToServiceAccounts(ctx context.Context, orgId int64) error

func (*ServiceAccountsStoreImpl) RetrieveServiceAccount

func (s *ServiceAccountsStoreImpl) RetrieveServiceAccount(ctx context.Context, orgId, serviceAccountId int64) (*serviceaccounts.ServiceAccountProfileDTO, error)

RetrieveServiceAccount returns a service account by its ID

func (*ServiceAccountsStoreImpl) RetrieveServiceAccountIdByName

func (s *ServiceAccountsStoreImpl) RetrieveServiceAccountIdByName(ctx context.Context, orgId int64, name string) (int64, error)

func (*ServiceAccountsStoreImpl) RevertApiKey

func (s *ServiceAccountsStoreImpl) RevertApiKey(ctx context.Context, saId int64, keyId int64) error

RevertApiKey converts service account token to old API key

func (*ServiceAccountsStoreImpl) RevokeServiceAccountToken

func (s *ServiceAccountsStoreImpl) RevokeServiceAccountToken(ctx context.Context, orgId, serviceAccountId, tokenId int64) error

func (*ServiceAccountsStoreImpl) SearchOrgServiceAccounts

func (s *ServiceAccountsStoreImpl) SearchOrgServiceAccounts(
	ctx context.Context, orgId int64, query string, filter serviceaccounts.ServiceAccountFilter, page int, limit int,
	signedInUser *user.SignedInUser,
) (*serviceaccounts.SearchServiceAccountsResult, error)

func (*ServiceAccountsStoreImpl) UpdateServiceAccount

func (s *ServiceAccountsStoreImpl) UpdateServiceAccount(ctx context.Context,
	orgId, serviceAccountId int64,
	saForm *serviceaccounts.UpdateServiceAccountForm) (*serviceaccounts.ServiceAccountProfileDTO, error)

UpdateServiceAccount updates service account

Jump to

Keyboard shortcuts

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