Gmail OAuth2 login for PQ email retrieval

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

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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
22/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
authentication

Hướng nghiên cứu

This depends on #443's EmailProvider interface and fetch/parse/DB-match pipeline, which the payload does not show in code, so read #443 first and confirm it has merged. The new GmailOAuthProvider should implement that interface using a loopback OAuth flow with google-auth, the gmail.readonly scope, and tokens stored via keyring. Done means a Gmail user can connect without an app-password while the existing pipeline runs unchanged; Google app verification is an external dependency that runs in parallel.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area: import feature on hold
Problem Statement

#443 implements PQ-from-email using generic IMAP + app-password, which
already works for Gmail (2FA + app-password). However, app-passwords are
an extra manual setup step for users, and some users may not want to
enable 2FA just to generate one.

Proposed Solution

Add Gmail as an OAuth2 login option alongside the generic IMAP path from
#443, so Gmail users can just click "Connect with Google" instead of
generating an app-password.

  • Use google-auth / google-api-python-client (official SDKs) rather
    than hand-rolled OAuth, to stay on the maintained side of any future
    protocol changes
  • Local loopback browser flow (opens system browser, listens on
    localhost callback) — standard pattern for desktop OAuth apps
  • Request the minimal scope needed: gmail.readonly
  • Token storage/refresh via keyring, same credential store as #443
  • Implements the shared EmailProvider interface from #443
    (GmailOAuthProvider), so it plugs into the same fetch/parse/DB-match
    pipeline without changes there
Notes / constraints
  • gmail.readonly is a restricted Google OAuth scope, requiring
    Google's app verification process before general release. Since
    OpenSAK is a pure desktop app with no backend server, we should be
    exempt from the costly annual security assessment — but standard
    verification (brand review + scope review) still applies and can take
    from a few days to a few weeks. Start this process early, in
    parallel with development
    — it's an external dependency, not dev
    time, and shouldn't block the rest of the implementation.
  • Until verification completes, users will see Google's "unverified
    app" warning on first login — worth a short note in the UI/user guide
    so it doesn't look like a bug or a security problem with OpenSAK.
  • Expect roughly one maintenance session per year as Google updates
    OAuth/API requirements (this has happened before and will again) —
    a standing cost of third-party OAuth integration.
  • This is a convenience layer, not a functional requirement — #443's
    IMAP+app-password path already covers Gmail if this gets deprioritized.
Depends on
  • #443 (EmailProvider interface, fetch/parse/DB-match pipeline)
Expected Benefits

Smoother login UX for Gmail users — no manual app-password setup.

Ngôn ngữ chính
Python
Star
37
Fork
17
Merge trung bình
16 giờ 7 phút
Pull request đã merge (30 ngày)
128

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

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 OpenSAK-Org/OpenSAK

Tất cả issue của OpenSAK-Org/OpenSAK

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.