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

feat: Support basic auth and bearer auth login to registry #3310

Merged
merged 1 commit into from Nov 7, 2023

Conversation

tosone
Copy link
Contributor

@tosone tosone commented Oct 18, 2023

Summary

In some scenarios, user wants to login the registry in oneline command. trivy can be used like this: trivy image --registry-token xx image

Release Note

Support basic auth and bearer auth login to registry

@tosone
Copy link
Contributor Author

tosone commented Oct 18, 2023

@haydentherapper Could you please review this pr?

@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Merging #3310 (e111ed9) into main (e92f0a3) will decrease coverage by 0.04%.
Report is 16 commits behind head on main.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #3310      +/-   ##
==========================================
- Coverage   30.65%   30.61%   -0.04%     
==========================================
  Files         155      155              
  Lines        9994    10007      +13     
==========================================
  Hits         3064     3064              
- Misses       6474     6487      +13     
  Partials      456      456              
Files Coverage Δ
cmd/cosign/cli/options/registry.go 0.00% <0.00%> (ø)

Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

it lgtm
but wondering if we can rely on the existing auth like when you do docker login ...

@tosone
Copy link
Contributor Author

tosone commented Oct 19, 2023

Yes, github.com/google/go-containerregistry can read the auth info from docker login, but in some scenarios, I have no the basic auth(username/password) info, only the bearer token, gcr(github.com/google/go-containerregistry) also supports bearer token access registry.
I have some code snippets that need this feat. https://github.com/go-sigma/sigma/blob/main/pkg/signing/cosign/sign/sign.go#L82

@tosone
Copy link
Contributor Author

tosone commented Oct 27, 2023

@haydentherapper gently ping.

@bobcallaway bobcallaway merged commit 827f24e into sigstore:main Nov 7, 2023
28 checks passed
@github-actions github-actions bot added this to the v2.3.0 milestone Nov 7, 2023
@cpanato cpanato modified the milestones: v2.3.0, v2.2.1 Nov 16, 2023
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