code wiki / _hdl_build / nx_office_closed_gate.nx
nx_office_closed_gate.nx
buildroot/runtime/_hdl_build/nx_office_closed_gate.nx
about
nx_office_closed_gate.nx -- END-TO-END GATE for the CLOSED, realm-bound office instance (LP3 of /compare/legalpractice):
ONE nx_office_daemon binary, a tenant instance that accepts ONLY sessions of ITS realm, owns its documents through ITS
own ReBAC plane, resolves handles from a docportal-shaped uidmap, and never exposes the open-mode namespace.
The gate builds a FRESH realm under /tmp/<gate>/<now_us> (its own OPAQUE keys + account store, two registered users, a
uidmap it writes itself), spawns the DEPLOYED ./nx_office_daemon.elf on a probe port it first proves FREE, and drives
it over a real loopback socket. Inherits nx_gate_verdict: gv_check per tooth, gv_bite on the closed-mode gate, the
verdict in the EXIT CODE; the daemon is killed and reaped before the verdict. license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_office_serve.nxnx_opaque_login.nxnx_gate_verdict.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
| 12 | const OC_SCRATCH: *u8 = "/tmp/nx_office_closed_gate" |
| 13 | const OC_DAEMON: *u8 = "./nx_office_daemon.elf" |
| 14 | const OC_DIRMODE: i64 = 493 |
| 15 | const OC_SMALL: i64 = 256 |
| 16 | const OC_TOK: i64 = 600 |
| 17 | const OC_OUT: i64 = 1048576 |
| 18 | const OC_REQ: i64 = 65536 |
| 19 | const OC_CTX: i64 = 256 |
| 20 | const OC_MN: i64 = 512 |
| 21 | const OC_I64: i64 = 16 |
| 22 | const OC_REALM: *u8 = "officegate_realm" |
| 23 | const OC_LABEL: *u8 = "Office gate realm" |
| 24 | const OC_USER1: *u8 = "firmtest" |
| 25 | const OC_USER2: *u8 = "otherlawyer" |
| 26 | const OC_PW1: *u8 = "correct horse battery staple 1" |
| 27 | const OC_PW2: *u8 = "another long passphrase 2" |
| 29 | const OC_KSF_M: i64 = 256 |
| 30 | const OC_KSF_T: i64 = 2 |
| 31 | const OC_KSF_P: i64 = 1 |
| 33 | const OC_PORT_BASE: i64 = 18600 |
| 34 | const OC_PORT_SPAN: i64 = 100 |
| 35 | const OC_CONNECT_MS: i64 = 1500 |
| 36 | const OC_SPAWN_TRIES: i64 = 40 |
| 37 | const OC_SPAWN_WAIT_MS: i64 = 250 |
| 38 | const OC_LOOPBACK_A: i64 = 127 |
| 39 | const OC_SIGKILL: i64 = 9 |
| 40 | const OC_DOC: *u8 = "closed-doc" |
functions
| 42 | func oc_path(out: *u8, root: *u8, tail: *u8) -> i64 |
| 48 | func oc_status_is(out: *u8, n: i64, code: *u8) -> i64 |
| 53 | func oc_send(port: i64, req: *u8, n: i64, out: *u8, cap: i64) -> i64 |
| 66 | func oc_get(port: i64, path: *u8, tok: *u8, req: *u8, out: *u8) -> i64 |
| 74 | func oc_post(port: i64, path: *u8, tok: *u8, body: *u8, req: *u8, out: *u8) -> i64 |
| 87 | func oc_user(ctx: *NxAuthContext, handle: *u8, pw: *u8, uidmap: *u8, tok: *u8) -> i64 |
| 109 | func main() -> i64 |