Skip to content
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

Prevent the pattern matching for KV V2 operations if a trailing slash… #64

Merged
merged 4 commits into from Sep 28, 2022

Conversation

peteski22
Copy link
Contributor

… is present in the URL

Overview

Kv v1 secrets engine returns a 404 if you attempt to perform actions on an endpoint with a trailing slash (i.e. an endpoint that doesn't exist).

KV v2 however allows this, but due to the way it handles metadata via the storage backends this can lead to a situation where a 500 Internal Server Error is returned as the secret cannot be found, but metadata can.

This change prevents the code from running by adjusting the pattern matcher in the framework.

Solves: VAULT-6804

@peteski22 peteski22 marked this pull request as ready for review September 27, 2022 19:06
@peteski22 peteski22 requested a review from a team September 27, 2022 19:07
path_data.go Outdated Show resolved Hide resolved
Copy link
Contributor

@tomhjp tomhjp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 thinking ahead, this probably warrants a change or bug type changelog when pulling into the vault repo?

@peteski22 peteski22 merged commit 05d1235 into main Sep 28, 2022
@peteski22 peteski22 deleted the VAULT-6804-kv-v2-trailing-slash branch September 28, 2022 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants