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 crane auth token #1709

Merged
merged 1 commit into from
May 22, 2023
Merged

Add crane auth token #1709

merged 1 commit into from
May 22, 2023

Conversation

jonjohnsonjr
Copy link
Collaborator

@jonjohnsonjr jonjohnsonjr commented May 19, 2023

This makes it easier to just use curl.

Fixes #1470

@codecov-commenter
Copy link

codecov-commenter commented May 19, 2023

Codecov Report

Merging #1709 (b0a0fd5) into main (e61c519) will decrease coverage by 0.46%.
The diff coverage is 54.01%.

❗ Current head b0a0fd5 differs from pull request most recent head 87972c3. Consider uploading reports for the commit 87972c3 to get more accurate results

@@            Coverage Diff             @@
##             main    #1709      +/-   ##
==========================================
- Coverage   72.20%   71.74%   -0.46%     
==========================================
  Files         121      121              
  Lines        9720     9782      +62     
==========================================
  Hits         7018     7018              
- Misses       2028     2088      +60     
- Partials      674      676       +2     
Impacted Files Coverage Δ
pkg/v1/remote/transport/bearer.go 60.29% <31.81%> (-16.40%) ⬇️
pkg/v1/remote/transport/ping.go 84.39% <84.21%> (-0.11%) ⬇️
pkg/crane/options.go 74.66% <100.00%> (+0.69%) ⬆️
pkg/v1/remote/transport/schemer.go 100.00% <100.00%> (ø)
pkg/v1/remote/transport/transport.go 95.83% <100.00%> (ø)

... and 1 file with indirect coverage changes

@jonjohnsonjr jonjohnsonjr marked this pull request as ready for review May 19, 2023 23:46
@tianon
Copy link
Contributor

tianon commented May 19, 2023

This is really neat 😄

(This makes it easier to just use curl.)

In order to do this, we expose some functionality in the transport
package:

transport.Ping(...) Challenge
transport.Exchange(..., Challenge) Token
transport.FromToken(..., Challenge, Token) http.RoundTripper

This will also make it possible to save a Challenge from the Ping() or a
Token from the Exchange() so that callers can elide token exchanges
across multiple calls (without using remote.Pusher or remote.Puller).
@jonjohnsonjr jonjohnsonjr merged commit 1d535e2 into google:main May 22, 2023
@jonjohnsonjr jonjohnsonjr deleted the token branch May 22, 2023 19:59
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.

crane auth token $registry
4 participants