Versions in this module Expand all Collapse all v0 v0.2.0 Oct 9, 2026 Changes in this version + const DefaultMaxNamingJWTLifetime + const DefaultReplayCacheEntries + const SchemeHWK + const SchemeJKTJWT + const TypJKTS256 + var ErrReplayCacheFull = errors.New("agentprovider: replay cache is full") + func AttachHWK(req *http.Request, pub crypto.PublicKey) error + func JKTURN(j aauth.JWK) string + func NewNamingJWT(durable crypto.Signer, ephemeral crypto.PublicKey, ttl time.Duration) (string, error) + func SignHWK(req *http.Request, key crypto.Signer) error + func SignJKTJWT(req *http.Request, namingJWT string, ephemeral crypto.Signer) error + type AgentTokenParams struct + Key aauth.JWK + Name string + NotAfter time.Time + PS string + ParentAgent string + TTL time.Duration + type Attestation struct + Claims map[string]any + Format string + type AttestationVerifier interface + VerifyAttestation func(ctx context.Context, evidence json.RawMessage, key aauth.JWK) (*Attestation, error) + type Client struct + BaseURL string + HTTPClient *http.Client + Paths Paths + func (c *Client) Issue(ctx context.Context, key crypto.Signer, body any) (*TokenResponse, error) + func (c *Client) Refresh(ctx context.Context, durable, ephemeral crypto.Signer, body any) (*TokenResponse, error) + func (c *Client) Subagent(ctx context.Context, parent *aauth.Agent, subPub crypto.PublicKey, ...) (*TokenResponse, error) + func (c *Client) TokenSource(fetch func(ctx context.Context) (*TokenResponse, error)) func() (string, error) + type Config struct + Attestation AttestationVerifier + Domain string + HTTPClient *http.Client + Issuer string + Key crypto.Signer + KeyID string + Limiter aauth.Limiter + Logger *slog.Logger + MaxNamingJWTLifetime time.Duration + Metadata aauth.AgentProviderMetadata + Now func() time.Time + OnIssue func(ctx context.Context, t IssuedToken) + Paths Paths + PublishedKeys []aauth.JWK + Registrar Registrar + Replay ReplayCache + SignatureWindow time.Duration + TokenTTL time.Duration + type IssueRequest struct + Attestation *Attestation + Body json.RawMessage + Key aauth.JWK + type IssuedToken struct + Claims *aauth.AgentClaims + Token string + type MemoryReplayCache struct + MaxEntries int + func NewMemoryReplayCache() *MemoryReplayCache + func (c *MemoryReplayCache) Remember(_ context.Context, key string, exp time.Time) (bool, error) + type Paths struct + JWKS string + Refresh string + Subagent string + Token string + func DefaultPaths() Paths + type RefreshRequest struct + Attestation *Attestation + Body json.RawMessage + Durable aauth.JWK + DurableID string + Ephemeral aauth.JWK + type Registrar interface + AuthorizeIssue func(ctx context.Context, r *http.Request, req *IssueRequest) (*Registration, error) + AuthorizeRefresh func(ctx context.Context, req *RefreshRequest) (*Registration, error) + AuthorizeSubagent func(ctx context.Context, req *SubagentRequest) (*SubagentGrant, error) + type Registration struct + Name string + PS string + TTL time.Duration + type ReplayCache interface + Remember func(ctx context.Context, key string, exp time.Time) (bool, error) + type Server struct + func New(cfg Config) (*Server, error) + func (s *Server) IssueAgentToken(ctx context.Context, p AgentTokenParams) (string, *aauth.AgentClaims, error) + func (s *Server) Issuer() string + func (s *Server) JWKS() aauth.JWKS + func (s *Server) Metadata() aauth.AgentProviderMetadata + func (s *Server) Register(mux *http.ServeMux) + func (s *Server) Resolver() aauth.KeyResolver + func (s *Server) RevokeAgentToken(ctx context.Context, ps, jti string, exp time.Time) error + func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (s *Server) Signer() aauth.ServerSigner + type SubagentGrant struct + Discriminator string + TTL time.Duration + type SubagentRequest struct + Discriminator string + Key aauth.JWK + Parent *aauth.AgentClaims + type TokenResponse struct + AgentToken string + ExpiresIn int64