NetKingdom facility for tenant management.
Find a file
tegwick 31e237cfa6 Fix: resolve tenants by identifier, not only internal tenant_id
Found via a real cross-service check while implementing key-cape's
KEY-WP-0005-T02: key-cape's Go adapter called GET /tenants/tenant:coulomb/roles
and got a genuine 404 for a tenant that existed. External callers
(key-cape, flex-auth) only ever have a tenant's profile identifier, never
tenant-engine's internal tenant_id (caller-chosen at creation, otherwise
opaque). Every existing test happened to use identical strings for both
fields, so this was invisible until a real, independent second caller
exercised the documented contract.

InMemoryTenantStore gained a _by_identifier index and a _resolve() helper
every method calls first; create_tenant now also rejects a duplicate
identifier under a different internal id (an oversight the same fix
surfaced). 5 new tests, including the exact HTTP-level scenario with colon
characters in the URL path. 65 total, all 60 pre-existing tests unaffected.

Re-verified end-to-end for real: fresh flex-auth + tenant-engine + key-cape's
actual adapter code, over real HTTP -- roles=[IAM] ok=true resolving by
identifier.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-24 00:15:26 +02:00
.claude/rules Bootstrap repo: State Hub registration, agent docs, TEN-WP-0001/0002 2026-07-23 21:56:07 +02:00
docs TEN-WP-0003: FlexAuthWriteAuthorizer -- gate writes through flex-auth 2026-07-23 22:54:44 +02:00
registry Bootstrap repo: State Hub registration, agent docs, TEN-WP-0001/0002 2026-07-23 21:56:07 +02:00
src/tenant_engine Fix: resolve tenants by identifier, not only internal tenant_id 2026-07-24 00:15:26 +02:00
tests Fix: resolve tenants by identifier, not only internal tenant_id 2026-07-24 00:15:26 +02:00
workplans Fix: resolve tenants by identifier, not only internal tenant_id 2026-07-24 00:15:26 +02:00
.custodian-brief.md chore(consistency): sync task status from DB [auto] 2026-07-23 22:55:05 +02:00
.gitignore Bootstrap repo: State Hub registration, agent docs, TEN-WP-0001/0002 2026-07-23 21:56:07 +02:00
.repo-classification.yaml Bootstrap repo: State Hub registration, agent docs, TEN-WP-0001/0002 2026-07-23 21:56:07 +02:00
AGENTS.md Bootstrap repo: State Hub registration, agent docs, TEN-WP-0001/0002 2026-07-23 21:56:07 +02:00
CLAUDE.md Bootstrap repo: State Hub registration, agent docs, TEN-WP-0001/0002 2026-07-23 21:56:07 +02:00
INTENT.md TEN-WP-0003: FlexAuthWriteAuthorizer -- gate writes through flex-auth 2026-07-23 22:54:44 +02:00
LICENSE Initial commit 2026-07-23 19:40:36 +00:00
Makefile TEN-WP-0002 T01-T03: service skeleton, domain model, storage layer 2026-07-23 22:01:23 +02:00
pyproject.toml TEN-WP-0003: FlexAuthWriteAuthorizer -- gate writes through flex-auth 2026-07-23 22:54:44 +02:00
README.md Initial commit 2026-07-23 19:40:36 +00:00
SCOPE.md TEN-WP-0003: FlexAuthWriteAuthorizer -- gate writes through flex-auth 2026-07-23 22:54:44 +02:00
WORK-RECORDS.md chore(consistency): sync WORK-RECORDS.md for TEN-WP-0003 closure [auto] 2026-07-23 22:55:13 +02:00

tenant-engine

NetKingdom facility for tenant management.