Versions in this module Expand all Collapse all v0 v0.5.0 Oct 11, 2026 Changes in this version + const HistoryRead + const MaxAssertionLifetime + const MaxGrantLifetime + const MaxTokenLifetime + const PagesRead + const PagesUpdate + const PreviewRead + var ErrConflict = errors.New("agent grant conflict") + var ErrDenied = errors.New("agent access denied") + var ErrUnavailable = errors.New("agent access unavailable") + func ValidateGrantForStorage(g Grant) error + type AssertionUse struct + ExpiresAt time.Time + GrantID string + GrantVersion int64 + JTIHash string + Now time.Time + type Audit struct + At time.Time + Decision string + GrantID string + GrantVersion int64 + JTIHash string + Operation string + OwnerID string + PageID string + Reason string + Scope string + Subject string + TenantID int64 + type Auditor interface + Record func(context.Context, Audit) error + type ExchangeRequest struct + Assertion string + Audience string + GrantID string + Scopes []string + type Grant struct + APIAudience string + ApprovedBy string + AssertionIssuer string + CreatedAt time.Time + ExpiresAt time.Time + ID string + KeyID string + Preview *PreviewGrant + PublicKey *ecdsa.PublicKey + Revoked bool + Scopes []string + Subject string + TenantID int64 + UpdatePageIDs []string + Version int64 + type GrantManager interface + CreateGrant func(context.Context, Grant) error + ListGrants func(context.Context, Owner) ([]Grant, error) + RevokeGrant func(context.Context, string, int64, string, time.Time) error + type IssueRequest struct + Audience string + ExpiresAt time.Time + GrantID string + GrantVersion int64 + IssuedAt time.Time + Scopes []string + Subject string + TenantID int64 + type Issuer interface + IssueAgentToken func(context.Context, IssueRequest) (string, error) + type IssuerFunc func(context.Context, IssueRequest) (string, error) + func (f IssuerFunc) IssueAgentToken(ctx context.Context, r IssueRequest) (string, error) + type ManagementOptions struct + OwnerOrigin string + Owners OwnerPolicy + PagePath string + Path string + Tenants *TenantPolicy + type Options struct + Audit Auditor + Clock func() time.Time + Issuer Issuer + IssuerKeys map[string]*ecdsa.PublicKey + IssuerURL string + Policy Policy + Store Store + TokenEndpoint string + type Owner struct + ID string + type OwnerPolicy interface + AuthorizeOwner func(context.Context, Owner, string, Grant) error + ResolveOwner func(*http.Request) (Owner, error) + type Policy interface + AllowGrant func(context.Context, Grant) error + AllowResource func(context.Context, Grant, Resource) error + type PreviewGrant struct + Audience string + Origin string + Paths []string + type Principal struct + GrantID string + GrantVersion int64 + JTIHash string + Scopes []string + Subject string + TenantID int64 + type Resource struct + Audience string + ExpectedVersion uint64 + Fields []string + HasCanonicalBlocks bool + Method string + Origin string + PageID string + Path string + Query string + RootPage bool + Scope string + TenantID int64 + type Service struct + func NewService(o Options) (*Service, error) + func (s *Service) Authorize(ctx context.Context, raw string, r Resource) (Principal, error) + func (s *Service) Exchange(ctx context.Context, in ExchangeRequest) (TokenResponse, error) + func (s *Service) ExchangeHandler() http.Handler + func (s *Service) ManagementHandler(o ManagementOptions) (http.Handler, error) + type Store interface + ConsumeAssertion func(context.Context, AssertionUse) (bool, error) + GetGrant func(context.Context, string) (Grant, error) + IsTokenRevoked func(context.Context, string) (bool, error) + type TenantConfig struct + APIAudience string + HistoryPath string + PagesPath string + Preview *PreviewGrant + Scopes []string + TenantID int64 + UpdatePageIDs []string + type TenantPolicy struct + func NewTenantPolicy(config []TenantConfig) (*TenantPolicy, error) + func (p *TenantPolicy) AllowGrant(_ context.Context, g Grant) error + func (p *TenantPolicy) AllowResource(ctx context.Context, g Grant, r Resource) error + type TokenResponse struct + AccessToken string + ExpiresIn int64 + Scope string + TokenType string