Repository navigation
[WEB-10168] fix: enforce the OAuth provider enabled flag - #10300
Conversation
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.
There was a problem hiding this comment.
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.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
sriramveeraghanta
left a comment
There was a problem hiding this comment.
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.
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.
…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)
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 throughget_configuration_valuewith the same env default as the instance endpoint) and raises the existing<PROVIDER>_NOT_CONFIGUREDerror 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
Screenshots and Media (if applicable)
Test Scenarios
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./auth/google/directly and confirm it returns the not-configured error; re-enable and confirm sign-in works.References
Created with Claude Code
Summary by CodeRabbit