feat: add Apple Sign-In support to ory_social_provider resource#81
feat: add Apple Sign-In support to ory_social_provider resource#81
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class Apple Sign-In support to the ory_social_provider Terraform resource by extending the schema/config payload, documenting Apple’s credential requirements, and adding acceptance coverage for Apple create/import/update.
Changes:
- Extends
ory_social_providerwithapple_team_id,apple_private_key_id, andapple_private_key, and makesclient_secretoptional (Apple-specific). - Adds resource-level
ValidateConfigto enforce valid attribute combinations perprovider_type. - Updates docs/examples and adds acceptance tests + testdata templates for Apple provider flows.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/resources/social_provider.md.tmpl | Documents Apple Sign-In behavior and constraints in the resource template. |
| internal/resources/socialprovider/testdata/apple_basic.tf.tmpl | Adds Apple acceptance test config (create). |
| internal/resources/socialprovider/testdata/apple_updated.tf.tmpl | Adds Apple acceptance test config (update). |
| internal/resources/socialprovider/resource_test.go | Adds acceptance test coverage for Apple create/import/update. |
| internal/resources/socialprovider/resource.go | Implements Apple attributes, optional client_secret, config validation, and API payload/state handling. |
| examples/resources/ory_social_provider/resource.tf | Updates example configuration to use Apple-specific credentials and new variables. |
| docs/resources/social_provider.md | Generated docs updates for Apple Sign-In fields and semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
internal/resources/socialprovider/testdata/apple_updated.tf.tmpl
Outdated
Show resolved
Hide resolved
2840cf1 to
132ca7c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
132ca7c to
912a64a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
912a64a to
5af1322
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add apple_team_id, apple_private_key_id, and apple_private_key attributes to the social provider resource. Apple uses a non-standard OAuth2 flow where Ory generates the JWT client_secret from these fields instead of requiring a static secret. - Make client_secret optional (Apple providers don't need it) - Add ValidateConfig with rules for Apple vs non-Apple providers - Validate empty strings and handle unknown values correctly - Update buildProviderConfig/Read to handle Apple fields - Add acceptance tests for Apple create/import/update - Generate test PEM keys at runtime to avoid secret scanner flags - Update docs and examples Closes #80
5af1322 to
1446627
Compare
feat: add Apple Sign-In support to ory_social_provider resource
feat: add Apple Sign-In support to ory_social_provider resource
Description
Add Apple Sign-In support to the
ory_social_providerresource. Apple uses a non-standard OAuth2 flow where Ory generates the JWTclient_secretfrom Apple-specific fields (apple_team_id,apple_private_key_id,apple_private_key) instead of requiring a static secret.Key changes:
apple_team_id,apple_private_key_id, andapple_private_keyattributesclient_secretoptional (not needed for Apple providers)ValidateConfigwith rules ensuring correct attribute combinations per provider typebuildProviderConfigandReadto handle Apple-specific fieldsRelated Issues
Fixes #80
Type of Change
Checklist
make test)make format)Testing
Describe how you tested these changes:
TestAccSocialProviderResource_basic,TestAccSocialProviderResource_apple)Screenshots/Output
Terraform plan output for Apple provider: