Skip to content

Add support for Docker credential helpers#460

Merged
chrmarti merged 9 commits into
devcontainers:mainfrom
aaronlehmann:docker-credential-helper
Mar 29, 2023
Merged

Add support for Docker credential helpers#460
chrmarti merged 9 commits into
devcontainers:mainfrom
aaronlehmann:docker-credential-helper

Conversation

@aaronlehmann

Copy link
Copy Markdown
Contributor

This adds the ability to retrieve registry credentials from a credential helper specified in credHelpers or credsStore inside ~/.docker/config.json.

This adds the ability to retrieve registry credentials from a credential
helper specified in `credHelpers` or `credsStore` inside
~/.docker/config.json.
@aaronlehmann aaronlehmann requested a review from a team as a code owner March 19, 2023 00:17
@aaronlehmann

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Netflix"

@samruddhikhandale samruddhikhandale left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice, thanks for putting up this PR! Left some minor comments

Comment thread src/spec-configuration/httpOCIRegistry.ts Outdated
Comment thread src/spec-configuration/httpOCIRegistry.ts Outdated
Comment thread src/spec-configuration/httpOCIRegistry.ts Outdated
Comment thread src/spec-configuration/httpOCIRegistry.ts Outdated
@aaronlehmann

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I made the suggested changes.

@chrmarti 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, left a few comments.

Comment thread src/spec-configuration/httpOCIRegistry.ts Outdated
Comment thread src/spec-configuration/httpOCIRegistry.ts Outdated
Comment thread src/spec-configuration/httpOCIRegistry.ts Outdated
@aaronlehmann

Copy link
Copy Markdown
Contributor Author

Thanks! I've made these changes.

@chrmarti 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.

Great, thanks! Left another question and ran the linter.

Comment thread src/spec-configuration/httpOCIRegistry.ts Outdated
Comment thread src/spec-configuration/httpOCIRegistry.ts
@aaronlehmann

Copy link
Copy Markdown
Contributor Author

Thanks, addressed this latest round of comments.

@joshspicer joshspicer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is awesome, thanks for taking the time (triggered the existing unit tests to run on this PR).

Do you have any suggestions on how to craft unit tests for this? Most of our unit tests run in linux, and we do have a subset of them running in windows. Theoretically we could run against macOS too (if we wanted to...)

Currently familiarizing myself with how this works

@joshspicer joshspicer self-assigned this Mar 27, 2023
@aaronlehmann

Copy link
Copy Markdown
Contributor Author

Do you have any suggestions on how to craft unit tests for this?

Great question. The credential helper "protocol" is very simple and it would be easy to mock a credential helper. But to ensure the returned creds are actually used, we'd need an authenticated registry to connect to, and I'm not sure what kind of test infra exists for that.

joshspicer
joshspicer previously approved these changes Mar 27, 2023

@joshspicer joshspicer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1 to some of the earlier feedback (which you've addressed). I don't want to block on the tests - I can make it an action item for myself if you don't have the time. There's one minor linting error in CI.

Validated this works well on MacOS with AzureCR creds (this branch is ./devcontainer.js and the current release is on my PATH)

image

@chrmarti 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 update. Left another comment on the use of a sync call. Otherwise 👍

Comment thread src/spec-configuration/httpOCIRegistry.ts Outdated

@chrmarti 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 your contribution!

@chrmarti chrmarti merged commit 66117b4 into devcontainers:main Mar 29, 2023
@aaronlehmann

Copy link
Copy Markdown
Contributor Author

Thanks so much for the help geting this through! It's been a great experience.

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.

4 participants