Skip to content

feat: Gmail OAuth - Connect with Google for individual org accounts#337

Open
benzntech wants to merge 7 commits into
LogicLabs-OU:mainfrom
benzntech:feature/gmail-oauth-connect
Open

feat: Gmail OAuth - Connect with Google for individual org accounts#337
benzntech wants to merge 7 commits into
LogicLabs-OU:mainfrom
benzntech:feature/gmail-oauth-connect

Conversation

@benzntech
Copy link
Copy Markdown

Summary

  • Adds google_oauth as a new ingestion provider type for individual Gmail organizational accounts
  • Introduces GoogleOAuthCredentials type (email, accessToken, refreshToken) alongside the existing google_workspace service-account provider — no breaking changes
  • Includes full RapidSpec proposal, tasks, investigation, research, and spec delta in rapidspec/changes/gmail-oauth-connect/

Problem

Connecting a Gmail account currently requires pasting a raw Google Service Account JSON blob + an admin email — a highly technical process that breaks the UX expectations of modern users.

Solution

A new google_oauth provider that lets individual users click "Connect with Google", complete a standard OAuth consent flow, and have their mailbox added automatically. No manual credential fields.

OAuth Flow

User clicks "Connect with Google"
  → GET /api/v1/oauth/google/authorize (authenticated)
  → Redirect to Google consent screen (gmail.readonly + userinfo.email)
  → GET /api/v1/oauth/google/callback
  → Exchange code → store tokens → create IngestionSource
  → Redirect to /dashboard/ingestions

What's in this PR

  • packages/types/src/ingestion.types.tsGoogleOAuthCredentials interface + google_oauth in provider union
  • rapidspec/changes/gmail-oauth-connect/ — full proposal spec (implementation continues in follow-up PRs)

Test plan

  • pnpm build passes with updated types
  • Remaining implementation tasks tracked in rapidspec/changes/gmail-oauth-connect/tasks.md

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 19, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@benzntech
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@benzntech
Copy link
Copy Markdown
Author

recheck

Consolidate GOOGLE_OAUTH_* env vars into googleOAuth config object
for consistent access and easier future validation.

Updates oauth.controller.ts and GoogleOAuthConnector.ts to use
centralized config instead of direct process.env access.
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