code wiki / _hdl_build / nx_access_lib.nx

nx_access_lib.nx

buildroot/runtime/_hdl_build/nx_access_lib.nx

5534 B101 linesdepth 3pulls 3 transitivereach 23 importersview sourcekind librarytopic access
docsdependenciesstructsconstsfunctions

about

nx_access_lib.nx -- the S-class authorization CORE. ONE rule, reusable on every site: a request is allowed iff the user's GRANTED level >= the area's REQUIRED level, deny-by-default. Composes the area->required-level resolver (nx_site_lock_lib / slk_resolve) with a user->granted-level resolver (a roles registry). The owner (level 3) clears everything incl. exclusive areas; a family member (1) can NEVER reach an owner area; no session (0) reaches nothing gated. No privilege escalation possible. roles registry line: handle <TAB> level (e.g. elderwesto<TAB>3 ; aunt_jane<TAB>1) Sovereign: nx_site_lock_lib only. license_tier: ORIGINAL

dependencies 1 imports · 6 importers

nx_site_lock_lib.nx nx_access_lib.nx nx_access_gate.nx nx_hub_gw.nx nx_maturity_registry.nx nx_mgmt_api.nx nx_shard_governance_gate.nx nx_shard_rbac_gate.nx

imports: nx_site_lock_lib.nx

imported by: nx_access_gate.nxnx_hub_gw.nxnx_maturity_registry.nxnx_mgmt_api.nxnx_shard_governance_gate.nxnx_shard_rbac_gate.nx

structs

none

consts

9const K_MAGIC_262144: i64 = 262144
10const K_MAGIC_32768: i64 = 32768

functions

13func ag_resolve_level(reg: *u8, len: i64, handle: *u8, hlen: i64) -> i64
36func ag_allow(sl: *u8, sl_len: i64, roles: *u8, r_len: i64,
called by 1: main calls 2: slk_resolveag_resolve_level
53func ag_hex(dst: *u8, off: i64, src: *u8, n: i64) -> i64 { let hx: *u8="0123456789abcdef" as *u8; var o: i64=off; var i: i64=0; while i<n { let c: i64=(src[i] as i64)&0xff; dst[o]=hx[(c>>4)&15]; dst[o+1]=hx[c&15]; o=o+2; i=i+1 } return o }
called by 1: ag_uid_to_level
55func ag_read_file(path: *u8, out: *u8, cap: i64) -> i64
called by 1: ag_uid_to_level calls 1: sys_read
70func ag_idx_lookup(idxbuf: *u8, idxlen: i64, uidhex: *u8, uxn: i64, out_h: *u8, cap: i64) -> i64
92func ag_uid_to_level(uid: *u8, uidn: i64, idx_path: *u8, roles_path: *u8) -> i64