omnigraph/crates/omnigraph-server/src
Ragnor Comerford 284c9377c2
Add X-Request-Id middleware
Per-request ULID minted at the edge, exposed in request extensions and
on the response header. Caller-supplied X-Request-Id is echoed when
well-formed (1..=128 ASCII printable characters); otherwise rejected
and replaced with a fresh ULID so the value is always safe to log.

Companion to the TypeScript SDK redesign — clients now correlate logs
across the wire by reading X-Request-Id from response headers (and the
SDK already surfaces it on every OmnigraphError as `requestId`).

No spec change required; the header is a transport-layer concern.

Tests:
- mint a ULID when no header is provided
- echo a valid caller-supplied id
- reject overlong header (200 chars), mint a fresh ULID

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 22:56:17 +02:00
..
api.rs Polish schema endpoint: rename show, align field name, add tests 2026-04-18 00:30:46 +03:00
auth.rs Add aws feature + SecretsManagerTokenSource backend 2026-04-18 03:48:51 +03:00
config.rs Rename config targets to graphs 2026-04-14 04:12:14 +03:00
lib.rs Add X-Request-Id middleware 2026-04-25 22:56:17 +02:00
main.rs Initial public Omnigraph repository 2026-04-10 20:49:41 +03:00
policy.rs Add schema apply command and policy support 2026-04-12 04:01:14 +03:00
request_id.rs Add X-Request-Id middleware 2026-04-25 22:56:17 +02:00