bb-plane-fork/apps/api/plane
binarybeach 64513797ee binarybeachio: per-app edge-identity validation + bundled bridge logout
Marker-cookie pattern per docs/conventions/per-app-edge-identity-validation.md:

- New BbEdgeIdentityMiddleware compares `_bb_edge_sub` cookie to
  `X-Auth-Request-User` header on every authenticated request. On mismatch,
  flushes the Django session and replaces request.user with AnonymousUser
  so DRF returns 401 / browser navigations land at the bridge handoff
  redirect. Lazy-populates the cookie on legacy sessions; passes through
  for anonymous requests and bearer-token-only callers.

- Trusted-JWT view sets `_bb_edge_sub` on the redirect response when
  X-Auth-Request-User is present (single session-mint choke-point — the
  Bucket-4 entry-point is the only path that creates Plane sessions in
  this deployment).

- SignOutAuthEndpoint reads optional BB_LOGOUT_REDIRECT_URL env. When set,
  the SPA's /auth/sign-out/ form-POST is 302'd to the platform bridge's
  synced-logout endpoint (clears edge `_bb_oauth2` + back-channels Zitadel
  end_session). Without this, the user's Zitadel session at the edge
  outlives the Plane logout and silently re-logs them in via bridge handoff
  → trusted sign-in. Vanilla regression-safe: env unset → upstream behavior.

Net surface vs upstream-clean: 1 new middleware file, 1 line in MIDDLEWARE,
~20 lines added to trusted.py and signout.py. No new dependencies.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 13:31:02 -10:00
..
analytics chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
api [SILO-1026] feat: add estimates external API endpoints (#8664) 2026-03-30 15:30:02 +05:30
app fix: prevent privilege escalation in project member role updates (GHSA-494h-3rcq-5g3c) (#8833) 2026-04-06 15:54:01 +05:30
authentication binarybeachio: per-app edge-identity validation + bundled bridge logout 2026-05-05 13:31:02 -10:00
bgtasks fix: validate redirects in favicon fetching to prevent SSRF (#8858) 2026-04-06 16:04:43 +05:30
db [SILO-1026] feat: add estimates external API endpoints (#8664) 2026-03-30 15:30:02 +05:30
license [GIT-44] refactor(auth): add PASSWORD_TOO_WEAK error code (#8522) 2026-02-13 18:51:33 +05:30
middleware binarybeachio: per-app edge-identity validation + bundled bridge logout 2026-05-05 13:31:02 -10:00
seeds/data [WEB-5602] feat: new design system (#8220) 2025-12-12 20:50:14 +05:30
settings binarybeachio: per-app edge-identity validation + bundled bridge logout 2026-05-05 13:31:02 -10:00
space fix: Member Information Disclosure via Public Endpoint #8646 2026-02-20 18:34:56 +05:30
static [WEB-6420] chore: self-host social icons in project invitation email (#8718) 2026-03-05 18:17:42 +05:30
tests binarybeachio: presigned PUT for uploads (R2/B2 don't implement PostObject) 2026-04-30 17:56:52 -10:00
throttles chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
utils binarybeachio: presigned PUT for uploads (R2/B2 don't implement PostObject) 2026-04-30 17:56:52 -10:00
web chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
__init__.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
asgi.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
celery.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
urls.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
wsgi.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30