code wiki / _hdl_build / nx_site_auth_gate.nx
nx_site_auth_gate.nx
buildroot/runtime/_hdl_build/nx_site_auth_gate.nx
about
nx_site_auth_gate.nx -- REFEREE for the ONE shared access gate (nx_sa_validate) against the REAL
canonical Modern Auth. Security code MUST prove it rejects: a wall that can't deny is no wall.
Arms a realm exactly like production (load-or-init server keys -> nx_auth_context_init), provisions
an admin (nx_modern_auth_register), logs in for a genuine 152B no-cookie token, base64-encodes it
into an X-Nishi-Session header, then drives nx_sa_validate four ways:
T1 valid X-Nishi-Session -> ALLOW (NX_MAUTH_OK)
T2 NO session header -> DENY (NO_SESSION) <- default-deny
T3 tampered token (1 b64 char flipped) -> DENY (INVALID_SESSION) <- Ed25519 sig catches it
T4 valid token, clock past TTL -> DENY (EXPIRED) <- session actually expires
GREEN iff T1..T4 hold. Sovereign: nx_site_auth + nx_modern_auth_flow + nx_base64 + nx_syscalls. license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_site_auth.nxnx_modern_auth_flow.nxnx_base64.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
| 16 | func g_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 17 | func g_row(name: *u8, ok: i64) -> i64 |
| 24 | func g_trunc(path: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 0x180); if fd >= 0 { sys_close(fd) } return 0 } |
| 27 | func g_build_req(req: *u8, b64: *u8, b64_n: i64, with_session: i64) -> i64 called by 1: main |
| 46 | func main() -> i64 |