Skip to content

Commit 2491d6b

Browse files
feat: added disabled_user_signup and disabled_user_deletion to google_identity_platform_tenant
1 parent cb5af1b commit 2491d6b

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

mmv1/products/identityplatform/Tenant.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ base_url: 'projects/{{project}}/tenants'
2727
self_link: 'projects/{{project}}/tenants/{{name}}'
2828
update_verb: 'PATCH'
2929
update_mask: true
30+
immutable: false
3031
timeouts:
3132
insert_minutes: 20
3233
update_minutes: 20
@@ -63,3 +64,23 @@ properties:
6364
Whether authentication is disabled for the tenant. If true, the users under
6465
the disabled tenant are not allowed to sign-in. Admins of the disabled tenant
6566
are not able to manage its users.
67+
- name: 'client'
68+
type: NestedObject
69+
description: |
70+
Options related to how clients making requests on behalf of a tenant should be configured.
71+
properties:
72+
- name: 'permissions'
73+
type: NestedObject
74+
description: |
75+
Configuration related to restricting a user's ability to affect their account.
76+
properties:
77+
- name: 'disabledUserSignup'
78+
type: Boolean
79+
description: |
80+
When true, end users cannot sign up for a new account on the associated project through any of our API methods.
81+
default_from_api: true
82+
- name: 'disabledUserDeletion'
83+
type: Boolean
84+
description: |
85+
When true, end users cannot delete their account on the associated project through any of our API methods.
86+
default_from_api: true

mmv1/third_party/terraform/services/identityplatform/resource_identity_platform_tenant_test.go

+20
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"testing"
55

66
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
7+
"github.com/hashicorp/terraform-plugin-testing/plancheck"
78
"github.com/hashicorp/terraform-provider-google/google/acctest"
89
)
910

@@ -29,6 +30,19 @@ func TestAccIdentityPlatformTenant_identityPlatformTenantUpdate(t *testing.T) {
2930
},
3031
{
3132
Config: testAccIdentityPlatformTenant_identityPlatformTenantUpdate(context),
33+
ConfigPlanChecks: resource.ConfigPlanChecks{
34+
PreApply: []plancheck.PlanCheck{
35+
plancheck.ExpectResourceAction("google_identity_platform_tenant.tenant", plancheck.ResourceActionUpdate),
36+
},
37+
},
38+
Check: resource.ComposeTestCheckFunc(
39+
resource.TestCheckResourceAttr("google_identity_platform_tenant.tenant", "display_name", "my-tenant"),
40+
resource.TestCheckResourceAttr("google_identity_platform_tenant.tenant", "allow_password_signup", "false"),
41+
resource.TestCheckResourceAttr("google_identity_platform_tenant.tenant", "enable_email_link_signin", "true"),
42+
resource.TestCheckResourceAttr("google_identity_platform_tenant.tenant", "disable_auth", "true"),
43+
resource.TestCheckResourceAttr("google_identity_platform_tenant.tenant", "client.0.permissions.0.disabled_user_signup", "true"),
44+
resource.TestCheckResourceAttr("google_identity_platform_tenant.tenant", "client.0.permissions.0.disabled_user_deletion", "true"),
45+
),
3246
},
3347
{
3448
ResourceName: "google_identity_platform_tenant.tenant",
@@ -55,6 +69,12 @@ resource "google_identity_platform_tenant" "tenant" {
5569
allow_password_signup = false
5670
enable_email_link_signin = true
5771
disable_auth = true
72+
client {
73+
permissions {
74+
disabled_user_signup = true
75+
disabled_user_deletion = true
76+
}
77+
}
5878
}
5979
`, context)
6080
}

0 commit comments

Comments
 (0)