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.
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
Add support to parameterize unauthenticated paths #12668
Add support to parameterize unauthenticated paths #12668
Changes from 24 commits
49a6c4b
f46cacc
c287044
e8ef63d
a3b77aa
9eb4fb4
cf3a93d
329f214
3bbe5b0
dbad5eb
ae8b73a
4ba8baa
bbb0156
ef652a6
1d18b42
5ff9e51
c2352c0
3d7cfd7
8ffb279
b9c7d33
d8070f0
b824939
44186ba
42d86dd
e87339c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is there any ambiguity about whether remain will or won't have a trailing slash?
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.
Yes, it could have one or it could not.
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.
Is that not a concern for the
len
comparison below?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.
No I don't think so.
I might not be understanding your concern correctly, but I setup a table to show what matches for
foo/+
(which will have a length of 2 when split):foo/+
?foo
{"foo"}
foo/
{"foo", ""}
foo/bar
{"foo", "bar"}
foo/bar/
{"foo", "bar", ""}
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.
I was wondering if we might see different values for the request path - that map to the same vault path - depending on how the user constructed their request. I'm pretty sure the answer is "no", however, I just haven't read the relevant code recently enough to be certain.
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.
What relevant code should I be taking a look at? Do you mean checking all the Unauthenticated paths defined for each backend?
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.
Suppose that we have path
foo/+/bar
in Unauthenticated, and we get requests forLIST foo/a/bar
andLIST foo/a/bar/
. Should those be treated the same or not? I think buildLogicalRequestNoAuth will ensure, at least for the LIST case, that there is always a trailing slash. But I would prefer that the dev populating Unauthenticated not to have to know to put a trailing slash in their path for it to match.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.
I think this is a valid concern and I am still trying to test it out and think my way through it.
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.
@ncabatoff Testing Vault 1.8.2 with the
sys/health
Unauthenticated endpoint the trailing slash does matter:No trailing
/
With trailing
/
My PR as it currently is maintains this behavior.
For Create/Update operations we are prohibiting a trailing slash:
vault/vault/request_handling.go
Lines 454 to 456 in 25458af
Please let me know if the above fully addresses your concern.