Skip to content

Commit

Permalink
Fix identity platform default_supported_idp_config idp_id (#2969)
Browse files Browse the repository at this point in the history
Merged PR #2969.
  • Loading branch information
slevenick authored and modular-magician committed Jan 14, 2020
1 parent a9899a8 commit 142ec17
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build/inspec
Submodule inspec updated 0 files
2 changes: 1 addition & 1 deletion build/terraform
2 changes: 1 addition & 1 deletion build/terraform-beta
66 changes: 60 additions & 6 deletions products/identityplatform/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ objects:
- !ruby/object:Api::Resource
name: 'DefaultSupportedIdpConfig'
base_url: 'projects/{{project}}/defaultSupportedIdpConfigs'
self_link: 'projects/{{project}}/defaultSupportedIdpConfigs/{{client_id}}'
create_url: 'projects/{{project}}/defaultSupportedIdpConfigs?idpId={{client_id}}'
self_link: 'projects/{{project}}/defaultSupportedIdpConfigs/{{idp_id}}'
create_url: 'projects/{{project}}/defaultSupportedIdpConfigs?idpId={{idp_id}}'
update_verb: :PATCH
update_mask: true
description: |
Expand All @@ -46,11 +46,38 @@ objects:
output: true
description: |
The name of the DefaultSupportedIdpConfig resource
- !ruby/object:Api::Type::String
name: 'idpId'
description: |
ID of the IDP. Possible values include:
* `apple.com`
* `facebook.com`
* `gc.apple.com`
* `github.com`
* `google.com`
* `linkedin.com`
* `microsoft.com`
* `playgames.google.com`
* `twitter.com`
* `yahoo.com`
input: true
url_param_only: true
required: true
- !ruby/object:Api::Type::String
name: 'clientId'
description: |
OAuth client ID
input: true
required: true
- !ruby/object:Api::Type::String
name: 'clientSecret'
Expand All @@ -64,8 +91,8 @@ objects:
- !ruby/object:Api::Resource
name: 'TenantDefaultSupportedIdpConfig'
base_url: 'projects/{{project}}/tenants/{{tenant}}/defaultSupportedIdpConfigs'
self_link: 'projects/{{project}}/tenants/{{tenant}}/defaultSupportedIdpConfigs/{{client_id}}'
create_url: 'projects/{{project}}/tenants/{{tenant}}/defaultSupportedIdpConfigs?idpId={{client_id}}'
self_link: 'projects/{{project}}/tenants/{{tenant}}/defaultSupportedIdpConfigs/{{idp_id}}'
create_url: 'projects/{{project}}/tenants/{{tenant}}/defaultSupportedIdpConfigs?idpId={{idp_id}}'
update_verb: :PATCH
update_mask: true
description: |
Expand All @@ -80,6 +107,34 @@ objects:
output: true
description: |
The name of the default supported IDP config resource
- !ruby/object:Api::Type::String
name: 'idpId'
description: |
ID of the IDP. Possible values include:
* `apple.com`
* `facebook.com`
* `gc.apple.com`
* `github.com`
* `google.com`
* `linkedin.com`
* `microsoft.com`
* `playgames.google.com`
* `twitter.com`
* `yahoo.com`
input: true
url_param_only: true
required: true
- !ruby/object:Api::Type::String
name: 'tenant'
required: true
Expand All @@ -89,7 +144,6 @@ objects:
The name of the tenant where this DefaultSupportedIdpConfig resource exists
- !ruby/object:Api::Type::String
name: 'clientId'
input: true
required: true
description: |
OAuth client ID
Expand Down
4 changes: 2 additions & 2 deletions products/identityplatform/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
--- !ruby/object:Provider::Terraform::Config
overrides: !ruby/object:Overrides::ResourceOverrides
DefaultSupportedIdpConfig: !ruby/object:Overrides::Terraform::ResourceOverride
import_format: ["projects/{{project}}/defaultSupportedIdpConfigs/{{client_id}}"]
import_format: ["projects/{{project}}/defaultSupportedIdpConfigs/{{idp_id}}"]
examples:
- !ruby/object:Provider::Terraform::Examples
name: "identity_platform_default_supported_idp_config_basic"
Expand All @@ -23,7 +23,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides
# If we could spin up a project and enable identity platform we could test this separately
skip_test: true
TenantDefaultSupportedIdpConfig: !ruby/object:Overrides::Terraform::ResourceOverride
import_format: ["projects/{{project}}/tenants/{{tenant}}/defaultSupportedIdpConfigs/{{client_id}}"]
import_format: ["projects/{{project}}/tenants/{{tenant}}/defaultSupportedIdpConfigs/{{idp_id}}"]
examples:
- !ruby/object:Provider::Terraform::Examples
name: "identity_platform_tenant_default_supported_idp_config_basic"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
resource "google_identity_platform_default_supported_idp_config" "<%= ctx[:primary_resource_id] %>" {
enabled = true
client_id = "playgames.google.com"
idp_id = "playgames.google.com"
client_id = "client-id"
client_secret = "secret"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resource "google_identity_platform_tenant" "tenant" {
resource "google_identity_platform_tenant_default_supported_idp_config" "<%= ctx[:primary_resource_id] %>" {
enabled = true
tenant = google_identity_platform_tenant.tenant.name
client_id = "playgames.google.com"
idp_id = "playgames.google.com"
client_id = "my-client-id"
client_secret = "secret"
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ func testAccIdentityPlatformDefaultSupportedIdpConfig_defaultSupportedIdpConfigB
return Nprintf(`
resource "google_identity_platform_default_supported_idp_config" "idp_config" {
enabled = true
client_id = "playgames.google.com"
idp_id = "playgames.google.com"
client_id = "client-id"
client_secret = "secret"
}
`, context)
Expand All @@ -81,7 +82,8 @@ func testAccIdentityPlatformDefaultSupportedIdpConfig_defaultSupportedIdpConfigU
return Nprintf(`
resource "google_identity_platform_default_supported_idp_config" "idp_config" {
enabled = false
client_id = "playgames.google.com"
idp_id = "playgames.google.com"
client_id = "client-id"
client_secret = "anothersecret"
}
`, context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ resource "google_identity_platform_tenant" "tenant" {
resource "google_identity_platform_tenant_default_supported_idp_config" "idp_config" {
enabled = true
tenant = google_identity_platform_tenant.tenant.name
client_id = "playgames.google.com"
idp_id = "playgames.google.com"
client_id = "client-id"
client_secret = "secret"
}
`, context)
Expand All @@ -65,7 +66,8 @@ resource "google_identity_platform_tenant" "tenant" {
resource "google_identity_platform_tenant_default_supported_idp_config" "idp_config" {
enabled = false
tenant = google_identity_platform_tenant.tenant.name
client_id = "playgames.google.com"
idp_id = "playgames.google.com"
client_id = "client-id2"
client_secret = "differentsecret"
}
`, context)
Expand Down

0 comments on commit 142ec17

Please sign in to comment.