Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle external change of secret type #3141

Merged
merged 17 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/resources/secret_with_authorization_code_grant.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ resource "snowflake_secret_with_authorization_code_grant" "test" {
- `describe_output` (List of Object) Outputs the result of `DESCRIBE SECRET` for the given secret. (see [below for nested schema](#nestedatt--describe_output))
- `fully_qualified_name` (String) Fully qualified name of the resource. For more information, see [object name resolution](https://docs.snowflake.com/en/sql-reference/name-resolution).
- `id` (String) The ID of this resource.
- `secret_type` (String) Specifies the secret flow type for the secret.
- `show_output` (List of Object) Outputs the result of `SHOW SECRETS` for the given secret. (see [below for nested schema](#nestedatt--show_output))

<a id="nestedatt--describe_output"></a>
Expand Down
1 change: 1 addition & 0 deletions docs/resources/secret_with_basic_authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ resource "snowflake_secret_with_basic_authentication" "test" {
- `describe_output` (List of Object) Outputs the result of `DESCRIBE SECRET` for the given secret. (see [below for nested schema](#nestedatt--describe_output))
- `fully_qualified_name` (String) Fully qualified name of the resource. For more information, see [object name resolution](https://docs.snowflake.com/en/sql-reference/name-resolution).
- `id` (String) The ID of this resource.
- `secret_type` (String) Specifies the secret flow type for the secret.
- `show_output` (List of Object) Outputs the result of `SHOW SECRETS` for the given secret. (see [below for nested schema](#nestedatt--show_output))

<a id="nestedatt--describe_output"></a>
Expand Down
1 change: 1 addition & 0 deletions docs/resources/secret_with_client_credentials.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ resource "snowflake_secret_with_client_credentials" "test" {
- `describe_output` (List of Object) Outputs the result of `DESCRIBE SECRET` for the given secret. (see [below for nested schema](#nestedatt--describe_output))
- `fully_qualified_name` (String) Fully qualified name of the resource. For more information, see [object name resolution](https://docs.snowflake.com/en/sql-reference/name-resolution).
- `id` (String) The ID of this resource.
- `secret_type` (String) Specifies the secret flow type for the secret.
- `show_output` (List of Object) Outputs the result of `SHOW SECRETS` for the given secret. (see [below for nested schema](#nestedatt--show_output))

<a id="nestedatt--describe_output"></a>
Expand Down
1 change: 1 addition & 0 deletions docs/resources/secret_with_generic_string.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ resource "snowflake_secret_with_generic_string" "test" {
- `describe_output` (List of Object) Outputs the result of `DESCRIBE SECRET` for the given secret. (see [below for nested schema](#nestedatt--describe_output))
- `fully_qualified_name` (String) Fully qualified name of the resource. For more information, see [object name resolution](https://docs.snowflake.com/en/sql-reference/name-resolution).
- `id` (String) The ID of this resource.
- `secret_type` (String) Specifies the secret flow type for the secret.
- `show_output` (List of Object) Outputs the result of `SHOW SECRETS` for the given secret. (see [below for nested schema](#nestedatt--show_output))

<a id="nestedatt--describe_output"></a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,20 @@ var allResourceSchemaDefs = []ResourceSchemaDef{
name: "StreamOnExternalTable",
schema: resources.StreamOnExternalTable().Schema,
},
{
name: "SecretWithAuthorizationCodeGrant",
schema: resources.SecretWithAuthorizationCodeGrant().Schema,
},
{
name: "SecretWithBasicAuthentication",
schema: resources.SecretWithBasicAuthentication().Schema,
},
{
name: "SecretWithClientCredentials",
schema: resources.SecretWithClientCredentials().Schema,
},
{
name: "SecretWithGenericString",
schema: resources.SecretWithGenericString().Schema,
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/acceptance/bettertestspoc/assert"
)

func (s *SecretWithAuthorizationCodeResourceAssert) HasOauthRefreshTokenExpiryTimeNotEmpty() *SecretWithAuthorizationCodeResourceAssert {
func (s *SecretWithAuthorizationCodeGrantResourceAssert) HasOauthRefreshTokenExpiryTimeNotEmpty() *SecretWithAuthorizationCodeGrantResourceAssert {
s.AddAssertion(assert.ValuePresent("oauth_refresh_token_expiry_time"))
return s
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package model

import tfconfig "github.com/hashicorp/terraform-plugin-testing/config"

func (s *SecretWithClientCredentialsModel) WithOauthScopes(oauthScopes []string) *SecretWithClientCredentialsModel {
oauthScopesStringVariables := make([]tfconfig.Variable, len(oauthScopes))
for i, v := range oauthScopes {
oauthScopesStringVariables[i] = tfconfig.StringVariable(v)
}

s.OauthScopes = tfconfig.SetVariable(oauthScopesStringVariables...)
return s
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading