Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[RBAC] cache the roles data #3799

Closed
flaneur2020 opened this issue Jan 7, 2022 · 3 comments · Fixed by #4165
Closed

[RBAC] cache the roles data #3799

flaneur2020 opened this issue Jan 7, 2022 · 3 comments · Fixed by #4165
Labels
A-query Area: databend query

Comments

@flaneur2020
Copy link
Member

flaneur2020 commented Jan 7, 2022

Tracking issue

#2793

Summary

https://github.com/datafuselabs/databend/pull/3710/files#r776930739

some ideas:

  • seperate a PrivilegeManager which responsible of cache all the privileges from roles, and current user
  • factor out the privilege check logic to PrivilegeManager instead of UserGrantSet, or move UserGrantSet out of meta types, leave the metadata types plain data objects.
@BohuTANG
Copy link
Member

BohuTANG commented Jan 7, 2022

Because we have the grant sets in the UserInfo now:
https://github.com/datafuselabs/databend/blob/46b89bbac5d60eee9fa7e5679906d02ad2e6f579/query/src/sessions/session_status.rs#L36

Why we still need a PrivilegeManager?

@BohuTANG BohuTANG added A-databend-cloud A-query Area: databend query and removed A-databend-cloud labels Jan 7, 2022
@flaneur2020
Copy link
Member Author

after introducing RBAC, validate_privilege needs not only the infomation from the user's grant set, but also the grant sets of the roles. thus there might need some place to access ALL the roles' grant sets to compute an user's effective grant set, which is a sum of:

  • the privileges which directly granted to the user
  • the privileges which granted to user's roles

a PrivilegeManager can help cache the privileges from the roles, it would not be useful without RBAC in front.

@flaneur2020
Copy link
Member Author

this issue has a lower privilege than the issue about RBAC design. it might be a step in the RBAC implementation.

@flaneur2020 flaneur2020 changed the title add PrivilegeManager [RBAC] cache the roles data Jan 18, 2022
@flaneur2020 flaneur2020 mentioned this issue Feb 16, 2022
10 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-query Area: databend query
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants