code wiki / _hdl_build / nx_apistack_svctoken.nx

nx_apistack_svctoken.nx

buildroot/runtime/_hdl_build/nx_apistack_svctoken.nx

2780 B48 linesdepth 3pulls 3 transitivereach 1 importersview sourcekind librarytopic apistack
docsdependenciesstructsconstsfunctions

about

nx_apistack_svctoken.nx -- CAP-API-SVCTOKEN: scoped machine-to-machine tokens for /api (service accounts that aren't a human OPAQUE login). A token store maps HASH(token) -> service + level (svctokens.conf: tokenhex TAB service TAB level), so the store holds only HASHES -- a leaked store never reveals a usable token (the sovereign exceed over plaintext API keys). st_resolve hashes the presented token and looks it up; deny-by-default. Scope = the same DATA-driven level as the roles SSOT, so a service token is level-scoped exactly like a user. license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_site_lock_lib.nx nx_apistack_svctoken.nx nx_apistack_svctoken_gate.nx

imports: nx_syscalls.nxnx_site_lock_lib.nx

imported by: nx_apistack_svctoken_gate.nx

structs

none

consts

8const K_MAGIC_3750763034362895579: i64 = 3750763034362895579
9const K_MAGIC_1099511628211: i64 = 1099511628211
10const K_MAGIC_65536: i64 = 65536

functions

12func st_read_file(path: *u8, out: *u8, cap: i64) -> i64
18func st_fnv(s: *u8, n: i64) -> i64
called by 2: st_resolvemain
23func st_hex16(h: i64, out: *u8) -> i64
called by 2: st_resolvemain
29func st_resolve(store_path: *u8, token: *u8, token_n: i64, out_service: *u8, svc_cap: i64, out_level: *i64) -> i64