feat(m-mig-5): products table, entitlement check, tenant ladder, per-client authz #23

Merged
sharang merged 4 commits from feat/m-mig-5-products-entitlements into main 2026-09-12 07:38:47 +00:00
4 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Fable 5.1 f530bc9cbe ci: image to Harbor platform project, orca webhook via repo variable
ci / shared (pull_request) Successful in 12s
ci / test (pull_request) Successful in 22m1s
ci / image (pull_request) Skipped
M-MIG-3/5: the platform cluster (bp-platform-stage) deploys
tenant-registry-stage from repo.breakpilot.com/platform/tenant-registry.
The image job now logs in with the org secrets REGISTRY_USERNAME /
REGISTRY_PASSWORD, pushes under platform/, and POSTs the orca webhook
only when the repo variable ORCA_WEBHOOK_URL is set (it no longer targets
the core master). release.yaml (env-stage/env-prod promotion against a
cluster layout that no longer exists) is removed; prod deploys get their
own trigger with the prod node.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-09-11 23:44:22 +02:00
Sharang ParnerkarandClaude Fable 5.1 9b50b98678 test: cover tenant listing, status ladder, authz gate, KC status sync
ci / image (pull_request) Skipped
ci / test (pull_request) Successful in 22m5s
ci / shared (pull_request) Successful in 14s
Coverage gate (70%) fell to 67.6% with the new M-MIG-5 code paths.
Adds tests for GET /v1/tenants pagination + filters + validation,
GET /v1/tenants/{id}, POST /v1/tenants/{id}/status validation and the
Keycloak-failure audit path, /readyz, the requireAuthz middleware and
LogAuthz, and HTTPAdapter.SyncTenantStatus / findUserByEmail against a
stub Keycloak admin API. CI package set now reports 73.5%.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-09-11 18:05:48 +02:00
Sharang ParnerkarandClaude Fable 5.1 5a74d84681 chore(lint): simplify the memory keyset cursor check (staticcheck QF1001)
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Failing after 16m19s
ci / image (pull_request) Skipped
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-09-11 17:30:31 +02:00
Sharang ParnerkarandClaude Fable 5.1 62335a9be3 feat(m-mig-5): products table, entitlement check, tenant ladder, per-client authz
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Failing after 14m36s
ci / image (pull_request) Skipped
Registry becomes the entitlement authority (ERP/02, PRODUCT_INTEGRATION_SPEC 2.0):

- migrations 0002/0003: ladder statuses warning|restricted|halted on
  tenant_status; products table replaces the hard-coded catalog, seeded with
  pruefwerk (+ werkbank add-on), werkpilot, firmwerk; compliance disabled
  until the dsms migration (M-MIG-9)
- GET /v1/tenants (keyset pagination, status/kind filters) for product
  schedulers and reconcile jobs
- POST /v1/internal/entitlements/check → {allowed, read_only, status, limits,
  expires_at, reason}; add-on limits from tenant_products.config
- POST /v1/tenants/{id}/status — the single ladder transition endpoint;
  cancel now moves to halted; activate accepts products[] with limits and
  provisions them via the catalog's per-env provision_urls
- SyncTenantStatus: coarse tenant_status attribute on every Keycloak org
  member after every status change (attributes merged, roles untouched)
- AUTHZ_RULES: per-client (JWT azp) route groups; 403 FORBIDDEN_CLIENT
- INVITE_CLIENT_ID / INVITE_REDIRECT_URI replace the hard-coded dev-portal
  invite parameters
- catalog entries carry type, launch_url (per APP_ENV), skus, addons,
  trial_days; openapi.yaml + README updated

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
2026-09-11 16:29:44 +02:00