-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(backend): Support authentication with ServiceAccountTokens. Part of #5138 #5286
feat(backend): Support authentication with ServiceAccountTokens. Part of #5138 #5286
Conversation
You also need to update (being able to update it in the same PR thanks to @yanniszark's work for moving them here) |
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.
Thank you for the super useful contribution that many users are hoping for!
I'm leaving some early comments before I finish reading all the code. I'll try to finish review tomorrow.
Note, most of them are nit pickings, so feel free to discuss about them. I don't think they are blockers.
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.
@Bobgy thank you for your comments. They are to the point.
I've answered to each one of them and I'll push a few extra commits on top
0f55e91
to
2a8ca8a
Compare
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.
Thank you! I've went through the PR, it's very well structured and well written.
I feel pretty confident about it, except for some very minor nitpickings
@Bobgy: GitHub didn't allow me to request PR reviews from the following users: elikatsis. Note that only kubeflow members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Can you please resolve another conflict? |
/lgtm |
ac4936f
to
5ef17ea
Compare
Introduce common utils for client initialization to factor out common code. This is a step towards fulfilling kubeflow#4738.
Extend the authenticators which the KFP apiserver applies on a request with a TokenReview authenticator. This authenticator expects a ServiceAccountToken in a header with the format: 'Authorization: Bearer <token>' Part of kubeflow#5138
Split the file into: * auth.go: contains the main entrance from the outside of the package * util.go: contains all utility functions used inside
Instead of using AuthenticateRequest to retrieve the user from the request and then use it for the expected values, allocate a variable for the username in the request and use that in the expected values. This ensures we don't hide potential errors of AuthenticateRequest.
5ef17ea
to
3dc13dc
Compare
Have the HTTPHeaderAuthenticator first followed by the TokenReviewAuthenticator
To avoid potential race conditions when initializing the Authenticators variable, we move authenticators to a ResourceManager property and initialize it along with the initialization of the manager.
/lgtm |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Bobgy, elikatsis 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 |
@Bobgy and thank you for the quick and detailed review! I think the code is very improved now. |
Description of your changes:
The changes are described in detail in this comment: #5138 (comment)
In a nutshell:
Authorization: Bearer <token>
ml-pipeline
as audience/cc @Bobgy
/cc @yanniszark
/cc @StefanoFioravanzo
/assign @elikatsis
Checklist:
Do you want this pull request (PR) cherry-picked into the current release branch?
Learn more about cherry-picking updates into the release branch.