Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jmichalak committed Jul 4, 2024
1 parent 33b9a5f commit 744b4ed
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
12 changes: 6 additions & 6 deletions pkg/resources/api_authentication_integration_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ var apiAuthCommonSchema = map[string]*schema.Schema{
Optional: true,
Description: "Specifies a comment for the integration.",
},
showOutputAttributeName: {
ShowOutputAttributeName: {
Type: schema.TypeList,
Computed: true,
Description: "Outputs the result of `SHOW SECURITY INTEGRATIONS` for the given security integration.",
Elem: &schema.Resource{
Schema: schemas.ShowSecurityIntegrationSchema,
},
},
describeOutputAttributeName: {
DescribeOutputAttributeName: {
Type: schema.TypeList,
Computed: true,
Description: "Outputs the result of `DESCRIBE SECURITY INTEGRATIONS` for the given security integration.",
Expand Down Expand Up @@ -325,8 +325,8 @@ func handleApiAuthRead(d *schema.ResourceData,

if err = handleExternalChangesToObjectInDescribe(d,
append(extraFieldsDescribeMappings,
describeMapping{"oauth_access_token_validity", "oauth_access_token_validity", oauthAccessTokenValidityInt, oauthAccessTokenValidityInt, stringToIntNormalizer},
describeMapping{"oauth_refresh_token_validity", "oauth_refresh_token_validity", oauthRefreshTokenValidityInt, oauthRefreshTokenValidityInt, stringToIntNormalizer},
describeMapping{"oauth_access_token_validity", "oauth_access_token_validity", oauthAccessTokenValidityInt, oauthAccessTokenValidityInt, nil},
describeMapping{"oauth_refresh_token_validity", "oauth_refresh_token_validity", oauthRefreshTokenValidityInt, oauthRefreshTokenValidityInt, nil},
describeMapping{"oauth_client_id", "oauth_client_id", oauthClientId.Value, oauthClientId.Value, nil},
describeMapping{"oauth_client_auth_method", "oauth_client_auth_method", oauthClientAuthMethod.Value, oauthClientAuthMethod.Value, nil},
describeMapping{"oauth_token_endpoint", "oauth_token_endpoint", oauthTokenEndpoint.Value, oauthTokenEndpoint.Value, nil},
Expand Down Expand Up @@ -365,11 +365,11 @@ func handleApiAuthRead(d *schema.ResourceData,
}
}

if err := d.Set(showOutputAttributeName, []map[string]any{schemas.SecurityIntegrationToSchema(integration)}); err != nil {
if err := d.Set(ShowOutputAttributeName, []map[string]any{schemas.SecurityIntegrationToSchema(integration)}); err != nil {
return err
}

if err := d.Set(describeOutputAttributeName, []map[string]any{schemas.ApiAuthSecurityIntegrationPropertiesToSchema(properties)}); err != nil {
if err := d.Set(DescribeOutputAttributeName, []map[string]any{schemas.ApiAuthSecurityIntegrationPropertiesToSchema(properties)}); err != nil {
return err
}
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ func ApiAuthenticationIntegrationWithAuthorizationCodeGrant() *schema.Resource {
ForceNewIfChangeToEmptyString("oauth_authorization_endpoint"),
ForceNewIfChangeToEmptyString("oauth_client_auth_method"),
ForceNewIfChangeToEmptyString("oauth_grant"),
ComputedIfAnyAttributeChanged(showOutputAttributeName, "enabled", "comment"),
ComputedIfAnyAttributeChanged(describeOutputAttributeName, "enabled", "comment", "oauth_access_token_validity", "oauth_refresh_token_validity",
ComputedIfAnyAttributeChanged(ShowOutputAttributeName, "enabled", "comment"),
ComputedIfAnyAttributeChanged(DescribeOutputAttributeName, "enabled", "comment", "oauth_access_token_validity", "oauth_refresh_token_validity",
"oauth_client_id", "oauth_client_auth_method", "oauth_authorization_endpoint",
"oauth_token_endpoint", "oauth_allowed_scopes", "oauth_grant"),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func ApiAuthenticationIntegrationWithClientCredentials() *schema.Resource {
ForceNewIfChangeToEmptyString("oauth_token_endpoint"),
ForceNewIfChangeToEmptyString("oauth_client_auth_method"),
ForceNewIfChangeToEmptyString("oauth_grant"),
ComputedIfAnyAttributeChanged(showOutputAttributeName, "enabled", "comment"),
ComputedIfAnyAttributeChanged(describeOutputAttributeName, "enabled", "comment", "oauth_access_token_validity", "oauth_refresh_token_validity",
ComputedIfAnyAttributeChanged(ShowOutputAttributeName, "enabled", "comment"),
ComputedIfAnyAttributeChanged(DescribeOutputAttributeName, "enabled", "comment", "oauth_access_token_validity", "oauth_refresh_token_validity",
"oauth_client_id", "oauth_client_auth_method", "oauth_token_endpoint", "oauth_allowed_scopes", "oauth_grant"),
),
Importer: &schema.ResourceImporter{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func ApiAuthenticationIntegrationWithJwtBearer() *schema.Resource {
ForceNewIfChangeToEmptyString("oauth_authorization_endpoint"),
ForceNewIfChangeToEmptyString("oauth_client_auth_method"),
ForceNewIfChangeToEmptyString("oauth_grant"),
ComputedIfAnyAttributeChanged(showOutputAttributeName, "enabled", "comment"),
ComputedIfAnyAttributeChanged(describeOutputAttributeName, "enabled", "comment", "oauth_access_token_validity", "oauth_refresh_token_validity",
ComputedIfAnyAttributeChanged(ShowOutputAttributeName, "enabled", "comment"),
ComputedIfAnyAttributeChanged(DescribeOutputAttributeName, "enabled", "comment", "oauth_access_token_validity", "oauth_refresh_token_validity",
"oauth_client_id", "oauth_client_auth_method", "oauth_authorization_endpoint",
"oauth_token_endpoint", "oauth_grant", "oauth_assertion_issuer"),
),
Expand Down
1 change: 0 additions & 1 deletion pkg/sdk/security_integrations_gen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ func TestSecurityIntegrations_CreateSaml2(t *testing.T) {
Saml2SsoUrl: "url",
Saml2Provider: "provider",
Saml2X509Cert: "cert",
Enabled: true,
}
}

Expand Down

0 comments on commit 744b4ed

Please sign in to comment.