Documentation
¶
Overview ¶
Package identity carries the authenticated caller identity on the request context. It lives outside package server so the provider layer can read it without an import cycle — per-principal key routing resolves from exactly this, never from anything client-supplied. The fields are GENERIC: who the caller is, which vendors they hold keys for, and whether serving is limited to those keyed vendors. What POPULATES them (a local token, or a hosted verification service) is the composition's business — this package encodes no commercial concepts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Info ¶
type Info struct {
// OrgID / UserID scope the principal (a tenant + a user within it; both
// "selfhost" in the default composition). They are the key-lookup scope
// and the rate-limit / usage dimension.
OrgID string
UserID string
// KeyedVendors are the vendors this principal holds serving keys for via
// the composition's KeySource. The presence gate: keys are resolved only
// for vendors listed here.
KeyedVendors []string
// LimitToKeyed means serving must use a keyed vendor — a non-keyed lane
// refuses rather than serving on the gateway's own keys. Always false in
// the default (self-host) composition; a hosted composition sets it (e.g.
// a hosted composition's usage limit). The refusal is the wire's insufficient_credits code.
LimitToKeyed bool
}
Info is the verified identity of one request, stamped by the auth middleware from the composition's Authenticator + Authorizer.