Skip to content

HttpOci: Retry fetching bearer token anonymously if credentials appear expired - #515

Merged
joshspicer merged 6 commits into
mainfrom
joshspicer/retry-anon-bearer
May 19, 2023
Merged

joshspicer merged 6 commits into
mainfrom
joshspicer/retry-anon-bearer

Conversation

@joshspicer

Copy link
Copy Markdown
Contributor

ref: microsoft/vscode-remote-release#8449

When trying to resolve a bearer token, we first attempt with the user credentials available to us for that service. If the returned response is 401 or 403 (ghcr appears to return 403), then we attempt one more time after clearing the Authorization header.

In this example, I set a GitHub PAT via docker login and then revoked the PAT.
image

@joshspicer
joshspicer requested a review from a team as a code owner May 9, 2023 14:36

@chrmarti Christof Marti (chrmarti) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the quick response! Left a single comment.

@joshspicer
joshspicer merged commit 5569d7f into main May 19, 2023
@joshspicer
joshspicer deleted the joshspicer/retry-anon-bearer branch May 19, 2023 14:23
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.

2 participants