Skip to content

docs: add SSE security section to real-time events guide#4394

Merged
aegis-gh-agent[bot] merged 1 commit into
developfrom
docs/sse-events-guide
May 28, 2026
Merged

docs: add SSE security section to real-time events guide#4394
aegis-gh-agent[bot] merged 1 commit into
developfrom
docs/sse-events-guide

Conversation

@OneStepAt4time
Copy link
Copy Markdown
Owner

Summary

Adds a Security section to docs/guides/real-time-events.md documenting the SSE auth model based on Themis's security audit (2026-05-28).

What's added

  • Authentication: SSE token requirement, limits (10 per API key, 5-min expiry)
  • Per-session authorization: ownership chain — tenant scoping, admin bypass, requireOwnership() wrapper, 404 for cross-tenant (doesn't leak existence)
  • Global stream filtering: isGlobalEventVisibleToRequest() checks session.tenantId === requestTenantId
  • Connection limits: SSEConnectionLimiter per-IP + global, SSEWriter back-pressure + zombie prevention
  • Audit confirmation: Both endpoints confirmed secure by Themis

Source

Security audit findings from Themis, cross-referenced with:

  • src/routes/session-data.ts:177 — per-session SSE with withOwnership()
  • src/routes/events.ts — global SSE with isGlobalEventVisibleToRequest()
  • src/events.ts:54toGlobalEvent() preserves sessionId for tenant lookup

aegis-gh-agent[bot]
aegis-gh-agent Bot previously approved these changes May 28, 2026
Copy link
Copy Markdown
Contributor

@aegis-gh-agent aegis-gh-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. SSE security section added to real-time events guide.

Security section covers:

  • SSE token auth (short-lived, max 10 per API key) ✅
  • Per-session authorization chain: lookup → tenant scoping → ownership check → 404/403 ✅
  • Global stream filtering via isGlobalEventVisibleToRequest()
  • toGlobalEvent() design preserving sessionId for tenant lookup ✅
  • Connection limits + back-pressure ✅
  • Audit confirmation from Themis ✅

Note: This replaces the previous real-time-events.md from #4382 with an expanded version. The file shows as new (not a diff) because it's on a branch that branched before #4382 merged. Scribe should verify no content was lost from the #4382 version (architecture diagram, dashboard integration hook, status values table).

CI green. Ship it.

Documents multi-layer SSE auth model:
- SSE token requirement + limits
- Per-session ownership chain (tenant scoping, admin bypass)
- Global stream tenant filtering via isGlobalEventVisibleToRequest()
- Connection limiting (SSEConnectionLimiter + SSEWriter)
- Back-pressure handling

Audit by Themis (2026-05-28) confirmed both endpoints secure.
Copy link
Copy Markdown
Contributor

@aegis-gh-agent aegis-gh-agent Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Re-approval after rebase. All sections verified — architecture diagram, dashboard integration, status values table, rate limiting, event reference (14+12), security section. CI green.

@aegis-gh-agent aegis-gh-agent Bot merged commit ca27027 into develop May 28, 2026
17 checks passed
@aegis-gh-agent aegis-gh-agent Bot deleted the docs/sse-events-guide branch May 28, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant