-
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 vault path-help
for selected paths with bad regexps
#18571
Conversation
See the comment being added in `sdk/framework/path.go` for the explanation of why this change is needed.
Hi @hsimon-hashicorp @miagilepner, Apologies for the direct @-ing - I wasn't sure if there was any better contact method, so I just picked some people I have seen triage community submissions in the past. I have quite a few open Vault PRs that have been sitting around for a while, so I picked this one - one of my smaller, hopefully easier to review ones - in which to ask: Is there anything I can do to make these easier for HashiCorp engineers to review and merge? |
@maxb I will be reviewing this PR. Thanks for putting it together. It looks great from the first glance. I just need to confirm the changes to the sudo paths internally. |
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.
@hghaf099 Please let me know if there is any evidence I can gather and add to this PR to assist with this process? It would be great to get it in before its 6-month anniversary, and then I can move on to trying to attract a HashiCorp sponsor to some of my other open PRs. |
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!
Describe the bug
When a Vault API path has been defined with a regex that requires a final slash, the
vault path-help
command is unable to retrieve help for it.Underlying cause
Vault's code automatically appends a trailing slash on to all paths used for
ListOperation
s, but removes a trailing slash for all other operations, includingHelpOperation
s. In order for a path pattern to match bothListOperation
andHelpOperation
, it must accept both the presence and absence of a trailing slash.To Reproduce, or test the fix
vault path-help auth/token/accessors/
unsupported path
errorExpected behavior
Help message displayed as expected.
Fix
Update the few path regex patterns that fall into this trap to end with
/?
instead of/
.Update a comment to explain why.