caelum0x e959daaef9 fix(context-passport): deploy for real, fix a real Relay auth bug found live
Context Passport (Identity Lock) had no Dockerfile and no deploy
scaffolding at all, unlike Vend/Toolgate. Added a standalone distroless
Dockerfile + Dockerfile.dockerignore: like apps/turnstile, this workspace
path-depends on apps/mint/crates/mint-protocol (and its siblings
mint-core/mint-store/mint-receipts/mint-ledger) outside its own workspace,
so the build context is the repo root, trimmed to exactly those crates.

Deployed it on railyard-box wired to the real, already-live Mint (via
well-known key discovery, confirmed in the boot log) and a real minted
Relay key, and ran the full core loop against the deployed container:
create -> lock -> resolve -> generate.

Found and fixed a real bug this way: passport-relay-client sent
X-API-Key to Relay's /v1/passport/generate, but Relay only accepts
Authorization: Bearer there -- every real call failed 401 before this
fix, invisible to every existing test because they all exercise
build_inference_request/payment_evidence directly, never the real
reqwest call ("tests fake the sink via FakeRelay"). Fixed the header and
added a real regression test with a genuine local axum server (no
fakes) asserting the actual outbound header through a real generate()
call. Full workspace suite: 59/59 (was 58/58). Clippy clean.

After the fix, generate genuinely reaches Relay and runs a real
inference (confirmed with provider:"groq", Relay's live funded default),
then correctly fails closed on a missing AITP-Receipt -- Relay's own
billing is globally off in this environment, the same funding-wall
boundary every other Railyard sub-app hit this session, not a bug here.
This app's own design intent is to never fabricate settlement evidence,
and it doesn't.

Full detail in apps/context-passport/README.md's new "Deployed" section.
2026-10-28 06:09:39 +03:00

45 lines
1.9 KiB
Docker

# syntax=docker/dockerfile:1.7
#
# apps/context-passport — production image for the `identity-lock-server`
# binary (package `passport-server`): the Identity Lock / Context Passport
# API (create/edit/lock/version a brand or character identity, resolve it
# per-provider, generate through Relay with signed Mint settlement evidence
# and C2PA-aligned provenance).
#
# BUILD CONTEXT = the railyard repo ROOT, NOT apps/context-passport.
# context-passport is its own cargo workspace but path-depends on
# `apps/mint/crates/mint-protocol` (and mint-protocol's own siblings
# mint-core/mint-store/mint-receipts/mint-ledger), which live OUTSIDE
# apps/context-passport. The build therefore recreates both workspaces with
# their sibling layout, same pattern as apps/turnstile's Dockerfile.
#
# docker build -f apps/context-passport/Dockerfile -t railyard/identity-lock-server .
#
# Runtime is distroless (CA bundle only); sqlx and reqwest use rustls, so
# there is no OpenSSL. Serves on :8095 by default (PASSPORT_BIND_ADDR).
FROM rust:1.94-bookworm AS builder
WORKDIR /src/apps/mint
COPY apps/mint/Cargo.toml apps/mint/Cargo.lock ./
COPY apps/mint/crates/mint-core ./crates/mint-core
COPY apps/mint/crates/mint-store ./crates/mint-store
COPY apps/mint/crates/mint-receipts ./crates/mint-receipts
COPY apps/mint/crates/mint-ledger ./crates/mint-ledger
COPY apps/mint/crates/mint-protocol ./crates/mint-protocol
WORKDIR /src/apps/context-passport
COPY apps/context-passport/Cargo.toml apps/context-passport/Cargo.lock ./
COPY apps/context-passport/crates ./crates
RUN cargo build --release -p passport-server --bin identity-lock-server \
&& strip target/release/identity-lock-server
FROM gcr.io/distroless/cc-debian12:nonroot
WORKDIR /app
COPY --from=builder /src/apps/context-passport/target/release/identity-lock-server /app/identity-lock-server
ENV PASSPORT_BIND_ADDR=0.0.0.0:8095
EXPOSE 8095
USER nonroot
ENTRYPOINT ["/app/identity-lock-server"]