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

Fixes redirects to KV engine when secret is a directory #24281

Merged
merged 8 commits into from
Nov 30, 2023

Conversation

Monkeychip
Copy link
Contributor

@Monkeychip Monkeychip commented Nov 28, 2023

Thank you @kiannaquach for a fix that I found on your quick actions card.

To reproduce:
not on this branch just on your most recent binary 1.15.0+

  1. Create a kv engine with a nested secret, something like kv-test with secret beep/bop/boop.
  2. Make a policy for a user bob that allows list access only to the beep/bop folder.
path "kv-test/metadata/beep/bop" {
  capabilities = ["list"]
}
path "kv-test/data/beep/bop/boop" {
  capabilities = ["read", "create", "update"]
}
  1. Login as root and navigate to the 'bop' folder. ex: http://localhost:8200/ui/vault/secrets/kv-test/kv/list/beep/bop/
  2. Copy the URL, and in an incognito window login paste that URL without the kv in the URL and login as bob. ex: http://localhost:8200/ui/vault/secrets/kv-test/list/beep/bop/
  3. The URL redirect from the old list view does not work. If you add back in the kv to the URL and login in as bob again, you'll see the view you should be redirected to. The expectation is that the URL should redirect from the old routing structure to the new one.
    This is the incorrect view (note: the button is fixed in another pr).
image

To test this fix:

  1. Do the same steps as above but in local dev with this branch checked out. On step 4, you should be redirected to the directory view of beep/bop.
image

@Monkeychip Monkeychip added the ui label Nov 28, 2023
@Monkeychip Monkeychip added this to the 1.15.4 milestone Nov 28, 2023
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Nov 28, 2023
@Monkeychip Monkeychip marked this pull request as ready for review November 29, 2023 17:16
Copy link

Build Results:
All builds succeeded! ✅

@Monkeychip Monkeychip marked this pull request as draft November 29, 2023 23:20
@Monkeychip Monkeychip marked this pull request as ready for review November 30, 2023 16:45
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I ran this same test on main and it fails, so this test is successfully testing this change.

Copy link
Contributor

@zofskeez zofskeez left a comment

Choose a reason for hiding this comment

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

Thanks for the update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants