-
Notifications
You must be signed in to change notification settings - Fork 236
feat: Add OAuth 2.0 authentication for Google Workspace email sending #10677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: yuki-takei <[email protected]>
Co-authored-by: yuki-takei <[email protected]>
Co-authored-by: yuki-takei <[email protected]>
|
@copilot public/static/locales 配下には他の言語用の admin.json があります |
Co-authored-by: yuki-takei <[email protected]>
|
@copilot CI で lint error が出ているので修正して eslint 管理対象のファイルなのか、biome でフォーマットされるべきファイルなのかを設定ファイルを確認して正しく把握してください |
Co-authored-by: yuki-takei <[email protected]>
修正しました。以下の対応を行いました:
biome管理対象のファイル( コミット: a54af2e |
Implementation Plan: Google Workspace OAuth 2.0 Email Support
Phase 1: Configuration Setup ✅
config-definition.tsfor OAuth 2.0 credentialsmail:oauth2ClientIdconfigmail:oauth2ClientSecretconfigmail:oauth2RefreshTokenconfigmail:oauth2Userconfig (email address of the authorized account)mail:transmissionMethodtype to include 'oauth2'Phase 2: Update Mail Service ✅
mail.tsto support OAuth 2.0 authenticationcreateOAuth2Client()methodinitialize()to handle 'oauth2' transmission methodPhase 3: API Routes ✅
app-settings/index.tsPhase 4: Frontend Components ✅
Phase 5: Testing & Validation ✅
Summary
This implementation adds OAuth 2.0 authentication support for sending emails using Google Workspace accounts. The feature is fully integrated into the admin settings UI and follows the existing patterns for SMTP and SES configuration.
Translations Added:
Lint Fixes:
Reactimport fromMailSetting.tsxconfig-definition.tsandmail.tsHow to Use:
The implementation uses nodemailer's built-in Gmail OAuth 2.0 support, which handles token refresh automatically.
Original prompt
Start implementation
[Chronological Review: The conversation began with a user request to implement email sending functionality using Google Workspace accounts, specifically mentioning the transition from username/password authentication to OAuth 2.0. The user highlighted the need to modify the `mail.ts` service file and check the version of the `nodemailer` library. The user also indicated that configuration values would need to be added to the `config-definition.ts` file. Following this, the user requested to save the plan to "serena memories" with a specific filename format. The user then canceled a previous command to delegate to a background agent and finally requested to start the implementation.][Intent Mapping:
nodemaileris up to date.[Technical Inventory:
mail.ts: Service layer file for email functionality.config-definition.ts: Configuration file where mail settings will be updated.][Code Archaeology:
[Progress Assessment:
[Context Validation: All critical information for continuation is captured, including the need for OAuth 2.0 implementation and the specific files to be modified.]
[Recent Commands Analysis:
1. Conversation Overview: - Primary Objectives: User wants to implement email sending functionality using Google Workspace accounts, specifically using OAuth 2.0 instead of username/password authentication. - Session Context: The conversation flowed from outlining the requirements for the email functionality to discussing necessary modifications in specific files and finally initiating the implementation. - User Intent Evolution: The user moved from requesting information and planning to actively starting the implementation process.- Technical Foundation:
- nodemailer: Latest version to be confirmed; used for sending emails with OAuth 2.0 support.
- OAuth 2.0: Required authentication method for Google Workspace email sending.
- Files Mentioned:
- Codebase Status:
- File: mail.ts:
- Purpose: Implement email sending functionality.
- Current State: To be modified for OAuth 2.0 support.
- File: config-definition.ts:
- Purpose: Update mail settings.
- Current State: New configuration values to be added.
- Problem Resolution:
- Issues Encountered: Transition from username/password to OAuth 2.0 for email sending.
- Solutions Implemented: User has outlined the need for OAuth 2.0 and identified necessary files for modification.
- Debugging Context: No ongoing issues reported; focus is on implementation.
- Lessons Learned: Understanding of the need for OAuth 2.0 in modern email sending practices.
- Progress Tracking:
- Completed Tasks: User has defined requirements and identified files for modification.
- Partially Complete Work: Implementation has just started.
- Validated Outcomes: None yet, as implementation is in the initial stage.
- Active Work State:
- Current Focus: Starting the implementation of email functionality using OAuth 2.0.
- Recent Context: User has just requested to start the implementation after outlining the requirements.
- Working Code: No specific code snippets discussed recently as the implementation has just begun.
- Immediate Context: User is focused on implementing the email sending...
mail.ts: Service layer for email functionality.config-definition.ts: Configuration file for mail settings.Created from VS Code.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.