-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
UI: Fix token renewal breaking policy checks #29416
UI: Fix token renewal breaking policy checks #29416
Conversation
Build Results: |
CI Results: |
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.
The logic here seems solid (and easy to read, thank you). Ping when you're ready for final review.
import { login, loginMethod, loginNs, logout } from 'vault/tests/helpers/auth/auth-helpers'; | ||
import { AUTH_FORM } from 'vault/tests/helpers/auth/auth-form-selectors'; | ||
import { v4 as uuidv4 } from 'uuid'; | ||
import { GENERAL } from '../helpers/general-selectors'; |
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.
nice clean up work on the tests!
await runCmd([`delete sys/namespaces/${this.ns}`], false); | ||
}); | ||
|
||
// this test is specifically to cover a token renewal bug within namespaces |
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.
totally not required, but i've found it helpful when folks have mentioned that a test is written for a specific bug to include the github pr or issue link in the comment. Matthew has done this a couple times and I've used those links for more context or additional regression testing.
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 going to do this if it was a GitHub link! But since it's a jira link I didn't include it. I remember a while ago the company discussed that we shouldn't share internal links publicly.
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.
ah, yep that's the correct move then.
Description
✅ enterprise tests passed
The UI makes a lot of inferences based on the shape of the auth response we receive. The UI relies on the
namespace_path
from the auth response to set the user's root namespace which is then used to calculate capabilities.vault/ui/app/adapters/capabilities.js
Lines 16 to 30 in dcdbacd
renew-self
does not returnnamespace_path
, so this PR manually adds it in therenew()
method, if it exists. The auth code is challenging to parse and is prone to regressions. I double checked that this change does not affect the bug the previous PR was solving that introduced these code changes: https://github.com/hashicorp/vault/pull/24168/filesThis fixes a bug where clicking
Renew token
would incorrectly gate navigation to resources a user does have access to. For example, the database overview page:before token renewal
after token renewal
TODO only if you're a HashiCorp employee
backport/
label that matches the desired release branch. Note that in the CE repo, the latest release branch will look likebackport/x.x.x
, but older release branches will bebackport/ent/x.x.x+ent
.of a public function, even if that change is in a CE file, double check that
applying the patch for this PR to the ENT repo and running tests doesn't
break any tests. Sometimes ENT only tests rely on public functions in CE
files.
in the PR description, commit message, or branch name.
description. Also, make sure the changelog is in this PR, not in your ENT PR.