diff --git a/docs/resources/branding_theme.md b/docs/resources/branding_theme.md index 6296545c6..45ed156b8 100644 --- a/docs/resources/branding_theme.md +++ b/docs/resources/branding_theme.md @@ -119,15 +119,15 @@ resource "auth0_branding_theme" "my_theme" { Required: -- `button_border_radius` (Number) Button border radius. -- `button_border_weight` (Number) Button border weight. -- `buttons_style` (String) Buttons style. -- `input_border_radius` (Number) Input border radius. -- `input_border_weight` (Number) Input border weight. -- `inputs_style` (String) Inputs style. +- `button_border_radius` (Number) Button border radius. Value needs to be between `1` and `10`. +- `button_border_weight` (Number) Button border weight. Value needs to be between `0` and `10`. +- `buttons_style` (String) Buttons style. Available options: `pill`, `rounded`, `sharp`. +- `input_border_radius` (Number) Input border radius. Value needs to be between `0` and `10`. +- `input_border_weight` (Number) Input border weight. Value needs to be between `0` and `3`. +- `inputs_style` (String) Inputs style. Available options: `pill`, `rounded`, `sharp`. - `show_widget_shadow` (Boolean) Show widget shadow. -- `widget_border_weight` (Number) Widget border weight. -- `widget_corner_radius` (Number) Widget corner radius. +- `widget_border_weight` (Number) Widget border weight. Value needs to be between `0` and `10`. +- `widget_corner_radius` (Number) Widget corner radius. Value needs to be between `0` and `50`. @@ -169,7 +169,7 @@ Required: - `input_labels` (Block List, Min: 1, Max: 1) Input labels. (see [below for nested schema](#nestedblock--fonts--input_labels)) - `links` (Block List, Min: 1, Max: 1) Links. (see [below for nested schema](#nestedblock--fonts--links)) - `links_style` (String) Links style. -- `reference_text_size` (Number) Reference text size. +- `reference_text_size` (Number) Reference text size. Value needs to be between `12` and `24`. - `subtitle` (Block List, Min: 1, Max: 1) Subtitle. (see [below for nested schema](#nestedblock--fonts--subtitle)) - `title` (Block List, Min: 1, Max: 1) Title. (see [below for nested schema](#nestedblock--fonts--title)) @@ -179,7 +179,7 @@ Required: Required: - `bold` (Boolean) Body text bold. -- `size` (Number) Body text size. +- `size` (Number) Body text size. Value needs to be between `0` and `150`. @@ -188,7 +188,7 @@ Required: Required: - `bold` (Boolean) Buttons text bold. -- `size` (Number) Buttons text size. +- `size` (Number) Buttons text size. Value needs to be between `0` and `150`. @@ -197,7 +197,7 @@ Required: Required: - `bold` (Boolean) Input labels bold. -- `size` (Number) Input labels size. +- `size` (Number) Input labels size. Value needs to be between `0` and `150`. @@ -206,7 +206,7 @@ Required: Required: - `bold` (Boolean) Links bold. -- `size` (Number) Links size. +- `size` (Number) Links size. Value needs to be between `0` and `150`. @@ -215,7 +215,7 @@ Required: Required: - `bold` (Boolean) Subtitle bold. -- `size` (Number) Subtitle size. +- `size` (Number) Subtitle size. Value needs to be between `0` and `150`. @@ -224,7 +224,7 @@ Required: Required: - `bold` (Boolean) Title bold. -- `size` (Number) Title size. +- `size` (Number) Title size. Value needs to be between `75` and `150`. @@ -235,7 +235,7 @@ Required: - `background_color` (String) Background color. - `background_image_url` (String) Background image url. -- `page_layout` (String) Page layout. +- `page_layout` (String) Page layout. Available options: `center`, `left`, `right`. @@ -243,11 +243,11 @@ Required: Required: -- `header_text_alignment` (String) Header text alignment. -- `logo_height` (Number) Logo height. -- `logo_position` (String) Logo position. +- `header_text_alignment` (String) Header text alignment. Available options: `center`, `left`, `right`. +- `logo_height` (Number) Logo height. Value needs to be between `1` and `100`. +- `logo_position` (String) Logo position. Available options: `center`, `left`, `right`, `none`. - `logo_url` (String) Logo url. -- `social_buttons_layout` (String) Social buttons layout. +- `social_buttons_layout` (String) Social buttons layout. Available options: `bottom`, `top`. ## Import diff --git a/internal/provider/resource_auth0_branding_theme.go b/internal/provider/resource_auth0_branding_theme.go index 46e104595..117965922 100644 --- a/internal/provider/resource_auth0_branding_theme.go +++ b/internal/provider/resource_auth0_branding_theme.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "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/value" ) @@ -37,34 +38,40 @@ func newBrandingTheme() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "buttons_style": { - Type: schema.TypeString, - Required: true, - Description: "Buttons style.", + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{"pill", "rounded", "sharp"}, false), + Required: true, + Description: "Buttons style. Available options: `pill`, `rounded`, `sharp`.", }, "button_border_radius": { - Type: schema.TypeInt, - Required: true, - Description: "Button border radius.", + Type: schema.TypeFloat, + ValidateFunc: validation.FloatBetween(1, 10), + Required: true, + Description: "Button border radius. Value needs to be between `1` and `10`.", }, "button_border_weight": { - Type: schema.TypeInt, - Required: true, - Description: "Button border weight.", + Type: schema.TypeFloat, + ValidateFunc: validation.FloatBetween(0, 10), + Required: true, + Description: "Button border weight. Value needs to be between `0` and `10`.", }, "inputs_style": { - Type: schema.TypeString, - Required: true, - Description: "Inputs style.", + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{"pill", "rounded", "sharp"}, false), + Required: true, + Description: "Inputs style. Available options: `pill`, `rounded`, `sharp`.", }, "input_border_radius": { - Type: schema.TypeInt, - Required: true, - Description: "Input border radius.", + Type: schema.TypeFloat, + ValidateFunc: validation.FloatBetween(0, 10), + Required: true, + Description: "Input border radius. Value needs to be between `0` and `10`.", }, "input_border_weight": { - Type: schema.TypeInt, - Required: true, - Description: "Input border weight.", + Type: schema.TypeFloat, + ValidateFunc: validation.FloatBetween(0, 3), + Required: true, + Description: "Input border weight. Value needs to be between `0` and `3`.", }, "show_widget_shadow": { Type: schema.TypeBool, @@ -72,14 +79,16 @@ func newBrandingTheme() *schema.Resource { Description: "Show widget shadow.", }, "widget_corner_radius": { - Type: schema.TypeInt, - Required: true, - Description: "Widget corner radius.", + Type: schema.TypeFloat, + ValidateFunc: validation.FloatBetween(0, 50), + Required: true, + Description: "Widget corner radius. Value needs to be between `0` and `50`.", }, "widget_border_weight": { - Type: schema.TypeInt, - Required: true, - Description: "Widget border weight.", + Type: schema.TypeFloat, + ValidateFunc: validation.FloatBetween(0, 10), + Required: true, + Description: "Widget border weight. Value needs to be between `0` and `10`.", }, }, }, @@ -202,9 +211,10 @@ func newBrandingTheme() *schema.Resource { Description: "Body text bold.", }, "size": { - Type: schema.TypeInt, - Required: true, - Description: "Body text size.", + Type: schema.TypeFloat, + ValidateFunc: validation.FloatBetween(0, 150), + Required: true, + Description: "Body text size. Value needs to be between `0` and `150`.", }, }, }, @@ -222,9 +232,10 @@ func newBrandingTheme() *schema.Resource { Description: "Buttons text bold.", }, "size": { - Type: schema.TypeInt, - Required: true, - Description: "Buttons text size.", + Type: schema.TypeFloat, + ValidateFunc: validation.FloatBetween(0, 150), + Required: true, + Description: "Buttons text size. Value needs to be between `0` and `150`.", }, }, }, @@ -247,9 +258,10 @@ func newBrandingTheme() *schema.Resource { Description: "Input labels bold.", }, "size": { - Type: schema.TypeInt, - Required: true, - Description: "Input labels size.", + Type: schema.TypeFloat, + ValidateFunc: validation.FloatBetween(0, 150), + Required: true, + Description: "Input labels size. Value needs to be between `0` and `150`.", }, }, }, @@ -267,9 +279,10 @@ func newBrandingTheme() *schema.Resource { Description: "Links bold.", }, "size": { - Type: schema.TypeInt, - Required: true, - Description: "Links size.", + Type: schema.TypeFloat, + ValidateFunc: validation.FloatBetween(0, 150), + Required: true, + Description: "Links size. Value needs to be between `0` and `150`.", }, }, }, @@ -280,9 +293,10 @@ func newBrandingTheme() *schema.Resource { Description: "Links style.", }, "reference_text_size": { - Type: schema.TypeInt, - Required: true, - Description: "Reference text size.", + Type: schema.TypeFloat, + ValidateFunc: validation.FloatBetween(12, 24), + Required: true, + Description: "Reference text size. Value needs to be between `12` and `24`.", }, "subtitle": { Type: schema.TypeList, @@ -297,9 +311,10 @@ func newBrandingTheme() *schema.Resource { Description: "Subtitle bold.", }, "size": { - Type: schema.TypeInt, - Required: true, - Description: "Subtitle size.", + Type: schema.TypeFloat, + ValidateFunc: validation.FloatBetween(0, 150), + Required: true, + Description: "Subtitle size. Value needs to be between `0` and `150`.", }, }, }, @@ -317,9 +332,10 @@ func newBrandingTheme() *schema.Resource { Description: "Title bold.", }, "size": { - Type: schema.TypeInt, - Required: true, - Description: "Title size.", + Type: schema.TypeFloat, + ValidateFunc: validation.FloatBetween(75, 150), + Required: true, + Description: "Title size. Value needs to be between `75` and `150`.", }, }, }, @@ -344,9 +360,10 @@ func newBrandingTheme() *schema.Resource { Description: "Background image url.", }, "page_layout": { - Type: schema.TypeString, - Required: true, - Description: "Page layout.", + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{"center", "left", "right"}, false), + Required: true, + Description: "Page layout. Available options: `center`, `left`, `right`.", }, }, }, @@ -358,19 +375,22 @@ func newBrandingTheme() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "header_text_alignment": { - Type: schema.TypeString, - Required: true, - Description: "Header text alignment.", + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{"center", "left", "right"}, false), + Required: true, + Description: "Header text alignment. Available options: `center`, `left`, `right`.", }, "logo_height": { - Type: schema.TypeInt, - Required: true, - Description: "Logo height.", + Type: schema.TypeFloat, + ValidateFunc: validation.FloatBetween(1, 100), + Required: true, + Description: "Logo height. Value needs to be between `1` and `100`.", }, "logo_position": { - Type: schema.TypeString, - Required: true, - Description: "Logo position.", + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{"center", "left", "right", "none"}, false), + Required: true, + Description: "Logo position. Available options: `center`, `left`, `right`, `none`.", }, "logo_url": { Type: schema.TypeString, @@ -378,9 +398,10 @@ func newBrandingTheme() *schema.Resource { Description: "Logo url.", }, "social_buttons_layout": { - Type: schema.TypeString, - Required: true, - Description: "Social buttons layout.", + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{"bottom", "top"}, false), + Required: true, + Description: "Social buttons layout. Available options: `bottom`, `top`.", }, }, }, @@ -465,15 +486,15 @@ func expandBrandingTheme(data *schema.ResourceData) management.BrandingTheme { } brandingTheme.Borders = management.BrandingThemeBorders{ - ButtonBorderRadius: data.Get("borders.0.button_border_radius").(int), - ButtonBorderWeight: data.Get("borders.0.button_border_weight").(int), + ButtonBorderRadius: data.Get("borders.0.button_border_radius").(float64), + ButtonBorderWeight: data.Get("borders.0.button_border_weight").(float64), ButtonsStyle: data.Get("borders.0.buttons_style").(string), - InputBorderRadius: data.Get("borders.0.input_border_radius").(int), - InputBorderWeight: data.Get("borders.0.input_border_weight").(int), + InputBorderRadius: data.Get("borders.0.input_border_radius").(float64), + InputBorderWeight: data.Get("borders.0.input_border_weight").(float64), InputsStyle: data.Get("borders.0.inputs_style").(string), ShowWidgetShadow: data.Get("borders.0.show_widget_shadow").(bool), - WidgetBorderWeight: data.Get("borders.0.widget_border_weight").(int), - WidgetCornerRadius: data.Get("borders.0.widget_corner_radius").(int), + WidgetBorderWeight: data.Get("borders.0.widget_border_weight").(float64), + WidgetCornerRadius: data.Get("borders.0.widget_corner_radius").(float64), } colorsConfig := config.GetAttr("colors").Index(cty.NumberIntVal(0)) @@ -502,37 +523,37 @@ func expandBrandingTheme(data *schema.ResourceData) management.BrandingTheme { brandingTheme.Fonts = management.BrandingThemeFonts{ FontURL: data.Get("fonts.0.font_url").(string), LinksStyle: data.Get("fonts.0.links_style").(string), - ReferenceTextSize: data.Get("fonts.0.reference_text_size").(int), + ReferenceTextSize: data.Get("fonts.0.reference_text_size").(float64), } brandingTheme.Fonts.BodyText = management.BrandingThemeText{ Bold: data.Get("fonts.0.body_text.0.bold").(bool), - Size: data.Get("fonts.0.body_text.0.size").(int), + Size: data.Get("fonts.0.body_text.0.size").(float64), } brandingTheme.Fonts.ButtonsText = management.BrandingThemeText{ Bold: data.Get("fonts.0.buttons_text.0.bold").(bool), - Size: data.Get("fonts.0.buttons_text.0.size").(int), + Size: data.Get("fonts.0.buttons_text.0.size").(float64), } brandingTheme.Fonts.InputLabels = management.BrandingThemeText{ Bold: data.Get("fonts.0.input_labels.0.bold").(bool), - Size: data.Get("fonts.0.input_labels.0.size").(int), + Size: data.Get("fonts.0.input_labels.0.size").(float64), } brandingTheme.Fonts.Links = management.BrandingThemeText{ Bold: data.Get("fonts.0.links.0.bold").(bool), - Size: data.Get("fonts.0.links.0.size").(int), + Size: data.Get("fonts.0.links.0.size").(float64), } brandingTheme.Fonts.Subtitle = management.BrandingThemeText{ Bold: data.Get("fonts.0.subtitle.0.bold").(bool), - Size: data.Get("fonts.0.subtitle.0.size").(int), + Size: data.Get("fonts.0.subtitle.0.size").(float64), } brandingTheme.Fonts.Title = management.BrandingThemeText{ Bold: data.Get("fonts.0.title.0.bold").(bool), - Size: data.Get("fonts.0.title.0.size").(int), + Size: data.Get("fonts.0.title.0.size").(float64), } brandingTheme.PageBackground = management.BrandingThemePageBackground{ @@ -543,7 +564,7 @@ func expandBrandingTheme(data *schema.ResourceData) management.BrandingTheme { brandingTheme.Widget = management.BrandingThemeWidget{ HeaderTextAlignment: data.Get("widget.0.header_text_alignment").(string), - LogoHeight: data.Get("widget.0.logo_height").(int), + LogoHeight: data.Get("widget.0.logo_height").(float64), LogoPosition: data.Get("widget.0.logo_position").(string), LogoURL: data.Get("widget.0.logo_url").(string), SocialButtonsLayout: data.Get("widget.0.social_buttons_layout").(string), diff --git a/internal/provider/resource_auth0_branding_theme_test.go b/internal/provider/resource_auth0_branding_theme_test.go index 0bf49d375..ea15bc9d6 100644 --- a/internal/provider/resource_auth0_branding_theme_test.go +++ b/internal/provider/resource_auth0_branding_theme_test.go @@ -11,15 +11,15 @@ import ( const testAccBrandingThemeCreate = ` resource "auth0_branding_theme" "my_theme" { borders { - button_border_radius = 1 - button_border_weight = 1 + button_border_radius = 1.1 + button_border_weight = 1.34 buttons_style = "pill" - input_border_radius = 3 - input_border_weight = 1 + input_border_radius = 3.2 + input_border_weight = 1.99 inputs_style = "pill" show_widget_shadow = false - widget_border_weight = 1 - widget_corner_radius = 3 + widget_border_weight = 1.11 + widget_corner_radius = 3.57 } colors { @@ -44,36 +44,36 @@ resource "auth0_branding_theme" "my_theme" { fonts { font_url = "https://google.com/font.woff" links_style = "normal" - reference_text_size = 12 + reference_text_size = 12.5 body_text { bold = false - size = 100 + size = 99.5 } buttons_text { bold = false - size = 100 + size = 99.5 } input_labels { bold = false - size = 100 + size = 99.5 } links { bold = false - size = 100 + size = 99.5 } title { bold = false - size = 100 + size = 99.5 } subtitle { bold = false - size = 100 + size = 99.5 } } @@ -85,7 +85,7 @@ resource "auth0_branding_theme" "my_theme" { widget { header_text_alignment = "center" - logo_height = 55 + logo_height = 55.5 logo_position = "center" logo_url = "https://google.com/logo.png" social_buttons_layout = "top" @@ -193,15 +193,15 @@ func TestAccBrandingTheme(t *testing.T) { Config: testAccBrandingThemeCreate, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.#", "1"), - resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.button_border_radius", "1"), - resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.button_border_weight", "1"), + resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.button_border_radius", "1.1"), + resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.button_border_weight", "1.34"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.buttons_style", "pill"), - resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.input_border_radius", "3"), - resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.input_border_weight", "1"), + resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.input_border_radius", "3.2"), + resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.input_border_weight", "1.99"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.inputs_style", "pill"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.show_widget_shadow", "false"), - resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.widget_border_weight", "1"), - resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.widget_corner_radius", "3"), + resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.widget_border_weight", "1.11"), + resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "borders.0.widget_corner_radius", "3.57"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "colors.#", "1"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "colors.0.body_text", "#FF00CC"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "colors.0.error", "#FF00CC"), @@ -222,31 +222,32 @@ func TestAccBrandingTheme(t *testing.T) { resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.#", "1"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.font_url", "https://google.com/font.woff"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.links_style", "normal"), + resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.reference_text_size", "12.5"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.body_text.#", "1"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.body_text.0.bold", "false"), - resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.body_text.0.size", "100"), + resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.body_text.0.size", "99.5"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.buttons_text.#", "1"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.buttons_text.0.bold", "false"), - resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.buttons_text.0.size", "100"), + resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.buttons_text.0.size", "99.5"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.input_labels.#", "1"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.input_labels.0.bold", "false"), - resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.input_labels.0.size", "100"), + resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.input_labels.0.size", "99.5"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.links.#", "1"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.links.0.bold", "false"), - resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.links.0.size", "100"), + resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.links.0.size", "99.5"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.title.#", "1"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.title.0.bold", "false"), - resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.title.0.size", "100"), + resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.title.0.size", "99.5"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.subtitle.#", "1"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.subtitle.0.bold", "false"), - resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.subtitle.0.size", "100"), + resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "fonts.0.subtitle.0.size", "99.5"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "page_background.#", "1"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "page_background.0.background_color", "#000000"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "page_background.0.background_image_url", "https://google.com/background.png"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "page_background.0.page_layout", "center"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "widget.#", "1"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "widget.0.header_text_alignment", "center"), - resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "widget.0.logo_height", "55"), + resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "widget.0.logo_height", "55.5"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "widget.0.logo_position", "center"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "widget.0.logo_url", "https://google.com/logo.png"), resource.TestCheckResourceAttr("auth0_branding_theme.my_theme", "widget.0.social_buttons_layout", "top"), diff --git a/internal/provider/resource_auth0_client.go b/internal/provider/resource_auth0_client.go index 90686af84..117c49b8c 100644 --- a/internal/provider/resource_auth0_client.go +++ b/internal/provider/resource_auth0_client.go @@ -789,10 +789,10 @@ func readClient(ctx context.Context, d *schema.ResourceData, m interface{}) diag d.Set("refresh_token", flattenClientRefreshTokenConfiguration(client.GetRefreshToken())), d.Set("encryption_key", client.GetEncryptionKey()), d.Set("addons", flattenClientAddons(client.Addons)), - d.Set("client_metadata", client.GetClientMetadata()), d.Set("mobile", flattenClientMobile(client.GetMobile())), d.Set("initiate_login_uri", client.GetInitiateLoginURI()), d.Set("signing_keys", client.SigningKeys), + d.Set("client_metadata", client.ClientMetadata), ) return diag.FromErr(result.ErrorOrNil()) diff --git a/internal/provider/resource_auth0_client_test.go b/internal/provider/resource_auth0_client_test.go index e4882dd30..012f78439 100644 --- a/internal/provider/resource_auth0_client_test.go +++ b/internal/provider/resource_auth0_client_test.go @@ -976,3 +976,70 @@ func TestAccClientSSOIntegrationWithSAML(t *testing.T) { }, }) } + +func TestAccClientMetadataBehavior(t *testing.T) { + httpRecorder := recorder.New(t) + + resource.Test(t, resource.TestCase{ + ProviderFactories: testProviders(httpRecorder), + Steps: []resource.TestStep{ + { + Config: template.ParseTestName(` + resource "auth0_client" "my_client" { + name = "Acceptance Test - Metadata - {{.testName}}" + client_metadata = { + foo = "zoo" + bar = "baz" + } + }`, t.Name()), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_client.my_client", "name", fmt.Sprintf("Acceptance Test - Metadata - %s", t.Name())), + resource.TestCheckResourceAttr("auth0_client.my_client", "client_metadata.%", "2"), + resource.TestCheckResourceAttr("auth0_client.my_client", "client_metadata.foo", "zoo"), + resource.TestCheckResourceAttr("auth0_client.my_client", "client_metadata.bar", "baz"), + ), + }, + { + Config: template.ParseTestName(` + resource "auth0_client" "my_client" { + name = "Acceptance Test - Metadata - {{.testName}}" + client_metadata = { + foo = "newZooButOldFoo" + newBar = "newBaz" + } + }`, t.Name()), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_client.my_client", "name", fmt.Sprintf("Acceptance Test - Metadata - %s", t.Name())), + resource.TestCheckResourceAttr("auth0_client.my_client", "client_metadata.%", "2"), + resource.TestCheckResourceAttr("auth0_client.my_client", "client_metadata.foo", "newZooButOldFoo"), + resource.TestCheckResourceAttr("auth0_client.my_client", "client_metadata.newBar", "newBaz"), + ), + }, + { + Config: template.ParseTestName(` + resource "auth0_client" "my_client" { + name = "Acceptance Test - Metadata - {{.testName}}" + client_metadata = { + bar = "baz" + } + }`, t.Name()), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_client.my_client", "name", fmt.Sprintf("Acceptance Test - Metadata - %s", t.Name())), + resource.TestCheckResourceAttr("auth0_client.my_client", "client_metadata.%", "1"), + resource.TestCheckResourceAttr("auth0_client.my_client", "client_metadata.bar", "baz"), + ), + }, + { + Config: template.ParseTestName(` + resource "auth0_client" "my_client" { + name = "Acceptance Test - Metadata - {{.testName}}" + client_metadata = { } + }`, t.Name()), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr("auth0_client.my_client", "name", fmt.Sprintf("Acceptance Test - Metadata - %s", t.Name())), + resource.TestCheckResourceAttr("auth0_client.my_client", "client_metadata.%", "0"), + ), + }, + }, + }) +} diff --git a/internal/provider/structure_auth0_client.go b/internal/provider/structure_auth0_client.go index 3ae3e75ed..3d8e0f8d0 100644 --- a/internal/provider/structure_auth0_client.go +++ b/internal/provider/structure_auth0_client.go @@ -40,7 +40,7 @@ func expandClient(d *schema.ResourceData) *management.Client { TokenEndpointAuthMethod: value.String(config.GetAttr("token_endpoint_auth_method")), InitiateLoginURI: value.String(config.GetAttr("initiate_login_uri")), EncryptionKey: value.MapOfStrings(config.GetAttr("encryption_key")), - ClientMetadata: value.MapOfStrings(config.GetAttr("client_metadata")), + ClientMetadata: expandClientMetadata(d), RefreshToken: expandClientRefreshToken(d), JWTConfiguration: expandClientJWTConfiguration(d), Addons: expandClientAddons(d), @@ -205,6 +205,24 @@ func expandClientMobileIOS(iosConfig cty.Value) *management.ClientMobileIOS { return &ios } +func expandClientMetadata(d *schema.ResourceData) *map[string]interface{} { + if !d.HasChange("client_metadata") { + return nil + } + + oldMetadata, newMetadata := d.GetChange("client_metadata") + oldMetadataMap := oldMetadata.(map[string]interface{}) + newMetadataMap := newMetadata.(map[string]interface{}) + + for key := range oldMetadataMap { + if _, ok := newMetadataMap[key]; !ok { + newMetadataMap[key] = nil + } + } + + return &newMetadataMap +} + func expandClientAddons(d *schema.ResourceData) map[string]interface{} { if !d.HasChange("addons") { return nil diff --git a/test/data/recordings/TestAccBrandingTheme.yaml b/test/data/recordings/TestAccBrandingTheme.yaml index dcb3ed78c..f6aac86f0 100644 --- a/test/data/recordings/TestAccBrandingTheme.yaml +++ b/test/data/recordings/TestAccBrandingTheme.yaml @@ -6,14 +6,14 @@ interactions: proto: HTTP/1.1 proto_major: 1 proto_minor: 1 - content_length: 1301 + content_length: 1327 transfer_encoding: [ ] trailer: { } host: terraform-provider-auth0-dev.eu.auth0.com remote_addr: "" request_uri: "" body: | - {"borders":{"button_border_radius":1,"button_border_weight":1,"buttons_style":"pill","input_border_radius":3,"input_border_weight":1,"inputs_style":"pill","show_widget_shadow":false,"widget_border_weight":1,"widget_corner_radius":3},"colors":{"body_text":"#FF00CC","error":"#FF00CC","header":"#FF00CC","icons":"#FF00CC","input_background":"#FF00CC","input_border":"#FF00CC","input_filled_text":"#FF00CC","input_labels_placeholders":"#FF00CC","links_focused_components":"#FF00CC","primary_button":"#FF00CC","primary_button_label":"#FF00CC","secondary_button_border":"#FF00CC","secondary_button_label":"#FF00CC","success":"#FF00CC","widget_background":"#FF00CC","widget_border":"#FF00CC"},"fonts":{"body_text":{"bold":false,"size":100},"buttons_text":{"bold":false,"size":100},"font_url":"https://google.com/font.woff","input_labels":{"bold":false,"size":100},"links":{"bold":false,"size":100},"links_style":"normal","reference_text_size":12,"subtitle":{"bold":false,"size":100},"title":{"bold":false,"size":100}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"}} + {"borders":{"button_border_radius":1.1,"button_border_weight":1.34,"buttons_style":"pill","input_border_radius":3.2,"input_border_weight":1.99,"inputs_style":"pill","show_widget_shadow":false,"widget_border_weight":1.11,"widget_corner_radius":3.57},"colors":{"body_text":"#FF00CC","error":"#FF00CC","header":"#FF00CC","icons":"#FF00CC","input_background":"#FF00CC","input_border":"#FF00CC","input_filled_text":"#FF00CC","input_labels_placeholders":"#FF00CC","links_focused_components":"#FF00CC","primary_button":"#FF00CC","primary_button_label":"#FF00CC","secondary_button_border":"#FF00CC","secondary_button_label":"#FF00CC","success":"#FF00CC","widget_background":"#FF00CC","widget_border":"#FF00CC"},"fonts":{"body_text":{"bold":false,"size":99.5},"buttons_text":{"bold":false,"size":99.5},"font_url":"https://google.com/font.woff","input_labels":{"bold":false,"size":99.5},"links":{"bold":false,"size":99.5},"links_style":"normal","reference_text_size":12.5,"subtitle":{"bold":false,"size":99.5},"title":{"bold":false,"size":99.5}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55.5,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"}} form: { } headers: Content-Type: @@ -30,7 +30,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"borders":{"button_border_radius":1,"button_border_weight":1,"buttons_style":"pill","input_border_radius":3,"input_border_weight":1,"inputs_style":"pill","show_widget_shadow":false,"widget_border_weight":1,"widget_corner_radius":3},"colors":{"body_text":"#FF00CC","error":"#FF00CC","header":"#FF00CC","icons":"#FF00CC","input_background":"#FF00CC","input_border":"#FF00CC","input_filled_text":"#FF00CC","input_labels_placeholders":"#FF00CC","links_focused_components":"#FF00CC","primary_button":"#FF00CC","primary_button_label":"#FF00CC","secondary_button_border":"#FF00CC","secondary_button_label":"#FF00CC","success":"#FF00CC","widget_background":"#FF00CC","widget_border":"#FF00CC"},"fonts":{"body_text":{"bold":false,"size":100},"buttons_text":{"bold":false,"size":100},"font_url":"https://google.com/font.woff","input_labels":{"bold":false,"size":100},"links":{"bold":false,"size":100},"links_style":"normal","reference_text_size":12,"subtitle":{"bold":false,"size":100},"title":{"bold":false,"size":100}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"},"themeId":"qeoI4Y8ZYPqlOG9HbpSc0mFoBl9RD9V3"}' + body: '{"borders":{"button_border_radius":1.1,"button_border_weight":1.34,"buttons_style":"pill","input_border_radius":3.2,"input_border_weight":1.99,"inputs_style":"pill","show_widget_shadow":false,"widget_border_weight":1.11,"widget_corner_radius":3.57},"colors":{"body_text":"#FF00CC","error":"#FF00CC","header":"#FF00CC","icons":"#FF00CC","input_background":"#FF00CC","input_border":"#FF00CC","input_filled_text":"#FF00CC","input_labels_placeholders":"#FF00CC","links_focused_components":"#FF00CC","primary_button":"#FF00CC","primary_button_label":"#FF00CC","secondary_button_border":"#FF00CC","secondary_button_label":"#FF00CC","success":"#FF00CC","widget_background":"#FF00CC","widget_border":"#FF00CC"},"fonts":{"body_text":{"bold":false,"size":99.5},"buttons_text":{"bold":false,"size":99.5},"font_url":"https://google.com/font.woff","input_labels":{"bold":false,"size":99.5},"links":{"bold":false,"size":99.5},"links_style":"normal","reference_text_size":12.5,"subtitle":{"bold":false,"size":99.5},"title":{"bold":false,"size":99.5}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55.5,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"},"themeId":"w1BL2SDwg4oWU4F83iTVzESMzbmGFgf8"}' headers: Content-Type: - application/json; charset=utf-8 @@ -56,7 +56,7 @@ interactions: - application/json User-Agent: - Go-Auth0-SDK/latest - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/branding/themes/qeoI4Y8ZYPqlOG9HbpSc0mFoBl9RD9V3 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/branding/themes/w1BL2SDwg4oWU4F83iTVzESMzbmGFgf8 method: GET response: proto: HTTP/2.0 @@ -66,7 +66,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"borders":{"button_border_radius":1,"button_border_weight":1,"buttons_style":"pill","input_border_radius":3,"input_border_weight":1,"inputs_style":"pill","show_widget_shadow":false,"widget_border_weight":1,"widget_corner_radius":3},"colors":{"body_text":"#FF00CC","error":"#FF00CC","header":"#FF00CC","icons":"#FF00CC","input_background":"#FF00CC","input_border":"#FF00CC","input_filled_text":"#FF00CC","input_labels_placeholders":"#FF00CC","links_focused_components":"#FF00CC","primary_button":"#FF00CC","primary_button_label":"#FF00CC","secondary_button_border":"#FF00CC","secondary_button_label":"#FF00CC","success":"#FF00CC","widget_background":"#FF00CC","widget_border":"#FF00CC"},"fonts":{"body_text":{"bold":false,"size":100},"buttons_text":{"bold":false,"size":100},"font_url":"https://google.com/font.woff","input_labels":{"bold":false,"size":100},"links":{"bold":false,"size":100},"links_style":"normal","reference_text_size":12,"subtitle":{"bold":false,"size":100},"title":{"bold":false,"size":100}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"},"themeId":"qeoI4Y8ZYPqlOG9HbpSc0mFoBl9RD9V3"}' + body: '{"borders":{"button_border_radius":1.1,"button_border_weight":1.34,"buttons_style":"pill","input_border_radius":3.2,"input_border_weight":1.99,"inputs_style":"pill","show_widget_shadow":false,"widget_border_weight":1.11,"widget_corner_radius":3.57},"colors":{"body_text":"#FF00CC","error":"#FF00CC","header":"#FF00CC","icons":"#FF00CC","input_background":"#FF00CC","input_border":"#FF00CC","input_filled_text":"#FF00CC","input_labels_placeholders":"#FF00CC","links_focused_components":"#FF00CC","primary_button":"#FF00CC","primary_button_label":"#FF00CC","secondary_button_border":"#FF00CC","secondary_button_label":"#FF00CC","success":"#FF00CC","widget_background":"#FF00CC","widget_border":"#FF00CC"},"fonts":{"body_text":{"bold":false,"size":99.5},"buttons_text":{"bold":false,"size":99.5},"font_url":"https://google.com/font.woff","input_labels":{"bold":false,"size":99.5},"links":{"bold":false,"size":99.5},"links_style":"normal","reference_text_size":12.5,"subtitle":{"bold":false,"size":99.5},"title":{"bold":false,"size":99.5}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55.5,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"},"themeId":"w1BL2SDwg4oWU4F83iTVzESMzbmGFgf8"}' headers: Content-Type: - application/json; charset=utf-8 @@ -92,7 +92,7 @@ interactions: - application/json User-Agent: - Go-Auth0-SDK/latest - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/branding/themes/qeoI4Y8ZYPqlOG9HbpSc0mFoBl9RD9V3 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/branding/themes/w1BL2SDwg4oWU4F83iTVzESMzbmGFgf8 method: GET response: proto: HTTP/2.0 @@ -102,7 +102,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"borders":{"button_border_radius":1,"button_border_weight":1,"buttons_style":"pill","input_border_radius":3,"input_border_weight":1,"inputs_style":"pill","show_widget_shadow":false,"widget_border_weight":1,"widget_corner_radius":3},"colors":{"body_text":"#FF00CC","error":"#FF00CC","header":"#FF00CC","icons":"#FF00CC","input_background":"#FF00CC","input_border":"#FF00CC","input_filled_text":"#FF00CC","input_labels_placeholders":"#FF00CC","links_focused_components":"#FF00CC","primary_button":"#FF00CC","primary_button_label":"#FF00CC","secondary_button_border":"#FF00CC","secondary_button_label":"#FF00CC","success":"#FF00CC","widget_background":"#FF00CC","widget_border":"#FF00CC"},"fonts":{"body_text":{"bold":false,"size":100},"buttons_text":{"bold":false,"size":100},"font_url":"https://google.com/font.woff","input_labels":{"bold":false,"size":100},"links":{"bold":false,"size":100},"links_style":"normal","reference_text_size":12,"subtitle":{"bold":false,"size":100},"title":{"bold":false,"size":100}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"},"themeId":"qeoI4Y8ZYPqlOG9HbpSc0mFoBl9RD9V3"}' + body: '{"borders":{"button_border_radius":1.1,"button_border_weight":1.34,"buttons_style":"pill","input_border_radius":3.2,"input_border_weight":1.99,"inputs_style":"pill","show_widget_shadow":false,"widget_border_weight":1.11,"widget_corner_radius":3.57},"colors":{"body_text":"#FF00CC","error":"#FF00CC","header":"#FF00CC","icons":"#FF00CC","input_background":"#FF00CC","input_border":"#FF00CC","input_filled_text":"#FF00CC","input_labels_placeholders":"#FF00CC","links_focused_components":"#FF00CC","primary_button":"#FF00CC","primary_button_label":"#FF00CC","secondary_button_border":"#FF00CC","secondary_button_label":"#FF00CC","success":"#FF00CC","widget_background":"#FF00CC","widget_border":"#FF00CC"},"fonts":{"body_text":{"bold":false,"size":99.5},"buttons_text":{"bold":false,"size":99.5},"font_url":"https://google.com/font.woff","input_labels":{"bold":false,"size":99.5},"links":{"bold":false,"size":99.5},"links_style":"normal","reference_text_size":12.5,"subtitle":{"bold":false,"size":99.5},"title":{"bold":false,"size":99.5}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55.5,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"},"themeId":"w1BL2SDwg4oWU4F83iTVzESMzbmGFgf8"}' headers: Content-Type: - application/json; charset=utf-8 @@ -128,7 +128,7 @@ interactions: - application/json User-Agent: - Go-Auth0-SDK/latest - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/branding/themes/qeoI4Y8ZYPqlOG9HbpSc0mFoBl9RD9V3 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/branding/themes/w1BL2SDwg4oWU4F83iTVzESMzbmGFgf8 method: GET response: proto: HTTP/2.0 @@ -138,7 +138,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"borders":{"button_border_radius":1,"button_border_weight":1,"buttons_style":"pill","input_border_radius":3,"input_border_weight":1,"inputs_style":"pill","show_widget_shadow":false,"widget_border_weight":1,"widget_corner_radius":3},"colors":{"body_text":"#FF00CC","error":"#FF00CC","header":"#FF00CC","icons":"#FF00CC","input_background":"#FF00CC","input_border":"#FF00CC","input_filled_text":"#FF00CC","input_labels_placeholders":"#FF00CC","links_focused_components":"#FF00CC","primary_button":"#FF00CC","primary_button_label":"#FF00CC","secondary_button_border":"#FF00CC","secondary_button_label":"#FF00CC","success":"#FF00CC","widget_background":"#FF00CC","widget_border":"#FF00CC"},"fonts":{"body_text":{"bold":false,"size":100},"buttons_text":{"bold":false,"size":100},"font_url":"https://google.com/font.woff","input_labels":{"bold":false,"size":100},"links":{"bold":false,"size":100},"links_style":"normal","reference_text_size":12,"subtitle":{"bold":false,"size":100},"title":{"bold":false,"size":100}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"},"themeId":"qeoI4Y8ZYPqlOG9HbpSc0mFoBl9RD9V3"}' + body: '{"borders":{"button_border_radius":1.1,"button_border_weight":1.34,"buttons_style":"pill","input_border_radius":3.2,"input_border_weight":1.99,"inputs_style":"pill","show_widget_shadow":false,"widget_border_weight":1.11,"widget_corner_radius":3.57},"colors":{"body_text":"#FF00CC","error":"#FF00CC","header":"#FF00CC","icons":"#FF00CC","input_background":"#FF00CC","input_border":"#FF00CC","input_filled_text":"#FF00CC","input_labels_placeholders":"#FF00CC","links_focused_components":"#FF00CC","primary_button":"#FF00CC","primary_button_label":"#FF00CC","secondary_button_border":"#FF00CC","secondary_button_label":"#FF00CC","success":"#FF00CC","widget_background":"#FF00CC","widget_border":"#FF00CC"},"fonts":{"body_text":{"bold":false,"size":99.5},"buttons_text":{"bold":false,"size":99.5},"font_url":"https://google.com/font.woff","input_labels":{"bold":false,"size":99.5},"links":{"bold":false,"size":99.5},"links_style":"normal","reference_text_size":12.5,"subtitle":{"bold":false,"size":99.5},"title":{"bold":false,"size":99.5}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55.5,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"},"themeId":"w1BL2SDwg4oWU4F83iTVzESMzbmGFgf8"}' headers: Content-Type: - application/json; charset=utf-8 @@ -164,7 +164,7 @@ interactions: - application/json User-Agent: - Go-Auth0-SDK/latest - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/branding/themes/qeoI4Y8ZYPqlOG9HbpSc0mFoBl9RD9V3 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/branding/themes/w1BL2SDwg4oWU4F83iTVzESMzbmGFgf8 method: PATCH response: proto: HTTP/2.0 @@ -174,7 +174,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"displayName":"My branding","borders":{"button_border_radius":2,"button_border_weight":2,"buttons_style":"pill","input_border_radius":2,"input_border_weight":2,"inputs_style":"pill","show_widget_shadow":true,"widget_border_weight":2,"widget_corner_radius":2},"colors":{"base_focus_color":"#BBBBBB","base_hover_color":"#CCCCCC","body_text":"#00FF00","error":"#00FF00","header":"#00FF00","icons":"#00FF00","input_background":"#00FF00","input_border":"#00FF00","input_filled_text":"#00FF00","input_labels_placeholders":"#00FF00","links_focused_components":"#00FF00","primary_button":"#00FF00","primary_button_label":"#00FF00","secondary_button_border":"#00FF00","secondary_button_label":"#00FF00","success":"#00FF00","widget_background":"#00FF00","widget_border":"#00FF00"},"fonts":{"body_text":{"bold":true,"size":100},"buttons_text":{"bold":true,"size":100},"font_url":"https://google.com/font.woff","input_labels":{"bold":true,"size":100},"links":{"bold":true,"size":100},"links_style":"normal","reference_text_size":12,"subtitle":{"bold":true,"size":100},"title":{"bold":true,"size":100}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"},"themeId":"qeoI4Y8ZYPqlOG9HbpSc0mFoBl9RD9V3"}' + body: '{"displayName":"My branding","borders":{"button_border_radius":2,"button_border_weight":2,"buttons_style":"pill","input_border_radius":2,"input_border_weight":2,"inputs_style":"pill","show_widget_shadow":true,"widget_border_weight":2,"widget_corner_radius":2},"colors":{"base_focus_color":"#BBBBBB","base_hover_color":"#CCCCCC","body_text":"#00FF00","error":"#00FF00","header":"#00FF00","icons":"#00FF00","input_background":"#00FF00","input_border":"#00FF00","input_filled_text":"#00FF00","input_labels_placeholders":"#00FF00","links_focused_components":"#00FF00","primary_button":"#00FF00","primary_button_label":"#00FF00","secondary_button_border":"#00FF00","secondary_button_label":"#00FF00","success":"#00FF00","widget_background":"#00FF00","widget_border":"#00FF00"},"fonts":{"body_text":{"bold":true,"size":100},"buttons_text":{"bold":true,"size":100},"font_url":"https://google.com/font.woff","input_labels":{"bold":true,"size":100},"links":{"bold":true,"size":100},"links_style":"normal","reference_text_size":12,"subtitle":{"bold":true,"size":100},"title":{"bold":true,"size":100}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"},"themeId":"w1BL2SDwg4oWU4F83iTVzESMzbmGFgf8"}' headers: Content-Type: - application/json; charset=utf-8 @@ -200,7 +200,7 @@ interactions: - application/json User-Agent: - Go-Auth0-SDK/latest - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/branding/themes/qeoI4Y8ZYPqlOG9HbpSc0mFoBl9RD9V3 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/branding/themes/w1BL2SDwg4oWU4F83iTVzESMzbmGFgf8 method: GET response: proto: HTTP/2.0 @@ -210,7 +210,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"displayName":"My branding","borders":{"button_border_radius":2,"button_border_weight":2,"buttons_style":"pill","input_border_radius":2,"input_border_weight":2,"inputs_style":"pill","show_widget_shadow":true,"widget_border_weight":2,"widget_corner_radius":2},"colors":{"base_focus_color":"#BBBBBB","base_hover_color":"#CCCCCC","body_text":"#00FF00","error":"#00FF00","header":"#00FF00","icons":"#00FF00","input_background":"#00FF00","input_border":"#00FF00","input_filled_text":"#00FF00","input_labels_placeholders":"#00FF00","links_focused_components":"#00FF00","primary_button":"#00FF00","primary_button_label":"#00FF00","secondary_button_border":"#00FF00","secondary_button_label":"#00FF00","success":"#00FF00","widget_background":"#00FF00","widget_border":"#00FF00"},"fonts":{"body_text":{"bold":true,"size":100},"buttons_text":{"bold":true,"size":100},"font_url":"https://google.com/font.woff","input_labels":{"bold":true,"size":100},"links":{"bold":true,"size":100},"links_style":"normal","reference_text_size":12,"subtitle":{"bold":true,"size":100},"title":{"bold":true,"size":100}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"},"themeId":"qeoI4Y8ZYPqlOG9HbpSc0mFoBl9RD9V3"}' + body: '{"displayName":"My branding","borders":{"button_border_radius":2,"button_border_weight":2,"buttons_style":"pill","input_border_radius":2,"input_border_weight":2,"inputs_style":"pill","show_widget_shadow":true,"widget_border_weight":2,"widget_corner_radius":2},"colors":{"base_focus_color":"#BBBBBB","base_hover_color":"#CCCCCC","body_text":"#00FF00","error":"#00FF00","header":"#00FF00","icons":"#00FF00","input_background":"#00FF00","input_border":"#00FF00","input_filled_text":"#00FF00","input_labels_placeholders":"#00FF00","links_focused_components":"#00FF00","primary_button":"#00FF00","primary_button_label":"#00FF00","secondary_button_border":"#00FF00","secondary_button_label":"#00FF00","success":"#00FF00","widget_background":"#00FF00","widget_border":"#00FF00"},"fonts":{"body_text":{"bold":true,"size":100},"buttons_text":{"bold":true,"size":100},"font_url":"https://google.com/font.woff","input_labels":{"bold":true,"size":100},"links":{"bold":true,"size":100},"links_style":"normal","reference_text_size":12,"subtitle":{"bold":true,"size":100},"title":{"bold":true,"size":100}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"},"themeId":"w1BL2SDwg4oWU4F83iTVzESMzbmGFgf8"}' headers: Content-Type: - application/json; charset=utf-8 @@ -236,7 +236,7 @@ interactions: - application/json User-Agent: - Go-Auth0-SDK/latest - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/branding/themes/qeoI4Y8ZYPqlOG9HbpSc0mFoBl9RD9V3 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/branding/themes/w1BL2SDwg4oWU4F83iTVzESMzbmGFgf8 method: GET response: proto: HTTP/2.0 @@ -246,7 +246,7 @@ interactions: trailer: { } content_length: -1 uncompressed: true - body: '{"displayName":"My branding","borders":{"button_border_radius":2,"button_border_weight":2,"buttons_style":"pill","input_border_radius":2,"input_border_weight":2,"inputs_style":"pill","show_widget_shadow":true,"widget_border_weight":2,"widget_corner_radius":2},"colors":{"base_focus_color":"#BBBBBB","base_hover_color":"#CCCCCC","body_text":"#00FF00","error":"#00FF00","header":"#00FF00","icons":"#00FF00","input_background":"#00FF00","input_border":"#00FF00","input_filled_text":"#00FF00","input_labels_placeholders":"#00FF00","links_focused_components":"#00FF00","primary_button":"#00FF00","primary_button_label":"#00FF00","secondary_button_border":"#00FF00","secondary_button_label":"#00FF00","success":"#00FF00","widget_background":"#00FF00","widget_border":"#00FF00"},"fonts":{"body_text":{"bold":true,"size":100},"buttons_text":{"bold":true,"size":100},"font_url":"https://google.com/font.woff","input_labels":{"bold":true,"size":100},"links":{"bold":true,"size":100},"links_style":"normal","reference_text_size":12,"subtitle":{"bold":true,"size":100},"title":{"bold":true,"size":100}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"},"themeId":"qeoI4Y8ZYPqlOG9HbpSc0mFoBl9RD9V3"}' + body: '{"displayName":"My branding","borders":{"button_border_radius":2,"button_border_weight":2,"buttons_style":"pill","input_border_radius":2,"input_border_weight":2,"inputs_style":"pill","show_widget_shadow":true,"widget_border_weight":2,"widget_corner_radius":2},"colors":{"base_focus_color":"#BBBBBB","base_hover_color":"#CCCCCC","body_text":"#00FF00","error":"#00FF00","header":"#00FF00","icons":"#00FF00","input_background":"#00FF00","input_border":"#00FF00","input_filled_text":"#00FF00","input_labels_placeholders":"#00FF00","links_focused_components":"#00FF00","primary_button":"#00FF00","primary_button_label":"#00FF00","secondary_button_border":"#00FF00","secondary_button_label":"#00FF00","success":"#00FF00","widget_background":"#00FF00","widget_border":"#00FF00"},"fonts":{"body_text":{"bold":true,"size":100},"buttons_text":{"bold":true,"size":100},"font_url":"https://google.com/font.woff","input_labels":{"bold":true,"size":100},"links":{"bold":true,"size":100},"links_style":"normal","reference_text_size":12,"subtitle":{"bold":true,"size":100},"title":{"bold":true,"size":100}},"page_background":{"background_color":"#000000","background_image_url":"https://google.com/background.png","page_layout":"center"},"widget":{"header_text_alignment":"center","logo_height":55,"logo_position":"center","logo_url":"https://google.com/logo.png","social_buttons_layout":"top"},"themeId":"w1BL2SDwg4oWU4F83iTVzESMzbmGFgf8"}' headers: Content-Type: - application/json; charset=utf-8 @@ -271,7 +271,7 @@ interactions: - application/json User-Agent: - Go-Auth0-SDK/latest - url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/branding/themes/qeoI4Y8ZYPqlOG9HbpSc0mFoBl9RD9V3 + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/branding/themes/w1BL2SDwg4oWU4F83iTVzESMzbmGFgf8 method: DELETE response: proto: HTTP/2.0 diff --git a/test/data/recordings/TestAccClientMetadataBehavior.yaml b/test/data/recordings/TestAccClientMetadataBehavior.yaml new file mode 100644 index 000000000..e3a9d143c --- /dev/null +++ b/test/data/recordings/TestAccClientMetadataBehavior.yaml @@ -0,0 +1,578 @@ +--- +version: 2 +interactions: + - id: 0 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 114 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_metadata":{"bar":"baz","foo":"zoo"}} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients + method: POST + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: false + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{"bar":"baz","foo":"zoo"},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 201 Created + code: 201 + duration: 1ms + - id: 1 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{"bar":"baz","foo":"zoo"},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 2 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{"bar":"baz","foo":"zoo"},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 3 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{"bar":"baz","foo":"zoo"},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 4 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 143 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_metadata":{"bar":null,"foo":"newZooButOldFoo","newBar":"newBaz"}} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{"foo":"newZooButOldFoo","newBar":"newBaz"},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 5 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{"foo":"newZooButOldFoo","newBar":"newBaz"},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 6 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{"foo":"newZooButOldFoo","newBar":"newBaz"},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 7 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{"foo":"newZooButOldFoo","newBar":"newBaz"},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 8 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 127 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_metadata":{"bar":"baz","foo":null,"newBar":null}} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{"bar":"baz"},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 9 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{"bar":"baz"},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 10 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{"bar":"baz"},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 11 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{"bar":"baz"},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 12 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 101 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + {"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_metadata":{"bar":null}} + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: PATCH + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 13 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 14 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 5 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: | + null + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: GET + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: -1 + uncompressed: true + body: '{"name":"Acceptance Test - Metadata - TestAccClientMetadataBehavior","client_id":"HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV","client_secret":"[REDACTED]","is_first_party":true,"is_token_endpoint_ip_header_trusted":false,"oidc_conformant":false,"jwt_configuration":{"secret_encoded":false,"lifetime_in_seconds":36000},"signing_keys":[{"cert":"[REDACTED]"}],"sso_disabled":false,"cross_origin_auth":false,"grant_types":["authorization_code","implicit","refresh_token","client_credentials"],"custom_login_page_on":true,"client_metadata":{},"refresh_token":{"rotation_type":"non-rotating","expiration_type":"non-expiring","leeway":0,"token_lifetime":2592000,"infinite_token_lifetime":true,"infinite_idle_token_lifetime":true,"idle_token_lifetime":1296000}}' + headers: + Content-Type: + - application/json; charset=utf-8 + status: 200 OK + code: 200 + duration: 1ms + - id: 15 + request: + proto: HTTP/1.1 + proto_major: 1 + proto_minor: 1 + content_length: 0 + transfer_encoding: [ ] + trailer: { } + host: terraform-provider-auth0-dev.eu.auth0.com + remote_addr: "" + request_uri: "" + body: "" + form: { } + headers: + Content-Type: + - application/json + User-Agent: + - Go-Auth0-SDK/latest + url: https://terraform-provider-auth0-dev.eu.auth0.com/api/v2/clients/HbMthbbrdYM0QhRr4ef07GAOdzMaRkMV + method: DELETE + response: + proto: HTTP/2.0 + proto_major: 2 + proto_minor: 0 + transfer_encoding: [ ] + trailer: { } + content_length: 0 + uncompressed: false + body: "" + headers: + Content-Type: + - application/json; charset=utf-8 + status: 204 No Content + code: 204 + duration: 1ms