4.5 KiB
4.5 KiB
TASK METADATA
- Target Files:
server/routes/auth_forward.tsserver/routes/events.tsui/db_queries.tsui/components/LoginPage.tsxui/components/EventJoinPage.tsxui/components/SessionsPage.tsxui/components/sessions/WorkshopDrawer.tsxui/components/sessions/EventCockpitDeck.tsxui/components/sessions/EventAttendeesDrawer.tsxui/components/sessions/SessionsScript.tsxserver/tests/forward_auth.test.tsserver/tests/events.test.ts
- Core Objective: Execute a comprehensive 4-phase architectural and UX overhaul of Event Passes, attendee join flows, ForwardAuth guest ingress, session management hierarchies, and live attendee roster controls.
- Dependencies: None.
- Additional Important Notes:
- Strictly 100% pure Hono SSR JSX (React-free).
- Must preserve zero-trust boundary: guest accounts must remain strictly
quarantined from
/adminand primary user mutations. - Must pass all quality gates (
deno fmt,deno task lint,deno task check, anddeno test --allow-all).
Architectural Considerations & Risks
Risks
- Ingress Privilege Escalation: Broadening ForwardAuth to support
guestaccounts could accidentally grant unauthorized access to non-scoped apps.- Mitigation: Explicitly enforce that
account_status: 'guest'ONLY grants ingress ifauth.customScopescontains the specificapp:<appName>grant.
- Mitigation: Explicitly enforce that
- State Machine Confusion in Drawer: Concurrently showing creation inputs
and success handoffs leads to phantom cancellations.
- Mitigation: Ensure strict 2-state mutually exclusive rendering in
WorkshopDrawer.tsx.
- Mitigation: Ensure strict 2-state mutually exclusive rendering in
- NAT Seat Depletion: Limiting joins strictly by IP locks out legitimate
users on shared conference/office WiFi.
- Mitigation: Implement cookie/session token-based idempotent seat re-use rather than aggressive raw IP bans.
Alternatives Considered
- Dedicated Event Dashboard Route (
/dashboard/events/:id): Evaluated and rejected in favor of the Slide-Out Attendee Drawer pattern to eliminate jarring page reloads and context loss during live event management.
Proposed Implementation (4-Phase Architecture)
Phase 1: Backend Core & Guest Ingress (.ph1.md)
- ForwardAuth Guest Ingress (
server/routes/auth_forward.ts): Allowaccount_status === 'guest'and validateapp:<appName>custom scope. - Launchpad Scopes (
ui/db_queries.ts): UpdategetDashboardAppsto evaluate sessioncustomScopesand return authorized app cards for guests. - Audit Logging on Join (
server/routes/events.ts): WireauditLoginPOST /api/joinforevent_seat_claimed. - Test Harness (
server/tests/forward_auth.test.ts,server/tests/events.test.ts): Add unit tests for guest ForwardAuth and audit event logging.
Phase 2: Login Discovery, PIN Normalization & Anti-DoS (.ph2.md)
- Discovery Link (
ui/components/LoginPage.tsx): AddJoin with PINlink in/loginfooter. - Input Normalization (
server/routes/events.ts,ui/components/EventJoinPage.tsx): Strip hyphens/spaces and lowercase slugs (LOWER(slug)). - Anti-DoS & Rate Limiting (
server/routes/events.ts): Mount tiered Valkey rate limiting and NAT-safe cookie seat re-use. - Test Harness: Add unit tests for PIN formatting tolerance and rate limits.
Phase 3: Sessions Layout & Drawer State Machine (.ph3.md)
- Page Hierarchy (
ui/components/SessionsPage.tsx): Standardize top heading toActive Sessions & Passeswith[ 🔑 Delegate Session ]button. - Subsections:
Event Passescards above,Active Sessionstable below. - 2-State Drawer (
ui/components/sessions/WorkshopDrawer.tsx): Hide creation form on success; render 3 distinct visible cards (PIN, URL, CLI) +Dismiss. - Emoji & Header Fixes: Fix double emoji (
🎟️ 🎟️) and mobile title wrapping.
Phase 4: Attendee Drawer & Live Event Controls (.ph4.md)
- Card Enhancements (
ui/components/sessions/EventCockpitDeck.tsx): Add⏳ Xh Ym leftcountdown badge, accessible<details>CLI expander, and[ End Event ]witharia-label. - Attendee Roster Drawer (
ui/components/sessions/EventAttendeesDrawer.tsx): Add slide-out drawer on[ 👥 Manage Attendees (N) ]to inspect guest seats. - Session Pausing: Introduce non-destructive
is_pausedsession state with instant Pause/Resume toggles. - Live Controls: Add
[ 🔄 Rotate PIN ]and[ +5 Seats ]on event cards.