Skip to content

Commit

Permalink
Fix schemas in setStateToValuesFromConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jmichalak committed Jul 23, 2024
1 parent 90b8c4b commit e5ecd2f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func ReadContextApiAuthenticationIntegrationWithClientCredentials(withExternalCh
}); err != nil {
return diag.FromErr(err)
}
if err := setStateToValuesFromConfig(d, warehouseSchema, []string{
if err := setStateToValuesFromConfig(d, apiAuthClientCredentialsSchema, []string{
"oauth_allowed_scopes",
}); err != nil {
return diag.FromErr(err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func ReadContextApiAuthenticationIntegrationWithJwtBearer(withExternalChangesMar
}); err != nil {
return diag.FromErr(err)
}
if err := setStateToValuesFromConfig(d, warehouseSchema, []string{
if err := setStateToValuesFromConfig(d, apiAuthJwtBearerSchema, []string{
"oauth_authorization_endpoint",
"oauth_assertion_issuer",
}); err != nil {
Expand Down
6 changes: 3 additions & 3 deletions pkg/resources/external_oauth_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

var privilegedRoles = []string{"ACCOUNTADMIN", "ORGADMIN", "SECURITYADMIN"}

var oauthExternalIntegrationSchema = map[string]*schema.Schema{
var externalOauthIntegrationSchema = map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -159,7 +159,7 @@ func ExternalOauthIntegration() *schema.Resource {
DeleteContext: DeleteContextExternalOauthIntegration,
Description: "Resource used to manage external oauth security integration objects. For more information, check [security integrations documentation](https://docs.snowflake.com/en/sql-reference/sql/create-security-integration-oauth-external).",

Schema: oauthExternalIntegrationSchema,
Schema: externalOauthIntegrationSchema,
CustomizeDiff: customdiff.All(
ForceNewIfChangeToEmptyString("external_oauth_rsa_public_key"),
ForceNewIfChangeToEmptyString("external_oauth_rsa_public_key_2"),
Expand Down Expand Up @@ -521,7 +521,7 @@ func ReadContextExternalOauthIntegration(withExternalChangesMarking bool) schema
}
}

if err = setStateToValuesFromConfig(d, warehouseSchema, []string{
if err = setStateToValuesFromConfig(d, externalOauthIntegrationSchema, []string{
"external_oauth_jws_keys_url",
"external_oauth_rsa_public_key",
"external_oauth_rsa_public_key_2",
Expand Down
2 changes: 1 addition & 1 deletion pkg/resources/scim_integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func ReadContextSCIMIntegration(withExternalChangesMarking bool) schema.ReadCont
}
}

if err = setStateToValuesFromConfig(d, saml2IntegrationSchema, []string{
if err = setStateToValuesFromConfig(d, scimIntegrationSchema, []string{
"network_policy",
"sync_password",
}); err != nil {
Expand Down

0 comments on commit e5ecd2f

Please sign in to comment.