-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add client, permissions, monitoring and mfa configs to google_identity_platform_config #9609
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
Changes from 15 commits
5eee1c1
856eb7b
3446233
f34a790
9446996
b87359f
48d79ad
e59629d
5d3806f
6aef458
273cb66
d04011e
b3752a0
0677465
b9715bd
b92edbc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
func flatten<%= prefix -%><%= titlelize_property(property) -%>(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} { | ||
if v == nil { | ||
return nil | ||
} | ||
|
||
original := v.(map[string]interface{}) | ||
transformed := make(map[string]interface{}) | ||
|
||
if original["disabledUserSignup"] == nil { | ||
transformed["disabled_user_signup"] = false | ||
} else { | ||
transformed["disabled_user_signup"] = original["disabledUserSignup"] | ||
} | ||
|
||
if original["disabledUserDeletion"] == nil { | ||
transformed["disabled_user_deletion"] = false | ||
} else { | ||
transformed["disabled_user_deletion"] = original["disabledUserDeletion"] | ||
} | ||
|
||
return []interface{}{transformed} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
func flatten<%= prefix -%><%= titlelize_property(property) -%>(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} { | ||
if v == nil { | ||
return nil | ||
} | ||
|
||
original := v.(map[string]interface{}) | ||
transformed := make(map[string]interface{}) | ||
|
||
if original["enabled"] == nil { | ||
transformed["enabled"] = false | ||
} else { | ||
transformed["enabled"] = original["enabled"] | ||
} | ||
|
||
return []interface{}{transformed} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,17 +29,19 @@ func TestAccIdentityPlatformConfig_update(t *testing.T) { | |
Config: testAccIdentityPlatformConfig_basic(context), | ||
}, | ||
{ | ||
ResourceName: "google_identity_platform_config.basic", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ResourceName: "google_identity_platform_config.basic", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{"client", "mfa", "monitoring"}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need ignore state verify here? If these are default_from_api it should just accept the server's value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed/or at least reduced to the outputs.
I'm not sure where this comes from but the actual expected is returned from the API therefor excluding this was my solution but happy to learn how to properly fix this |
||
}, | ||
{ | ||
Config: testAccIdentityPlatformConfig_update(context), | ||
}, | ||
{ | ||
ResourceName: "google_identity_platform_config.basic", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ResourceName: "google_identity_platform_config.basic", | ||
ImportState: true, | ||
ImportStateVerify: true, | ||
ImportStateVerifyIgnore: []string{"client", "mfa", "monitoring"}, | ||
}, | ||
}, | ||
}) | ||
|
@@ -90,6 +92,35 @@ resource "google_identity_platform_config" "basic" { | |
] | ||
} | ||
} | ||
|
||
client { | ||
permissions { | ||
disabled_user_deletion = true | ||
disabled_user_signup = true | ||
} | ||
} | ||
|
||
mfa { | ||
enabled_providers = ["PHONE_SMS"] | ||
provider_configs { | ||
state = "ENABLED" | ||
totp_provider_config { | ||
adjacent_intervals = 3 | ||
} | ||
} | ||
state = "ENABLED" | ||
} | ||
|
||
monitoring { | ||
request_logging { | ||
enabled = true | ||
} | ||
} | ||
|
||
multi_tenant { | ||
allow_tenants = true | ||
default_tenant_location = "organizations/%{org_id}" | ||
} | ||
} | ||
`, context) | ||
} | ||
|
@@ -138,6 +169,23 @@ resource "google_identity_platform_config" "basic" { | |
] | ||
} | ||
} | ||
|
||
client { | ||
permissions { | ||
disabled_user_deletion = false | ||
disabled_user_signup = false | ||
} | ||
} | ||
slevenick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
mfa { | ||
enabled_providers = ["PHONE_SMS"] | ||
state = "DISABLED" | ||
} | ||
monitoring { | ||
request_logging { | ||
enabled = false | ||
} | ||
} | ||
slevenick marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
`, context) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't need ignore_read_extra for output-only values I think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above:
without the ingore read for the outputs the test fails: (This also feels a little bit flaky not happening every time but regularly)