fix(branding): a workspace the registry refuses still reads its branding #1102

Merged
sharang merged 1 commits from fix/branding-past-entitlement into main 2026-12-01 15:34:46 +00:00
Owner

Follow-up to #1087 and tenant-registry #160.

Problem (stage, Sharang's workspace, entitlement expired)

  • tenant-registry #160 now sends branding even when allowed is false.
  • But Prüfwerk's entitlement gate answered 403 not_entitled to GET /api/v1/branding, as to every request of a refused workspace.
  • The dashboard's fetch_branding failed, so there was no frame and no logo, exactly on the screens that tell the workspace it's expired.

Fix

  • The gate (require_entitlement) lets two requests through when the registry answered for the tenant but refused it (expired, member_blocked):
    • GET /api/v1/branding
    • GET /api/v1/branding/logo
  • The tenant context is marked Restricted (read-only).
  • Everything else stays refused, including POST /api/v1/branding/ack.
  • An unreachable registry still gives 503, as before.

Test

  • tests/member_blocked.rs gets a_refused_workspace_still_reads_its_branding_and_nothing_else:
    • an expired workspace reads branding and logo (200);
    • /r and the ack stay 403;
    • a blocked member sees the frame too.
  • The existing block and unreachable-registry tests pass. Clippy is clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9

Follow-up to #1087 and tenant-registry #160. **Problem (stage, Sharang's workspace, entitlement expired)** - tenant-registry #160 now sends `branding` even when `allowed` is false. - But Prüfwerk's entitlement gate answered `403 not_entitled` to `GET /api/v1/branding`, as to every request of a refused workspace. - The dashboard's `fetch_branding` failed, so there was no frame and no logo, exactly on the screens that tell the workspace it's expired. **Fix** - The gate (`require_entitlement`) lets two requests through when the registry answered for the tenant but refused it (expired, `member_blocked`): - `GET /api/v1/branding` - `GET /api/v1/branding/logo` - The tenant context is marked `Restricted` (read-only). - Everything else stays refused, including `POST /api/v1/branding/ack`. - An unreachable registry still gives 503, as before. **Test** - `tests/member_blocked.rs` gets `a_refused_workspace_still_reads_its_branding_and_nothing_else`: - an expired workspace reads branding and logo (200); - `/r` and the ack stay 403; - a blocked member sees the frame too. - The existing block and unreachable-registry tests pass. Clippy is clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang added 1 commit 2026-12-01 15:11:23 +00:00
fix(branding): a workspace the registry refuses still reads its branding
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 5m19s
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 23m3s
230204c283
An expired or blocked workspace got 403 not_entitled on every request,
the branding included, so its frame and logo vanished exactly on the
screens that tell it why. The registry now sends `branding` for every
known tenant (tenant-registry #160); the entitlement gate lets GET
/api/v1/branding and /api/v1/branding/logo through for a tenant the
registry answered for, read-only. The acknowledgement and everything
else stay refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang merged commit a2a91efaad into main 2026-12-01 15:34:46 +00:00
Sign in to join this conversation.