code wiki / _hdl_build / nx_authz_session_gate.nx
nx_authz_session_gate.nx
buildroot/runtime/_hdl_build/nx_authz_session_gate.nx
about
nx_authz_session_gate.nx -- proves the FULL per-request authorization chain a daemon runs, end-to-end and
sovereign: a real no-cookie OPAQUE session token (X-Nishi-Session) -> nx_sa_validate_handle (authn -> the
user's HANDLE) -> authz_level_of (handle -> permission LEVEL) -> authz_level_allow (LEVEL vs the gallery
policy) -> the NSFW section is served ONLY to a private-level user. Uses REAL Modern Auth (register + login
for genuine 152B tokens) + the gallery policy (/ ->0 public, /gallery/private/ ->2 NSFW). This is exactly
what nx_media_server will call per request. license_tier: ORIGINAL
dependencies 5 imports · 0 importers
imports: nx_site_auth.nxnx_authz.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
| 13 | func sg_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 14 | func sg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 15 | func sg_row(name: *u8, ok: i64) -> i64 { if ok == 1 { sg_w(" PASS " as *u8) } if ok != 1 { sg_w(" FAIL " as *u8) } sg_w(name); sg_w("\n" as *u8); return ok } |
| 16 | func sg_trunc(p: *u8) -> i64 { let fd: i64 = sys_openat_wr(p, 0x180); if fd >= 0 { sys_close(fd) } return 0 } |
| 17 | func sg_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 } |
| 18 | func sg_catn(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: sg_req |
| 19 | func sg_streq_n(a: *u8, an: i64, b: *u8) -> i64 calls 1: sg_len |
| 27 | func sg_req(req: *u8, path: *u8, b64: *u8, b64n: i64) -> i64 |
| 37 | func sg_decide(ctx: *NxAuthContext, req: *u8, rl: i64, now_s: i64, hbuf: *u8, hn: *i64, uh: *i64, uhl: *i64, ul: *i64, un: i64, pp: *i64, pl: *i64, pv: *i64, np: i64, path: *u8) -> i64 |
| 44 | func main() -> i64 |