-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v1' into feature/DXCDT-492-rp-logout-tenant
- Loading branch information
Showing
7 changed files
with
2,295 additions
and
1,441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,32 @@ resource "auth0_email_provider" "sendgrid_email_provider" { | |
api_key = "secretAPIKey" | ||
} | ||
} | ||
# This is an example on how to set up the email provider with Azure CS. | ||
resource "auth0_email_provider" "smtp_email_provider" { | ||
name = "azure_cs" | ||
enabled = true | ||
default_from_address = "[email protected]" | ||
credentials { | ||
azure_cs_connection_string = "azure_cs_connection_string" | ||
} | ||
} | ||
# This is an example on how to set up the email provider with MS365. | ||
resource "auth0_email_provider" "smtp_email_provider" { | ||
name = "ms365" | ||
enabled = true | ||
default_from_address = "[email protected]" | ||
credentials { | ||
ms365_tenant_id = "ms365_tenant_id" | ||
ms365_client_id = "ms365_client_id" | ||
ms365_client_secret = "ms365_client_secret" | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
|
@@ -57,7 +83,7 @@ resource "auth0_email_provider" "sendgrid_email_provider" { | |
|
||
- `credentials` (Block List, Min: 1, Max: 1) Configuration settings for the credentials for the email provider. (see [below for nested schema](#nestedblock--credentials)) | ||
- `default_from_address` (String) Email address to use as the sender when no other "from" address is specified. | ||
- `name` (String) Name of the email provider. Options include `mailgun`, `mandrill`, `sendgrid`, `ses`, `smtp`, and `sparkpost`. | ||
- `name` (String) Name of the email provider. Options include `azure_cs`, `mailgun`, `mandrill`, `ms365`, `sendgrid`, `ses`, `smtp` and `sparkpost`. | ||
|
||
### Optional | ||
|
||
|
@@ -75,7 +101,11 @@ Optional: | |
|
||
- `access_key_id` (String, Sensitive) AWS Access Key ID. Used only for AWS. | ||
- `api_key` (String, Sensitive) API Key for your email service. Will always be encrypted in our database. | ||
- `azure_cs_connection_string` (String, Sensitive) Azure Communication Services Connection String. | ||
- `domain` (String) Domain name. | ||
- `ms365_client_id` (String, Sensitive) Microsoft 365 Client ID. | ||
- `ms365_client_secret` (String, Sensitive) Microsoft 365 Client Secret. | ||
- `ms365_tenant_id` (String, Sensitive) Microsoft 365 Tenant ID. | ||
- `region` (String) Default region. Used only for AWS, Mailgun, and SparkPost. | ||
- `secret_access_key` (String, Sensitive) AWS Secret Key. Will always be encrypted in our database. Used only for AWS. | ||
- `smtp_host` (String) Hostname or IP address of your SMTP server. Used only for SMTP. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,29 @@ resource "auth0_email_provider" "sendgrid_email_provider" { | |
api_key = "secretAPIKey" | ||
} | ||
} | ||
|
||
|
||
# This is an example on how to set up the email provider with Azure CS. | ||
resource "auth0_email_provider" "smtp_email_provider" { | ||
name = "azure_cs" | ||
enabled = true | ||
default_from_address = "[email protected]" | ||
|
||
credentials { | ||
azure_cs_connection_string = "azure_cs_connection_string" | ||
} | ||
} | ||
|
||
|
||
# This is an example on how to set up the email provider with MS365. | ||
resource "auth0_email_provider" "smtp_email_provider" { | ||
name = "ms365" | ||
enabled = true | ||
default_from_address = "[email protected]" | ||
|
||
credentials { | ||
ms365_tenant_id = "ms365_tenant_id" | ||
ms365_client_id = "ms365_client_id" | ||
ms365_client_secret = "ms365_client_secret" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,6 +126,54 @@ resource "auth0_email_provider" "my_email_provider" { | |
} | ||
` | ||
|
||
const testAccCreateAzureCSEmailProvider = ` | ||
resource "auth0_email_provider" "my_email_provider" { | ||
name = "azure_cs" | ||
enabled = true | ||
default_from_address = "[email protected]" | ||
credentials { | ||
azure_cs_connection_string = "azure_cs_connection_string" | ||
} | ||
} | ||
` | ||
|
||
const testAccUpdateAzureCSEmailProvider = ` | ||
resource "auth0_email_provider" "my_email_provider" { | ||
name = "azure_cs" | ||
enabled = false | ||
default_from_address = "" | ||
credentials { | ||
azure_cs_connection_string = "azure_cs_updated_connection_string" | ||
} | ||
} | ||
` | ||
|
||
const testAccCreateMS365EmailProvider = ` | ||
resource "auth0_email_provider" "my_email_provider" { | ||
name = "ms365" | ||
enabled = true | ||
default_from_address = "[email protected]" | ||
credentials { | ||
ms365_tenant_id = "ms365_tenant_id" | ||
ms365_client_id = "ms365_client_id" | ||
ms365_client_secret = "ms365_client_secret" | ||
} | ||
} | ||
` | ||
|
||
const testAccUpdateMS365EmailProvider = ` | ||
resource "auth0_email_provider" "my_email_provider" { | ||
name = "ms365" | ||
enabled = false | ||
default_from_address = "" | ||
credentials { | ||
ms365_tenant_id = "ms365_updated_tenant_id" | ||
ms365_client_id = "ms365_updated_client_id" | ||
ms365_client_secret = "ms365_updated_client_secret" | ||
} | ||
} | ||
` | ||
|
||
const testAccAlreadyConfiguredEmailProviderWillNotConflict = ` | ||
resource "auth0_email_provider" "my_email_provider" { | ||
name = "mailgun" | ||
|
@@ -255,6 +303,46 @@ func TestAccEmail(t *testing.T) { | |
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "credentials.0.region", "eu"), | ||
), | ||
}, | ||
{ | ||
Config: testAccCreateAzureCSEmailProvider, | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "name", "azure_cs"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "enabled", "true"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "default_from_address", "[email protected]"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "credentials.0.azure_cs_connection_string", "azure_cs_connection_string"), | ||
), | ||
}, | ||
{ | ||
Config: testAccUpdateAzureCSEmailProvider, | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "name", "azure_cs"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "enabled", "false"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "default_from_address", ""), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "credentials.0.azure_cs_connection_string", "azure_cs_updated_connection_string"), | ||
), | ||
}, | ||
{ | ||
Config: testAccCreateMS365EmailProvider, | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "name", "ms365"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "enabled", "true"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "default_from_address", "[email protected]"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "credentials.0.ms365_tenant_id", "ms365_tenant_id"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "credentials.0.ms365_client_id", "ms365_client_id"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "credentials.0.ms365_client_secret", "ms365_client_secret"), | ||
), | ||
}, | ||
{ | ||
Config: testAccUpdateMS365EmailProvider, | ||
Check: resource.ComposeTestCheckFunc( | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "name", "ms365"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "enabled", "false"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "default_from_address", ""), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "credentials.0.ms365_tenant_id", "ms365_updated_tenant_id"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "credentials.0.ms365_client_id", "ms365_updated_client_id"), | ||
resource.TestCheckResourceAttr("auth0_email_provider.my_email_provider", "credentials.0.ms365_client_secret", "ms365_updated_client_secret"), | ||
), | ||
}, | ||
{ | ||
Config: testAccAlreadyConfiguredEmailProviderWillNotConflict, | ||
Check: resource.ComposeTestCheckFunc( | ||
|
Oops, something went wrong.