code wiki / _hdl_build / nx_doc_authz.nx
nx_doc_authz.nx
buildroot/runtime/_hdl_build/nx_doc_authz.nx
about
nx_doc_authz.nx -- PER-CLIENT EYES-ONLY authorization for confidential docs (the P2 vault read gate). Closes the
audit's most-dangerous gaps: no per-doc ownership, no authenticated private-read route (a WRITE-ONLY vault), and
the free domain request param. HIPAA minimum-necessary 164.502(b) + ABA Model Rule 1.6(c) + iManage ethical
walls: a confidential doc is readable ONLY by its OWNER (the authenticated subject who uploaded it) -- or a
future attorney/partner tier -- and DENIED to everyone else, FAIL-CLOSED. Composes nx_doc_at_rest (doc_get
decrypts) + the sovereign seg_store (own:<cid> ownership row, additive alongside doc:<cid> / pol:<cid>).
STANDALONE lib -- wires into no daemon (the operator-approved swap is a later step, like P1). license_tier: ORIGINAL
dependencies 2 imports · 3 importers
imports: nx_doc_at_rest.nxnx_docportal_lib.nx
imported by: nx_doc_authz_gate.nxnx_docportal_admin_lib.nxnx_docportal_authz_route_gate.nx
structs
| none |
consts
| 14 | const AUTHZ_TIER_OWNER: i64 = 3 |
functions
| 16 | func az_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 17 | func az_cat(out: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { out[o] = s[i]; o = o + 1; i = i + 1 } return o } called by 1: az_ownkey |
| 18 | func az_eqbytes(a: *u8, b: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { if a[i] != b[i] { return 0 } i = i + 1 } return 1 } called by 1: authz_may_read |
| 20 | func az_ownkey(cid: i64, out: *u8) -> i64 |
| 31 | func authz_set_owner(domain: *u8, vis: i64, cid: i64, subject: *u8) -> i64 |
| 43 | func authz_get_owner(domain: *u8, vis: i64, cid: i64, out: *u8, outcap: i64) -> i64 |
| 63 | func authz_may_read(domain: *u8, vis: i64, cid: i64, subject: *u8, subject_level: i64) -> i64 |
| 77 | func authz_doc_get(domain: *u8, vis: i64, cid: i64, subject: *u8, subject_level: i64, out: *u8) -> i64 |