Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = xerror.NotFound(xerror.APIKey) ErrSlugAlreadyExists = xerror.AlreadyExists(xerror.APIKey) )
Functions ¶
This section is empty.
Types ¶
type CreateParams ¶
type Repository ¶
type Repository interface {
Create(ctx context.Context, tx postgres.DBTX, params CreateParams) (*APIKey, error)
FindBySlug(ctx context.Context, tx postgres.DBTX, orgSlug, apiKeySlug slug.Slug) (*APIKey, error)
ListByOrganization(
ctx context.Context,
tx postgres.DBTX,
orgSlug slug.Slug,
roleFilter *slug.Slug,
req model.ListRequest,
) ([]*APIKey, error)
Update(ctx context.Context, tx postgres.DBTX, params UpdateParams) error
Revoke(ctx context.Context, tx postgres.DBTX, orgSlug, apiKeySlug slug.Slug) error
DeleteRevoked(ctx context.Context, tx postgres.DBTX, orgSlug, apiKeySlug slug.Slug) error
Rotate(ctx context.Context, tx postgres.DBTX, params RotateParams) (*APIKey, error)
FindActivePrincipalByTokenHash(ctx context.Context, tx postgres.DBTX, tokenHash string) (*Principal, error)
MarkUsed(ctx context.Context, tx postgres.DBTX, orgSlug, apiKeySlug slug.Slug) error
}
func NewRepository ¶
func NewRepository() Repository
type RotateParams ¶
Click to show internal directories.
Click to hide internal directories.