-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix list on password policies to list the policies containing slashes #23155
Conversation
Build Results: |
CI Results: |
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.
Looks good! Just a couple of things I'd like to see before we merge this.
@@ -4739,6 +4739,26 @@ func TestHandlePoliciesPasswordList(t *testing.T) { | |||
}, | |||
}, | |||
}, | |||
"policy with /": { |
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'd be nice to see a test with another level of paths, similar to the example included in the associated issue (path/to/policy
).
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.
Also curious to see what happens if our policy ends in /
.
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.
Added tests for these two cases listed above
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.
Looks great!
Issue: #17117
Slack conversation: https://hashicorp.slack.com/archives/C0287E435NE/p1694714032988359
Jira: https://hashicorp.atlassian.net/browse/VAULT-20052
Vault allows us to create password policies with "/" similar to other policy types like acl
Example: vault write sys/policies/password/example/example1 policy=@example_policy.hcl is allowed
but the list on password policies does not list the values after "/"
Example response: {"request_id":"9b1eadda-0511-02e0-f17f-7b9fe1d2c8b7","lease_id":"","renewable":false,"lease_duration":0,"data":{"keys":["example/"]},"wrap_info":null,"warnings":null,"auth":null}
Making this work consistently with acl policies. This fix produces the following response:
{"request_id":"9b1eadda-0511-02e0-f17f-7b9fe1d2c8b7","lease_id":"","renewable":false,"lease_duration":0,"data":{"keys":["example/example1"]},"wrap_info":null,"warnings":null,"auth":null}