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

Fix NewKeychainFromHelper #1265

Merged
merged 2 commits into from
Jan 25, 2022
Merged

Fix NewKeychainFromHelper #1265

merged 2 commits into from
Jan 25, 2022

Conversation

imjasonh
Copy link
Collaborator

  • only pass RegistryStr, since helpers don't expect to see repo paths,
    and might not handle them correctly
  • if the returned username is "", interpret the returned password
    as an identity token
  • add unit tests to cover both of these behaviors

This builds on the excellent work done by @simongottschlag in #1256, and adds unit tests.

- only pass RegistryStr, since helpers don't expect to see repo paths,
  and might not handle them correctly
- if the returned username is "<token>", interpret the returned password
  as an identity token
- add unit tests to cover both of these behaviors
@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2022

Codecov Report

Merging #1265 (f047a6a) into main (3a2a6f1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1265   +/-   ##
=======================================
  Coverage   73.77%   73.78%           
=======================================
  Files         111      111           
  Lines        8286     8289    +3     
=======================================
+ Hits         6113     6116    +3     
  Misses       1571     1571           
  Partials      602      602           
Impacted Files Coverage Δ
pkg/authn/keychain.go 86.15% <100.00%> (+0.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a2a6f1...f047a6a. Read the comment docs.

if err != nil {
return Anonymous, nil
}
// If the secret being stored is an identity token, the Username should be set to <token>
// ref: https://docs.docker.com/engine/reference/commandline/login/#credential-helper-protocol
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the link!

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.

None yet

3 participants