code wiki / _hdl_build / nx_doc_serve_gate.nx
nx_doc_serve_gate.nx
buildroot/runtime/_hdl_build/nx_doc_serve_gate.nx
about
nx_doc_serve_gate.nx -- GATE for LEGAL D3 (nx_doc_serve).
Asserts the open-in-app-of-choice serve invariants, each w/ a negative control:
T1 CONTENT-TYPE : every format maps to its exact MIME (browser opens the
right app).
T2 BYTE-EXACT : a body that itself contains CRLFCRLF + NUL round-trips
bit-for-bit (Content-Length framed); flipping one body
byte is detected.
T3 DISPOSITION : DOCX defaults to download (open in Word), PDF inline;
the attachment response carries the filename.
T4 LENGTH+HARDENING : Content-Length is exact + X-Content-Type-Options:nosniff
present (no MIME-sniff of a legal doc).
T5 INJECTION-SAFE : a "name\r\nSet-Cookie: ..." filename cannot inject a
header -- framing intact AND the CRLF is stripped.
T6 SAFE-BY-DEFAULT : an unknown format is octet-stream + attachment (never
inlined).
T7 TENANT ISOLATION : the vault prefix discipline rejects '.'/'/' tenant ids.
Evidence -> knowledge/status/doc_serve.log
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_doc_serve.nxnx_doc_vault.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 25 | const DS_LOG: *u8 = "knowledge/status/doc_serve.log" |
functions
| 27 | func ew(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 28 | func ewn(fd: i64, v: i64) -> i64 |
| 37 | func streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 47 | func main() -> i64 |