Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAPIKeyNotFound = apikeys.ErrNotFound ErrAPIKeyAlreadyExists = apikeys.ErrSlugAlreadyExists ErrInvalidInput = xerror.ValidationFailed() ErrInvalidToken = xerror.InvalidCredentials() ErrAPIKeyNotRevoked = xerror.InvalidInput(xerror.APIKey). WithPublicDetail("API key must be revoked before deletion.") )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service interface {
ListAPIKeys(
ctx context.Context,
orgSlug slug.Slug,
roleFilter *slug.Slug,
req model.ListRequest,
) (model.ListResponse[model.APIKey], error)
CreateAPIKey(
ctx context.Context,
orgSlug slug.Slug,
actor model.EventActor,
newAPIKey model.NewAPIKey,
) (*model.APIKeyWithToken, error)
GetAPIKey(ctx context.Context, orgSlug, apiKeySlug slug.Slug) (*model.APIKey, error)
UpdateAPIKey(
ctx context.Context,
orgSlug, apiKeySlug slug.Slug,
actor model.EventActor,
update model.UpdateAPIKey,
) (*model.APIKey, error)
RevokeAPIKey(ctx context.Context, orgSlug, apiKeySlug slug.Slug, actor model.EventActor) error
DeleteRevokedAPIKey(ctx context.Context, orgSlug, apiKeySlug slug.Slug, actor model.EventActor) error
RotateAPIKey(
ctx context.Context,
orgSlug, apiKeySlug slug.Slug,
actor model.EventActor,
) (*model.APIKeyWithToken, error)
Authenticate(ctx context.Context, token string) (*model.APIKeyPrincipal, error)
}
func New ¶
func New( txm postgres.TransactionManager, apiKeysRepo apikeys.Repository, rolesSvc rolessvc.Service, eventProducer workerproducer.EventProducer, ) Service
Click to show internal directories.
Click to hide internal directories.