-
Notifications
You must be signed in to change notification settings - Fork 68
Add missing prompt custom text and implement prompt screen partial in terraform generator #1426
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
Draft
bkiran6398
wants to merge
11
commits into
main
Choose a base branch
from
ESD-55877/fix_prompt_custom_text_and_screen_partial
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add missing prompt custom text and implement prompt screen partial in terraform generator #1426
bkiran6398
wants to merge
11
commits into
main
from
ESD-55877/fix_prompt_custom_text_and_screen_partial
Conversation
This file contains hidden or 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
- Reformatted the `customTextPromptTypes` array for better readability. - Added new prompt types: `email_identifier_challenge` and `passkeys`. - This change enhances the prompt handling capabilities in the `terraform_fetcher.go` file.
- Introduced `promptScreenPartialResourceFetcher` to handle fetching data for screen partial prompts. - Updated `parseResourceFetchers` method in `terraform.go` to include the new fetcher for "auth0_prompt_screen_partial". - Added a mapping for screen partial prompt types to their corresponding screens in `terraform_fetcher.go`. - This enhancement allows for better management and retrieval of screen partial prompts in the CLI.
- Added missing custom text prompt types including "login-passwordless", "phone-identifier-enrollment", and others to enhance prompt coverage. - Removed outdated TODO comments to improve code clarity. - Updated references in comments for better documentation and accuracy.
- Refactored the promptTypes array in TestPromptCustomTextResourceFetcher to improve readability and added new prompt types. - Introduced Test_promptScreenPartialResourceFetcher to validate the retrieval of screen partial prompts data. - Ensured that the new tests cover various scenarios for screen partial prompts, enhancing overall test coverage.
- Updated the default resources list to include `auth0_prompt_screen_partial`. - This change allows users to generate Terraform configurations for screen partial prompts, enhancing the flexibility of the `auth0 terraform generate` command.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1426 +/- ##
==========================================
- Coverage 64.51% 58.99% -5.53%
==========================================
Files 108 117 +9
Lines 17959 20421 +2462
==========================================
+ Hits 11586 12047 +461
- Misses 5615 7587 +1972
- Partials 758 787 +29 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Eliminated "async-approval-flow" from the customTextPromptTypes slice in terraform_fetcher.go. - This prompt type is not supported in go-auth0 and terraform provider.
- Consolidated the definition of `customTextPromptTypes` in `terraform_fetcher.go` and `terraform_fetcher_test.go` to a single line for improved readability. - This change reduces visual clutter and maintains consistency across the codebase. - No functional changes were made; the prompt types remain the same.
2 tasks
…her_FetchData - Changed assertion from assert.Equal to assert.ElementsMatch to ensure that the order of elements in the fetched data does not affect the test outcome.
- Introduced functions to check for and process sensitive fields in the generated Terraform config. - Added `hasSensitiveNullValues` to identify sensitive fields set to null. - Implemented `processSensitiveFieldsInConfig` to replace sensitive null values with empty strings and a TODO comment. - Created `replaceSensitiveNullWithEmptyString` to modify the content of the generated config file accordingly. - Enhances security by ensuring sensitive values are flagged for user input.
- Introduced constants for Terraform file names: `mainTFFileName`, `importTFFileName`, and `generatedTFFileName`. - Updated all references in the codebase to use these constants for better maintainability and readability. - Ensured consistency across functions like `createMainFile`, `createImportFile`, and `generateTerraformResourceConfig`. - Improved error messages and assertions in tests to reflect the new constants.
…config - Introduced new test cases to validate the handling of sensitive fields in Terraform configurations. - Implemented `Test_hasSensitiveNullValues` to check for presence of sensitive null values. - Added `Test_processSensitiveFieldsInConfig` to ensure sensitive fields are replaced correctly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔧 Changes
This PR enhances the Terraform generation feature with two key improvements:
Added support for
auth0_prompt_screen_partialresource - The terraform generate command now includes support for generating configuration for prompt screen partials across various login and signup screens (login, login-id, login-password, login-passwordless, signup, signup-id, signup-password, and customized-consent).Improved handling of sensitive fields - Implemented automatic detection and processing of sensitive fields that cannot be exported via the Management API. When terraform plan fails due to sensitive null values, the CLI now automatically replaces them with empty strings and adds TODO comments, allowing users to manually provide the required values.
Additional improvements include standardizing file name constants throughout the codebase for better maintainability.
📚 References
N/A
🔬 Testing
Automated Testing:
promptScreenPartialResourceFetcherto verify correct generation of import statements for screen partialshasSensitiveNullValuesandprocessSensitiveFieldsInConfig)Manual Testing:
auth0 terraform generatewithauth0_prompt_screen_partialresource included📝 Checklist