Skip to content

Enforce authentication across the v2 API (routers, WS/SSE, and web-UI login) #336

Description

@frankbria

Important

Refreshed 2026-06-04 (post #609) — the lists below are stale (projects_v2.py is gone; 6 routers added; now 22 REST + 2 WS routers; frontend has no login flow). See the refreshed assessment & sub-task breakdown in the comments for the current plan of record.


Summary

The v2 API routers are missing authentication enforcement despite documentation stating "All endpoints require authentication."

Current State

  • 18 v2 routers have no auth dependencies
  • Only api_key_router.py (for managing API keys) uses require_auth
  • Documentation in server.py line 261 claims auth is required
  • Frontend uses withCredentials: true but doesn't send API keys

Routers Requiring Auth

All files in codeframe/ui/routers/*_v2.py:

  • batches_v2.py
  • blockers_v2.py
  • checkpoints_v2.py
  • diagnose_v2.py
  • discovery_v2.py
  • environment_v2.py
  • events_v2.py
  • gates_v2.py
  • git_v2.py
  • pr_v2.py
  • prd_v2.py
  • projects_v2.py
  • review_v2.py
  • schedule_v2.py
  • streaming_v2.py
  • tasks_v2.py
  • templates_v2.py
  • workspace_v2.py

Implementation

  1. Add require_auth dependency to all v2 router endpoints
  2. Update frontend to send API key or session token
  3. Consider read-only endpoints that might allow optional auth
  4. Update tests to include auth headers

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase-6Pre-launch hardening: critical items before public releasesecurity

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions