code wiki / _hdl_build / nx_inventory_gate.nx

nx_inventory_gate.nx

buildroot/runtime/_hdl_build/nx_inventory_gate.nx

9083 B162 linesdepth 17pulls 52 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_inventory_gate.nx -- proves nx_inventory_serve's teeth IN-PROCESS. No socket, no curl, no shell. WHY THIS EXISTS: the first version of this daemon was tested by a shell script driving curl -- the break-glass shape rule 29 forbids -- and that suite was BLIND TWICE OVER: 1. it printed only "Refused." without the REASON, so four SSRF negative tests went green while the url decoder was completely broken. ***A GUARD THAT REFUSES EVERYTHING PASSES EVERY NEGATIVE TEST.*** Only a POSITIVE control (an input that MUST be allowed) could see it. 2. once auth landed, every route 401s before reaching the guard, so the SSRF checks could not run over HTTP AT ALL. A test that the product's own security improvement disables is not a test. The daemon's router is a PURE FUNCTION for exactly this reason: request bytes in, response bytes out. So this gate calls iv_url_ok / iv_urldec / iv_handle directly and asserts WHICH RULE FIRED. Fixtures live under /tmp; production surfaces are never read or written. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_inventory_serve.nx nx_inventory_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_inventory_serve.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_mmap ↻ iv_url_ok iv_lit_at gv_bite gv_puts ↻ ig_url sys_mmap ↻ iv_url_ok ↻ gv_check gv_puts ↻ ig_dec iv_lit_at ↻ sys_mmap ↻ iv_urldec iv_hexval gv_check ↻ nx_uas_server_keys_load_or sys_mmap ↻ sys_read_file sys_openat_rd

structs

none

consts

19const IG_BUF: i64 = 4096
20const IG_SMALL: i64 = 64

functions

24func ig_url(name: *u8, url: *u8, want_ok: i64, want_why: i64, ctr: *i64) -> i64
called by 1: main calls 3: sys_mmapiv_url_okgv_check
36func ig_dec(name: *u8, reqline: *u8, want: *u8, ctr: *i64) -> i64
62func ig_contains(h: *u8, hn: i64, needle: *u8) -> i64
called by 1: main calls 1: iv_lit_at
68func main(argc: i64, argv: *i64) -> i64