-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add support for rendering the settings of prompt-screen #1077
base: main
Are you sure you want to change the base?
Add support for rendering the settings of prompt-screen #1077
Conversation
2. Include unit tests, examples and docs 3. Update Go-Auth0's dependent version
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" | ||
) | ||
|
||
var ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to use as an enum as the values are not constant
StateContext: schema.ImportStatePassthroughContext, | ||
}, | ||
Description: "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/universal-login-pages/.../acul).", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
link is not valid
Computed: true, | ||
ValidateFunc: validation.StringIsJSON, | ||
DiffSuppressFunc: structure.SuppressJsonDiff, | ||
Description: "An array of head tags", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add better description
func deletePromptScreenRenderer(ctx context.Context, data *schema.ResourceData, meta any) diag.Diagnostics { | ||
api := meta.(*config.Config).GetAPI() | ||
idComponents := strings.Split(data.Id(), ":") | ||
promptName, screenName := idComponents[0], idComponents[1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add check and validation promptName, screenName
|
||
func readPromptScreenRenderer(ctx context.Context, data *schema.ResourceData, meta any) diag.Diagnostics { | ||
api := meta.(*config.Config).GetAPI() | ||
promptScreenSettings, err := api.Prompt.ReadRendering(ctx, management.PromptType(strings.Split(data.Id(), ":")[0]), management.ScreenName(strings.Split(data.Id(), ":")[1])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add check and validation for [0] and [1] in case invalid
return diag.FromErr(internalError.HandleAPIError(data, err)) | ||
} | ||
|
||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not it call readPromptScreenRenderer() instead for return null?
|
||
const ( | ||
testAccPromptScreenRenderWithoutSettings = ` | ||
resource "auth0_prompt_screen_renderer" "prompt_screen_renderer" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add cases for:
resource "auth0_prompt_screen_renderer" "prompt_screen_renderer" {
screen_name = "logout"
}
resource "auth0_prompt_screen_renderer" "prompt_screen_renderer" {
prompt_type = "logout"
}
), | ||
}, | ||
}, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add case for testAccPromptScreenRenderDelete
|
||
# Resource: auth0_prompt_screen_renderer | ||
|
||
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/universal-login-pages/.../acul). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
invalid link
e2e test recordings are not available |
🔧 Changes
Added new resources and data sources: "auth0_prompt_screen_renderer"
Added relevant expand and flatten rules.
Added relevant test cases for data_source and resource.
Added relevant docs and examples.
Example
📝 Checklist