code wiki / _hdl_build / nx_realm_isolation_gate.nx
nx_realm_isolation_gate.nx
buildroot/runtime/_hdl_build/nx_realm_isolation_gate.nx
about
nx_realm_isolation_gate.nx -- PROVES per-site OPAQUE realm isolation (operator 2026-06-17: "don't allow
andelinwest.com to share the same as nishifamily.com -- each site a SEPARATE opaque login"). Arms TWO
realms with SEPARATE keys + stores + realm_ids (nishifamily, andelinwest), registers + logs in a user in
each via the REAL Modern Auth (OPAQUE-3DH), then CROSS-VALIDATES: a token minted for one realm MUST be
rejected by the other. This is the multi-tenant separation property: no token crosses site boundaries.
T1 nishifamily token on nishifamily ctx -> OK
T2 nishifamily token on andelinwest ctx -> DENY (isolation: a family token is useless on the law firm)
T3 andelinwest token on andelinwest ctx -> OK
T4 andelinwest token on nishifamily ctx -> DENY (isolation: a client/lawyer token is useless on the family hub)
Sovereign: nx_modern_auth_flow + nx_syscalls. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_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
structs
| none |
consts
| none |
functions
| 14 | func ri_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 15 | func ri_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 16 | func ri_row(name: *u8, ok: i64) -> i64 { if ok==1 { ri_w(" PASS " as *u8) } else { ri_w(" FAIL " as *u8) } ri_w(name); ri_w("\n" as *u8); return ok } |
| 17 | func ri_trunc(path: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 0x180); if fd >= 0 { sys_close(fd) } return 0 } |
| 20 | func ri_arm(keys: *u8, store: *u8, realm: *u8, handle: *u8, pass: *u8, ctx: *NxAuthContext, tok: *u8, tokn: *i64) -> i64 |
| 39 | func ri_validate(ctx: *NxAuthContext, tok: *u8, tok_n: i64, now_s: i64) -> i64 |
| 45 | func main() -> i64 |