Skip to content

Commit

Permalink
Add BlockingFunctionsConfig, RecaptchaConfig and QuotaConfig fields t…
Browse files Browse the repository at this point in the history
…o identityplatform config (hashicorp#8402)

* Add Add BlockingFunctionsConfig, AuthorizedDomains and QuotaConfig fields to Config.yaml

* adding new fields to identity_platform_config_basic.tf.erb

* Update Config.yaml

Temporarily enable VCR to run the tests. Also, provide a more user's friendly desc for the quota field.

* Fix the failing test

* Update Config.yaml

Fix the quota start_time format.

* Attempt 2: Fix the failing test

* Update Config.yaml Enabling VCR.

* Update Config.yaml

Re-enable skip_vcr due to hashicorp/terraform-provider-google#14158.

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician committed Jul 28, 2023
1 parent ffd4d8f commit 99abd10
Show file tree
Hide file tree
Showing 4 changed files with 575 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .changelog/8402.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
identityplayform: added support for `blocking_functions` `quota` and `authorized_domains` in `google_identity_platform_config`
```
31 changes: 28 additions & 3 deletions google-beta/resource_identity_platform_config_generated_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package google

import (
"testing"
"time"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"

Expand All @@ -31,9 +32,10 @@ func TestAccIdentityPlatformConfig_identityPlatformConfigBasicExample(t *testing
t.Parallel()

context := map[string]interface{}{
"org_id": envvar.GetTestOrgFromEnv(t),
"billing_acct": envvar.GetTestBillingAccountFromEnv(t),
"random_suffix": acctest.RandString(t, 10),
"org_id": envvar.GetTestOrgFromEnv(t),
"billing_acct": envvar.GetTestBillingAccountFromEnv(t),
"quota_start_time": time.Now().AddDate(0, 0, 1).Format(time.RFC3339),
"random_suffix": acctest.RandString(t, 10),
}

acctest.VcrTest(t, resource.TestCase{
Expand Down Expand Up @@ -73,6 +75,29 @@ resource "google_project_service" "identitytoolkit" {
resource "google_identity_platform_config" "default" {
project = google_project.default.project_id
autodelete_anonymous_users = true
blocking_functions {
triggers {
event_type = "beforeSignIn"
function_uri = "https://us-east1-tf-test-my-project%{random_suffix}.cloudfunctions.net/before-sign-in"
}
forward_inbound_credentials {
refresh_token = true
access_token = true
id_token = true
}
}
quota {
sign_up_quota_config {
quota = 1000
start_time = "%{quota_start_time}"
quota_duration = "7200s"
}
}
authorized_domains = [
"localhost",
"tf-test-my-project%{random_suffix}.firebaseapp.com",
"tf-test-my-project%{random_suffix}.web.app",
]
}
`, context)
}
Loading

0 comments on commit 99abd10

Please sign in to comment.