code wiki / _hdl_build / nx_modauth_arm.nx

nx_modauth_arm.nx

buildroot/runtime/_hdl_build/nx_modauth_arm.nx

4846 B88 linesdepth 15pulls 43 transitivereach 0 importersview sourcekind tooltopic modauth
docsdependenciesstructsconstsfunctions

about

nx_modauth_arm.nx -- PROVISION an admin into the canonical Modern Auth (the arming step that makes "all sites use modern_auth" deployable). File-driven by construction so the operator's passphrase NEVER touches chat / argv / stdout: it is read from a STAGED file, used to register the admin, and the one-time BIP39 24-word recovery mnemonic is written to an out-file for the operator to save then DELETE (it is never echoed). Idempotent: re-running supersedes the admin (additive-only store -- old passphrase dies, new lives; rows 8-9 of nx_modauth_e2e_gate prove this). ONE server-key bundle + ONE store serve every realm; realm+handle decide WHICH site+admin (a status token can't validate a wiki ctx -- realm-scoped hash). argv: [1]=keysfile [2]=storefile [3]=realm [4]=handle [5]=passphrase-file [6]=mnemonic-outfile e.g. nx_modauth_arm /vault/nishi_auth_keys /vault/nishi_auth_store nishi_status_adm elder /tmp/pw /tmp/mn Sovereign: nx_modern_auth_flow + nx_syscalls (no gcc, no 3rd-party). license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_modern_auth_flow.nx nx_syscalls.nx nx_modauth_arm.nx

imports: nx_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 sys_write arm_len sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close arm_w sys_write ↻ arm_len ↻ nx_uas_server_keys_load_or sys_mmap ↻ sys_read_file ↻ _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

14const K_MAGIC_8192: i64 = 8192

functions

16func arm_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: arm_wmain
17func arm_w(s: *u8) -> i64 { sys_write(1, s, arm_len(s)); return 0 }
called by 1: main calls 2: sys_writearm_len
19func main(argc: i64, argv: *i64) -> i64