feature: Mark ForceAttemptOAuth2 deprecated and add SetLegacyMode()#973
feature: Mark ForceAttemptOAuth2 deprecated and add SetLegacyMode()#973TerryHowe wants to merge 2 commits intooras-project:v2from
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #973 +/- ##
=======================================
Coverage 80.60% 80.61%
=======================================
Files 64 64
Lines 6125 6127 +2
=======================================
+ Hits 4937 4939 +2
Misses 864 864
Partials 324 324 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This PR is stale because it has been open for 45 days with no activity. Remove the stale label or comment to prevent it from being closed in 30 days. |
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
38eef35 to
aaaf837
Compare
|
This should work like helm/helm#31212 |
Yes, thanks. Updated. |
|
|
||
| // SetLegacyMode favors basic auth even when the registry requests bearer. | ||
| func (c *Client) SetLegacyMode() { | ||
| c.ForceAttemptOAuth2 = false |
There was a problem hiding this comment.
Wondering what's the scenario of this? This field is defaulted to be false.🤔
There was a problem hiding this comment.
This is a method for people to use in the future to preserve the old behavior (favor basic auth).
| // - https://distribution.github.io/distribution/spec/auth/jwt/ | ||
| // - https://distribution.github.io/distribution/spec/auth/oauth/ | ||
| // Deprecated: This will be removed in the future. | ||
| // Calling SetLegacyMode() will preserve ForceAttemptOAuth2 set to false |
There was a problem hiding this comment.
Do we really want to deprecate this when there's no substitute solution?
There was a problem hiding this comment.
This deprecation notice is just to let people know if they are using this variable that it is going away.
There was a problem hiding this comment.
I thought this was what was wanted, but I'll create another PR that is a breaking change
|
I created #1038 to replace this pull request. |
Mark ForceAttemptOAuth2 deprecated and add SetLegacyMode() method to ease migration to oras-go v3.
Closes: #972