code wiki / _hdl_build / nx_gen_live_probe.nx
nx_gen_live_probe.nx
buildroot/runtime/_hdl_build/nx_gen_live_probe.nx
about
nx_gen_live_probe.nx -- LIVE FRONTEND PROOF. Runs ON THE NAS (via `nx_hostctl genprobe`). Drives the REAL
deployed /gen gateway over loopback 127.0.0.1:18794 (the same daemon serving nishifamily.com/gen), end-to-end
through the production OPAQUE auth + HR authz:
- registers a temp owner in the LIVE OPAQUE store (credential lives only on the NAS, never transmitted)
- enrolls it OWNER in the LIVE nishi_hr- (so it hits the same hra_is_superadmin path elderwesto needs)
- logs in for a REAL session token, then asserts (1) authed GET /gen -> 200 + the Elder AI UI, (2) no-cred -> 401
- DEMOTES the temp owner (latest HR record = level NONE) so the lingering account keeps NO /gen access
GREEN proves the DEPLOYED gateway grants an enrolled owner -- exactly what the bootstrap does for elderwesto.
license_tier: ORIGINAL expect_exit: 0
dependencies 6 imports · 0 importers
imports: nx_opaque_login.nxnx_connect.nxnx_hr_admin.nxnx_hr.nxnx_hr_entitle.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
| 16 | const LP_MAGIC_1000000: i64 = 1000000 |
| 17 | const LP_MAGIC_86400: i64 = 86400 |
| 18 | const LP_MAGIC_1024: i64 = 1024 |
| 19 | const LP_MAGIC_8192: i64 = 8192 |
| 20 | const LP_MAGIC_262144: i64 = 262144 |
| 22 | const LP_PORT: i64 = 18794 |
| 23 | const LP_KEYS: *u8 = "/volume1/homes/elderwesto/nishihost/opaque_keys.bin" as *u8 |
| 24 | const LP_STORE: *u8 = "/volume1/homes/elderwesto/nishihost/opaque_store.log" as *u8 |
| 25 | const LP_HR: *u8 = "/volume1/homes/elderwesto/nishihost/nishi_hr-" as *u8 |
| 26 | const LP_ENT: *u8 = "/volume1/homes/elderwesto/nishihost/nishi_entitlements-" as *u8 |
functions
| 28 | func lp_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 29 | func lp_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: main |
| 30 | func lp_n(v: i64) -> i64 { var m: i64=v; if m<0{lp_w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 } |
| 31 | func lp_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i]; o=o+1; i=i+1} return o } called by 1: main |
| 32 | func lp_catb(dst: *u8, off: i64, src: *u8, n: i64) -> i64 { var o: i64=off; var i: i64=0; while i<n {dst[o]=src[i]; o=o+1; i=i+1} return o } called by 1: main |
| 33 | func lp_find(buf: *u8, n: i64, needle: *u8) -> i64 { var nl: i64=0; while needle[nl]!=(0 as u8){nl=nl+1} if nl==0 {return 0} var i: i64=0; while i+nl<=n { var j: i64=0; var ok: i64=1; while j<nl { if (buf[i+j]&0xff)!=(needle[j]&0xff){ok=0;j=nl} else {j=j+1} } if ok==1 {return i} i=i+1 } return 0-1 } called by 1: lp_has |
| 34 | func lp_has(buf: *u8, n: i64, needle: *u8) -> i64 { if lp_find(buf,n,needle)>=0 {return 1} return 0 } |
| 35 | func lp_nap(ms: i64) -> i64 { let ts: *i64 = sys_mmap(16) as *i64; ts[0]=0; ts[1]=ms*LP_MAGIC_1000000; __syscall(35, ts as i64, 0, 0, 0, 0, 0); return 0 } |
| 38 | func lp_send(raw: *u8, rawlen: i64, resp: *u8, cap: i64) -> i64 |
| 64 | func lp_itoa(dst: *u8, off: i64, v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var o: i64=off; var q: i64=k-1; while q>=0{dst[o]=t[q];o=o+1;q=q-1} return o } |
| 67 | func lp_send_gen(raw: *u8, rawlen: i64, resp: *u8, cap: i64) -> i64 |
| 92 | func main() -> i64 |