Recipe — verify revoke
Access control only counts if removing a grant is visible to your app.
Setup
- Pick a Collection the test user can open (
accessible-collectionsincludes it). - Open a product screen that loads Collection-scoped data through your BFF.
- From the Control Plane (or member API), revoke / remove that membership.
Expectation
The next Collection-scoped call must fail closed:
curl -sS -o /tmp/out.json -w '%{http_code}\n' \
"${PLEXON_BASE}/api/platform/provisioning/accessible-collections" \
-H "X-Service-Secret: ${PLEXON_SERVICE_SECRET}" \
-H "X-Plexon-Contract-Version: 2026-05-plexon-federation-v3" \
-H "X-Plexon-User-Id: ${PLEXON_USER_ID}"
Pass: either HTTP 403, or 200 with that Collection gone from the list.
Fail: the Collection still appears and product calls still succeed — your app is caching grants or bypassing the Control Plane.
Product UI behaviour
| Do | Don't |
|---|---|
| Clear local Collection context on 401/403 | Keep showing stale domain data |
| Send the user to a picker / “access lost” | Silently retry with a different user id |
| Re-fetch accessible Collections after focus | Assume membership forever |
TypeScript sketch
export async function loadCollectionOrThrow(id: string, viewerUserId: string) {
const res = await fetch(`/api/collections/${id}`, {
headers: { 'x-viewer-id': viewerUserId }, // your BFF maps this to DIC headers
})
if (res.status === 401 || res.status === 403) {
// route to access-lost — do not soft-fail with empty fake data
throw new Error('access-revoked')
}
if (!res.ok) throw new Error(`collection ${res.status}`)
return res.json()
}
Checklist
- Before revoke: Collection visible
- After revoke: list/detail refuse or omit it
- UI recovers without a full redeploy
Related: Collections and access · Auth