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

unexpected expand/lookup behaviour with wildcard permissions #358

Closed
vroldanbet opened this issue Dec 31, 2021 · 3 comments
Closed

unexpected expand/lookup behaviour with wildcard permissions #358

vroldanbet opened this issue Dec 31, 2021 · 3 comments
Assignees
Labels
area/api v0 Affects the v0 API area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) kind/bug Something is broken or regressed priority/2 medium This needs to be done

Comments

@vroldanbet
Copy link
Contributor

vroldanbet commented Dec 31, 2021

Reproduction: https://play.authzed.com/s/Ay9ZZJBrGDKu (check validation tab)

As I run some experiments with the new wildcard permissions feature, I stumbled upon an apparently unexpected behaviour when doing lookup/expand. Permissions that effectively end up in user* & userset behave correctly with Check API, but not with Lookup/Expand API (which is presumably what's used in the validation tab in the playground).

In the original issue, we discussed that SpiceDB will have special treatment to user:* relationship when performing Lookup/Expand API, which is reasonable because it would lead to "listing all public resources" phenomenon. However, when user:* is chained with other algebraic operators like & and -, I think the current implementation semantics seem unexpected. The desirable outcome would be:

<user:userset> - <user:*> = empty
<user:userset> & <user:*> = <user:userset>

@josephschorr josephschorr self-assigned this Dec 31, 2021
@josephschorr
Copy link
Member

Appears that we need to support wildcard in the subjectset that the developer API is using for its expected relations determination:

func newSubjectSet() *subjectSet {

@josephschorr josephschorr added area/api v0 Affects the v0 API area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) kind/bug Something is broken or regressed priority/2 medium This needs to be done labels Dec 31, 2021
@josephschorr
Copy link
Member

After discussion, we might also need to do handle in Lookup (Expand already has it in the correct place)

@josephschorr
Copy link
Member

josephschorr commented Jan 11, 2022

Closed by recent fixes, as addressed in GHSA-7p8f-8hjm-wm92. See commit: 15bba2e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api v0 Affects the v0 API area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) kind/bug Something is broken or regressed priority/2 medium This needs to be done
Projects
None yet
Development

No branches or pull requests

2 participants