Skip to content

add support for azure access_token#41

Open
saurabh-gupta-pingsafe wants to merge 1 commit into
TritonDataCenter:masterfrom
saurabh-gupta-pingsafe:azure_access_token
Open

add support for azure access_token#41
saurabh-gupta-pingsafe wants to merge 1 commit into
TritonDataCenter:masterfrom
saurabh-gupta-pingsafe:azure_access_token

Conversation

@saurabh-gupta-pingsafe

Copy link
Copy Markdown

No description provided.

@bahamat

bahamat commented Oct 23, 2023

Copy link
Copy Markdown
Contributor

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

saurabh-gupta-pingsafe commented Oct 25, 2023

Copy link
Copy Markdown
Author

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