Skip to content

Commit

Permalink
Merge branch 'v1' into DXCDT-537-guardian-import-empty-message-types
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught authored Sep 11, 2023
2 parents 8a0d425 + abd4088 commit 8d79aa3
Show file tree
Hide file tree
Showing 12 changed files with 870 additions and 330 deletions.
1 change: 0 additions & 1 deletion docs/resources/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ resource "auth0_client" "my_client" {
custom_login_page_on = true
is_first_party = true
is_token_endpoint_ip_header_trusted = true
token_endpoint_auth_method = "client_secret_post"
oidc_conformant = false
callbacks = ["https://example.com/callback"]
allowed_origins = ["https://example.com"]
Expand Down
1 change: 0 additions & 1 deletion examples/resources/auth0_client/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ resource "auth0_client" "my_client" {
custom_login_page_on = true
is_first_party = true
is_token_endpoint_ip_header_trusted = true
token_endpoint_auth_method = "client_secret_post"
oidc_conformant = false
callbacks = ["https://example.com/callback"]
allowed_origins = ["https://example.com"]
Expand Down
4 changes: 2 additions & 2 deletions internal/auth0/branding/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/id"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"

"github.com/auth0/terraform-provider-auth0/internal/config"
internalError "github.com/auth0/terraform-provider-auth0/internal/error"
internalValidation "github.com/auth0/terraform-provider-auth0/internal/validation"
)

var errNoCustomDomain = fmt.Errorf(
Expand Down Expand Up @@ -94,7 +94,7 @@ func NewResource() *schema.Resource {
"body": {
Type: schema.TypeString,
Required: true,
ValidateFunc: validation.StringIsNotEmpty,
ValidateFunc: internalValidation.UniversalLoginTemplateContainsCorrectTags,
Description: "The html template for the New Universal Login Experience.",
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/auth0/branding/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func TestAccBranding(t *testing.T) {
},
{
Config: testAccBrandingConfigThrowsAValidationErrorIfUniversalLoginBodyIsEmpty,
ExpectError: regexp.MustCompile("expected \"universal_login.0.body\" to not be an empty string"),
ExpectError: regexp.MustCompile("expected \"universal_login.0.body\" to contain a single auth0:head tag and at least one auth0:widget tag"),
},
{
Config: testAccBrandingConfigRemovesUniversalLoginTemplate,
Expand Down
24 changes: 24 additions & 0 deletions internal/auth0/connection/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var expandConnectionOptionsMap = map[string]expandConnectionOptionsFunc{
management.ConnectionStrategyBox: expandConnectionOptionsOAuth2,
management.ConnectionStrategyWordpress: expandConnectionOptionsOAuth2,
management.ConnectionStrategyShopify: expandConnectionOptionsOAuth2,
management.ConnectionStrategyLine: expandConnectionOptionsOAuth2,
management.ConnectionStrategyCustom: expandConnectionOptionsOAuth2,
management.ConnectionStrategyFacebook: expandConnectionOptionsFacebook,
management.ConnectionStrategyApple: expandConnectionOptionsApple,
Expand Down Expand Up @@ -975,3 +976,26 @@ func passThroughUnconfigurableConnectionOptionsPingFederate(

return nil
}

// checkForUnmanagedConfigurationSecrets is used to assess keys diff because values are sent back encrypted.
func checkForUnmanagedConfigurationSecrets(configFromTF, configFromAPI map[string]string) diag.Diagnostics {
var warnings diag.Diagnostics

for key := range configFromAPI {
if _, ok := configFromTF[key]; !ok {
warnings = append(warnings, diag.Diagnostic{
Severity: diag.Error,
Summary: "Unmanaged Configuration Secret",
Detail: fmt.Sprintf("Detected a configuration secret not managed through terraform: %q. "+
"If you proceed, this configuration secret will get deleted. It is required to "+
"add this configuration secret to your custom database settings to "+
"prevent unintentionally destructive results.",
key,
),
AttributePath: cty.Path{cty.GetAttrStep{Name: "options.configuration"}},
})
}
}

return warnings
}
Loading

0 comments on commit 8d79aa3

Please sign in to comment.