patssvc

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	TokenPrefix = "xto_pat_"
)

Variables

View Source
var (
	ErrPersonalAccessTokenNotFound      = pats.ErrNotFound
	ErrPersonalAccessTokenAlreadyExists = pats.ErrSlugAlreadyExists
	ErrInvalidInput                     = xerror.ValidationFailed()
	ErrInvalidToken                     = xerror.InvalidCredentials()
	ErrPersonalAccessTokenRevoked       = xerror.InvalidInput(xerror.PersonalAccessToken).
										WithPublicDetail("Personal access token must be active to update.")
	ErrPersonalAccessTokenNotRevoked = xerror.InvalidInput(xerror.PersonalAccessToken).
										WithPublicDetail("Personal access token must be revoked before deletion.")
)

Functions

This section is empty.

Types

type Service

type Service interface {
	ListPersonalAccessTokens(
		ctx context.Context,
		userSlug slug.Slug,
		req model.ListRequest,
	) (model.ListResponse[model.PersonalAccessToken], error)
	CreatePersonalAccessToken(
		ctx context.Context,
		userSlug slug.Slug,
		newPAT model.NewPersonalAccessToken,
	) (*model.PersonalAccessTokenWithToken, error)
	GetPersonalAccessToken(
		ctx context.Context,
		userSlug, patSlug slug.Slug,
	) (*model.PersonalAccessToken, error)
	UpdatePersonalAccessToken(
		ctx context.Context,
		userSlug, patSlug slug.Slug,
		update model.UpdatePersonalAccessToken,
	) (*model.PersonalAccessToken, error)
	RevokePersonalAccessToken(ctx context.Context, userSlug, patSlug slug.Slug) error
	DeleteRevokedPersonalAccessToken(ctx context.Context, userSlug, patSlug slug.Slug) error
	RotatePersonalAccessToken(
		ctx context.Context,
		userSlug, patSlug slug.Slug,
	) (*model.PersonalAccessTokenWithToken, error)
	Authenticate(ctx context.Context, token string) (*model.UserPrincipal, error)
}

func New

func New(
	txm postgres.TransactionManager,
	patsRepo pats.Repository,
) Service

Jump to

Keyboard shortcuts

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