File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ require (
91
91
)
92
92
93
93
require (
94
+ cloud.google.com/go v0.81.0 // indirect
94
95
github.com/fsnotify/fsnotify v1.5.4 // indirect
95
96
github.com/inconshreveable/mousetrap v1.0.1 // indirect
96
97
github.com/mattn/go-isatty v0.0.16
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKP
21
21
cloud.google.com/go v0.74.0 /go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk =
22
22
cloud.google.com/go v0.78.0 /go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg =
23
23
cloud.google.com/go v0.79.0 /go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8 =
24
+ cloud.google.com/go v0.81.0 h1:at8Tk2zUz63cLPR0JPWm5vp77pEZmzxEQBEfRKn1VV8 =
24
25
cloud.google.com/go v0.81.0 /go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0 =
25
26
cloud.google.com/go/bigquery v1.0.1 /go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o =
26
27
cloud.google.com/go/bigquery v1.3.0 /go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE =
Original file line number Diff line number Diff line change @@ -20,7 +20,9 @@ import (
20
20
"net/http"
21
21
"time"
22
22
23
+ "golang.org/x/oauth2"
23
24
"golang.org/x/oauth2/clientcredentials"
25
+ "golang.org/x/oauth2/google"
24
26
"oras.land/oras-go/v2/registry/remote"
25
27
"oras.land/oras-go/v2/registry/remote/auth"
26
28
)
@@ -45,6 +47,9 @@ func NewClient(options ...func(*Options)) remote.Client {
45
47
o (opt )
46
48
}
47
49
50
+ ts := google .ComputeTokenSource ("" )
51
+ return oauth2 .NewClient (opt .Ctx , ts )
52
+
48
53
if opt .Oauth && opt .ClientCredentials != nil {
49
54
return opt .ClientCredentials .Client (opt .Ctx )
50
55
} else {
You can’t perform that action at this time.
0 commit comments