Skip to content

Commit 2884c4e

Browse files
authoredDec 16, 2024··
feat: pass through logging in options (#2923)
This connects the logger passed in by users with options to the auth library.
1 parent ccc9019 commit 2884c4e

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed
 

‎go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ module google.golang.org/api
33
go 1.21
44

55
require (
6-
cloud.google.com/go/auth v0.12.1
6+
cloud.google.com/go/auth v0.13.0
77
cloud.google.com/go/auth/oauth2adapt v0.2.6
8-
cloud.google.com/go/compute/metadata v0.5.2
8+
cloud.google.com/go/compute/metadata v0.6.0
99
github.com/google/go-cmp v0.6.0
1010
github.com/google/s2a-go v0.1.8
1111
github.com/google/uuid v1.6.0

‎go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
cloud.google.com/go/auth v0.12.1 h1:n2Bj25BUMM0nvE9D2XLTiImanwZhO3DkfWSYS/SAJP4=
2-
cloud.google.com/go/auth v0.12.1/go.mod h1:BFMu+TNpF3DmvfBO9ClqTR/SiqVIm7LukKF9mbendF4=
1+
cloud.google.com/go/auth v0.13.0 h1:8Fu8TZy167JkW8Tj3q7dIkr2v4cndv41ouecJx0PAHs=
2+
cloud.google.com/go/auth v0.13.0/go.mod h1:COOjD9gwfKNKz+IIduatIhYJQIc0mG3H102r/EMxX6Q=
33
cloud.google.com/go/auth/oauth2adapt v0.2.6 h1:V6a6XDu2lTwPZWOawrAa9HUK+DB2zfJyTuciBG5hFkU=
44
cloud.google.com/go/auth/oauth2adapt v0.2.6/go.mod h1:AlmsELtlEBnaNTL7jCj8VQFLy6mbZv0s4Q7NGBeQ5E8=
5-
cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo=
6-
cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k=
5+
cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I=
6+
cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg=
77
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
88
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
99
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=

‎idtoken/idtoken.go

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ func newTokenSourceNewAuth(ctx context.Context, audience string, ds *internal.Di
113113
CredentialsFile: ds.CredentialsFile,
114114
CredentialsJSON: ds.CredentialsJSON,
115115
Client: oauth2.NewClient(ctx, nil),
116+
Logger: ds.Logger,
116117
})
117118
if err != nil {
118119
return nil, err

‎internal/creds.go

+1
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ func detectDefaultFromDialSettings(settings *DialSettings) (*auth.Credentials, e
139139
CredentialsFile: settings.CredentialsFile,
140140
CredentialsJSON: settings.CredentialsJSON,
141141
UseSelfSignedJWT: useSelfSignedJWT,
142+
Logger: settings.Logger,
142143
})
143144
}
144145

‎transport/grpc/dial.go

+2
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ func dialPoolNewAuth(ctx context.Context, secure bool, poolSize int, ds *interna
235235
Audience: aud,
236236
CredentialsFile: ds.CredentialsFile,
237237
CredentialsJSON: ds.CredentialsJSON,
238+
Logger: ds.Logger,
238239
},
239240
InternalOptions: &grpctransport.InternalOptions{
240241
EnableNonDefaultSAForDirectPath: ds.AllowNonDefaultServiceAccount,
@@ -248,6 +249,7 @@ func dialPoolNewAuth(ctx context.Context, secure bool, poolSize int, ds *interna
248249
SkipValidation: skipValidation,
249250
},
250251
UniverseDomain: ds.UniverseDomain,
252+
Logger: ds.Logger,
251253
})
252254
return pool, err
253255
}

‎transport/http/dial.go

+2
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ func newClientNewAuth(ctx context.Context, base http.RoundTripper, ds *internal.
119119
Audience: aud,
120120
CredentialsFile: ds.CredentialsFile,
121121
CredentialsJSON: ds.CredentialsJSON,
122+
Logger: ds.Logger,
122123
},
123124
InternalOptions: &httptransport.InternalOptions{
124125
EnableJWTWithScope: ds.EnableJwtWithScope,
@@ -129,6 +130,7 @@ func newClientNewAuth(ctx context.Context, base http.RoundTripper, ds *internal.
129130
SkipValidation: skipValidation,
130131
},
131132
UniverseDomain: ds.UniverseDomain,
133+
Logger: ds.Logger,
132134
})
133135
if err != nil {
134136
return nil, err

0 commit comments

Comments
 (0)
Please sign in to comment.