Skip to content

NA-0652: GET /v1/server-info capability document (D588, D-0012) - #62

Merged
Tebbens4832 merged 1 commit into
mainfrom
na-0652-server-info
Jul 17, 2026
Merged

NA-0652: GET /v1/server-info capability document (D588, D-0012)#62
Tebbens4832 merged 1 commit into
mainfrom
na-0652-server-info

Conversation

@Tebbens4832

Copy link
Copy Markdown
Member

Goals: G4, G5

NA-0652 (qsl-protocol governance; directive QSL-DIR-2026-07-17-588/D588, approved 2026-07-17; qsl-server decision D-0012): the capability document GET /v1/server-info — DOC-PROG-004 step 2 per locked decision L4 (additive-only, auth-gated, features-never-security).

What it serves

Relay auth Request token Response
open (RELAY_TOKEN unset) any (none needed) 200 full document, auth.mode:"open"
bearer missing 401 + exactly {"server":"qsl-server","auth":{"mode":"bearer"}}
bearer wrong 401 + byte-identical probe (no token oracle)
bearer valid 200 full document, auth.mode:"bearer"

Full document (live config, never constants): server, version (CARGO_PKG_VERSION), name (RELAY_NAME, ""-safe), api ["push_v1","pull_v1","pull_ack_lease_v1"], auth.mode, limits.{max_body_bytes,max_queue_depth}, retention.ttl_secs, directory.mode:"none", attachments.service_url (RELAY_ATTACHMENTS_SERVICE_URL, null-safe), kt.mode:"none", min_client_version (RELAY_MIN_CLIENT_VERSION, null-safe, advisory — not enforced). Contract rules encoded in the new docs/server/DOC-SRV-006 (additive-only evolution; features-never-security; same bearer gate; probe registry fixed at two keys).

Impact

Purely additive: src/lib.rs +96/−0 (ServerInfoCfg, two AppState fields, one widened constructor, the handler, one router line); new test file; DOC-SRV-006; relay.env.example + runbook lines for the three optional env vars (RELAY_TOKEN env-only precedent — absent/empty never fails startup); DECISIONS D-0012. src/main.rs, src/store.rs, Cargo.toml, Cargo.lock, and every existing test file untouched.

No-regression

/v1/push, /v1/pull, /v1/pull/ack handlers byte-untouched (their 401 stays plain ERR_UNAUTHORIZED); storage schema unchanged; auth mechanism unchanged — auth_ok reused AS-IS (the known non-constant-time compare remains ENG-0039 filed debt, deliberately not touched); zero dependency change. Full suite green locally: 108 passed / 0 failed across 26 result sets = the NA-0642 baseline (100/25) plus this PR's 8 tests; cargo fmt --check and cargo clippy --all-targets -- -D warnings clean.

Tests-Vectors

tests/na0652_server_info.rs (8): open-relay unauth full doc; bearer missing-token exact probe (exact-field-set guard at both nesting levels); wrong-token byte-identical probe; valid-token full doc; injected-config value tracking (limits/TTL/all three info fields); unset fields ""/null-safe; full-doc top-level exact-field-set guard (pins the additive baseline); real-binary end-to-end env plumbing (RELAY_* vars through main.rs, probe + full doc + RETENTION_TTL_SECS=7200 reflected).

🤖 Generated with Claude Code

…xed two-key probe, live-config document (D588, D-0012)

DOC-PROG-004 step 2 per locked decision L4 (additive-only, auth-gated,
features-never-security). On a bearer relay an unauthorized request
(missing OR wrong token, identical both ways — never a token oracle)
gets 401 with EXACTLY {"server":"qsl-server","auth":{"mode":"bearer"}};
an authorized request (or any request on an open relay) gets the full
document from LIVE config: server, version, name (RELAY_NAME, ""-safe),
api [push_v1, pull_v1, pull_ack_lease_v1], auth.mode per RELAY_TOKEN
presence, limits, retention.ttl_secs, directory none, attachments
service_url (RELAY_ATTACHMENTS_SERVICE_URL, null-safe), kt none,
min_client_version (RELAY_MIN_CLIENT_VERSION, null-safe, advisory).
DOC-SRV-006 carries the contract rules; the three new env vars follow
the RELAY_TOKEN env-only precedent and never fail startup; auth_ok is
reused AS-IS (the ENG-0039 compare stays filed debt, untouched).
push/pull/ack handlers, storage schema, auth mechanism, Cargo.toml and
Cargo.lock byte-untouched; src/lib.rs diff is purely additive.
Tests: tests/na0652_server_info.rs — probe-vs-full both auth modes,
wrong-token byte-identity, exact-field-set guards (probe both nesting
levels + full-doc top level), injected-config value tracking, real-binary
env plumbing end-to-end. Full suite 108/0 across 26 sets (the NA-0642
100/25 baseline + this file); fmt + clippy -D warnings clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Tebbens4832
Tebbens4832 merged commit 3cc551a into main Jul 17, 2026
1 check passed
@Tebbens4832
Tebbens4832 deleted the na-0652-server-info branch July 17, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant