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

UI: Don't show resultant-ACL banner in nested namespace if ancestor wildcard policy #27263

Merged
merged 8 commits into from
May 30, 2024

Conversation

hashishaw
Copy link
Contributor

@hashishaw hashishaw commented May 29, 2024

This PR builds on the work from #26233. It hides the resultant-ACL banner if there are non-deny wildcard policies present for any ancestor of the current namespace. The changes in this PR are best illustrated through an example:

Example scenario
User Bob logs in at foo namespace and then navigates to namespace /foo/bar/baz. Bob has a policy with the following block:

path "bar/*" {
  capabilities = ["read", "update", "list"]
}

before, the wildcard calculation would determine the user does not have access because it was only checking a wildcard path at the user's relative root namespace (in this case, foo/). With this change, the wildcard calculation takes the current namespace foo/bar/baz and checks at each level if the Bob has wildcard access. The results are as follows:

  • foo/bar/baz/ ❌ no match

  • foo/bar/ ✅ match (exits loop)

  • Ent tests pass

@hashishaw hashishaw added ui bug Used to indicate a potential bug backport/1.16.x backport/ent/1.16.x+ent Changes are backported to 1.16.x+ent backport/1.17.x labels May 29, 2024
@hashishaw hashishaw added this to the 1.16.4 milestone May 29, 2024
@hashishaw hashishaw requested a review from a team as a code owner May 29, 2024 16:37
@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label May 29, 2024
Copy link

github-actions bot commented May 29, 2024

CI Results:
All Go tests succeeded! ✅

Copy link

github-actions bot commented May 29, 2024

Build Results:
All builds succeeded! ✅

Copy link
Contributor

@hellobontempo hellobontempo left a comment

Choose a reason for hiding this comment

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

Great work ✨ Thanks for the thorough comments

changelog/27263.txt Outdated Show resolved Hide resolved
hashishaw and others added 2 commits May 30, 2024 12:18
Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
@hashishaw hashishaw merged commit 83949e8 into main May 30, 2024
31 checks passed
@hashishaw hashishaw deleted the ui/VAULT-27617/wildcard-access-nested-banner branch May 30, 2024 19:30
@hashishaw hashishaw modified the milestones: 1.16.4, 1.15.9 May 31, 2024
@hashishaw hashishaw added the backport/ent/1.15.x+ent Changes are backported to 1.15.x+ent label May 31, 2024
@hashishaw hashishaw removed this from the 1.15.9 milestone May 31, 2024
@hashishaw hashishaw added this to the 1.15.10 milestone May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/ent/1.15.x+ent Changes are backported to 1.15.x+ent backport/ent/1.16.x+ent Changes are backported to 1.16.x+ent backport/1.17.x bug Used to indicate a potential bug 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