-
Notifications
You must be signed in to change notification settings - Fork 913
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
[KYUUBI #3325] [FEATURE] [AUTHZ] Privilege checks for permanent views and skipping shadowed tables #3326
[KYUUBI #3325] [FEATURE] [AUTHZ] Privilege checks for permanent views and skipping shadowed tables #3326
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3326 +/- ##
============================================
- Coverage 51.49% 51.45% -0.04%
Complexity 13 13
============================================
Files 475 479 +4
Lines 26491 26556 +65
Branches 3698 3707 +9
============================================
+ Hits 13641 13664 +23
- Misses 11522 11560 +38
- Partials 1328 1332 +4
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
...rk-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/ViewAccessAnalysis.scala
Outdated
Show resolved
Hide resolved
...rk-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/ViewAccessAnalysis.scala
Outdated
Show resolved
Hide resolved
...kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/util/AuthZUtils.scala
Outdated
Show resolved
Hide resolved
...kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/util/AuthZUtils.scala
Outdated
Show resolved
Hide resolved
...rk-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/ViewAccessAnalysis.scala
Outdated
Show resolved
Hide resolved
...rk-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/ViewAccessAnalysis.scala
Outdated
Show resolved
Hide resolved
...z/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RangerSparkExtensionSuite.scala
Outdated
Show resolved
Hide resolved
...z/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RangerSparkExtensionSuite.scala
Outdated
Show resolved
Hide resolved
@@ -129,6 +130,9 @@ object PrivilegesBuilder { | |||
val db = quote(parts.init) | |||
privilegeObjects += tablePrivileges(TableIdentifier(parts.last, Some(db))) | |||
|
|||
case permanentViewMarker: PermanentViewMarker => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
case PermanentViewMarker(child, table) => mergeProjection(table, child)
looks we need to change to the above one, we may still project a view
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
Changed to mergeProjection, and checking column level privileges for perm views.
...rc/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RuleApplyPermanentViewMarker.scala
Outdated
Show resolved
Hide resolved
…PrivilegesBuilder with PermanentViewMarker, finally maker cleanup in RuleEliminateViewMarker
… non-existed isTempView field
Squashed commits: [98f523d] fix error in view casting
2342d6a
to
81e8b99
Compare
hi @bowenliang123, please help resolve the conflicts when you have time |
@yaooqinn sure. will do it soon. |
# Conflicts: # extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RangerSparkExtensionSuite.scala
some ut for selecting unauthed view added and it remains unexpected error. |
thanks, merged to master |
Why are the changes needed?
fix #3325
Permanent views are generally registed globally and then used for unifing, masking, joining tables for different practical purposes. The data manager would like to authorize views to users , but not all the source tables.
Authz plugin is not satisfiying this senario as it checks privileges all the source table instead of the permanent views.
Suggesting chaning behaviour of PrivilegesBuilder
How was this patch tested?
Add some test cases that check the changes thoroughly including negative and positive cases if possible
Add screenshots for manual tests if appropriate
Run test locally before make a pull request