Documentation
¶
Overview ¶
Package binding preserves the vMCP binding API, delegating the canonical format to pkg/auth/sessionbinding. An identity binding encodes the principal that created a session as a single opaque string suitable for storage in a key/value store such as Redis or Valkey.
Format ¶
Standard bindings have two NUL-separated fields: iss and sub. Delegated bindings add the route tag "delegated" and client_id, followed by act.iss and act.sub when an actor is present. Every encoded field is nonempty and contains no NUL.
Sessions created before any auth middleware ran use the literal "unauthenticated" sentinel. The sentinel must not contain '\x00' so it cannot collide with any bound form; any future format change must keep the sentinel and the bound-form value sets non-overlapping.
Trust boundary ¶
Bindings are stored plaintext at rest. They are PII but not credentials — they identify but do not authenticate. They carry no freshness signal (no exp, no nonce) and are NOT a substitute for token validation: callers must only compare a stored binding against the full binding from the current request's freshly validated identity.
Index ¶
Constants ¶
const UnauthenticatedSentinel = sessionbinding.UnauthenticatedSentinel
UnauthenticatedSentinel is the binding value stored for sessions that were created without an authenticated identity (auth middleware not present or identity nil).
Variables ¶
var ErrInvalidBinding = sessionbinding.ErrInvalidBinding
ErrInvalidBinding is returned by Format when either input is empty or contains a NUL byte.
Functions ¶
func Format ¶
Format returns the canonical on-the-wire form of an identity binding: iss + "\x00" + sub. Returns ErrInvalidBinding when either input is empty or contains a NUL byte.
func IsUnauthenticated ¶
IsUnauthenticated reports whether s is the literal unauthenticated sentinel.
Types ¶
This section is empty.