Skip to content

[Phase 2] Add authentication to all v2 API routers #336

@frankbria

Description

@frankbria

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-2Phase 2: Server Layer as Thin Adapter

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions