Skip to content
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

add support for azure access_token #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

saurabh-gupta-pingsafe
Copy link

No description provided.

@bahamat
Copy link
Member

bahamat commented Oct 23, 2023

Hi @saurabh-gupta-pingsafe and @nishant-pingsafe, could you provide some context as to why this change is being requested?

I'd also like to see a test case showing the current behavior with any error messages produced, along with the new behavior showing success.

@saurabh-gupta-pingsafe
Copy link
Author

saurabh-gupta-pingsafe commented Oct 25, 2023

Hi @bahamat ,

When we run docker login V2 on azure container registry, it throws the following error

        if (fields.err) {
                   ^

TypeError: Cannot read properties of null (reading 'err')
    at UnauthorizedError._DockerRegistryClientBaseError (/Users/myrepo/node_modules/docker-registry-client/lib/errors.js:101:20)
    at new UnauthorizedError (/Users/myrepo/node_modules/docker-registry-client/lib/errors.js:161:36)
    at /Users/myrepo/node_modules/docker-registry-client/lib/registry-client-v2.js:349:23
    at IncomingMessage.finish (/Users/myrepo/node_modules/docker-registry-client/lib/docker-json-client.js:171:13)

This is because azure container registry returns token in the field called "access_token" but currently we are only checking on "token".

I have added support for "access_token" as well.

With access token, the login works as expected.

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.

3 participants