Skip to content

fix: update authentication method for internal Gmail & Outlook integration endpoints#218

Merged
Userunknown84 merged 1 commit into
Userunknown84:mainfrom
vedant-kawale-27:main
Jun 23, 2026
Merged

fix: update authentication method for internal Gmail & Outlook integration endpoints#218
Userunknown84 merged 1 commit into
Userunknown84:mainfrom
vedant-kawale-27:main

Conversation

@vedant-kawale-27

Copy link
Copy Markdown
Contributor

Description

This PR resolves an issue where the Gmail & Outlook integrations failed internally with 401 Unauthorized errors because the Flask API expected a JWT token on protected endpoints. Since the Flask app is an internal service accessed through the Express Gateway, the gateway only forwards the user identity via the X-User-Username header and secures the request with X-Internal-Secret.

Changes

  • Removed the @jwt_or_secret_required() decorator from internal integration routes:
    • /gmail/callback
    • /gmail/emails
    • /outlook/callback
    • /outlook/emails
    • /scan-emails
  • Updated these endpoints to authenticate using the existing _require_username() helper, extracting the identity from the X-User-Username header and validating X-Internal-Secret.
  • Updated the test suite in backend/tests/test_internal_secret.py to match the updated header-based authentication strategy.

Related Issues

Closes #173

Copilot AI review requested due to automatic review settings June 23, 2026 11:05
@vercel

vercel Bot commented Jun 23, 2026

Copy link
Copy Markdown

@vedant-kawale-27 is attempting to deploy a commit to the Aditya Sharma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added SSoC26 bug Something isn't working Hard labels Jun 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Userunknown84 Userunknown84 merged commit 5d8de67 into Userunknown84:main Jun 23, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Hard SSoC26

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internal requests to Gmail & Outlook API integrations fail with 401 Unauthorize

3 participants