-
Notifications
You must be signed in to change notification settings - Fork 101
feat: remove ForceAttemptOAuth2 add SetLegacyMode to auth client #1038
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
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1038 +/- ##
==========================================
+ Coverage 82.50% 82.59% +0.09%
==========================================
Files 64 64
Lines 4779 4781 +2
==========================================
+ Hits 3943 3949 +6
+ Misses 512 509 -3
+ Partials 324 323 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull request overview
This PR refactors the authentication client API by replacing the public ForceAttemptOAuth2 field with a private legacyMode field and introducing a new SetLegacyMode method. The default authentication behavior changes from using the legacy distribution spec to using OAuth2 with password grant.
Key changes:
- Replaced public
ForceAttemptOAuth2boolean field with privatelegacyModefield andSetLegacyMode(bool)method - Inverted default behavior: OAuth2 is now the default instead of legacy distribution spec
- Updated all tests to use the new API pattern
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| registry/remote/auth/client.go | Replaced ForceAttemptOAuth2 field with legacyMode field, added SetLegacyMode method, and inverted the authentication logic to make OAuth2 the default |
| registry/remote/auth/client_test.go | Removed ForceAttemptOAuth2: true from OAuth2 tests (now use default), added SetLegacyMode(true) calls to legacy distribution spec tests |
| registry/remote/auth/example_test.go | Removed ForceAttemptOAuth2: true from example to use the new OAuth2 default behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
989f536 to
eb3124f
Compare
Signed-off-by: Terry Howe <[email protected]>
Signed-off-by: Terry Howe <[email protected]>
eb3124f to
989f67e
Compare
shizhMSFT
left a comment
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.
Since we are now in v3 development, should we just remove ForceAttemptOAuth2?
This pull request does remove |
Remove ForceAttemptOAuth2 and add SetLegacyMode to the auth client.