-
Notifications
You must be signed in to change notification settings - Fork 178
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
Check user permissions before promoting data science projects #991
Check user permissions before promoting data science projects #991
Conversation
/hold Waiting for an image built to deploy and test. |
/unhold Everything is updated and ready for review. |
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.
We need to look at our linter again -- seems just omitting types is still allowed.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewballantyne The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…tahub-io#991) * Use access token to promote projects * update to use access token * Use pass-through API and selfSubjectAccessReview to check the user permissions * lint * address comments
…tahub-io#991) * Use access token to promote projects * update to use access token * Use pass-through API and selfSubjectAccessReview to check the user permissions * lint * address comments
…tahub-io#991) * Use access token to promote projects * update to use access token * Use pass-through API and selfSubjectAccessReview to check the user permissions * lint * address comments
Closes #963
Description
We can use SelfSubjectReviewAccess to check the permissions of a specific user to some resources. For this issue, we need to check the update permission to the given project, but everything needs to be done at the backend so we need to call
passThrough
and the k8s API endpoint directly before the service account do the labels patching.How Has This Been Tested?
Prerequisite: You must have 2 accounts on the cluster, 1 as the cluster admin (ADMIN) and one as the regular user (USER).
pr-991
to your dashboard pod${dashboardURL}/api/namespaces/${projectYouCreated}/1
, this command will patch a label and promote the project to a model serving project{ applied: true }
, and for the USER account, it should return a 403 erroradmin
and the subject is the regular user, which gives the regular user admin permission to the project{ applied: true }
edit
Follow the test instructions in the last section, you will see this if you have admin permission for the project you are trying to promote:
And the project will be promoted:
If you don't have permission:
Test Impact
N/A, this needs to be tested on the cluster since we need the service account.
Request review criteria: