code wiki / _hdl_build / nx_email_portal_gate.nx

nx_email_portal_gate.nx

buildroot/runtime/_hdl_build/nx_email_portal_gate.nx

16138 B226 linesdepth 18pulls 56 transitivereach 0 importersview sourcekind gate/prooftopic email
docsdependenciesstructsconstsfunctions

about

nx_email_portal_gate.nx -- SOVEREIGN in-process referee for the mail.<domain> EMAIL portal daemon (no socket/curl/shell). Arms a fresh realm + invite store, then feeds crafted HTTP request BYTES into the pure router epd_handle and asserts response bytes AND real mailbox side effects in the seg_store: T1 GET / -> 200 + the login/register/mail SPA shell T2 invite register alice -> 200 mnemonic; then login -> token A T3 NEG bad-charset handle -> 400 AND the invite is NOT consumed (proved by T4 using it) T4 register bob with T3's invite -> 200 (the invite survived the refused attempt); login -> token B T5 NEG /mail/inbox with NO session -> 401 T6 alice sends bob a message whose subject carries "<script>" -> 200 DELIVERED-LOCAL + bob count +1 T7 bob's inbox fragment shows the subject HTML-ESCAPED (&lt;script&gt;), raw <script> ABSENT T8 bob reads the message -> body marker present, escaped T9 ISOLATION: alice's inbox does NOT contain bob's subject (mailbox derives from the session only) T10 alice sends to an EXTERNAL rcpt -> 200 QUEUED-EXTERNAL + relay-queue@<domain> count +1 (honest) T11 bob deletes the message -> inbox fragment no longer lists it; slot reads tombstoned T12 GET /mail/whoami (token A) -> {"handle":"alice","mailbox":"alice@<domain>"} GREEN iff 12/12. Appends knowledge/status/email_portal_gate.log. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_email_portal_daemon.nx nx_modern_auth_flow.nx nx_syscalls.nx nx_email_portal_gate.nx

imports: nx_email_portal_daemon.nxnx_modern_auth_flow.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main g_w sys_write g_trunc sys_openat_wr sys_close sys_mkdir sys_mmap nx_uas_server_keys_load_or sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻ _uas_hex_dec _uas_nib nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd ↻ sys_read ↻ sys_close ↻ nx_opq_derive_keypair sys_mmap ↻ _voprf_load_context_string u256_alloc nx_scratch nx_scratch_init sys_mmap ↻ nx_scratch_oom sys_write ↻ sys_exit sys_mmap ↻ nx_opq_hash_to_scalar sys_mmap ↻ nx_h2c_expand_message_xmd_ sys_mmap ↻ _h2c_i2osp_1

structs

none

consts

none

functions

21func g_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: g_verdictmain calls 1: sys_write
22func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
23func g_lw(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: main calls 1: sys_write
24func g_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 }
called by 1: main
25func g_cat_n(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: main
26func g_trunc(path: *u8) -> i64 { let fd: i64 = sys_openat_wr(path, 0x180); if fd >= 0 { sys_close(fd) } return 0 }
called by 1: main calls 2: sys_openat_wrsys_close
27func g_starts(buf: *u8, n: i64, s: *u8) -> i64 { let sn: i64 = g_len(s); if n < sn { return 0 } var i: i64 = 0; while i < sn { if (buf[i] as i64) != (s[i] as i64) { return 0 } i = i + 1 } return 1 }
called by 1: main calls 1: g_len
28func g_contains(hay: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: g_len
33func g_extract_token(resp: *u8, n: i64, out: *u8) -> i64
called by 1: main
42func g_verdict(label: *u8, ok: i64) -> i64 { g_w(" " as *u8); g_w(label); if ok == 1 { g_w(" PASS\n" as *u8) } else { g_w(" FAIL\n" as *u8) } return ok }
called by 1: main calls 1: g_w
44func main() -> i64