Prüfwerk slice of M-MIG-6 (products on staging) — implements PRODUCT_INTEGRATION_SPEC 2.0 §4.1 / §4.4 / §9.2 against the tenant-registry (platform/tenant-registry#23).
JWT hardening: issuer pinned to {KEYCLOAK_URL}/realms/{REALM}, audience validated (KEYCLOAK_AUDIENCE, default pruefwerk, empty string disables for dev). New validate_service_token() for client_credentials tokens (azp).
Registry client (compliance-agent::registry): client_credentials token cache, POST /v1/internal/entitlements/check cached ≤60 s and fail-closed (503 when the registry is unreachable and nothing is cached), GET /v1/tenants with cursor, POST /v1/internal/api-keys/verify, POST /v1/usage/events.
Entitlement gate: require_entitlement runs between the JWT and status middlewares; the registry's status/read-only answer overrides the tenant_status claim (never widens). No registry configured → no-op (dev).
Platform endpoints/api/v1/platform/*: version, usage?tenant_id&from&to, tenants/{id}/provision|suspend|reactivate|terminate, GET tenants/{id}/export, DELETE tenants/{id}/data (needs confirm), tenants/demo/reset. Gated by a service token whose azp ∈ PLATFORM_ALLOWED_CLIENTS (default tenant-registry-svc-{stage,prod}, portal-svc-{stage,prod}).
CORS: allowlist from CORS_ALLOWED_ORIGINS; permissive only when unset (logged).
Werkbank runners: bearer bp_… registry API keys with scope werkbank:runner accepted next to the static WERKBANK_RUNNER_TOKEN; router mounted when either is available.
Scheduler: tenant list from the registry client, filtered to active|trial|demo|warning.
Prüfwerk slice of **M-MIG-6** (products on staging) — implements PRODUCT_INTEGRATION_SPEC 2.0 §4.1 / §4.4 / §9.2 against the tenant-registry (platform/tenant-registry#23).
## What changes
- **Tenant ladder** (`compliance-core::tenant`): `demo|trial|active|warning|restricted|frozen|halted|archived`. `restricted`/`frozen` block writes (402), `halted` blocks everything (402), `archived` → 410.
- **JWT hardening**: issuer pinned to `{KEYCLOAK_URL}/realms/{REALM}`, audience validated (`KEYCLOAK_AUDIENCE`, default `pruefwerk`, empty string disables for dev). New `validate_service_token()` for client_credentials tokens (`azp`).
- **Registry client** (`compliance-agent::registry`): client_credentials token cache, `POST /v1/internal/entitlements/check` cached ≤60 s and **fail-closed** (503 when the registry is unreachable and nothing is cached), `GET /v1/tenants` with cursor, `POST /v1/internal/api-keys/verify`, `POST /v1/usage/events`.
- **Entitlement gate**: `require_entitlement` runs between the JWT and status middlewares; the registry's status/read-only answer overrides the `tenant_status` claim (never widens). No registry configured → no-op (dev).
- **Platform endpoints** `/api/v1/platform/*`: `version`, `usage?tenant_id&from&to`, `tenants/{id}/provision|suspend|reactivate|terminate`, `GET tenants/{id}/export`, `DELETE tenants/{id}/data` (needs `confirm`), `tenants/demo/reset`. Gated by a service token whose `azp` ∈ `PLATFORM_ALLOWED_CLIENTS` (default `tenant-registry-svc-{stage,prod}`, `portal-svc-{stage,prod}`).
- **CORS**: allowlist from `CORS_ALLOWED_ORIGINS`; permissive only when unset (logged).
- **Werkbank runners**: bearer `bp_…` registry API keys with scope `werkbank:runner` accepted next to the static `WERKBANK_RUNNER_TOKEN`; router mounted when either is available.
- **Scheduler**: tenant list from the registry client, filtered to `active|trial|demo|warning`.
- `.env.example` documents `PRODUCT_KEY`, `TENANT_REGISTRY_URL/CLIENT_ID/CLIENT_SECRET`, `KEYCLOAK_AUDIENCE`, `CORS_ALLOWED_ORIGINS`, `PLATFORM_ALLOWED_CLIENTS`.
## Not in this PR
- Usage event *emission* on scan completion / target add (M-MIG-7, with the registry outbox).
- Export as streamed archive (JSON document for now).
- Crate renames `compliance-*` → `pruefwerk-*` (deferred per plan).
## Verification
- `cargo clippy -p compliance-agent -- -D warnings`, `-p compliance-mcp`: clean
- `cargo test -p compliance-core -p compliance-agent --lib`: 312 + 52 pass
- `cargo test -p compliance-agent --test tenant_status_middleware` (new ladder cases) and `--test werkbank_api`: pass
- `cargo check -p compliance-dashboard --features server --no-default-features`: ok
- Pre-existing, untouched: `compliance-core/tests/models.rs` does not compile on `main` either (`TrackedRepository`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Prüfwerk M-MIG-6 slice (PRODUCT_INTEGRATION_SPEC 2.0):
- core: tenant status ladder demo|trial|active|warning|restricted|frozen|
halted|archived; blocks_writes()/is_halted(); status gate returns 402
for halted on every route, 410 for archived
- core auth: JwksState::new(jwks_url, issuer, audience) — issuer pinned,
audience validated (KEYCLOAK_AUDIENCE, default pruefwerk);
validate_service_token() for client_credentials tokens (azp)
- agent: RegistryClient (client_credentials token cache, entitlement
check cached 60 s fail-closed, tenant list w/ cursor, api-key verify,
usage push); require_entitlement middleware between JWT and status
gate; registry answer overrides the tenant_status claim
- agent: /api/v1/platform/{version,usage,tenants/{id}/provision|suspend|
reactivate|terminate|export,tenants/{id}/data DELETE,tenants/demo/reset}
behind service-token gate + PLATFORM_ALLOWED_CLIENTS allowlist
- agent: CORS allowlist from CORS_ALLOWED_ORIGINS (permissive only when
unset, logged)
- agent: werkbank runner auth accepts registry API keys (bp_…, scope
werkbank:runner) next to the static token; router mounted when either
is available
- agent: scheduler lists tenants via the registry client and skips
restricted/frozen/halted/archived
- smoke: use JwksState::new; .env.example documents the new variables
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
On the platform cluster the docs are an orca route (/docs/*) on the
dashboard host, prefix not stripped. Build with base /docs/, copy the
dist to html/docs, redirect / → /docs/.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
sharang
merged commit 5822b51cec into main2026-09-12 07:39:01 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Prüfwerk slice of M-MIG-6 (products on staging) — implements PRODUCT_INTEGRATION_SPEC 2.0 §4.1 / §4.4 / §9.2 against the tenant-registry (platform/tenant-registry#23).
What changes
compliance-core::tenant):demo|trial|active|warning|restricted|frozen|halted|archived.restricted/frozenblock writes (402),haltedblocks everything (402),archived→ 410.{KEYCLOAK_URL}/realms/{REALM}, audience validated (KEYCLOAK_AUDIENCE, defaultpruefwerk, empty string disables for dev). Newvalidate_service_token()for client_credentials tokens (azp).compliance-agent::registry): client_credentials token cache,POST /v1/internal/entitlements/checkcached ≤60 s and fail-closed (503 when the registry is unreachable and nothing is cached),GET /v1/tenantswith cursor,POST /v1/internal/api-keys/verify,POST /v1/usage/events.require_entitlementruns between the JWT and status middlewares; the registry's status/read-only answer overrides thetenant_statusclaim (never widens). No registry configured → no-op (dev)./api/v1/platform/*:version,usage?tenant_id&from&to,tenants/{id}/provision|suspend|reactivate|terminate,GET tenants/{id}/export,DELETE tenants/{id}/data(needsconfirm),tenants/demo/reset. Gated by a service token whoseazp∈PLATFORM_ALLOWED_CLIENTS(defaulttenant-registry-svc-{stage,prod},portal-svc-{stage,prod}).CORS_ALLOWED_ORIGINS; permissive only when unset (logged).bp_…registry API keys with scopewerkbank:runneraccepted next to the staticWERKBANK_RUNNER_TOKEN; router mounted when either is available.active|trial|demo|warning..env.exampledocumentsPRODUCT_KEY,TENANT_REGISTRY_URL/CLIENT_ID/CLIENT_SECRET,KEYCLOAK_AUDIENCE,CORS_ALLOWED_ORIGINS,PLATFORM_ALLOWED_CLIENTS.Not in this PR
compliance-*→pruefwerk-*(deferred per plan).Verification
cargo clippy -p compliance-agent -- -D warnings,-p compliance-mcp: cleancargo test -p compliance-core -p compliance-agent --lib: 312 + 52 passcargo test -p compliance-agent --test tenant_status_middleware(new ladder cases) and--test werkbank_api: passcargo check -p compliance-dashboard --features server --no-default-features: okcompliance-core/tests/models.rsdoes not compile onmaineither (TrackedRepository).🤖 Generated with Claude Code
https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
Prüfwerk M-MIG-6 slice (PRODUCT_INTEGRATION_SPEC 2.0): - core: tenant status ladder demo|trial|active|warning|restricted|frozen| halted|archived; blocks_writes()/is_halted(); status gate returns 402 for halted on every route, 410 for archived - core auth: JwksState::new(jwks_url, issuer, audience) — issuer pinned, audience validated (KEYCLOAK_AUDIENCE, default pruefwerk); validate_service_token() for client_credentials tokens (azp) - agent: RegistryClient (client_credentials token cache, entitlement check cached 60 s fail-closed, tenant list w/ cursor, api-key verify, usage push); require_entitlement middleware between JWT and status gate; registry answer overrides the tenant_status claim - agent: /api/v1/platform/{version,usage,tenants/{id}/provision|suspend| reactivate|terminate|export,tenants/{id}/data DELETE,tenants/demo/reset} behind service-token gate + PLATFORM_ALLOWED_CLIENTS allowlist - agent: CORS allowlist from CORS_ALLOWED_ORIGINS (permissive only when unset, logged) - agent: werkbank runner auth accepts registry API keys (bp_…, scope werkbank:runner) next to the static token; router mounted when either is available - agent: scheduler lists tenants via the registry client and skips restricted/frozen/halted/archived - smoke: use JwksState::new; .env.example documents the new variables Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB