key-cape/src
tegwick 44da5f5f99
All checks were successful
Build and Publish Container Image / build-and-push (push) Successful in 1m21s
KEY-WP-0005-T02-T03: cached tenant_roles claim, close workplan
New internal/adapters/tenantengine package, mirroring
internal/adapters/{lldap,privacyidea,authelia}'s shape: Client.Roles()
calls tenant-engine's cache-read endpoint. Fails open by construction --
unreachable, non-200, malformed body, or a nil *Client all return
(nil, false), never an error to specially handle. Wired into
TokenHandler.TenantEngine (nil by default, existing tests unaffected);
token.go stamps tenant_roles only when ok.

7 adapter tests plus 3 TokenHandler-level tests proving the actual
required behavior end-to-end: present when reachable, token issuance still
200 with every other core claim intact when unreachable (tenant_roles
simply absent -- the literal done-criteria), absent when not configured.

Real bug found and fixed at the source, not worked around: the first live
cross-process check (real flex-auth, real tenant-engine, this adapter)
returned tenant_not_found for a tenant that existed -- tenant-engine's read
endpoint was keyed by its internal tenant_id, but key-cape only ever has
the tenant's profile identifier. Fixed in tenant-engine
(ADHOC-2026-07-24), re-verified with the same live three-process chain --
roles=[IAM] ok=true.

Workplan closed: T01-T03 done. Explicitly still open: client_credentials /
service-token issuance -- no such flow exists in token.go at all, a
materially larger separate piece of work than either task here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-24 00:18:17 +02:00
..
cmd feat: implement T22, T18, T23 — dev stack, profile tests, server binary 2026-03-13 02:18:36 +01:00
internal KEY-WP-0005-T02-T03: cached tenant_roles claim, close workplan 2026-07-24 00:18:17 +02:00
tests KEY-WP-0005-T01: IAM Profile core claims for the human PKCE flow 2026-07-24 00:03:31 +02:00
go.mod feat: implement T14, T10 — enforcement middleware, LLDAP adapter 2026-03-13 01:45:21 +01:00
go.sum feat: implement T14, T10 — enforcement middleware, LLDAP adapter 2026-03-13 01:45:21 +01:00
Makefile feat: implement T01-T04 — Go module, canonical model, LDAP validator, error taxonomy 2026-03-13 01:27:54 +01:00