working commit

This commit is contained in:
2026-03-10 12:52:12 +02:00
parent d0a5fab362
commit d1ef1fbe50
42 changed files with 242 additions and 426 deletions
+7 -6
View File
@@ -9,12 +9,12 @@ import (
"time"
)
func xxxxTestClientGetToken(t *testing.T) {
func xxxTestClientGetToken(t *testing.T) {
var token string
var err error
{
cli := NewClient()
cli.UseMiddleware(NewBasicAuthMiddleware("xxxxxxx", "xxxxxxxxxx"))
cli := NewClient(nil, nil)
//cli.UseMiddleware(NewBasicAuthMiddleware("xxxxxxx", "xxxxxxxxxx"))
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
token, err = cli.GetToken(ctx, "https://auth.docker.io/token")
require.NoError(t, err)
@@ -23,11 +23,12 @@ func xxxxTestClientGetToken(t *testing.T) {
fmt.Printf("Token: %s\n", token)
{
rawrepo := "docker.io/onborodin/toolbox:0.18"
cli := NewClient()
cli.UseMiddleware(NewBearerAuthMiddleware(token))
cli := NewClient(nil, nil)
//cli.UseMiddleware(NewBearerAuthMiddleware(token))
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
loc, err := cli.GetUpload(ctx, rawrepo)
id, loc, err := cli.GetUpload(ctx, rawrepo)
require.NoError(t, err)
fmt.Printf("Upload ID: %s\n", id)
fmt.Printf("Upload Location: %s\n", loc)
}