-
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
address various issues with the output-policy flag #19160
address various issues with the output-policy flag #19160
Conversation
api/output_policy.go
Outdated
if d.params.Has(listKey) { | ||
isList, err := strconv.ParseBool(d.params.Get(listKey)) | ||
if err != nil { | ||
return "", err |
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.
This error could probably be improved with some context. Alternatively you can simply check for strings.Lower(d.params.Get("list")) == "true"
or something similar
Co-authored-by: Anton Averchenkov <[email protected]>
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.
Tested it with make dev
and it seems to be working well! Thanks a bunch for handling these cases.
Addressing various issues called out by this sustaining issue, some are not going to be fixed by this PR but rather in a longer term follow up initiative to change how we handle the policy building.
For now though we will address the following which were tested locally:
Update the error message when trying to generate a policy for kvV2 where
/data/
is not properly contained in the path provided.Capture the list url param that is passed on list commands since a lists HTTP Verb is GET instead of LIST.
Since we have aggressive and decentralized path sanitization for all command requests, we needed to change the sudo path regex for paths with a trailing
/
. The change is to make the trailing/
optional since it is technically correct to have it but every command removes the users input before we could check the path.