feat: add third-party auth resource#334
Conversation
savme
left a comment
There was a problem hiding this comment.
Thank you so much @JEETDESAI25! I wonder if we should follow this up with provider-specific resources that wrap this? For example:
supabase_third_party_auth_aws_cognito {
project_ref = "mayuaycdtijbctgqbycg"
pool_id = "xyz"
}This is just an idea for a separate discussion - it is in no way blocking merge!
| return nil | ||
| } | ||
|
|
||
| func waitForAuthServiceActive(ctx context.Context, projectRef string, client *api.ClientWithResponses, timeout time.Duration) diag.Diagnostics { |
There was a problem hiding this comment.
This looks similar to waitForServicesActive. I wonder if we could have a single helper that allows scoping services being checked?
There was a problem hiding this comment.
Thanks! I agree on both points.
Provider specific convenience resources could be a useful follow up discussion. I kept this PR focused on the generic third-party auth primitive that maps directly to the Management API, but wrappers for Cognito/Clerk/etc sounds good.
For the service readiness helper, good call. waitForAuthServiceActive is intentionally scoped to Auth, but it does duplicate most of waitForServicesActive. I’ll refactor that into a shared helper that accepts the services to check while preserving the existing all services and Data API disabled behavior.
What kind of change does this PR introduce?
Feature
What is the current behavior?
The Terraform provider does not support managing Supabase third-party auth integrations. Users need to configure third-party auth outside Terraform.
What is the new behavior?
Adds a new
supabase_third_party_authresource for managing Supabase third-party auth integrations.The resource supports exactly one auth source:
oidc_issuer_urljwks_urlcustom_jwksIt also includes:
<project_ref>/<third_party_auth_id>custom_jwksand resolved API responsescustom_jwksto avoid replacement on formatting-only changesAdditional context
custom_jwksandresolved_jwksare treated as public verification metadata, not sensitive state. The provider rejects private or symmetric JWK members.custom_jwksuses semantic JSON comparison so formatting/key-order-only changes do not force replacement.type = "clerk-development", a follow-up plan was no-op, and destroy removed the integration.