Repository navigation
Conversation
Member
|
Thanks for the report and the clear reproduction, the bug is real. It's fixed on master in c157de4 with a slightly broader change, so I'm closing this PR:
Your test cases are included in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GetImplicitUsersForResourceByDomainonly checked the domain of a rule when its subject was a role in the queried domain. Rules whose subject is a plain user, or a role that only exists in another domain, were returned no matter which domain they belong to.With
examples/rbac_with_domains_model.confandexamples/rbac_with_domains_policy.csv:Actual:
[[alice domain1 data1 read] [alice domain1 data1 write] [carol domain2 data1 read] [manager domain2 data1 write]]Expected:
[[alice domain1 data1 read] [alice domain1 data1 write]](Enforce("carol", "domain1", "data1", "read")is false, andmanageris a role, not a user, in domain2).The domain check now runs for every rule before the role/user split, using the same exact comparison the role branch already used.
The new cases in
TestGetImplicitUsersForResourceByDomainfail on master withImplicit users for data1 in domain domain1 : [... [carol domain2 data1 read] [manager domain2 data1 write]] , supposed to be [[alice domain1 data1 read] [alice domain1 data1 write]].go test -race ./...passes and golangci-lint v2.15 reports 0 issues.