code wiki / _hdl_build / nx_mgmt_cap_mint_gate.nx
nx_mgmt_cap_mint_gate.nx
buildroot/runtime/_hdl_build/nx_mgmt_cap_mint_gate.nx
about
nx_mgmt_cap_mint_gate.nx -- prove POST /api/cap/mint is fail-closed least-authority. In-process referee
(no socket): crafts request BYTES, feeds the pure handler ma_do_cap_mint. Auth is the SAME ma_level_of
gate as every other write route, so this focuses on the NEW logic:
T1 missing allow -> 400
T2 allow=* -> 400 (charset refuses the mint-everything cap BY CONSTRUCTION)
T3 malformed csv (a,,b) -> 400
T4 allow names an UNREGISTERED tool -> 400 (a cap can never pre-authorize a phantom tool)
T5 no confirm=yes -> 400
T6 days out of range -> 400
T7 FAIL-CLOSED oracle: valid multi-element allow + confirm, but the on-NAS minter elf is absent locally
-> oracle exit != 0 -> 400 "mint failed", NO token, and NO cap_consent.log audit line (nothing minted).
(The positive mint is proven LIVE post-deploy -- the oracle + keyfile are NAS-absolute by design.)
Runs FS under /tmp. license_tier: ORIGINAL expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_mgmt_api.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
| none |
functions
| 17 | func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 18 | func pn(v: i64) -> i64 |
| 27 | func glen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 28 | func gcat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){d[o+i]=s[i]; i=i+1} return o+i } called by 1: mkreq |
| 29 | func gcatn(d: *u8, o: i64, s: *u8, n: i64) -> i64 { var i: i64=0; while i<n {d[o+i]=s[i]; i=i+1} return o+n } called by 1: mkreq |
| 30 | func gcontains(hay: *u8, n: i64, needle: *u8) -> i64 |
| 41 | func mkreq(dst: *u8, line: *u8, bod: *u8) -> i64 |
| 54 | func wfile(path: *u8, buf: *u8, n: i64) -> i64 |
| 58 | func fsize(path: *u8) -> i64 |
| 65 | func main() -> i64 |