VVeritia documentation

Original sources · POC — modules

Platform stub — README

poc-code/platform/stub/README.md POC EN updated 2026-12-01 5 KBraw file

Summarised in: POC components · Known inconsistencies

Platform stub (web-platform-stub)

The machine-facing half of "Notre Plateforme" for the POC — the handful of endpoints a real downstream process (the PDS) genuinely calls, plus the two the SPA needs to survive a reload. No database, no real itsme; in-memory state, localhost only.

Endpoints

Method + pathContractConsumer
GET /jwks.json§5.1PDS filter — verifies the mandate signature
POST /discover§5.2SPA registration — server-side initialize + tools/list, dodges browser CORS
POST /providersspec A4SPA registration finalize ("J'accepte")
GET /providers/:idspec B5SPA mandate form — provider lookup
POST /account-link/initiate§5.8 / §8SPA espace-client — fetch the PDS-signed account-link assertion, verify it, open a link session
POST /mandates§5.3SPA mandate form — signs the Agent Delegation Token (needs a link_session_id from /account-link/initiate)
GET /introspect/:jti§5.4PDS filter — every call, RFC 7662-style; deny on anything but active:true
POST /mandates/:jti/revoke§5.5SPA dashboard
GET /mandates?itsme_sub=§5.6SPA dashboard list
GET /audit/:jti§5.7SPA dashboard + demo step 8 (Trace Plateforme)
POST /setup-codes/:code/redeem§5.9 / §9mcp-server setup (Outil Local) — redeems the one-time setup code into the mandate's config.json (step 5b)
GET /health—liveness

POST /discover uses POST with a JSON body ({ "mcp_endpoint": "..." }) per contracts §5.2 — not the GET /discover shown in the architecture mermaid.

Run

bash
npm install
# once — generates deploy/keys/platform-signing.jwk.json (git-ignored, stable across restarts)
../../deploy/gen-keys.sh
npm run dev            # tsx watch, http://localhost:3000

Build / CI:

bash
npm run typecheck
npm test              # node:test via tsx — no network, spins the app on an ephemeral port
npm run build && npm start

The stub fails fast if the signing key is missing (it never auto-generates one — a fresh key would drift the JWKS the PDS caches; see deploy/spec.md D-2).

Hands-on manual testing (curl walkthrough, endpoint reference, troubleshooting): TESTING.md.

Configuration (env — defaults from contracts §4/§6)

VarDefaultMeaning
PORT3000
PLATFORM_ISSUERhttps://veritia.eutoken iss
PDS_MCP_URIhttp://localhost:8081/mcptoken aud (canonical MCP URI, not the provider UUID)
PDS_DISCOVERY_URIhttp://localhost:8081/mcpfallback target for POST /discover when the body omits mcp_endpoint
SIGNING_KEY_PATH../../deploy/keys/platform-signing.jwk.jsonRSA private JWK, kid platform-poc-1. In the container: /keys/platform-signing.jwk.json
FIXED_PROVIDER_ID9b7c1e40-2f6a-4c11-9e2a-000000000bqtconstant provider_id for repeatable demos; set to empty to mint a random UUID per registration
MANDATE_LINK_BASEhttp://localhost:4200/mandate/newSPA form URL; ?provider=<id> is appended
PDS_ASSERT_URIhttp://localhost:8081/account-link/assertaccount-linking (§8): stub POSTs {pds_customer_id} here to get a signed assertion
PDS_ASSERTION_JWKS_URIhttp://localhost:8081/pds-jwks.jsonPDS assertion key (kid bqt-assertion-1) — used to verify the assertion JWS
PDS_ASSERT_DEV_SECRETpoc-dev-secretX-Poc-Dev-Auth header for the mocked-auth PDS assert endpoint
LINK_SESSION_TTL_SECONDS600how long a verified link session is usable before POST /mandates

Layout

src/
  server.ts        entry — loadConfig -> loadSigner -> createApp -> listen
  app.ts           all routes (Express); createApp({config,signer,state}) is the testable seam
  config.ts        env -> Config, defaults from contracts §4/§6
  signing.ts       load RSA private JWK; sign() + public JWK for /jwks.json
  mandate.ts       mint the Agent Delegation Token — claim set frozen in contracts §1
  mcp-discover.ts  server-side MCP initialize/tools/list handshake (Streamable HTTP, JSON or SSE)
  assertion.ts     verify a PDS-signed account-link assertion (contracts §8.4) — JWKS fetch + jose
  state.ts         in-memory Maps: providers, mandates, audit, linkSessions, usedAssertionJti
  seed.ts          fake itsme identities (contracts §4)
test/
  stub.test.ts     scenario coverage (platform §A6 + contracts §7 rows)
Generated 2026-11-30 by documentation/build.mjs · edit the Markdown, never this HTML.