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

Infer the proxy user automatically for delete batch operation #5717

Closed
wants to merge 6 commits into from

Conversation

turboFei
Copy link
Member

@turboFei turboFei commented Nov 17, 2023

🔍 Description

Infer the batch user from session or metadata, user do not need to specify the proxy user anymore.

This pr also align the behavior of BatchesResource with that of SessionsResource and OperationsResource(no proxy user parameter).

For Kyuubi Batch, Session and Operation, these resources have the user attiribute.

So we only need to check whether the authentication user has the permission to access the resource.

Issue References 🔗

This pull request fixes #

Describe Your Solution 🔧

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Types of changes 🔖

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Test Plan 🧪

Behavior Without This Pull Request ⚰️

Behavior With This Pull Request 🎉

Related Unit Tests


Checklists

📝 Author Self Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • This patch was not authored or co-authored using Generative Tooling

📝 Committer Pre-Merge Checklist

  • Pull request title is okay.
  • No license issues.
  • Milestone correctly set?
  • Test coverage is ok
  • Assignees are selected.
  • Minimum number of approvals
  • No changes are requested

Be nice. Be informative.

@turboFei turboFei force-pushed the hive_server2_proxy_user branch from 851a0bd to d4ba200 Compare November 17, 2023 03:23
@turboFei turboFei changed the title Proxy user is not needed for delete batch operation Infer the session user for batch permission for delete batch operation Nov 17, 2023
@turboFei turboFei force-pushed the hive_server2_proxy_user branch from d4ba200 to e3670a4 Compare November 17, 2023 03:25
@turboFei turboFei requested a review from pan3793 November 17, 2023 03:26
@turboFei turboFei changed the title Infer the session user for batch permission for delete batch operation Infer the proxy user automatically for delete batch operation Nov 17, 2023
@turboFei turboFei force-pushed the hive_server2_proxy_user branch from e3670a4 to 7340401 Compare November 17, 2023 03:27
@turboFei turboFei added this to the v1.8.1 milestone Nov 17, 2023
@turboFei turboFei self-assigned this Nov 17, 2023
@turboFei turboFei force-pushed the hive_server2_proxy_user branch from 7340401 to cef9e32 Compare November 17, 2023 03:46
@github-actions github-actions bot added the kind:documentation Documentation is a feature! label Nov 17, 2023
@turboFei
Copy link
Member Author

cc @pan3793 @cxzl25

@turboFei turboFei requested a review from cxzl25 November 17, 2023 07:25
@pan3793
Copy link
Member

pan3793 commented Nov 17, 2023

I think it may be useful in the future.

Currently, we only have a true-false-switch for roles: admin/non-admin. But in the future, we may introduce the real RBAC system, which means we can control tom only allows proxying jerry, as Hadoop does.

@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (88fae49) 61.40% compared to head (70ad7e7) 61.30%.
Report is 4 commits behind head on master.

Files Patch % Lines
.../apache/kyuubi/server/api/v1/BatchesResource.scala 50.00% 1 Missing and 2 partials ⚠️
...in/java/org/apache/kyuubi/client/BatchRestApi.java 75.00% 1 Missing ⚠️
...ache/kyuubi/server/api/v1/InternalRestClient.scala 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5717      +/-   ##
============================================
- Coverage     61.40%   61.30%   -0.11%     
  Complexity       23       23              
============================================
  Files           607      607              
  Lines         35755    35815      +60     
  Branches       4900     4912      +12     
============================================
+ Hits          21957    21958       +1     
- Misses        11413    11467      +54     
- Partials       2385     2390       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@turboFei
Copy link
Member Author

have addressed all comments and updated the pr description. @pan3793

@turboFei turboFei force-pushed the hive_server2_proxy_user branch from e6e0b75 to 55bcf40 Compare November 17, 2023 09:56
Copy link
Member

@pan3793 pan3793 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, directly cherry-pick to branch-1.8 may have conflicts

@turboFei turboFei force-pushed the hive_server2_proxy_user branch from 55bcf40 to 70ad7e7 Compare November 17, 2023 09:57
@turboFei turboFei closed this in 3478fc9 Nov 17, 2023
@turboFei turboFei deleted the hive_server2_proxy_user branch November 17, 2023 12:54
turboFei added a commit to turboFei/kyuubi that referenced this pull request Nov 17, 2023
…tch operation

Infer the batch user from session or metadata, user do not need to specify the proxy user anymore.

This pr also align the behavior of BatchesResource with that of SessionsResource and OperationsResource(no proxy user parameter).

For Kyuubi Batch, Session and Operation, these resources have the user attiribute.

So we only need to check whether the authentication user has the permission to access the resource.

This pull request fixes #

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

---

- [x] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project
- [x] I have performed a self-review
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

- [x] Pull request title is okay.
- [x] No license issues.
- [x] Milestone correctly set?
- [ ] Test coverage is ok
- [x] Assignees are selected.
- [x] Minimum number of approvals
- [x] No changes are requested

**Be nice. Be informative.**

Closes apache#5717 from turboFei/hive_server2_proxy_user.

Closes apache#5717

70ad7e7 [fwang12] comment
c721a75 [fwang12] ignore
da92bd5 [fwang12] fix ut
9a197d0 [fwang12] doc
c8ed5f9 [fwang12] ut
cef9e32 [fwang12] do not use proxy user

Authored-by: fwang12 <[email protected]>
Signed-off-by: fwang12 <[email protected]>
(cherry picked from commit 3478fc9)
Signed-off-by: fwang12 <[email protected]>
@turboFei
Copy link
Member Author

thanks, merged to master and branch-1.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants