The auth account (response issuer): its pub + the signing seed the response is signed with.
The spawn-ledger hook: THROW to deny. Client-supplied actor claims are only as good as this server-side check — the flip wires the manager's authenticated spawn ledger in here.
OptionalconnectThe connect limits, shared with the exchange so an actor limited here is refused there too. Absent: a limiter of this callout's own at the default limits.
The data account users are bound into: its pub + the signing seed that mints user JWTs.
OptionalexpectedAllow-list of trusted nats-server ids (server_id.id) — the tightest request-provenance pin:
a request whose server id is not listed is dropped (no response). STRONGLY RECOMMENDED for any
hardened / multi-server deploy. When omitted, the ONLY barrier left is NATS $SYS system-subject
isolation (no in-account user can publish $SYS.REQ.USER.AUTH, and the callout user is even
explicitly pub-denied it) — the app-layer iss === server_id.id + N…-prefix check is NOT
independently sufficient, since an attacker who could reach the subject could present their own
createServer() key and matching sealing xkey. That isolation holds single-broker, so omitting
the list is safe today; startup logs a WARNING so the over-trust is never silent.
OptionallimitsDeadline, concurrency and slow-line limits. Absent: every default.
OptionallogDiagnostics sink (default: console.error). Never carries bearer contents. Each answered
request writes one auth callout: level=… line, whose fields docs/identity-and-auth.mdx names.
OptionalonAudit hook fired on each successful mint, BEFORE the response is sent — the minted user JWT
plus its principal and bound expiry. For metering/audit and for asserting the revocation lever
(the mint's exp is bound to the bearer's, so broker access dies with the bearer).
Permission builder for a validated principal (the flip feeds core's permissionsFor via a thin
@cotal-ai/auth adapter). connId is the connection name (req.connect_opts.name), NOT the
NATS-minted req.user_nkey. The builder scopes the private reply inbox _INBOX_<connId>.> on it.
The callout checks that a principal-bound name matches the bearer. Legacy nonces remain
valid. Neither form may contain subject metacharacters.
readerId is core's calloutReaderId of this connection, which keys the observer and admin
profiles' history-reader deletes: the client chooses the connId, so the connId cannot key them.
REQUIRED: durably record the minted JWT's broker user key (req.user_nkey) against the validated
principal BEFORE the response leaves (SPEC 13.1 natkey.). Awaited; a throw becomes the signed
deny and the minted JWT is never sent. A thrown record write may still have landed: evidence of
an issuance, never proof a client received the JWT or the connection was accepted.
OptionalserviceOptional sealed native service path. Absent means service-endpoint continues to refuse.
The space — enforced as the bearer's audience.
Pinned bearer verification: the key resolver (pinned JWKS/local key) + exact issuer.
The callout xkey SEED — MANDATORY. No xkey, no service (fail startup, never plaintext).
Hooks for distinct connections may run concurrently. Each connection still awaits its own authority checks and durable issuance before its encrypted response is released.