code wiki / _hdl_build / nx_dev_api_gate.nx
nx_dev_api_gate.nx
buildroot/runtime/_hdl_build/nx_dev_api_gate.nx
about
nx_dev_api_gate.nx -- in-process gate for the sovereign DEV/CI API (nx_dev_api). Drives da_handle with
byte requests (NO socket, NO real fork). Proves routing + the TWO boundaries that make it safe to expose:
AUTH (object-capability): mutating routes need an X-Nishi-Cap granting "dev_build"; no-cap/forged -> 401.
INJECTION: with a VALID cap, the organ name is still charset-validated -> traversal/injection -> 400
BEFORE any exec (fixed-argv). Defence in depth: authority AND input both checked.
T1 GET index 200 T2 GET status 200 T3 unknown 404
T4 build NO cap -> 401 T5 build FORGED cap -> 401 T6 build valid-cap + ../etc/passwd -> 400
T7 build valid-cap + empty -> 400 T8 da_valid_name unit T9 da_form_field unit T10 injection charset
expect_exit: 0 license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_dev_api.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
| 12 | func gp(s: *u8) -> i64 { sys_write(1, s, da_slen(s)); return 0 } |
| 13 | func gpn(v: i64) -> i64 { let b: *u8=sys_mmap(24); let n: i64=da_catn(b,0,v); sys_write(1,b,n); return 0 } |
| 14 | func gcontains(hay: *u8, n: i64, needle: *u8) -> i64 |
| 19 | func chk(name: *u8, ok: i64, pass: *i64) -> i64 |
| 26 | func mkreq_path(out: *u8, path: *u8, cap: *u8, capl: i64, body: *u8) -> i64 |
| 36 | func mkreq(out: *u8, cap: *u8, capl: i64, body: *u8) -> i64 { return mkreq_path(out, "/api/dev/build" as *u8, cap, capl, body) } |
| 38 | func main() -> i64 |