code wiki / _hdl_build / nx_sitegen_studio_daemon.nx
nx_sitegen_studio_daemon.nx
buildroot/runtime/_hdl_build/nx_sitegen_studio_daemon.nx
about
nx_sitegen_studio_daemon.nx -- the CAPABILITY-ADAPTIVE WYSIWYG studio for nishifamily.com/webdev, BEHIND the
CANONICAL Modern Auth (the SINGLE ecosystem-wide login: OPAQUE-3DH + Argon2id KSF + BIP39 recovery + NO-COOKIE
Ed25519 session, 152B X-Nishi-Session header). Operator: "OPAQUE login for all nishifamily.com/* sites." This
composes the ONE shared gate nx_sa_validate -- NOT cookies, NOT nx_cms_admin (that argon2id+cookie path is the
pre-charter CMS holdout). A loopback HTTP daemon the sites daemon reverse-proxies /webdev* to.
The router is a PURE FUNCTION stu_handle(ctx, req, n, out) -> out_n (request bytes in, response bytes out, no
socket); the socket loop is a thin shell; the gate drives it IN-PROCESS (sovereign, no curl/shell). Routes:
POST /webdev/login -> handle=<h>&passphrase=<p> -> nx_modern_auth_login -> 200 {"token":"<b64 152B>"}|401
POST /webdev/build -> X-Nishi-Session validates (nx_sa_validate) ? se_build_tier(body) : 401 (privileged)
GET /webdev/guided|blocks|freeform -> the tier surface (its /build fetch carries X-Nishi-Session)
GET /webdev (+ any) -> the no-cookie SPA shell: login -> token in sessionStorage -> the tier picker
Context armed at startup (nx_uas_server_keys_load_or_init + nx_auth_context_init); the admin is provisioned
out-of-band by nx_modauth_arm (this daemon never registers). argv: [1]=port [2]=keysfile [3]=storefile
[4]=realm [5]=budget. Composes nx_site_auth + nx_modern_auth_flow + nx_studio_tiers (se_build_tier) +
nx_http_server + nx_base64. license_tier: ORIGINAL
dependencies 6 imports · 1 importers
imports: nx_syscalls.nxnx_http_server.nxnx_site_auth.nxnx_modern_auth_flow.nxnx_base64.nxnx_studio_tiers.nx
imported by: nx_studio_daemon_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 23 | const STU_MAGIC_262144: i64 = 262144 |
| 24 | const STU_MAGIC_262143: i64 = 262143 |
| 25 | const STU_MAGIC_8192: i64 = 8192 |
| 27 | const STU_REQCAP: i64 = 131072 |
| 28 | const STU_OUTCAP: i64 = 524288 |
functions
| 30 | func stu_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != 0 as u8 { n = n + 1 } return n } |
| 31 | func stu_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 } |
| 32 | func stu_atoi(s: *u8) -> i64 { var v: i64 = 0; var i: i64 = 0; while s[i] != 0 as u8 { let c: i64 = s[i] as i64; if c >= 48 { if c <= 57 { v = v * 10 + (c - 48) } } i = i + 1 } return v } called by 1: main |
| 33 | func stu_catn(d: *u8, o: i64, v: i64) -> i64 |
| 41 | func stu_starts(req: *u8, n: i64, s: *u8) -> i64 |
| 48 | func stu_find_path(req: *u8, n: i64, off_box: *i64, len_box: *i64) -> i64 called by 1: stu_handle |
| 61 | func stu_body_off(req: *u8, n: i64) -> i64 called by 1: stu_handle |
| 69 | func stu_hexnib(c: i64) -> i64 called by 1: stu_urldecode |
| 75 | func stu_urldecode(src: *u8, n: i64, out: *u8, out_cap: i64) -> i64 |
| 96 | func stu_form_field(body: *u8, body_n: i64, name: *u8, name_n: i64, out_off: *i64, out_n: *i64) -> i64 called by 1: stu_handle |
| 125 | func stu_emit_401(out: *u8) -> i64 |
| 129 | func stu_serve(out: *u8, file: *u8) -> i64 |
| 141 | func stu_shell(out: *u8) -> i64 |
| 154 | func stu_handle(ctx: *NxAuthContext, req: *u8, req_n: i64, out: *u8) -> i64 called by 2: mainmain calls 17: sys_mmapstu_find_pathstu_startsstu_body_offstu_form_fieldstu_urldecode+11 |
| 232 | func main(argc: i64, argv: *i64) -> i64 |