code wiki / _hdl_build / nx_shard_registry.nx
nx_shard_registry.nx
buildroot/runtime/_hdl_build/nx_shard_registry.nx
about
nx_shard_registry.nx -- the SSOT reader for the Nishi SHARDED ecosystem (CAP-SHARD-REGISTRY). Industry best-practice
for managing many shards/tenants = ONE control plane over a REGISTRY of data planes (AWS Organizations' account tree,
k8s fleet's cluster registry, a SaaS tenant catalog: "onboard a tenant = write a row to the registry"). This reads
knowledge/hosting/shards.conf -- one row per shard = the JOIN the ecosystem lacked (domain x service x port x
identity x roles x health, today scattered across ~8 confs). The control plane (nx_mgmt_api /api/shards) enumerates +
ADDRESSES every shard by shard-id, and per-shard AUTH (realm) + per-shard RBAC (roles_path) become DATA not code --
which is exactly how one canonical realm scopes authority per shard WITHOUT the rejected dual-realm hack. Composes the
shipped slk_* TSV parsers (nx_site_lock_lib). Add a shard = a row + reload, no recompile.
row: shard_id <TAB> domain <TAB> service <TAB> port <TAB> realm <TAB> keys <TAB> store <TAB> roles_path <TAB> health_flow
license_tier: ORIGINAL
dependencies 1 imports · 4 importers
imports: nx_site_lock_lib.nx
imported by: nx_shard_governance_gate.nxnx_shard_rbac_gate.nxnx_shard_registry_gate.nxnx_shard_view.nx
structs
| none |
consts
| 13 | const SR_F_ID: i64 = 0 // shard-id -- the PRIMARY KEY the control plane targets (e.g. andelinwest-portal) |
| 14 | const SR_F_DOMAIN: i64 = 1 |
| 15 | const SR_F_SERVICE: i64 = 2 |
| 16 | const SR_F_PORT: i64 = 3 |
| 17 | const SR_F_REALM: i64 = 4 // the shard's OPAQUE realm (canonical for control-plane shards; own realm for tenant silos) |
| 18 | const SR_F_KEYS: i64 = 5 |
| 19 | const SR_F_STORE: i64 = 6 |
| 20 | const SR_F_ROLES: i64 = 7 // the per-shard roles file -- THE per-shard-RBAC crux (ag_uid_to_level's 4th arg) |
| 21 | const SR_F_HEALTH: i64 = 8 // the functional health flow name (funcchecks.conf) for real round-trip truth |
functions
| 24 | func sr_count(reg: *u8, n: i64) -> i64 |
| 35 | func sr_field_at(reg: *u8, ls: i64, le: i64, f: i64, out: *u8, cap: i64) -> i64 |
| 47 | func sr_field_int(reg: *u8, ls: i64, le: i64, f: i64) -> i64 |
| 55 | func sr_find_by_id(reg: *u8, n: i64, id: *u8, idlen: i64, out_le: *i64) -> i64 |
| 73 | func sr_roles_of(reg: *u8, n: i64, id: *u8, idlen: i64, out: *u8, cap: i64) -> i64 |
| 81 | func sr_port_of(reg: *u8, n: i64, id: *u8, idlen: i64) -> i64 |