Versions in this module Expand all Collapse all v0 v0.2.0 Oct 22, 2026 Changes in this version + const CodeIdentityProviderUnavailable + const CodeInvalidToken + const CodeMissingCSRFHeader + const CodeMissingToken + const CodeOutsideGroup + const CodeOutsideServiceScope + const CodeSessionStoreUnavailable + const ProtectedResourcePath + var ErrProviderUnavailable = errors.New("identity provider unavailable") + var ErrUnauthorized = errors.New("unauthorized") + func BearerToken(header string) string + func LimitServices(mux *http.ServeMux, routes map[string][]string, log *slog.Logger) http.Handler + func RequireBearer(verifier TokenVerifier, log *slog.Logger, public ...string) func(http.Handler) http.Handler + func RequireGroup(group string, next http.Handler) http.Handler + func WithIdentity(ctx context.Context, identity Identity) context.Context + type Config struct + Issuer string + PersonPrefix string + ServicePrefix string + type Connecting struct + func NewConnecting(config Config) (*Connecting, error) + func (c *Connecting) Ready() error + func (c *Connecting) Run(ctx context.Context, log *slog.Logger) + func (c *Connecting) Verify(ctx context.Context, raw string) (Identity, error) + type Identity struct + ClientID string + Groups []string + Scopes []string + Service bool + Subject string + func IdentityFrom(ctx context.Context) (Identity, bool) + type ProtectedResourceMetadata struct + Issuer string + Resource string + func (m ProtectedResourceMetadata) ServeHTTP(w http.ResponseWriter, r *http.Request) + type TokenVerifier interface + Verify func(ctx context.Context, raw string) (Identity, error) + type Verifier struct + func NewVerifier(ctx context.Context, config Config) (*Verifier, error) + func (v *Verifier) Verify(ctx context.Context, raw string) (Identity, error) v0.1.0 Oct 21, 2026