code wiki / _hdl_build / nx_docportal_admin_daemon.nx
nx_docportal_admin_daemon.nx
buildroot/runtime/_hdl_build/nx_docportal_admin_daemon.nx
about
nx_docportal_admin_daemon.nx -- the admin.<domain> DOCUMENT-PORTAL daemon, on the CANONICAL ecosystem auth
(the SAME Modern Auth nishifamily.com/status uses: OPAQUE-3DH + Argon2id + NO-COOKIE Ed25519 session). Operator
2026-06-28: "match it to what we have in the nishi ecosystem and team." So this does NOT invent a token scheme --
it COMPOSES nx_status_daemon's proven auth (sd_* request parsing + nx_modern_auth_login + nx_sa_validate) and
wraps the proven nx_docportal_admin_lib router da_handle:
GET /admin -> the no-cookie login + upload SPA shell (public)
POST /admin/login -> handle+passphrase -> nx_modern_auth_login -> 200 {"token":...} | 401
* /admin/* (token) -> X-Nishi-Session validates (nx_sa_validate) ? da_handle at STAFF level : 401
A loopback HTTP daemon the sites daemon reverse-proxies to (behind the SNI router admin.<d> row); the public
TLS + cert are the operator-gated deploy step. Pure router dad_handle = bytes-in/bytes-out (the gate drives it
in-process, no socket). license_tier: ORIGINAL
dependencies 9 imports · 4 importers
imports: nx_docportal_admin_lib.nxnx_status_daemon.nxnx_modern_auth_flow.nxnx_syscalls.nxnx_invite_token.nxnx_opaque_login.nxnx_docportal_search_serve.nxnx_tool_registry.nxnx_multipart.nx
imported by: nx_browser_forms_e2e_gate.nxnx_docportal_admin_daemon_gate.nxnx_docportal_multipart_gate.nxnx_nojs_session_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 25 | const DAD_ACCEPT_BACKOFF_MS: i64 = 50 |
| 29 | const DAD_REFRESH_MIN_SEC: i64 = 10 |
| 30 | const DAD_REQCAP: i64 = 65536 |
| 31 | const DAD_OUTCAP: i64 = 524288 |
| 304 | const DAD_MAXPARTS: i64 = 16 |
functions
| 35 | func dad_shell(out: *u8) -> i64 |
| 67 | func dad_invite_path(ctx: *NxAuthContext, out: *u8) -> i64 |
| 85 | func dad_landing(out: *u8, b64: *u8, b64n: i64) -> i64 |
| 106 | func dad_hex32(src: *u8, out: *u8) -> i64 called by 1: dad_handle |
| 113 | func dad_uidmap_path(ctx: *NxAuthContext, out: *u8) -> i64 called by 1: dad_handle |
| 123 | func dad_map_put(path: *u8, hexuid: *u8, h: *u8, hn: i64) -> i64 |
| 138 | func dad_map_get(path: *u8, hexuid: *u8, out: *u8, cap: i64) -> i64 |
| 173 | func dad_ui_page(out: *u8, handle: *u8, hn: i64, sraw: *u8, sn: i64) -> i64 |
| 200 | func dad_uploadtext(ctx: *NxAuthContext, req: *u8, req_n: i64, subject: *u8, out: *u8) -> i64 |
| 259 | func dad_ct_boundary(req: *u8, req_n: i64, out: *u8) -> i64 |
| 284 | func dad_cd_extract(body: *u8, hoff: i64, hlen: i64, key: *u8, out: *u8) -> i64 called by 1: dad_uploadfile |
| 308 | func dad_uploadfile(ctx: *NxAuthContext, req: *u8, req_n: i64, subject: *u8, out: *u8) -> i64 called by 1: dad_handle calls 8: sys_mmapdad_ct_boundarysd_catsd_body_offmultipart_parsedad_cd_extract+2 |
| 363 | func dad_handle(ctx: *NxAuthContext, req: *u8, req_n: i64, out: *u8) -> i64 |
| 620 | func main(argc: i64, argv: *i64) -> i64 |