nx_cap_mint.nx
buildroot/runtime/nx_cap_mint.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 1 imports · 1 importers
imports: nx_cap_token.nx
imported by: nx_cap_mint_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 7 | const CM_MAGIC_2048: i64 = 2048 |
| 14 | 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_atoi(s: *u8) -> i64 { var v: i64 = 0; var i: i64 = 0; while s[i] != (0 as u8) { let d: i64 = s[i] as i64; if d >= 48 { if d <= 57 { v = v * 10 + (d - 48) } } i = i + 1 } return v } called by 1: main |
| 17 | func cm_streq_n(a: *u8, alen: i64, b: *u8) -> i64 called by 1: cm_mint |
| 26 | func cm_mint(secret: *u8, secretlen: i64, allow: *u8, allen: i64, exp: i64, nonce: i64, out: *u8, cap: i64) -> i64 |
| 31 | func main(argc: i64, argv: *i64) -> i64 |