bb-plane-fork/apps/api
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
..
bin [WEB-5592] chore: add static files update settings for static files support (#8251) 2025-12-09 21:05:26 +05:30
plane binarybeachio: per-app edge-identity validation + bundled bridge logout 2026-05-05 13:31:02 -10:00
requirements chore(deps): bump cryptography (#8819) 2026-03-30 12:28:39 +05:30
templates [WEB-6420] chore: self-host social icons in project invitation email (#8718) 2026-03-05 18:17:42 +05:30
.coveragerc chore: rename server to api (#7342) 2025-07-04 15:32:21 +05:30
.env.example - Add SIGNED_URL_EXPIRATION environment variable (#8136) 2025-12-03 10:52:19 +05:30
.prettierignore fix: eslint (#8185) 2025-12-05 16:03:51 +05:30
Dockerfile.api chore: updated node version to 22 and python version to 3.12.10 (#7343) 2025-07-04 16:28:30 +05:30
Dockerfile.dev chore: rename server to api (#7342) 2025-07-04 15:32:21 +05:30
manage.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
package.json chore: version bump 2026-03-31 17:09:35 +05:30
pyproject.toml [WEB-5044] fix: ruff lint and format errors (#7868) 2025-09-29 19:15:32 +05:30
pytest.ini chore: rename server to api (#7342) 2025-07-04 15:32:21 +05:30
requirements.txt chore: rename server to api (#7342) 2025-07-04 15:32:21 +05:30
run_tests.py chore: add copyright (#8584) 2026-01-27 13:54:22 +05:30
run_tests.sh chore: rename server to api (#7342) 2025-07-04 15:32:21 +05:30