Skip to content

[WEB-10168] fix: enforce the OAuth provider enabled flag - #10300

Merged
sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10168-oauth-enabled-flag
Nov 16, 2026
Merged

sriramveeraghanta merged 1 commit into
previewfrom
fix/web-10168-oauth-enabled-flag

Conversation

@pablohashescobar

@pablohashescobar pablohashescobar commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Description

The instance admin switch that disables an OAuth provider only changed IS_<PROVIDER>_ENABLED, which the backend read for display. The Google, GitHub, GitLab and Gitea providers checked only that a client ID and secret were configured, so /auth/<provider>/ kept working after a provider was switched off.

Each provider's __init__ now also requires its enabled flag to be "1" (read through get_configuration_value with the same env default as the instance endpoint) and raises the existing <PROVIDER>_NOT_CONFIGURED error otherwise. Both the initiate and callback views construct the provider, so both are covered.

Behavior change: an instance that has a client ID and secret set but never enabled the provider loses that sign-in route. Its login button was already hidden in that state.

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/unit/views/test_oauth_provider_enabled_flag.py, parametrised over the four providers: construction raises when the flag is "0" with credentials set, and succeeds when it is "1". Fails without the fix, 8 passed with it.
  • Suggested: disable Google in the instance admin, then open /auth/google/ directly and confirm it returns the not-configured error; re-enable and confirm sign-in works.

References

  • WEB-10168

Created with Claude Code

Summary by CodeRabbit

  • Configuration
    • Google, GitHub, GitLab, and Gitea sign-in now require an explicit enable setting in addition to valid provider credentials. Providers remain unavailable when the setting is off or required configuration is missing.

Switching a provider off in the instance settings only hid it in the UI; the auth endpoints kept working while client credentials were set. Each provider now also requires its IS_<PROVIDER>_ENABLED value to be "1" and reports <PROVIDER>_NOT_CONFIGURED otherwise.
Copilot AI balanced review requested due to automatic review settings November 15, 2026 22:48

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.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Google, GitHub, GitLab, and Gitea OAuth providers now require an enabled flag set to "1" in addition to their required configuration values. Parameterized unit tests cover disabled and enabled configurations for all four providers.

Changes: OAuth provider enablement

Layer / File(s) Summary
Provider configuration gates
apps/api/plane/authentication/provider/oauth/{google,github,gitlab,gitea}.py, apps/api/plane/tests/unit/views/test_oauth_provider_enabled_flag.py
Each provider rejects configuration unless its enabled flag equals "1" and its required configuration values are present. Parameterized tests check provider-specific errors when disabled and successful construction with a nonempty authorization URL when enabled.

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

Change: Bug fix

Merge Risk: Minimal · up to ea75a

This change makes the backend honor the admin's OAuth provider enabled setting, so disabled providers can no longer be used to sign in just because credentials are configured. Tests cover all four providers. No merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Description check Passed The description covers the problem, the fix in each provider's init, the behavior change, and test scenarios. It states the bug fix and improvement types. It leaves the Screenshots section as an u…
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 backend now enforces the OAuth provider enabled flag (IS__ENABLED) for Google, GitHub, GitLab, and Gitea. The raw summary confirms each provider's __init…
Full details: Description check

Explanation

The description covers the problem, the fix in each provider's init, the behavior change, and test scenarios. It states the bug fix and improvement types. It leaves the Screenshots section as an unfilled placeholder, which is acceptable because the section applies only if relevant. The References section lists WEB-10168. The Type of Change list is partly filled but the choices are clear. The description does not explain the Description template heading exactly, but all critical information is present.

Full details: Title check

Explanation

The title names the main change: the backend now enforces the OAuth provider enabled flag (IS_<PROVIDER>_ENABLED) for Google, GitHub, GitLab, and Gitea. The raw summary confirms each provider's init now requires the flag to be "1" before construction succeeds, and the new test file checks this behavior. The title uses the "fix:" prefix and a ticket ID, which matches the PR objectives. It is specific and concise, so a teammate scanning history can identify the primary change.

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: 26f62944-153f-4d96-8825-b377590ae3b6
Commits

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

Files selected for processing: 5

  • apps/api/plane/authentication/provider/oauth/gitea.py
  • apps/api/plane/authentication/provider/oauth/github.py
  • apps/api/plane/authentication/provider/oauth/gitlab.py
  • apps/api/plane/authentication/provider/oauth/google.py
  • apps/api/plane/tests/unit/views/test_oauth_provider_enabled_flag.py

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

@makeplane

makeplane Bot commented Nov 15, 2026

Copy link
Copy Markdown

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@pablohashescobar pablohashescobar changed the title [WEB-10168] fix(security): enforce the OAuth provider enabled flag [WEB-10168] fix: enforce the OAuth provider enabled flag Nov 16, 2026

@sriramveeraghanta sriramveeraghanta left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. The key names and the "0"/"1" values match what the admin app saves, and both the initiate and callback paths (app and space) are covered.

@sriramveeraghanta
sriramveeraghanta merged commit 4384545 into preview Nov 16, 2026
19 of 21 checks passed
@sriramveeraghanta
sriramveeraghanta deleted the fix/web-10168-oauth-enabled-flag branch November 16, 2026 20:23
sriramveeraghanta pushed a commit that referenced this pull request Nov 16, 2026
Switching a provider off in the instance settings only hid it in the UI; the auth endpoints kept working while client credentials were set. Each provider now also requires its IS_<PROVIDER>_ENABLED value to be "1" and reports <PROVIDER>_NOT_CONFIGURED otherwise.
Pawel-Kranzberg pushed a commit to klazwi/pi-plane that referenced this pull request Nov 18, 2026
…0300)

Switching a provider off in the instance settings only hid it in the UI; the auth endpoints kept working while client credentials were set. Each provider now also requires its IS_<PROVIDER>_ENABLED value to be "1" and reports <PROVIDER>_NOT_CONFIGURED otherwise.

(cherry picked from commit 8fc1cbc)
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