code wiki / (root) / nx_room_key.nx

nx_room_key.nx

buildroot/runtime/nx_room_key.nx

3715 B87 linesdepth 5pulls 5 transitivereach 4 importersview sourcekind librarytopic room
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_sha256.nx nx_room_key.nx nx_room_invite.nx nx_room_key_gate.nx nx_signaling_v2.nx nx_signaling_v2_gate.nx

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

9const RK_MAGIC_4096: i64 = 4096
11const RK_TOK_LEN: i64 = 16 // hex chars of the first 8 digest bytes

functions

14func rk_base_len(room: *u8, n: i64) -> i64
called by 3: mainmainmain
20func rk_parse_k(path: *u8, n: i64, k_out: *u8, cap: i64) -> i64
called by 2: mainmain
38func rk_path_no_query(path: *u8, n: i64) -> i64
called by 2: mainmain
44func rk_token(room: *u8, room_len: i64, secret: *u8, secret_len: i64, out: *u8) -> i64
61func rk_protected(list: *u8, ln: i64, room: *u8, blen: i64) -> i64
called by 2: mainmain