Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the authentication configuration and policy management by removing the legacy policy module and consolidating policy definitions and user credentials within the authentication module. Key changes include the removal of the policy module, the introduction of dynamic user configuration via a JSON file in the userpass authentication configuration, and a new vault_policy resource that leverages a fileset for policy files.
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| policy/main.tf | Removal of legacy policy resource to support refactored design |
| main.tf | Removal of the policy module and focus on the authentication module |
| authentication/userpass.tf | Dynamic user configuration via JSON and consolidated endpoint setup |
| authentication/templates/users.json.example | Addition of a sample JSON file for user configuration |
| authentication/templates/policy/admin_policy.hcl | Extension of policy content with updated certs capability |
| authentication/templates/default_template.tftpl | Update to use dynamic password in the template |
| authentication/policy.tf | New resource that dynamically loads policy files from a directory |
Comments suppressed due to low confidence (1)
authentication/policy.tf:2
- The use of split on a dot to derive the policy name may be brittle if the file name does not contain a dot; consider a more robust naming strategy or add validation for the file naming convention.
name = split(".", each.value)[0]
|
|
||
| resource "vault_generic_endpoint" "devops_user" { | ||
| resource "vault_generic_endpoint" "users" { | ||
| for_each = { for user in local.users : user.username => user } |
There was a problem hiding this comment.
Ensure that the usernames in the users JSON are unique to prevent key collisions in the for_each mapping.
Suggested change
| for_each = { for user in local.users : user.username => user } | |
| for_each = local.unique_usernames |
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
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.
No description provided.