Versions in this module Expand all Collapse all v0 v0.3.0 Aug 26, 2026 Changes in this version + var ErrAccessDenied = errors.New("authit/device: access denied") + var ErrAuthorizationPending = errors.New("authit/device: authorization pending") + var ErrExpiredToken = errors.New("authit/device: device code expired or invalid") + var ErrInvalidUserCode = errors.New("authit/device: invalid, already-used, or expired user code") + var ErrSlowDown = errors.New("authit/device: polling too frequently") + type Authorization struct + DeviceCode string + ExpiresIn time.Duration + Interval time.Duration + UserCode string + type Config struct + AuditLogger audit.Logger + DeviceCodeTTL time.Duration + PollInterval time.Duration + SlowDownIncrement time.Duration + type Service struct + func NewService(stores Stores, cfg Config) (*Service, error) + func (s *Service) ApproveDeviceAuthorization(ctx context.Context, callerUserID, userCode string) error + func (s *Service) DenyDeviceAuthorization(ctx context.Context, userCode string) error + func (s *Service) PollDeviceToken(ctx context.Context, rawDeviceCode string) (userID, scope string, err error) + func (s *Service) StartDeviceAuthorization(ctx context.Context, clientID, scope string) (Authorization, error) + type Stores struct + Authorizations store.DeviceAuthorizationStore v0.2.0 Aug 25, 2026