[FEATURE] [Authz] Support authorization for hive persist function call#3633
[FEATURE] [Authz] Support authorization for hive persist function call#3633packyan wants to merge 5 commits intoapache:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3633 +/- ##
============================================
- Coverage 52.86% 52.85% -0.01%
Complexity 13 13
============================================
Files 496 499 +3
Lines 27971 28008 +37
Branches 3857 3862 +5
============================================
+ Hits 14787 14805 +18
- Misses 11788 11802 +14
- Partials 1396 1401 +5
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
cc @bowenliang123, interested in this feature? Maybe we can collaborate on it. |
|
Are you suggesting checking privileges in LogicalPlan in function usage? |
…_authorization # Conflicts: # extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RuleAuthorization.scala
|
Hope to see the reworking soon. Here's some hints for the new Serde design:
And also,
|
Thx for your prompt, I plan to divide the whole feature into several subtasks
|
|
Good, you can create an umbrella issue and subtask issues, and the following small PRs. Also cc @yaooqinn |
|
closed this pr, and new small PRs will be tracked in #3632 |
Why are the changes needed?
to close #3632
The Spark Sql Authz in Kyuubi currently supports authorize create function command , drop function command, and refresh function command.
But the authentication for function usage is not implemented, anyone can use all permanent functions in hive. This behavior needs to be restricted.
Since function expression may be optimized as constants by catalyst optimization rules, the function usage authorization should be injected before the optimization phase.
So before the optimization rules running, perform the collection of permanent function information involved in the LogicalPlan and construct them as functionPrivilegeObjects.
I think it's necessary to create a class like RuleAuthorization and inject it as a post-hoc resolution rule, dedicated to the authentication of function usage privileges.
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