Skip to content

Print error for failed HTTP auth request.#1249

Merged
stevvooe merged 3 commits intodistribution:masterfrom
k4leung4:print-error-msg
Jan 5, 2016
Merged

Print error for failed HTTP auth request.#1249
stevvooe merged 3 commits intodistribution:masterfrom
k4leung4:print-error-msg

Conversation

@k4leung4
Copy link
Copy Markdown
Contributor

@k4leung4 k4leung4 commented Dec 8, 2015

In the case of a failed HTTP auth token request, in addition to the current message that is returned, also return the error message in the response. This is to provide the user with a more descriptive message about what went wrong.

Signed-off-by: Kenny Leung [email protected]

@mattmoor
Copy link
Copy Markdown
Contributor

@stevvooe @dmcgowan @aaronlehmann FYI

@stevvooe
Copy link
Copy Markdown
Collaborator

Code LGTM.

@k4leung4 Any tests for this?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems odd to throw away a nicely typed error for a formatted string here. Perhaps any additional messaging about failure to fetch a token should be left to the caller.

@dmp42
Copy link
Copy Markdown
Contributor

dmp42 commented Dec 22, 2015

@k4leung4 This needs a rebase, tests, and addressing @dmcgowan comments :)

@mattmoor
Copy link
Copy Markdown
Contributor

FYI, he's on vacation this week. I will ping him Monday. :)

@dmp42
Copy link
Copy Markdown
Contributor

dmp42 commented Dec 22, 2015

Thanks @mattmoor
It's just a friendly bump either way - I don't expect anything to happen before next year :p

…ution into print-error-msg

Changed to use typed error instead of formatted string.
Added tests for new public method.

Signed-off-by: Kenny Leung <[email protected]>
@k4leung4
Copy link
Copy Markdown
Contributor Author

Changed to make use of typed error instead of formatted string.
Added tests.

please take another look.

@codecov-io
Copy link
Copy Markdown

Current coverage is 57.60%

Merging #1249 into master will increase coverage by +0.07% as of 7ff5042

@@            master   #1249   diff @@
======================================
  Files          116     116       
  Stmts        10468   10469     +1
  Branches       719     719       
  Methods          0       0       
======================================
+ Hit           6023    6031     +8
  Partial        719     719       
+ Missed        3726    3719     -7

Review entire Coverage Diff as of 7ff5042


Uncovered Suggestions

  1. +0.31% via ...ge/driver/gcs/gcs.go#185...216
  2. +0.31% via ...ge/driver/gcs/gcs.go#104...135
  3. +0.23% via ...ge/driver/gcs/gcs.go#469...492
  4. See 7 more...

Powered by Codecov. Updated on successful CI builds.

@stevvooe
Copy link
Copy Markdown
Collaborator

LGTM

@mattmoor
Copy link
Copy Markdown
Contributor

mattmoor commented Jan 5, 2016

Anything left needed to merge this? I ask in part because of the upcoming code freeze.

@dmcgowan
Copy link
Copy Markdown
Collaborator

dmcgowan commented Jan 5, 2016

LGTM

@dmcgowan
Copy link
Copy Markdown
Collaborator

dmcgowan commented Jan 5, 2016

CI is back, lets turn this green then merge 😉

stevvooe added a commit that referenced this pull request Jan 5, 2016
Print error for failed HTTP auth request.
@stevvooe stevvooe merged commit 74d719d into distribution:master Jan 5, 2016
aaronlehmann pushed a commit to aaronlehmann/distribution that referenced this pull request Jan 20, 2016
distribution#1249 changed token fetching
to parse HTTP error response bodies as serialized errcodes. However,
Docker Hub's authentication endpoint does not return error bodies in
this format. To work around this, convert its format into
ErrCodeUnauthorized or ErrCodeUnknown.

Signed-off-by: Aaron Lehmann <[email protected]>
dalsh pushed a commit to dalsh/distribution that referenced this pull request Jan 13, 2017
distribution#1249 changed token fetching
to parse HTTP error response bodies as serialized errcodes. However,
Docker Hub's authentication endpoint does not return error bodies in
this format. To work around this, convert its format into
ErrCodeUnauthorized or ErrCodeUnknown.

Signed-off-by: Aaron Lehmann <[email protected]>
thaJeztah pushed a commit to thaJeztah/distribution that referenced this pull request Apr 22, 2021
Print error for failed HTTP auth request.
thaJeztah pushed a commit to thaJeztah/distribution that referenced this pull request Apr 22, 2021
distribution#1249 changed token fetching
to parse HTTP error response bodies as serialized errcodes. However,
Docker Hub's authentication endpoint does not return error bodies in
this format. To work around this, convert its format into
ErrCodeUnauthorized or ErrCodeUnknown.

Signed-off-by: Aaron Lehmann <[email protected]>
thaJeztah pushed a commit to thaJeztah/distribution that referenced this pull request Jan 19, 2022
Print error for failed HTTP auth request.
thaJeztah pushed a commit to thaJeztah/distribution that referenced this pull request Jan 19, 2022
distribution#1249 changed token fetching
to parse HTTP error response bodies as serialized errcodes. However,
Docker Hub's authentication endpoint does not return error bodies in
this format. To work around this, convert its format into
ErrCodeUnauthorized or ErrCodeUnknown.

Signed-off-by: Aaron Lehmann <[email protected]>
dylanrhysscott pushed a commit to digitalocean/docker-distribution that referenced this pull request Jan 5, 2023
distribution#1249 changed token fetching
to parse HTTP error response bodies as serialized errcodes. However,
Docker Hub's authentication endpoint does not return error bodies in
this format. To work around this, convert its format into
ErrCodeUnauthorized or ErrCodeUnknown.

Signed-off-by: Aaron Lehmann <[email protected]>
thaJeztah pushed a commit to thaJeztah/docker that referenced this pull request Oct 31, 2024
distribution/distribution#1249 changed token fetching
to parse HTTP error response bodies as serialized errcodes. However,
Docker Hub's authentication endpoint does not return error bodies in
this format. To work around this, convert its format into
ErrCodeUnauthorized or ErrCodeUnknown.

Signed-off-by: Aaron Lehmann <[email protected]>
thaJeztah pushed a commit to thaJeztah/docker that referenced this pull request Mar 23, 2025
distribution/distribution#1249 changed token fetching
to parse HTTP error response bodies as serialized errcodes. However,
Docker Hub's authentication endpoint does not return error bodies in
this format. To work around this, convert its format into
ErrCodeUnauthorized or ErrCodeUnknown.

Signed-off-by: Aaron Lehmann <[email protected]>
thaJeztah pushed a commit to thaJeztah/docker that referenced this pull request Nov 6, 2025
distribution/distribution#1249 changed token fetching
to parse HTTP error response bodies as serialized errcodes. However,
Docker Hub's authentication endpoint does not return error bodies in
this format. To work around this, convert its format into
ErrCodeUnauthorized or ErrCodeUnknown.

Signed-off-by: Aaron Lehmann <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants