nx_room_key.nx
buildroot/runtime/nx_room_key.nx
about
nx_room_key.nx -- ROOM CAPABILITY TOKENS (task #41 ladder: the last table-stakes gap vs the field --
LiveKit JWT / Janus+Ant tokens; ours = capability LINKS, sovereign). token = hex16 of sha256(base_room
|| secret): no server DB, no third party, secret is a FILE (data-driven). Protection is a data-driven
LIST (rooms_protected.txt) -- empty list = every room open = today's behavior BY CONSTRUCTION. The lane
suffix (#1/#2 shard rooms) is stripped for the check so ONE key covers all lanes of a room. This organ
is the SSOT both the relay and the invite tool import -- they cannot drift. license_tier: ORIGINAL
dependencies 2 imports · 4 importers
imports: nx_syscalls.nxnx_sha256.nx
imported by: nx_room_invite.nxnx_room_key_gate.nxnx_signaling_v2.nxnx_signaling_v2_gate.nx
structs
| none |
consts
| 9 | const RK_MAGIC_4096: i64 = 4096 |
| 11 | const RK_TOK_LEN: i64 = 16 // hex chars of the first 8 digest bytes |
functions
| 14 | func rk_base_len(room: *u8, n: i64) -> i64 |
| 20 | func rk_parse_k(path: *u8, n: i64, k_out: *u8, cap: i64) -> i64 |
| 38 | func rk_path_no_query(path: *u8, n: i64) -> i64 |
| 44 | func rk_token(room: *u8, room_len: i64, secret: *u8, secret_len: i64, out: *u8) -> i64 |
| 61 | func rk_protected(list: *u8, ln: i64, room: *u8, blen: i64) -> i64 |