Versions in this module Expand all Collapse all v1 v1.148.0 Oct 19, 2026 Changes in this version + const CapabilityMint + const CapabilityVerify + const MaxClaimsBytes + const MaxEndpoints + const MaxTTL + const MaxTokenLen + const ReasonExpired + const ReasonMalformed + const ReasonOtherEndpoint + const ReasonTampered + const ReasonUsed + const SecretUse + var ErrRefused = errors.New("token refused") + func Key(secret string) []byte + func Reason(err error) string + func Sign(key []byte, at Binding, m Mint, now time.Time) (string, error) + type Authority func(roles []string) (persona string, admin bool) + type Binding struct + Endpoint string + ScriptID string + type Caller interface + CallTool func(ctx context.Context, name string, args map[string]any) (map[string]any, error) + type Host struct + Ctx context.Context + Live Caller + Record func(tool string, args, out map[string]any, err error) + Replay Caller + Testing bool + func (h Host) Mint(_ *starlark.Thread, b *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error) + func (h Host) Verify(_ *starlark.Thread, b *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error) + type Issuer struct + Authority Authority + Keys KeyReader + Now func() time.Time + Uses Uses + func (i *Issuer) Bind(at Binding, roles []string) Caller + type KeyReader func(ctx context.Context, name, persona string, admin bool) (string, error) + type Mint struct + Claims map[string]any + Endpoints []string + SingleUse bool + TTL time.Duration + type PostgresUses struct + func NewUses(db *sql.DB) *PostgresUses + func (p *PostgresUses) Sweep(ctx context.Context, now time.Time) (int64, error) + func (p *PostgresUses) Use(ctx context.Context, id string, expires time.Time) (bool, error) + type Token struct + Claims map[string]any + Expires time.Time + ID string + SingleUse bool + func Verify(key []byte, at Binding, token string, now time.Time) (Token, error) + type Uses interface + Sweep func(ctx context.Context, now time.Time) (int64, error) + Use func(ctx context.Context, id string, expires time.Time) (bool, error)