Skip to content

Headers

Every X-Plat5-* header, who sets it and who reads it. What a service should do with them: write a service.

The same values the upstream placeholders use, so a service can read them either way.

Header On Value
X-Plat5-<Kind>-Id (e.g. X-Plat5-Organization-Id, X-Plat5-Project-Id) Kind routes One per node in the chain
X-Plat5-Member-Id Kind routes The caller’s member id in this tree
X-Plat5-User-Id User routes The caller’s user id
X-Request-ID Every route Correlation id, gateway-generated; also on the response
traceparent Every route W3C trace context
X-Plat5-Signature Every route (when enabled) Ed25519 request signature; omitted unless UPSTREAM_SIGNING_KEY is set (signing)

<Kind> is the kind name in title case, with _ becoming -: project → Project, cost_center → Cost-Center.

Never sent: the caller’s permissions or role, or a user id on a kind route.

Recommended use: store the member id as an owner or author when a feature needs one, and key per-user data by the user id on user routes; never decide access by the caller (concepts/model.md). Access is Plat5’s, and the one place Plat5 reads the caller to decide it is identity’s child list, filtered to what X-Plat5-Member-Id can see: without the header the list is unfiltered, so a front door serving a member sends it (identity’s API).

Header Direction Why
Every X-Plat5-* Request, before the gateway’s own are set A client can’t name a node, a member or a user
Authorization Request Consumed by the gateway; never leaked to services
X-Plat5-Audit-* Response What the service tells audit (concepts/audit.md). Stripped on every route, audit on or off

Clients still send Authorization to the gateway, and CORS allows browsers to send it.

Set on the upstream response of an audited route; the gateway reads them, then strips them on every route (audit).

Header Says
X-Plat5-Audit-Details What changed, as one JSON object
X-Plat5-Audit-Created The id a create produced
X-Plat5-Audit-Nodes, X-Plat5-Audit-Member On a user route, the chain of nodes it changed, and the member in that tree

None. Internal calls carry no token: the deployment’s network is the boundary (internal APIs).

Base Plat5 defines no other headers. An operator plane documents its own, such as X-Plat5-Operator-Id, in its own repo.

When UPSTREAM_SIGNING_KEY is set (reference/env.md), the gateway signs every forwarded request (including public routes) and attaches:

X-Plat5-Signature: v1,kid=<kid>,t=<unix_seconds>,sig=<base64url_nopad>
  • v1 — signature version.
  • kid — key identifier (1–64 of [A-Za-z0-9._-]), for zero-downtime key rotation.
  • t — UTC Unix timestamp in seconds (decimal integer). Verifiers should reject timestamps outside a short skew window (recommended: ±30s).
  • sig — 64-byte Ed25519 signature encoded as base64url without padding (RFC 4648 §5).

The signed bytes are UTF-8, \n-delimited:

v1\n
<kid>\n
<t>\n
<METHOD>\n
<path_and_query>\n
<X-Request-ID>\n
<sorted_plat5_headers>
  • <METHOD> is uppercase (GET, POST, PUT, PATCH, DELETE, HEAD).
  • <path_and_query> is the rewritten upstream request target (with ?query when present).
  • <X-Request-ID> is included so every signature is unique per request (supporting optional replay-cache deduplication) and the correlation id cannot be forged.
  • <sorted_plat5_headers> is every outgoing X-Plat5-* header except X-Plat5-Signature, formatted as <lowercase-name>:<value>\n and sorted lexicographically by byte order of <lowercase-name> (empty on public routes).

Request bodies are not hashed: TLS protects the body in transit and skipping body hashing preserves streaming. Client-sent X-Plat5-Signature headers are stripped by the X-Plat5-* strip rule above.