You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(workspace-service): the membership gate — identity must clear the instance's org
Build-order step 3. In DIDI_AUTH=required mode, a verified didi_session
is necessary but no longer sufficient: the didi_id must hold a
membership in REQUIRED_ORG_ID (the single-tenant instance's org — e.g.
humain.vc) or the superuser role anywhere. Checked once per WS upgrade
via /api/me with the cookie forwarded, cached 60s per session so
reconnect storms don't hammer the id service, and failing CLOSED when
the id service is unreachable — an identity outage must not silently
open the tenant's door. Rejection closes 4403 (vs 4401 for no
identity), so the shell can distinguish "sign in" from "no access".
This is the users/orgs/workspaces triangulation ENFORCING for the first
time: id.didi.sh says who you are and what orgs you hold; this gate
says what that means here.
Proven by the prove script's new GATE mode against the live container
in required mode: anonymous 4401, superuser admitted, signed-in
non-member 4403 — then optional mode restored and the base proof green
(local dev workflow unchanged).
Files changed:
- services/workspace/src/didi.ts (checkMembership + cache + fail-closed)
- services/workspace/src/ws.ts (gate on upgrade, 4403)
- scripts/prove-didi-auth.mjs (GATE mode)
- docker-compose.yml (REQUIRED_ORG_ID passthrough)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments