nx_cap_mint_candidate_t186.nx
buildroot/runtime/nx_cap_mint_candidate_t186.nx
about
nx_cap_mint.nx -- CLI to MINT a capability token for R0's tools/call (R2 live). Reads the HMAC secret from a keyfile
(the vault-provisioned prod secret -- the SAME file R0 loads), and mints a capability granting <allow> until <exp>.
Operator-run (holds the keyfile); the eventual auth-gated self-service issuance endpoint is the ratchet.
nx_cap_mint <keyfile> <allow-comma-list-or-*> <exp-epoch> <nonce> -> prints the capability token to stdout.
license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_cap_token_candidate_t186.nxnx_fio.nx
imported by: nx_mgmt_cap_data_candidate_t186.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| 39 | struct NxCapFile {bytes:*u8,length:i64,code:i64} |
consts
| 21 | const CM_PLACEHOLDER: *u8 = "nishi-tools-cap-hmac-secret-v1-REPLACE-FROM-VAULT" as *u8 |
functions
| 9 | func cm_puts(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 1: main |
| 10 | func cm_decimal(s:*u8,n:i64)->i64 called by 1: cm_atoi |
| 17 | func cm_atoi(s:*u8)->i64{return cm_decimal(s,capt_slen(s))} |
| 24 | func cm_streq_n(a: *u8, alen: i64, b: *u8) -> i64 called by 1: cm_mint |
| 33 | func cm_mint(secret: *u8, secretlen: i64, allow: *u8, allen: i64, exp: i64, nonce: i64, out: *u8, cap: i64) -> i64 |
| 40 | func cm_file_close(file:*NxCapFile)->i64 |
| 48 | func cm_file_read(path:*u8,file:*NxCapFile)->i64 called by 1: cm_mint_file calls 5: fio_region_initfio_region_openfio_region_nextfio_region_closecm_file_close |
| 71 | func cm_mint_file(path:*u8,allow:*u8,allen:i64,exp:i64,nonce:i64,out:*u8,cap:i64)->i64 |
| 79 | func main(argc:i64,argv:*i64)->i64 |