code wiki / _hdl_build / nx_office_closed_gate.nx

nx_office_closed_gate.nx

buildroot/runtime/_hdl_build/nx_office_closed_gate.nx

12262 B203 linesdepth 16pulls 65 transitivereach 0 importersview sourcekind gate/prooftopic office
docsdependenciesstructsconstsfunctions

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

nx_office_serve.nx nx_opaque_login.nx nx_gate_verdict.nx nx_office_closed_gate.nx

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

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ of_cat of_catn nxi_buf oc_path of_cat ↻ gv_puts ↻ olg_ctx_setup olg_ctx_setup_ttl nx_uas_server_keys_load_or sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close _uas_hex_dec _uas_nib nx_csprng_fill

structs

none

consts

12const OC_SCRATCH: *u8 = "/tmp/nx_office_closed_gate"
13const OC_DAEMON: *u8 = "./nx_office_daemon.elf"
14const OC_DIRMODE: i64 = 493
15const OC_SMALL: i64 = 256
16const OC_TOK: i64 = 600
17const OC_OUT: i64 = 1048576
18const OC_REQ: i64 = 65536
19const OC_CTX: i64 = 256
20const OC_MN: i64 = 512
21const OC_I64: i64 = 16
22const OC_REALM: *u8 = "officegate_realm"
23const OC_LABEL: *u8 = "Office gate realm"
24const OC_USER1: *u8 = "firmtest"
25const OC_USER2: *u8 = "otherlawyer"
26const OC_PW1: *u8 = "correct horse battery staple 1"
27const OC_PW2: *u8 = "another long passphrase 2"
29const OC_KSF_M: i64 = 256
30const OC_KSF_T: i64 = 2
31const OC_KSF_P: i64 = 1
33const OC_PORT_BASE: i64 = 18600
34const OC_PORT_SPAN: i64 = 100
35const OC_CONNECT_MS: i64 = 1500
36const OC_SPAWN_TRIES: i64 = 40
37const OC_SPAWN_WAIT_MS: i64 = 250
38const OC_LOOPBACK_A: i64 = 127
39const OC_SIGKILL: i64 = 9
40const OC_DOC: *u8 = "closed-doc"

functions

42func oc_path(out: *u8, root: *u8, tail: *u8) -> i64
called by 1: main calls 1: of_cat
48func oc_status_is(out: *u8, n: i64, code: *u8) -> i64
called by 1: main calls 1: of_memhas
53func oc_send(port: i64, req: *u8, n: i64, out: *u8, cap: i64) -> i64
called by 2: oc_getoc_post calls 1: nx_connect_bounded
66func oc_get(port: i64, path: *u8, tok: *u8, req: *u8, out: *u8) -> i64
called by 1: main calls 2: of_catoc_send
74func oc_post(port: i64, path: *u8, tok: *u8, body: *u8, req: *u8, out: *u8) -> i64
called by 1: main calls 4: of_catof_catnof_slenoc_send
87func oc_user(ctx: *NxAuthContext, handle: *u8, pw: *u8, uidmap: *u8, tok: *u8) -> i64
109func main() -> i64