Skip to content

feat(floware): change to OAuth flow from DWD for cron job#291

Open
vishnurk6247 wants to merge 1 commit into
developfrom
feat/gmail-cron
Open

feat(floware): change to OAuth flow from DWD for cron job#291
vishnurk6247 wants to merge 1 commit into
developfrom
feat/gmail-cron

Conversation

@vishnurk6247
Copy link
Copy Markdown
Member

@vishnurk6247 vishnurk6247 commented May 26, 2026

Summary by CodeRabbit

  • Configuration Changes
    • Updated Gmail email service authentication mechanism to use OAuth 2.0 credentials (client ID, client secret, and refresh token) instead of service account authentication.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2f143758-ab70-475b-bd19-93db6730ab04

📥 Commits

Reviewing files that changed from the base of the PR and between aaa79e9 and b28cbb1.

📒 Files selected for processing (3)
  • wavefront/server/apps/floware/floware/config.ini
  • wavefront/server/modules/user_management_module/user_management_module/services/email_service.py
  • wavefront/server/modules/user_management_module/user_management_module/user_container.py

📝 Walkthrough

Walkthrough

Gmail authentication switches from service-account delegation to OAuth2 credentials. Config keys, GmailEmailService constructor, credential refresh logic, and dependency injection are updated in parallel to support client_id, client_secret, and refresh_token instead of service account file and delegate user parameters.

Changes

Gmail OAuth Migration

Layer / File(s) Summary
Config schema migration
wavefront/server/apps/floware/floware/config.ini
Gmail configuration parameters replaced: service_account_file and delegate_user removed; client_id, client_secret, and refresh_token added while email_sender is retained.
GmailEmailService OAuth implementation
wavefront/server/modules/user_management_module/user_management_module/services/email_service.py
GmailEmailService constructor signature changed to accept client_id, client_secret, refresh_token; imports updated for OAuth credential handling; credential refresh and Gmail API service initialization added via get_credentials() and _get_gmail_service() methods.
Email sending with OAuth service
wavefront/server/modules/user_management_module/user_management_module/services/email_service.py
send_email method updated to retrieve Gmail service via _get_gmail_service() instead of prior credential construction patterns.
Dependency injection wiring
wavefront/server/modules/user_management_module/user_management_module/user_container.py
UserContainer email_service provider for Gmail updated to inject client_id, client_secret, refresh_token to GmailEmailService instead of service_account_b64 and delegate_user.

Sequence Diagram

sequenceDiagram
  participant Config as Configuration
  participant Container as UserContainer
  participant Service as GmailEmailService
  participant OAuth as Google OAuth
  participant API as Gmail API
  Config->>Container: client_id, client_secret, refresh_token
  Container->>Service: initialize with OAuth credentials
  Service->>OAuth: get_credentials()
  OAuth->>Service: refreshed Credentials
  Service->>API: _get_gmail_service() with refreshed token
  API->>Service: Gmail service client
  Service->>API: send_email via service
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 OAuth flows where tokens dance,
Service accounts fade in glance,
Config keys align so right,
Gmail shines in OAuth light! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: migrating Gmail authentication from service account (DWD/delegate_user) to OAuth flow across config, email service, and container wiring.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/gmail-cron

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant