Auth: migrate OAuth routes from /rest/v1/login to /rest/v1/auth/*

Đang mở
#963 2 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@skypank-coder đang làm issue này rồi.

Từ ngày 9/7/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Context

RFC merged in #876 (docs/rfc/user-auth-myopencre.md) proposes new auth routes at /auth/login, /auth/callback, /auth/logout. Existing Google OAuth already lives at:

  • GET /rest/v1/login
  • GET /rest/v1/callback
  • GET /rest/v1/logout
  • GET /rest/v1/user

Per maintainer review of #876, consolidate under the versioned API namespace:

Target routes:

  • GET /rest/v1/auth/login
  • GET /rest/v1/auth/callback
  • GET /rest/v1/auth/logout
  • GET /rest/v1/auth/user (or keep /rest/v1/user — decide during implementation)

Requirements

  • Add /rest/v1/auth/* routes implementing the RFC TODO 1 session contract (session['user_id'], redirect on missing session)
  • Keep /rest/v1/login, /rest/v1/callback, /rest/v1/logout as temporary aliases with deprecation headers or redirect to /rest/v1/auth/*
  • Update frontend (useUser, Header) and any docs referencing old paths
  • Update login_required to redirect to /rest/v1/auth/login?next=<url> (not 401 for browser flows)
  • Consider separate behavior for API clients (Accept: application/json → 401 vs browser → 302)

Related

  • RFC: docs/rfc/user-auth-myopencre.md TODO 1
  • #586 (MyOpenCRE online)
  • #943 (frontend auth UX)
  • #949 (capabilities API)

Acceptance criteria

  • New routes work end-to-end with Google OAuth
  • Old routes redirect or alias without breaking existing bookmarks
  • Tests cover both old aliases and new canonical paths during migration window
Ngôn ngữ chính
Python
Star
210
Fork
167
Merge trung bình
4 ngày 12 giờ
Pull request đã merge (30 ngày)
28

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của OWASP/OpenCRE

Tất cả issue của OWASP/OpenCRE

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.