-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(vault): reference ending with slash when parsed should not return…
… 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 <[email protected]>
- Loading branch information
Showing
3 changed files
with
64 additions
and
9 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
changelog/unreleased/kong/fix-vault-reference-parsing-endslash.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
message: | | ||
**Vault**: Reference ending with slash when parsed should not return a key. | ||
type: bugfix | ||
scope: PDK |
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
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