Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs & unit tests related to prompt_screen_renderer #1101

Merged
merged 3 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/resources/prompt_screen_renderer.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
page_title: "Resource: auth0_prompt_screen_renderer"
description: |-
With this resource, you can Configure the render settings for a specific screen.You can read more about this.
With this resource, you can Configure the render settings for a specific screen.You can read more about this here https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens.
---

# Resource: auth0_prompt_screen_renderer

With this resource, you can Configure the render settings for a specific screen.You can read more about this.
With this resource, you can Configure the render settings for a specific screen.You can read more about this [here](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens).

## Example Usage

Expand Down Expand Up @@ -57,8 +57,8 @@ resource "auth0_prompt_screen_renderer" "prompt_screen_renderer" {

### Required

- `prompt_type` (String) The prompt that you are configuring settings for. Options are: `signup-id`, `signup`, `signup-password`, `login`, `login-id`, `login-password`, `login-passwordless`, `login-email-verification`, `phone-identifier-enrollment`, `phone-identifier-challenge`, `email-identifier-challenge`, `reset-password`, `custom-form`, `consent`, `customized-consent`, `logout`, `mfa-push`, `mfa-otp`, `mfa-voice`, `mfa-phone`, `mfa-webauthn`, `mfa-sms`, `mfa-email`, `mfa-recovery-code`, `mfa`, `status`, `device-flow`, `email-verification`, `email-otp-challenge`, `organizations`, `invitation`, `common`, `passkeys`, `captcha`.
- `screen_name` (String) The screen that you are configuring settings for. Options are: `login`, `login-id`, `login-password`, `signup`, `signup-id`, `signup-password`, `login-passwordless-sms-otp`, `login-passwordless-email-code`, `login-passwordless-email-link`, `login-email-verification`, `phone-identifier-enrollment`, `phone-identifier-challenge`, `email-identifier-challenge`, `reset-password-request`, `reset-password-email`, `reset-password`, `reset-password-success`, `reset-password-error`, `reset-password-mfa-email-challenge`, `reset-password-mfa-otp-challenge`, `reset-password-mfa-phone-challenge`, `reset-password-mfa-push-challenge-push`, `reset-password-mfa-recovery-code-challenge`, `reset-password-mfa-sms-challenge`, `reset-password-mfa-voice-challenge`, `reset-password-mfa-webauthn-platform-challenge`, `reset-password-mfa-webauthn-roaming-challenge`, `custom-form`, `consent`, `customized-consent`, `logout`, `logout-complete`, `logout-aborted`, `mfa-push-welcome`, `mfa-push-enrollment-qr`, `mfa-push-enrollment-code`, `mfa-push-success`, `mfa-push-challenge-push`, `mfa-push-list`, `mfa-otp-enrollment-qr`, `mfa-otp-enrollment-code`, `mfa-otp-challenge`, `mfa-voice-enrollment`, `mfa-voice-challenge`, `mfa-phone-challenge`, `mfa-phone-enrollment`, `mfa-webauthn-platform-enrollment`, `mfa-webauthn-roaming-enrollment`, `mfa-webauthn-platform-challenge`, `mfa-webauthn-roaming-challenge`, `mfa-webauthn-change-key-nickname`, `mfa-webauthn-enrollment-success`, `mfa-webauthn-error`, `mfa-webauthn-not-available-error`, `mfa-country-codes`, `mfa-sms-enrollment`, `mfa-sms-challenge`, `mfa-sms-list`, `mfa-email-challenge`, `mfa-email-list`, `mfa-recovery-code-enrollment`, `mfa-recovery-code-challenge`, `mfa-detect-browser-capabilities`, `mfa-enroll-result`, `mfa-login-options`, `mfa-begin-enroll-options`, `status`, `device-code-activation`, `device-code-activation-allowed`, `device-code-activation-denied`, `device-code-confirmation`, `email-verification-result`, `email-otp-challenge`, `organization-selection`, `organization-picker`, `accept-invitation`, `redeem-ticket`, `passkey-enrollment`, `passkey-enrollment-local`, `interstitial-captcha`.
- `prompt_type` (String) The prompt that you are configuring settings for. Options are: `signup-id`, `signup-password`, `login-id`, `login-password`, `login-passwordless`, `phone-identifier-enrollment`, `phone-identifier-challenge`, `email-identifier-challenge`, `passkeys`, `captcha`.
- `screen_name` (String) The screen that you are configuring settings for. Options are: `signup-id`, `signup-password`, `login-id`, `login-password`, `login-passwordless-sms-otp`, `login-passwordless-email-code`, `phone-identifier-enrollment`, `phone-identifier-challenge`, `email-identifier-challenge`, `passkey-enrollment`, `passkey-enrollment-local`, `interstitial-captcha`.

### Optional

Expand Down
98 changes: 3 additions & 95 deletions internal/auth0/prompt/resource_screen_render.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,118 +19,26 @@ import (
var (
allowedPromptsSettingsRenderer = []string{
string(management.PromptSignupID),
string(management.PromptSignup),
string(management.PromptSignupPassword),
string(management.PromptLogin),
string(management.PromptLoginID),
string(management.PromptLoginPassword),
string(management.PromptLoginPasswordLess),
string(management.PromptLoginEmailVerification),
string(management.PromptPhoneIdentifierEnrollment),
string(management.PromptPhoneIdentifierChallenge),
string(management.PromptEmailIdentifierChallenge),
string(management.PromptResetPassword),
string(management.PromptCustomForm),
string(management.PromptConsent),
string(management.PromptCustomizedConsent),
string(management.PromptLogout),
string(management.PromptMFAPush),
string(management.PromptMFAOTP),
string(management.PromptMFAVoice),
string(management.PromptMFAPhone),
string(management.PromptMFAWebAuthn),
string(management.PromptMFASMS),
string(management.PromptMFAEmail),
string(management.PromptMFARecoveryCode),
string(management.PromptMFA),
string(management.PromptStatus),
string(management.PromptDeviceFlow),
string(management.PromptEmailVerification),
string(management.PromptEmailOTPChallenge),
string(management.PromptOrganizations),
string(management.PromptInvitation),
string(management.PromptCommon),
string(management.PromptPasskeys),
string(management.PromptCaptcha),
}
allowedScreensSettingsRenderer = []string{
string(management.ScreenLogin),
string(management.ScreenLoginID),
string(management.ScreenLoginPassword),
string(management.ScreenSignup),
string(management.ScreenSignupID),
string(management.ScreenSignupPassword),
string(management.ScreenLoginID),
string(management.ScreenLoginPassword),
string(management.ScreenLoginPasswordlessSMSOTP),
string(management.ScreenLoginPasswordlessEmailCode),
string(management.ScreenLoginPasswordlessEmailLink),
string(management.ScreenLoginEmailVerification),
string(management.ScreenPhoneIdentifierEnrollment),
string(management.ScreenPhoneIdentifierChallenge),
string(management.ScreenEmailIdentifierChallenge),
string(management.ScreenResetPasswordRequest),
string(management.ScreenResetPasswordEmail),
string(management.ScreenResetPassword),
string(management.ScreenResetPasswordSuccess),
string(management.ScreenResetPasswordError),
string(management.ScreenResetPasswordMFAEmailChallenge),
string(management.ScreenResetPasswordMFAOTPChallenge),
string(management.ScreenResetPasswordMFAPhoneChallenge),
string(management.ScreenResetPasswordMFAPushChallengePush),
string(management.ScreenResetPasswordMFARecoveryCodeChallenge),
string(management.ScreenResetPasswordMFASMSChallenge),
string(management.ScreenResetPasswordMFAVoiceChallenge),
string(management.ScreenResetPasswordMFAWebAuthnPlatformChallenge),
string(management.ScreenResetPasswordMFAWebAuthnRoamingChallenge),
string(management.ScreenCustomForm),
string(management.ScreenConsent),
string(management.ScreenCustomizedConsent),
string(management.ScreenLogout),
string(management.ScreenLogoutComplete),
string(management.ScreenLogoutAborted),
string(management.ScreenMFAPushWelcome),
string(management.ScreenMFAPushEnrollmentQR),
string(management.ScreenMFAPushEnrollmentCode),
string(management.ScreenMFAPushSuccess),
string(management.ScreenMFAPushChallengePush),
string(management.ScreenMFAPushList),
string(management.ScreenMFAOTPEnrollmentQR),
string(management.ScreenMFAOTPEnrollmentCode),
string(management.ScreenMFAOTPChallenge),
string(management.ScreenMFAVoiceEnrollment),
string(management.ScreenMFAVoiceChallenge),
string(management.ScreenMFAPhoneChallenge),
string(management.ScreenMFAPhoneEnrollment),
string(management.ScreenMFAWebAuthnPlatformEnrollment),
string(management.ScreenMFAWebAuthnRoamingEnrollment),
string(management.ScreenMFAWebAuthnPlatformChallenge),
string(management.ScreenMFAWebAuthnRoamingChallenge),
string(management.ScreenMFAWebAuthnChangeKeyNickname),
string(management.ScreenMFAWebAuthnEnrollmentSuccess),
string(management.ScreenMFAWebAuthnError),
string(management.ScreenMFAWebAuthnNotAvailableError),
string(management.ScreenMFACountryCodes),
string(management.ScreenMFASMSEnrollment),
string(management.ScreenMFASMSChallenge),
string(management.ScreenMFASMSList),
string(management.ScreenMFAEmailChallenge),
string(management.ScreenMFAEmailList),
string(management.ScreenMFARecoveryCodeEnrollment),
string(management.ScreenMFARecoveryCodeChallenge),
string(management.ScreenMFADetectBrowserCapabilities),
string(management.ScreenMFAEnrollResult),
string(management.ScreenMFALoginOptions),
string(management.ScreenMFABeginEnrollOptions),
string(management.ScreenStatus),
string(management.ScreenDeviceCodeActivation),
string(management.ScreenDeviceCodeActivationAllowed),
string(management.ScreenDeviceCodeActivationDenied),
string(management.ScreenDeviceCodeConfirmation),
string(management.ScreenEmailVerificationResult),
string(management.ScreenEmailOTPChallenge),
string(management.ScreenOrganizationSelection),
string(management.ScreenOrganizationPicker),
string(management.ScreenAcceptInvitation),
string(management.ScreenRedeemTicket),
string(management.ScreenPasskeyEnrollment),
string(management.ScreenPasskeyEnrollmentLocal),
string(management.ScreenInterstitialCaptcha),
Expand All @@ -150,7 +58,7 @@ func NewPromptScreenRenderResource() *schema.Resource {
StateContext: schema.ImportStatePassthroughContext,
},
Description: "With this resource, you can Configure the render settings for a specific screen." +
"You can read more about this.",
"You can read more about this [here](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens).",
Schema: map[string]*schema.Schema{
"prompt_type": {
Type: schema.TypeString,
Expand Down
22 changes: 11 additions & 11 deletions internal/auth0/prompt/resource_screen_render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ resource "auth0_prompt_screen_renderer" "login-id" {

testAccPromptScreenRenderCreate = testAccPromptScreenRenderWithoutSettings + `
resource "auth0_prompt_screen_renderer" "prompt_screen_renderer" {
prompt_type = "logout"
screen_name = "logout"
prompt_type = "login-password"
screen_name = "login-password"
rendering_mode = "advanced"

head_tags = jsonencode([
Expand Down Expand Up @@ -78,8 +78,8 @@ resource "auth0_prompt_screen_renderer" "prompt_screen_renderer" {

testAccPromptScreenRenderUpdate = `
resource "auth0_prompt_screen_renderer" "prompt_screen_renderer" {
prompt_type = "logout"
screen_name = "logout"
prompt_type = "login-password"
screen_name = "login-password"
rendering_mode = "advanced"

head_tags = jsonencode([
Expand Down Expand Up @@ -116,8 +116,8 @@ resource "auth0_prompt_screen_renderer" "prompt_screen_renderer" {

testAccPromptScreenRenderDataAfterDelete = `
data "auth0_prompt_screen_renderer" "prompt_screen_renderer" {
prompt_type = "logout"
screen_name = "logout"
prompt_type = "login-password"
screen_name = "login-password"
}
`
)
Expand Down Expand Up @@ -149,8 +149,8 @@ func TestAccPromptScreenSettings(t *testing.T) {
{
Config: testAccPromptScreenRenderCreate,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "prompt_type", "logout"),
resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "screen_name", "logout"),
resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "prompt_type", "login-password"),
resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "screen_name", "login-password"),
resource.TestCheckResourceAttrSet("auth0_prompt_screen_renderer.prompt_screen_renderer", "id"),
resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "rendering_mode", "advanced"),
resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "context_configuration.#", "15"),
Expand All @@ -159,8 +159,8 @@ func TestAccPromptScreenSettings(t *testing.T) {
{
Config: testAccPromptScreenRenderUpdate,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "prompt_type", "logout"),
resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "screen_name", "logout"),
resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "prompt_type", "login-password"),
resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "screen_name", "login-password"),
resource.TestCheckResourceAttrSet("auth0_prompt_screen_renderer.prompt_screen_renderer", "id"),
resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "rendering_mode", "advanced"),
resource.TestCheckResourceAttr("auth0_prompt_screen_renderer.prompt_screen_renderer", "context_configuration.#", "11"),
Expand All @@ -172,7 +172,7 @@ func TestAccPromptScreenSettings(t *testing.T) {
{
Config: testAccPromptScreenRenderDataAfterDelete,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.auth0_prompt_screen_renderer.prompt_screen_renderer", "prompt_type", "logout"),
resource.TestCheckResourceAttr("data.auth0_prompt_screen_renderer.prompt_screen_renderer", "prompt_type", "login-password"),
resource.TestCheckResourceAttr("data.auth0_prompt_screen_renderer.prompt_screen_renderer", "rendering_mode", "standard"),
),
},
Expand Down
Loading
Loading