-
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
Add banner for when resultant-acl check fails #23503
Add banner for when resultant-acl check fails #23503
Conversation
@@ -4,56 +4,52 @@ | |||
~}} | |||
|
|||
{{#if (and this.licenseExpired (not this.expiredDismissed))}} | |||
<div class="license-banner-wrapper"> |
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.
Removed wrapping div and moved it to outside all the banners (in cluster.hbs)
@autoloaded={{eq this.activeCluster.licenseState "autoloaded"}} | ||
/> | ||
{{/if}} | ||
<div class="cluster-banners-wrapper"> |
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.
This class automatically adds margins to the child divs so that spacing is consistent
Build 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.
LGTM thanks for the updates!
ui/tests/acceptance/cluster-test.js
Outdated
test('shows error banner if resultant-acl check fails', async function (assert) { | ||
const login_only = ` | ||
path "auth/token/lookup-self" { | ||
capabilities = ["read"] | ||
}, | ||
`; | ||
await consoleComponent.runCommands([ | ||
`write sys/policies/acl/login-only policy=${btoa(login_only)}`, | ||
`write -field=client_token auth/token/create no_default_policy=true policies="login-only"`, | ||
]); | ||
const noDefaultPolicyUser = consoleComponent.lastLogOutput; | ||
assert.dom('[data-test-resultant-acl-banner]').doesNotExist('Resultant ACL banner does not show as root'); | ||
await logout.visit(); | ||
assert.dom('[data-test-resultant-acl-banner]').doesNotExist('Does not show on login page'); | ||
await authPage.login(noDefaultPolicyUser); | ||
assert.dom('[data-test-resultant-acl-banner]').includesText('Resultant ACL check failed'); | ||
await click('[data-test-resultant-acl-reauthenticate]'); | ||
assert.strictEqual(currentRouteName(), 'vault.cluster.auth', 'Reauth link goes to login page'); | ||
}); |
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 resultant-acl endpoint is an internal endpoint that is critical for the UI to deliver an interface that shows a given user only the navigation items they have access to. However, access to this endpoint is controlled via policies, so if a GUI user does not have the default policy (which includes read access to this endpoint) the user might see navigation items that they don't actually have access to.
To alleviate confusion we are adding an alert banner when this check fails:
This check will also fail if the given user doesn't have access to the namespace, so the log in CTA will have them sign in directly to the namespace with a different user.