feat(auth): add custom OIDC/OAuth provider admin CRUD methods#2133
feat(auth): add custom OIDC/OAuth provider admin CRUD methods#2133
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Cache: Disabled due to Reviews > Disable Cache setting Disabled knowledge base sources:
📒 Files selected for processing (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis change adds a new admin surface to GoTrueAdminApi: Sequence Diagram(s)sequenceDiagram
participant Client
participant AdminSDK as GoTrueAdminApi.customProviders
participant Server as GoTrue Admin Server (/admin/custom-providers)
participant DB
Client->>AdminSDK: createProvider(params) / listProviders(...) / getProvider(id) / updateProvider(id, params) / deleteProvider(id)
AdminSDK->>Server: HTTP POST/GET/PUT/DELETE /admin/custom-providers[/:id] (service_role auth)
Server->>Server: validate service_role token
alt auth valid
Server->>DB: perform create/list/get/update/delete
DB-->>Server: operation result
Server-->>AdminSDK: 200/201 + response payload
AdminSDK-->>Client: return transformed response { data, error }
else auth error
Server-->>AdminSDK: 401/403 error
AdminSDK-->>Client: return structured auth error (no service_role exposed)
end
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. Comment |
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/core/auth-js/src/GoTrueAdminApi.ts`:
- Around line 606-618: Update the xform passed to _request in the GET
/admin/custom-providers call inside GoTrueAdminApi so it defensively defaults
providers to an empty array; specifically modify the xform function (the arrow
passed as xform) to return { data: { providers: data?.providers ?? [] }, error:
null } (or equivalent null/undefined-safe fallback) so callers never receive
providers as undefined while keeping the existing error-path fallback intact.
ℹ️ Review info
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Cache: Disabled due to Reviews > Disable Cache setting
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
packages/core/auth-js/src/GoTrueAdminApi.tspackages/core/auth-js/src/lib/types.ts
Add customProviders namespace to GoTrueAdminApi with
listProviders,createProvider,getProvider,updateProvider, anddeleteProvidermethods for managing custom identity providers.reference openapi changes: https://github.com/supabase/auth/pull/2357/changes#diff-d910ba2ef878f7db0223a966b81c8b3f3b65027bb39e4431bb05140171eece39