Add OAuth error for client#2047
Merged
stevvooe merged 2 commits intodistribution:masterfrom Nov 10, 2016
Merged
Conversation
stevvooe
reviewed
Nov 9, 2016
registry/client/errors.go
Outdated
| // permission or invalid token given from a token server. | ||
| // See https://tools.ietf.org/html/rfc6750#section-3 | ||
| type OAuthError struct { | ||
| ErrorCode string |
Collaborator
There was a problem hiding this comment.
Could you clarify that this will contain values from https://tools.ietf.org/html/rfc6750#section-3.1?
18b35e3 to
b9114cc
Compare
Collaborator
Author
|
Updated to cover all 4xx statuses and added further description to error struct |
Split challenges into its own package. Avoids possible import cycle with challenges from client. Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
Allow clients to handle errors being set in the WWW-Authenticate rather than in the body. The WWW-Authenticate errors give a more precise error describing what is needed to authorize with the server. Signed-off-by: Derek McGowan <[email protected]> (github: dmcgowan)
b9114cc to
16396a7
Compare
Current coverage is 51.35% (diff: 48.00%)@@ master #2047 diff @@
==========================================
Files 126 126
Lines 11275 11284 +9
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 6939 5795 -1144
- Misses 3449 4742 +1293
+ Partials 887 747 -140
|
|
LGTM |
1 similar comment
Collaborator
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow clients to handle errors being set in the WWW-Authenticate rather than in the body. The
WWW-Authenticateerrors give a more precise error describing what is needed to authorize with the server. This allows clients to distinguish between 401s which require user login and 401s which are caused by insufficient scope.