Skip to content

Commit 281aa68

Browse files
authored
Merge pull request #5862 from cloudflare/tamas/zero_trust_access_identity_provider
chore: modernize zero_trust_access_identity_provider tests
2 parents e6ea011 + 41e5d14 commit 281aa68

7 files changed

+587
-87
lines changed

internal/services/zero_trust_access_identity_provider/resource_test.go

Lines changed: 502 additions & 87 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
resource "cloudflare_zero_trust_access_identity_provider" "%[2]s" {
2+
account_id = "%[1]s"
3+
name = "%[2]s"
4+
type = "azureAD"
5+
config = {
6+
client_id = "test"
7+
client_secret = "test"
8+
directory_id = "directory"
9+
support_groups = true
10+
conditional_access_enabled = true
11+
prompt = "select_account"
12+
}
13+
scim_config = {
14+
enabled = true
15+
seat_deprovision = true
16+
user_deprovision = true
17+
identity_update_behavior = "automatic"
18+
}
19+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
resource "cloudflare_zero_trust_access_identity_provider" "%[2]s" {
2+
account_id = "%[1]s"
3+
name = "%[2]s"
4+
type = "oauth2"
5+
config = {
6+
client_id = "test"
7+
client_secret = "secret"
8+
auth_url = "https://example.com/auth"
9+
token_url = "https://example.com/token"
10+
certs_url = "https://example.com/certs"
11+
scopes = ["openid", "profile", "email"]
12+
pkce_enabled = true
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
resource "cloudflare_zero_trust_access_identity_provider" "%[2]s" {
2+
account_id = "%[1]s"
3+
name = "%[2]s"
4+
type = "github"
5+
config = {
6+
client_id = "test"
7+
client_secret = "secret"
8+
scopes = ["user:email", "read:user"]
9+
support_groups = true
10+
}
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
resource "cloudflare_zero_trust_access_identity_provider" "%[2]s" {
2+
account_id = "%[1]s"
3+
name = "%[2]s"
4+
type = "github"
5+
config = {
6+
client_id = "test"
7+
client_secret = "secret"
8+
}
9+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
resource "cloudflare_zero_trust_access_identity_provider" "%[2]s" {
2+
account_id = "%[1]s"
3+
name = "%[2]s"
4+
type = "okta"
5+
config = {
6+
client_id = "test"
7+
client_secret = "secret"
8+
okta_account = "example.okta.com"
9+
authorization_server_id = "default"
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
resource "cloudflare_zero_trust_access_identity_provider" "%[2]s" {
2+
account_id = "%[1]s"
3+
name = "%[2]s"
4+
type = "saml"
5+
config = {
6+
issuer_url = "jumpcloud"
7+
sso_target_url = "https://sso.myexample.jumpcloud.com/saml2/cloudflareaccess"
8+
attributes = ["email", "username", "groups"]
9+
email_attribute_name = "email"
10+
sign_request = true
11+
idp_public_certs = [
12+
"MIIDpDCCAoygAwIBAgIGAV2ka+55MA0GCSqGSIb3DQEBCwUAMIGSMQswCQYDVQQGEwJVUzETMBEG\nA1UEC…..GF/Q2/MHadws97cZg\nuTnQyuOqPuHbnN83d/2l1NSYKCbHt24o"
13+
]
14+
header_attributes = [
15+
{
16+
attribute_name = "department"
17+
header_name = "X-Department"
18+
}
19+
]
20+
}
21+
}

0 commit comments

Comments
 (0)