Skip to content

Commit

Permalink
feat: pass through logging in options (#2923)
Browse files Browse the repository at this point in the history
This connects the logger passed in by users with options to the
auth library.
  • Loading branch information
codyoss authored Dec 16, 2024
1 parent ccc9019 commit 2884c4e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module google.golang.org/api
go 1.21

require (
cloud.google.com/go/auth v0.12.1
cloud.google.com/go/auth v0.13.0
cloud.google.com/go/auth/oauth2adapt v0.2.6
cloud.google.com/go/compute/metadata v0.5.2
cloud.google.com/go/compute/metadata v0.6.0
github.com/google/go-cmp v0.6.0
github.com/google/s2a-go v0.1.8
github.com/google/uuid v1.6.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cloud.google.com/go/auth v0.12.1 h1:n2Bj25BUMM0nvE9D2XLTiImanwZhO3DkfWSYS/SAJP4=
cloud.google.com/go/auth v0.12.1/go.mod h1:BFMu+TNpF3DmvfBO9ClqTR/SiqVIm7LukKF9mbendF4=
cloud.google.com/go/auth v0.13.0 h1:8Fu8TZy167JkW8Tj3q7dIkr2v4cndv41ouecJx0PAHs=
cloud.google.com/go/auth v0.13.0/go.mod h1:COOjD9gwfKNKz+IIduatIhYJQIc0mG3H102r/EMxX6Q=
cloud.google.com/go/auth/oauth2adapt v0.2.6 h1:V6a6XDu2lTwPZWOawrAa9HUK+DB2zfJyTuciBG5hFkU=
cloud.google.com/go/auth/oauth2adapt v0.2.6/go.mod h1:AlmsELtlEBnaNTL7jCj8VQFLy6mbZv0s4Q7NGBeQ5E8=
cloud.google.com/go/compute/metadata v0.5.2 h1:UxK4uu/Tn+I3p2dYWTfiX4wva7aYlKixAHn3fyqngqo=
cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k=
cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I=
cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
Expand Down
1 change: 1 addition & 0 deletions idtoken/idtoken.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ func newTokenSourceNewAuth(ctx context.Context, audience string, ds *internal.Di
CredentialsFile: ds.CredentialsFile,
CredentialsJSON: ds.CredentialsJSON,
Client: oauth2.NewClient(ctx, nil),
Logger: ds.Logger,
})
if err != nil {
return nil, err
Expand Down
1 change: 1 addition & 0 deletions internal/creds.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ func detectDefaultFromDialSettings(settings *DialSettings) (*auth.Credentials, e
CredentialsFile: settings.CredentialsFile,
CredentialsJSON: settings.CredentialsJSON,
UseSelfSignedJWT: useSelfSignedJWT,
Logger: settings.Logger,
})
}

Expand Down
2 changes: 2 additions & 0 deletions transport/grpc/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ func dialPoolNewAuth(ctx context.Context, secure bool, poolSize int, ds *interna
Audience: aud,
CredentialsFile: ds.CredentialsFile,
CredentialsJSON: ds.CredentialsJSON,
Logger: ds.Logger,
},
InternalOptions: &grpctransport.InternalOptions{
EnableNonDefaultSAForDirectPath: ds.AllowNonDefaultServiceAccount,
Expand All @@ -248,6 +249,7 @@ func dialPoolNewAuth(ctx context.Context, secure bool, poolSize int, ds *interna
SkipValidation: skipValidation,
},
UniverseDomain: ds.UniverseDomain,
Logger: ds.Logger,
})
return pool, err
}
Expand Down
2 changes: 2 additions & 0 deletions transport/http/dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func newClientNewAuth(ctx context.Context, base http.RoundTripper, ds *internal.
Audience: aud,
CredentialsFile: ds.CredentialsFile,
CredentialsJSON: ds.CredentialsJSON,
Logger: ds.Logger,
},
InternalOptions: &httptransport.InternalOptions{
EnableJWTWithScope: ds.EnableJwtWithScope,
Expand All @@ -129,6 +130,7 @@ func newClientNewAuth(ctx context.Context, base http.RoundTripper, ds *internal.
SkipValidation: skipValidation,
},
UniverseDomain: ds.UniverseDomain,
Logger: ds.Logger,
})
if err != nil {
return nil, err
Expand Down

0 comments on commit 2884c4e

Please sign in to comment.