Versions in this module Expand all Collapse all v0 v0.1.0 Nov 24, 2026 Changes in this version + const PrefixAccount + const PrefixClient + const PrefixGrant + const PrefixInvite + const PrefixPasskey + const PrefixPerson + const PrefixTxn + var ErrConflict = errors.New("conflict") + var ErrExpired = errors.New("expired") + var ErrForbidden = errors.New("forbidden") + var ErrInvalidToken = errors.New("invalid token") + var ErrNoSession = errors.New("no session") + var ErrNotFound = errors.New("not found") + var ErrStepUpRequired = errors.New("step-up required") + var ErrUsed = errors.New("already used") + func ClientIP(r *http.Request, mode ClientIPMode) string + func NewID(prefix string) string + func WithViewer(ctx context.Context, v Viewer) context.Context + type AccessInfo struct + AccountID AccountID + Assistant Assistant + ClientID ClientID + ExpiresAt time.Time + GrantID GrantID + PersonID PersonID + ResourceID ResourceID + Scope string + type Account struct + CreatedAt time.Time + ID AccountID + Name string + type AccountID string + type Assistant string + const AssistantChatGPT + const AssistantClaude + type AuditEntry struct + AccountID AccountID + Action string + Actor PersonID + At time.Time + Detail map[string]string + ID string + IP string + Target string + type AuthCode struct + ClientID ClientID + CodeChallenge string + CodeHash []byte + CreatedAt time.Time + ExpiresAt time.Time + GrantID GrantID + RedirectURI string + Resource string + Scope string + type Brand struct + CSRFHeader string + Product string + SessionCookie string + TxnCookie string + type ClientID string + type ClientIPMode string + const ClientIPCloudflare + const ClientIPForwarded + const ClientIPRemote + type ClientKind string + const ClientCIMD + const ClientDCR + type Clock func() time.Time + type Grant struct + AccountID AccountID + ClientID ClientID + CreatedAt time.Time + ID GrantID + LastUsedAt *time.Time + PersonID PersonID + ResourceID ResourceID + RevokedAt *time.Time + Scope string + type GrantID string + type Invite struct + AccountID AccountID + CreatedAt time.Time + CreatedBy PersonID + ExpiresAt time.Time + ID string + Kind InviteKind + Name string + RevokedAt *time.Time + TokenHash []byte + UsedAt *time.Time + type InviteKind string + const InviteMember + const InviteOwner + const InviteSetup + type Middleware func(http.Handler) http.Handler + type OAuthClient struct + Assistant Assistant + AuthMethod string + CreatedAt time.Time + FetchedAt time.Time + ID ClientID + Kind ClientKind + LastUsedAt *time.Time + Name string + RedirectURIs []string + SecretHash []byte + type Passkey struct + CreatedAt time.Time + CredentialID []byte + Data []byte + ID string + LastUsedAt *time.Time + Name string + PersonID PersonID + type PerResource struct + Prefix string + func (p PerResource) FromPath(path string) (ResourceID, bool) + func (p PerResource) Path(id ResourceID) string + type Person struct + AccountID AccountID + CreatedAt time.Time + DisabledAt *time.Time + ID PersonID + Name string + Role Role + Superadmin bool + type PersonID string + type ResourceCatalog interface + Available func(ctx context.Context, a AccountID, id ResourceID) (bool, error) + Resource func(ctx context.Context, id ResourceID) (ResourceInfo, error) + type ResourceID string + type ResourceInfo struct + Description string + ID ResourceID + Name string + Tools []ToolInfo + type ResourcePaths interface + FromPath func(path string) (ResourceID, bool) + Path func(id ResourceID) string + type Role string + const RoleMember + const RoleOwner + type RouteRegistrar interface + RegisterRoutes func(mux *http.ServeMux) + type Session struct + CreatedAt time.Time + ExpiresAt time.Time + IDHash []byte + LastSeenAt time.Time + PersonID PersonID + StepUpUntil time.Time + UserAgent string + type Sessions interface + RequireStepUp func(next http.Handler) http.Handler + RequireViewer func(next http.Handler) http.Handler + SameOrigin func(next http.Handler) http.Handler + Viewer func(r *http.Request) (Viewer, error) + type SingleResource struct + At string + ID ResourceID + func (s SingleResource) FromPath(path string) (ResourceID, bool) + func (s SingleResource) Path(ResourceID) string + type Site struct + ClientIP ClientIPMode + PublicURL string + RPID string + type Token struct + CreatedAt time.Time + ExpiresAt time.Time + Family string + GrantID GrantID + Hash []byte + Kind TokenKind + RevokedAt *time.Time + UsedAt *time.Time + type TokenKind string + const TokenAccess + const TokenRefresh + type TokenValidator interface + ValidateAccess func(ctx context.Context, token string, r ResourceID) (AccessInfo, error) + type ToolInfo struct + Access string + Name string + Title string + type Viewer struct + Account Account + Person Person + Session Session + func ViewerFrom(ctx context.Context) (Viewer, bool)