code wiki / _hdl_build / nx_studio_daemon_gate.nx

nx_studio_daemon_gate.nx

buildroot/runtime/_hdl_build/nx_studio_daemon_gate.nx

9363 B165 linesdepth 17pulls 59 transitivereach 0 importersview sourcekind gate/prooftopic studio
docsdependenciesstructsconstsfunctions

about

nx_studio_daemon_gate.nx -- SOVEREIGN in-process referee for the OPAQUE-gated studio daemon (no socket, no curl, no shell). Arms a realm + registers an admin via the REAL Modern Auth (OPAQUE-3DH), then feeds crafted HTTP request BYTES into the pure router stu_handle and asserts the response bytes -- the whole no-cookie login -> token -> gated-build -> deny flow, inside one Nishi organ. Proves the studio is behind the CANONICAL login (X-Nishi-Session, NOT a cookie, NOT nx_cms_admin). T1 GET /webdev -> 200 + SPA shell (public) T2 POST /webdev/login ok -> 200 + {"token":...} (mint a real 152B no-cookie token) T3 POST /webdev/build WITH token, tier|guided -> 200 + governed guided page T4 POST /webdev/build NO token -> 401 (default-deny: cannot build/publish unauthenticated) T5 POST /webdev/login WRONG pw -> 401 T6 POST /webdev/build BAD token -> 401 (forged token rejected by Ed25519) T7 GET /webdev/guided -> 200 + the guided surface (served) T8 POST /webdev/build WITH token, tier|freeform -> 200 + governed canvas (placement honored) Sovereign: nx_sitegen_studio_daemon + nx_modern_auth_flow + nx_syscalls. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_sitegen_studio_daemon.nx nx_modern_auth_flow.nx nx_syscalls.nx nx_studio_daemon_gate.nx

imports: nx_sitegen_studio_daemon.nxnx_modern_auth_flow.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sdg_w sys_write sdg_trunc sys_openat_wr sys_close sys_mmap nx_uas_server_keys_load_or sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻ _uas_hex_dec _uas_nib nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd ↻ sys_read ↻ sys_close ↻ nx_opq_derive_keypair sys_mmap ↻ _voprf_load_context_string u256_alloc nx_scratch nx_scratch_init sys_mmap ↻ nx_scratch_oom sys_write ↻ sys_exit sys_mmap ↻ nx_opq_hash_to_scalar sys_mmap ↻ nx_h2c_expand_message_xmd_ sys_mmap ↻ _h2c_i2osp_1 _h2c_i2osp_2

structs

none

consts

none

functions

19func sdg_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: sdg_rowmain calls 1: sys_write
20func sdg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
21func sdg_row(name: *u8, ok: i64) -> i64 { if ok == 1 { sdg_w(" PASS " as *u8) } if ok != 1 { sdg_w(" FAIL " as *u8) } sdg_w(name); sdg_w("\n" as *u8); return ok }
called by 1: main calls 1: sdg_w
22func sdg_cat(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: main
23func sdg_cat_n(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: main
24func sdg_trunc(path: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 0x180); if fd >= 0 { sys_close(fd) } return 0 }
called by 1: main calls 2: sys_openat_wrsys_close
25func sdg_starts(buf: *u8, n: i64, s: *u8) -> i64
called by 1: main calls 1: sdg_len
32func sdg_contains(hay: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: sdg_len
44func sdg_extract_token(resp: *u8, n: i64, out: *u8) -> i64
called by 1: main
68func main() -> i64