-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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): reference ending with slash when parsed should not return a key #13504
Merged
Conversation
This file contains 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
github-actions
bot
added
core/pdk
cherry-pick kong-ee
schedule this PR for cherry-picking to kong/kong-ee
labels
Aug 16, 2024
bungle
force-pushed
the
fix/vault-reference-endslash
branch
from
August 16, 2024 08:38
fd53ac8
to
bd614d1
Compare
bungle
changed the title
Fix/vault reference endslash
fix(vault): reference path ending with slash should not have a key
Aug 16, 2024
bungle
changed the title
fix(vault): reference path ending with slash should not have a key
fix(vault): reference ending with slash when parsed should not return a key
Aug 16, 2024
bungle
force-pushed
the
fix/vault-reference-endslash
branch
from
August 16, 2024 08:41
bd614d1
to
a222cf2
Compare
bungle
force-pushed
the
fix/vault-reference-endslash
branch
2 times, most recently
from
August 16, 2024 08:47
2f9e567
to
e702139
Compare
… a key ### Summary Our docs state here: https://docs.konghq.com/gateway/latest/kong-enterprise/secrets-management/reference-format/#secret-key > If secret key ends with /, then it is not considered as a Secret Key but as a part of Secret Id. > The difference between Secret Key and Secret Id is that only the Secret Id is sent to vault API, > and the Secret Key is only used when processing The logic was not working correctly because it was incorrectly assuming what `require("socket.url").parse_path` did, that is: ```lua parse_path("/a") -- { "a", is_absolute = 1 } ``` ```lua parse_path("/a/") -- { "a", is_absolute = 1, is_directory = 1 } ``` ```lua parse_path("/a/b") -- { "a", "b", is_absolute = 1 } ``` ```lua > parse_path("/a/b/") -- { "a", "b", is_absolute = 1, is_directory = 1} ``` This fixes it. Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
### Summary Less pressure to garbage collector. Signed-off-by: Aapo Talvensaari <aapo.talvensaari@gmail.com>
bungle
force-pushed
the
fix/vault-reference-endslash
branch
from
August 16, 2024 09:22
e702139
to
f1859d7
Compare
jschmid1
approved these changes
Aug 21, 2024
samugi
approved these changes
Aug 21, 2024
3 tasks
Successfully created backport PR for |
Successfully created cherry-pick PR for |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport release/3.8.x
cherry-pick kong-ee
schedule this PR for cherry-picking to kong/kong-ee
core/pdk
size/M
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.
Summary
Our docs state here:
https://docs.konghq.com/gateway/latest/kong-enterprise/secrets-management/reference-format/#secret-key
The logic was not working correctly because it was incorrectly assuming what
require("socket.url").parse_path
did, that is:This fixes it.
KAG-5181
Checklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.md