[AMORO-4117] Implement dashboard RBAC with jCasbin and LDAP role mapping#4118
Open
xxubai wants to merge 11 commits intoapache:masterfrom
Open
[AMORO-4117] Implement dashboard RBAC with jCasbin and LDAP role mapping#4118xxubai wants to merge 11 commits intoapache:masterfrom
xxubai wants to merge 11 commits intoapache:masterfrom
Conversation
Contributor
|
Thanks for the PR! A few thoughts: 1. Consider using jCasbin for the permission model There is a prior PR #3544 that implemented readonly user support using jCasbin. The jCasbin approach has some advantages worth considering:
The complexity of integrating jCasbin is not high (PR #3544 shows +254/-37), and it would make the permission layer more extensible and maintainable. |
Contributor
Author
Hi @zhoujinsong . I refactor this PR base on your suggestion. PTAL. |
…n and role resolution
… and ConfigurationsTest.java
…on and new dependencies
…enhance privilege mapping
… and introduce new roles
…ail example for username normalization
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.
Why are the changes needed?
Close #4117.
Amoro Dashboard needs a cleaner RBAC model for multi-user and enterprise environments, especially when login is integrated with LDAP. The previous authorization approach was coarse-grained and difficult to extend.
This patch introduces the first version of Dashboard RBAC based on
jcasbin, using LDAP group-to-role mapping as the primary role source. The implementation keeps the privilege model intentionally small while making role capabilities policy-driven and frontend authorization privilege-driven.Brief change log
jcasbin-based Dashboard authorization.SERVICE_ADMINandVIEWER.VIEW_SYSTEMVIEW_CATALOGVIEW_TABLEVIEW_OPTIMIZERMANAGE_CATALOGMANAGE_TABLEMANAGE_OPTIMIZEREXECUTE_SQLMANAGE_PLATFORMrolesandprivilegesfrom/login/current.http-server.authorization.ldap-role-mapping.groups.Role design
SERVICE_ADMINVIEWERVIEW_CATALOG,VIEW_TABLE,VIEW_OPTIMIZERCustom role names are also supported when they are defined by Casbin policy and resolved from LDAP group mapping. Example:
OPERATOR.Privilege design
VIEW_SYSTEMVIEW_CATALOGVIEW_TABLEVIEW_OPTIMIZERMANAGE_CATALOGMANAGE_TABLEMANAGE_OPTIMIZEREXECUTE_SQLMANAGE_PLATFORMCustom role example
A custom role can be introduced by policy and LDAP group mapping.
Policy example:
LDAP mapping example:
How was this patch tested?
Test details:
mvn -pl amoro-ams -am -DskipTests compilemvn -pl amoro-ams -am -DskipTests test-compileDocumentation