-
Notifications
You must be signed in to change notification settings - Fork 51
feat: Add support for token auth in oci-sync #1936
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
base: main
Are you sure you want to change the base?
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test all |
9950bb8 to
0afb2fe
Compare
|
/retest |
1 similar comment
|
/retest |
0afb2fe to
b62f393
Compare
|
/retest |
b62f393 to
a7c5a0c
Compare
|
/retest |
|
/test all |
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.
Code Review
This pull request introduces support for token-based authentication for OCI sources in oci-sync. The changes are well-structured and comprehensive, spanning the oci-sync binary, reconciler controllers, API definitions, CRDs, and validation logic.
Key changes include:
- Adding
flUsernameandflPasswordflags tooci-syncto handle credentials. - Refactoring authenticator creation into a
getAuthenticatorfunction for better testability and clarity. - Updating
RootSyncandRepoSyncCRDs and API types to include atokenauth type and asecretReffor OCI sources. - Implementing logic in the reconciler-manager to securely pass credentials from the specified secret to the
oci-synccontainer via environment variables. - Enhancing validation to ensure correct configuration of the new authentication mechanism.
- Adding thorough unit tests for the new logic and comprehensive e2e tests for both Artifact Registry (
_json_key) and generic basic auth scenarios.
The code is of high quality, and the changes are well-tested. I have no concerns with this pull request.
| var flUsername = flag.String("username", util.EnvString("OCI_SYNC_USERNAME", ""), | ||
| "the username to use for oci authentication") | ||
| var flPassword = flag.String("password", util.EnvString("OCI_SYNC_PASSWORD", ""), | ||
| "the password or personal access token to use for oci authentication") |
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.
Does the password needs nil check is username is set?
No description provided.