Versions in this module Expand all Collapse all v0 v0.3.0 Aug 26, 2026 Changes in this version + var ErrExpiryRequired = errors.New("authit/pat: an expiry is required") + var ErrExpiryTooFar = errors.New("authit/pat: requested expiry exceeds the configured maximum") + var ErrInvalidToken = errors.New("authit/pat: invalid, revoked, or expired token") + var ErrNotOwner = errors.New("authit/pat: token does not belong to this user") + func HasScope(t store.PersonalAccessToken, scope string) bool + type Config struct + AuditLogger audit.Logger + MaxExpiry *time.Duration + Prefix string + RequireExpiry bool + type Service struct + func NewService(stores Stores, cfg Config) (*Service, error) + func (s *Service) CreateToken(ctx context.Context, userID, name string, scopes []string, ...) (string, store.PersonalAccessToken, error) + func (s *Service) ListTokens(ctx context.Context, userID string) ([]store.PersonalAccessToken, error) + func (s *Service) Resolve(ctx context.Context, rawToken string) (store.PersonalAccessToken, error) + func (s *Service) RevokeToken(ctx context.Context, userID, tokenID string) error + type Stores struct + Tokens store.PersonalAccessTokenStore v0.2.0 Aug 25, 2026