code wiki / (root) / nx_iot_hub_tenant.nx

nx_iot_hub_tenant.nx

buildroot/runtime/nx_iot_hub_tenant.nx

4424 B80 linesdepth 11pulls 21 transitivereach 3 importersview sourcekind tooltopic iot
docsdependenciesstructsconstsfunctions

about

nx_iot_hub_tenant.nx -- per-HOUSE IoT sharding built ON THE NISHI HR SPINE (killer-feature rung 4). Operator 2026-06-23: "make sure on the tenant and all that this is why we were building into a nishi hr." So the multi-tenancy is NOT a bespoke IoT store -- it composes NISHI HR (the access SSOT). Each HOUSE = an HR REALM; realm isolation is BY CONSTRUCTION (cred_id = sha256(realm||| handle), so the same handle in another house derives a DIFFERENT cred = level 0 here). A viewer's HR level drives their IoT access tier (deny-by-default, exactly like torrent/gallery via HR): level 0 (unknown/suspended) -> DENY (no devices, no controls) level 1 (family) -> FAMILY (see + on/off) level 3 (owner/operator) -> OWNER (+ manage/adopt) Reuses nx_iot_dashboard (zero-JS cards) + nx_hr (hr_cred_id / hr_resolve_level). One running hub serves the right house's dashboard to the right HR-authenticated viewer; sharding is the realm. license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_hr.nx nx_iot_dashboard.nx nx_iot_hub_tenant.nx nx_iot_hub_serve_realm.nx nx_iot_hub_tenant_gate.nx

imports: nx_hr.nxnx_iot_dashboard.nx

imported by: nx_iot_hub_serve_realm.nxnx_iot_hub_tenant_gate.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main iot_tenant_render cp_head cp_cat cp_foot cp_cat ↻ db_card nx_iot_cap_for_class cp_cat ↻ db_badge cp_cat ↻ cp_catn sys_mmap cp_widgets nx_iot_cap_has cp_cmd_open cp_cat ↻ cp_cat ↻ cp_catn ↻ sys_openat_wr

structs

none

consts

16const IOT_MAGIC_262144: i64 = 262144
19const IOT_DENY: i64 = 0
20const IOT_FAMILY: i64 = 1
21const IOT_OWNER: i64 = 2

functions

23func iot_access_from_level(level: i64) -> i64
32func iot_hub_viewer_access(hr_store: *u8, realm: *u8, realm_n: i64, handle: *u8, hn: i64) -> i64
42func iot_tenant_render(h: *u8, house_label: *u8, access: i64) -> i64
69func main() -> i64