ADR-083: Outbound Partner Authentication — Secret References Bound to Deployment Hosts, Applied by the Shared Transport
Status
Accepted (2026-10-19) — implemented by U1 (#2426, !1935), U2 (#2427, !1941) and U3 (#1813, !1939) of the plan Outbound Partner Authentication and the Initial Medicaid Application (#1813, #1805 slice, #1807) (epic &108); proposed as its U0 (2026-10-15). The as-built note records every deviation.
As built (U3, #1813). A reference’s value is read before its binding: no value settles auth-unavailable; a value with no or a
non-matching binding settles auth-misconfigured (D3’s "resolves to nothing"). A value holding a control byte (0x00–0x1F, TAB
included, or 0x7F) counts as no value; any other byte, non-ASCII included, is accepted. auth-refused is the trigger lane’s
class: a manual 401/403 rides the shared ladder to retries-exhausted (a manual retry recovers it) and the probe reports the
adapter’s error with its status (D4). A fifth class, partner-inactive, ends a manual job for a deactivated partner. A stored
failure names its reference as ` ref=<name>`, never a value. The boot warning names every active partner whose credential would
be refused, not only an unresolved or unbound one. Redaction also covers the \/ spelling, a body the #1460 bound clipped
mid-secret, numbers and object keys. The send-job retention sweep keeps an unreleased auth-class record job (U2).
Context
exchange_partners.auth_type and auth_config have existed since the first exchange migration. Nothing reads them: every
outbound send and connectivity probe goes out unauthenticated, and the write path accepts any string and any JSON, a plaintext
secret included. ADR-075 names authenticated sends a prerequisite of every real trigger bind.
The adapter seam carries a URL and a payload only, and adapters are per-kind boot singletons over one shared transport, so nothing per-partner can reach the wire. No partner catalogue names a CRAIG-presented scheme; the broker path (GTA webMethods) holds credentials itself. ADR-064’s sops store is dev/CI only; production secrets reach a service as environment variables or mounted files from the orchestrator’s store. Partner rows are written by supervisors in Georgia’s ruleset, so whoever can write a partner can choose where its credential goes.
Decision
D1 — A closed scheme vocabulary over secret references
auth_type is one of none, bearer, basic, api_key, parsed with its auth_config into a typed PartnerAuth. A config holds
reference names (^[a-z][a-z0-9_]{0,62}$, never ending _file or _hosts), a Basic username and an API-key header name, never a
value; anything else is a typed 422 that names the JSON path and never echoes it. Stored configs are emptied once. An endpoint
carrying userinfo is refused at every write, active or not, and refused at admission, send and probe if one is already stored; a
credential never crosses plain http unless the host is listed in CRAIG_EXCHANGE__PARTNER_AUTH_PLAIN_HTTP_HOSTS.
D2 — An explicit credential through the seam
OutboundAuth (redacted Debug, no Serialize, values in SecretString) passes per call through ExchangeAdapter::send and
test_connectivity to the transport, which sets the header sensitive. The broker, egress-controlled and SSA paths refuse any auth
other than None before building a request.
D3 — Per-send resolution, bound to deployment hosts
A reference resolves on every send from CRAIG_PARTNER_SECRET_<REF> or the file named by CRAIG_PARTNER_SECRET_<REF>_FILE
(bounded), through an injected source; nothing is cached, so a rotated file is used on the next send. Each reference also needs
CRAIG_PARTNER_SECRET_<REF>_HOSTS, the exact hosts it may reach: a send or probe to any other host, or for a reference with no
list, resolves to nothing and sends nothing. The deployment, not the partner writer, decides where a secret goes. The probe sends
the configured auth and needs partner update.
D4 — Auth failures are their own classes, and recoverable
Four settlement classes join ADR-075 decision 10: auth-unsupported, auth-misconfigured (neither sends; an occurrence holds),
auth-unavailable and auth-refused (a 401 or 403; both ride the remaining retry ladder). A trigger record job that fails
under any auth-* class is re-staged by release under a new correlation and a fresh attempt budget, as decision 8’s
supersession does, so no record is lost to a credential problem. Manual dispatch refuses an inactive partner.
D5 — Nothing stored carries the credential
Every byte string exchange stores or serves from a send (the transaction response, an acknowledgement, last_error,
exchange.failed, the probe result) passes a redaction of the exact applied forms first: the secret, its header value, Basic’s
encoded token, and their JSON-escaped forms. Logs, events and metric labels carry a class and a reference name only.
Consequences
-
A partner needs its secret and its host binding provisioned before it can send; an unprovisioned one settles
auth-unavailableand is released once fixed. -
Between the release that validates the vocabulary and the one that applies credentials, every row claiming auth stops sending (fail closed) and its records wait for one
release. The schema floor bump means exchange cannot roll back below that release. -
A host binding grants every partner row naming the reference; bindings should be narrow.
-
Redaction matches exact applied forms; a partner that transforms the secret before echoing it defeats it.
-
Scrubbed plaintext survives in WAL and backups: rotation is the revocation (ADR-064 D3).
Open questions
-
Which scheme each real endpoint requires, who issues and rotates the credentials, and whether webMethods stays in the path: asked on #1073. mTLS (#2434) and OAuth2 client credentials (#2435) wait for an answer.
Alternatives considered
-
Secrets encrypted in Postgres (plan A-F1 C). Rejected: the database becomes a credential store, and rotation becomes an API act.
-
Environment keyed by partner id (A-F1 B). Rejected: runtime rows coupled to deploy configuration; ids differ per environment.
-
References with no host binding (A-F1 D). Rejected: a partner writer could aim any provisioned secret at a host it controls and read it through the probe.
-
Per-partner adapter caches or a host-keyed decorator (A-F2 B, C). Rejected: invalidation logic, or two rows on one host unable to differ.
-
401/403 stay terminal
bad-status(A-F6 B). Rejected: a rotated credential would drop every record it meets.