Versions in this module Expand all Collapse all v1 v1.4.0 Aug 18, 2026 Changes in this version + var ErrInvalidToken = errors.New("invalid API token") + var ErrTokenNotFound = errors.New("API token not found") + type Principal struct + Name string + Scopes map[string]struct{} + TokenID string + func (p Principal) HasScope(scope string) bool + type Store struct + func NewStore(path string) (*Store, error) + func (s *Store) Authenticate(raw string) (Principal, error) + func (s *Store) Create(name string, scopes []string, expiresAt *time.Time) (Token, string, error) + func (s *Store) List() []Token + func (s *Store) Revoke(id string) error + type Token struct + CreatedAt time.Time + ExpiresAt *time.Time + Hash string + ID string + Name string + RevokedAt *time.Time + Scopes []string