Versions in this module Expand all Collapse all v0 v0.0.2 Feb 16, 2026 Changes in this version + var ErrUnauthorized = errors.New("ctrlplane: unauthorized") + func WithClaims(ctx context.Context, c *Claims) context.Context + type AuthzRequest struct + Action string + Resource string + ResourceID string + SubjectID string + TenantID string + type Claims struct + Email string + Metadata map[string]string + Name string + Roles []string + SubjectID string + TenantID string + func ClaimsFrom(ctx context.Context) *Claims + func RequireClaims(ctx context.Context) (*Claims, error) + func (c *Claims) HasRole(role string) bool + func (c *Claims) IsSystemAdmin() bool + type NoopProvider struct + DefaultClaims *Claims + DefaultTenantID string + func (n *NoopProvider) Authenticate(_ context.Context, _ string) (*Claims, error) + func (n *NoopProvider) Authorize(_ context.Context, _ AuthzRequest) (bool, error) + func (n *NoopProvider) GetTenantID(_ context.Context) string + type Provider interface + Authenticate func(ctx context.Context, token string) (*Claims, error) + Authorize func(ctx context.Context, req AuthzRequest) (bool, error) + GetTenantID func(ctx context.Context) string v0.0.1 Feb 13, 2026