Repository navigation
feat(auth): update a custom OAuth/OIDC provider as an admin - #600
Merged
Merged
Conversation
Tr00d
force-pushed
the
feat/auth.admin.update_provider
branch
from
October 29, 2026 15:18
1a35040 to
c49af92
Compare
Tr00d
marked this pull request as ready for review
October 29, 2026 15:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Admins can update a custom OAuth/OIDC provider. Only the settings they set are sent; every other setting keeps its current value.
Capability:
auth.admin.update_provider: Admin Update Provider.Public API
New type in
Supabase.Gotrue.UpdateCustomProvider:CustomProviderChanges(init-only record, every member optional)Name,ClientId,ClientSecret,Issuer,AuthorizationUrl,TokenUrl,UserInfoUrl,Options(Supabase.Gotrue.Common.CustomProviderOptions, shared with create)IGotrueApi<TUser, TSession>gains the matchingUpdateCustomProviderAsync(string jwt, string identifier, CustomProviderChanges, CancellationToken).Behavior
PUT /admin/custom-providers/{identifier}with the service-role keyidentifier, required, starting withcustom:.changes, required. Null members are left out of the body, so the server keeps those values. Type and identifier cannot change. Settings of the other protocol are ignored by the server. Changing the issuer or discovery URL of an OIDC provider makes the server fetch and validate the discovery document again. If nothing is set, the server returns the provider unchanged.CustomProviderArgumentNullExceptionfor nullchanges.ArgumentException(the same check as get and delete) when the identifier lacks the case-sensitivecustom:prefix or contains/,\,?,#or%.GotrueException:Reason = CustomProviderNotFoundon 404custom_provider_not_found;ErrorCode = validation_failedon 400 (an invalid setting, a non-HTTPS or loopback URL, an OIDC discovery failure);Reason = AdminTokenRequiredon 401/403;ErrorCode = feature_disabledon 404. Anullbody also throwsGotrueException.CustomProviderChanges.ToString()leaves out the client secret.Deviations from supabase-js
CustomProviderOptionsrecord shared with create, instead of one flat parameter bag.Tests
The E2E test asserts on the provider
UpdateCustomProviderAsyncreturns, so it doesn't depend onGetCustomProviderAsync.UpdateCustomProviderTestsGetCustomProviderAsync). Unknown identifier →CustomProviderNotFound. Non-admin key →AdminTokenRequired.UpdateCustomProviderContractTestsCustomProviderNotFound.nullbody. Null changes rejected before I/O. A cancelled token sends nothing. The call completes when the caller blocks on a context that never runs continuations.UpdateCustomProviderApprovalTests{"name":"Renamed"}) and with every member setUpdateCustomProviderIdentifierTests,CustomProviderChangesTestsToString().Changed-line coverage: 100% (38 lines, measured against
master). Mutation: 5/5 detected on changed lines (4 killed, 1 timeout from the deadlock test), 0 survivors (1 compile error, 2 ignored). The local mutation run predates the split; the production code is unchanged and themutationcheck on this PR reruns it.Layout
Update reuses
Common/(CustomProviderOptions,CustomProviderOptionsBody,CustomProvider) as it is and moves nothing.Notes
discovery_url,jwks_urior the text settings. The XML docs say so. The SDK sends what it is given.