Skip to content

[WEB-10171] fix: stop returning OAuth provider tokens - #10303

Merged
sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10171-hide-provider-tokens
Nov 16, 2026
Merged

sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10171-hide-provider-tokens

Conversation

@pablohashescobar

@pablohashescobar pablohashescobar commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Description

GET /api/users/me/accounts/ serialised Account with fields = "__all__", which returned the stored OAuth access_token, refresh_token and id_token to the browser. No frontend reads them.

AccountSerializer now excludes those three fields. AccountEndpoint is its only caller.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

  • New plane/tests/contract/app/test_user_accounts_app.py: the list and detail responses include the account and none of the three token fields. Fails without the fix, passes with it.

References

  • WEB-10171

Created with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • GitHub account listings and details no longer include access, refresh, or ID tokens in their responses. Account IDs and provider information remain available.
  • Tests

    • Added coverage to verify that account listing and retrieval responses omit these tokens and continue to return account details successfully.

…sponse

AccountSerializer returned the stored OAuth access, refresh and id tokens to the browser. No client reads them, so they are no longer serialised.
Copilot AI balanced review requested due to automatic review settings November 15, 2026 22:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@makeplane

makeplane Bot commented Nov 15, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Account responses exclude access_token, refresh_token, and id_token. A contract test checks that list and detail responses omit these fields.

Changes: Account response token handling

Layer / File(s) Summary
Exclude provider tokens from account responses
apps/api/plane/app/serializers/user.py, apps/api/plane/tests/contract/app/test_user_accounts_app.py
AccountSerializer excludes access_token, refresh_token, and id_token. The contract test verifies successful list and detail responses, matching account identity and provider values, and absence of these fields.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: Minimal · up to 2b57b

Connected-account responses no longer include OAuth provider tokens. No concrete merge-blocking risk was identified in this small, easily reversible change.

Pre-merge checks: Passed 4

Check name Status Explanation
Description check Passed The description covers the problem (GET /api/users/me/accounts/ returned access_token, refresh_token and id_token), the fix (AccountSerializer excludes those fields), and the test scenario. It also li…
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.
Title check Passed The title names the main change: the connected-accounts response no longer returns OAuth provider tokens (access_token, refresh_token, id_token). The AccountSerializer change and the new contract test…
Full details: Description check

Explanation

The description covers the problem (GET /api/users/me/accounts/ returned access_token, refresh_token and id_token), the fix (AccountSerializer excludes those fields), and the test scenario. It also lists the bug-fix type and references WEB-10171. The Screenshots section still holds the template placeholder, which is acceptable because it applies only if relevant. The Description section is brief but sufficient. The Type of Change section is filled in correctly.

Full details: Title check

Explanation

The title names the main change: the connected-accounts response no longer returns OAuth provider tokens (access_token, refresh_token, id_token). The AccountSerializer change and the new contract test both match this. The title is short, uses the ticket prefix and conventional 'fix:' form, and is specific enough for a teammate scanning history.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7d78f7d7-69ac-4b03-9633-4fd7580ea31a
Commits

Reviewing files that changed from the base of the PR and between 290383d and 2b57b78.

Files selected for processing: 2

  • apps/api/plane/app/serializers/user.py
  • apps/api/plane/tests/contract/app/test_user_accounts_app.py

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

@pablohashescobar pablohashescobar changed the title [WEB-10171] fix(security): stop returning OAuth provider tokens [WEB-10171] fix: stop returning OAuth provider tokens Nov 16, 2026
@sriramveeraghanta
sriramveeraghanta merged commit 72efad1 into preview Nov 16, 2026
19 of 20 checks passed
@sriramveeraghanta
sriramveeraghanta deleted the fix/web-10171-hide-provider-tokens branch November 16, 2026 09:36
Pawel-Kranzberg pushed a commit to klazwi/pi-plane that referenced this pull request Nov 18, 2026
…sponse (makeplane#10303)

AccountSerializer returned the stored OAuth access, refresh and id tokens to the browser. No client reads them, so they are no longer serialised.

(cherry picked from commit 72efad1)
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.

3 participants