From bbf43ebc5e37bf02a1df4a83a6d0db2b23bb889e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 21:19:07 +0000 Subject: [PATCH] chore(deps): Bump google.golang.org/api Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.299.0 to 0.300.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.299.0...v0.300.0) --- updated-dependencies: - dependency-name: google.golang.org/api dependency-version: 0.300.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- ci/resources/stemcell-version-bump/go.mod | 10 +- ci/resources/stemcell-version-bump/go.sum | 20 +- .../cloud.google.com/go/auth/CHANGES.md | 12 + .../vendor/cloud.google.com/go/auth/auth.go | 2 +- .../go/auth/credentials/detect.go | 21 +- .../go/auth/credentials/filetypes.go | 46 +- .../externalaccount/externalaccount.go | 17 +- .../externalaccountuser.go | 13 +- .../go/auth/internal/transport/transport.go | 19 +- .../go/auth/internal/version.go | 2 +- .../go/auth/oauth2adapt/CHANGES.md | 9 +- .../cloud.google.com/go/auth/threelegged.go | 9 +- .../go/compute/metadata/CHANGES.md | 7 + .../gax-go/v2/.release-please-manifest.json | 2 +- .../googleapis/gax-go/v2/CHANGES.md | 32 ++ .../googleapis/gax-go/v2/call_option.go | 40 ++ .../googleapis/gax-go/v2/internal/version.go | 2 +- .../github.com/googleapis/gax-go/v2/invoke.go | 40 +- .../gax-go/v2/proto_json_stream_go127.go | 12 +- .../googleapis/gax-go/v2/telemetry.go | 426 +++++++++++++++++- .../google.golang.org/api/internal/version.go | 2 +- .../api/storage/v1/storage-api.json | 103 ++++- .../api/storage/v1/storage-gen.go | 176 ++++++++ .../stemcell-version-bump/vendor/modules.txt | 18 +- 24 files changed, 949 insertions(+), 91 deletions(-) diff --git a/ci/resources/stemcell-version-bump/go.mod b/ci/resources/stemcell-version-bump/go.mod index 465ac49f9..207fcb07b 100644 --- a/ci/resources/stemcell-version-bump/go.mod +++ b/ci/resources/stemcell-version-bump/go.mod @@ -5,15 +5,15 @@ go 1.26.0 require ( cloud.google.com/go/storage v1.68.0 github.com/stretchr/testify v1.12.1 - google.golang.org/api v0.299.0 + google.golang.org/api v0.300.0 ) require ( cel.dev/expr v0.25.2 // indirect cloud.google.com/go v0.123.0 // indirect - cloud.google.com/go/auth v0.23.3 // indirect - cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect - cloud.google.com/go/compute/metadata v0.9.1 // indirect + cloud.google.com/go/auth v0.24.0 // indirect + cloud.google.com/go/auth/oauth2adapt v0.3.0 // indirect + cloud.google.com/go/compute/metadata v0.10.0 // indirect cloud.google.com/go/iam v1.12.0 // indirect cloud.google.com/go/monitoring v1.30.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.34.0 // indirect @@ -30,7 +30,7 @@ require ( github.com/google/s2a-go v0.1.10 // indirect github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.22 // indirect - github.com/googleapis/gax-go/v2 v2.24.1 // indirect + github.com/googleapis/gax-go/v2 v2.26.2 // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/spiffe/go-spiffe/v2 v2.8.1 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect diff --git a/ci/resources/stemcell-version-bump/go.sum b/ci/resources/stemcell-version-bump/go.sum index c61c3b213..8ba068c55 100644 --- a/ci/resources/stemcell-version-bump/go.sum +++ b/ci/resources/stemcell-version-bump/go.sum @@ -2,12 +2,12 @@ cel.dev/expr v0.25.2 h1:K6j46C81hXtZQfuX60cVWQFBJahKSE2gfRbNuvr5bFs= cel.dev/expr v0.25.2/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= cloud.google.com/go v0.123.0 h1:2NAUJwPR47q+E35uaJeYoNhuNEM9kM8SjgRgdeOJUSE= cloud.google.com/go v0.123.0/go.mod h1:xBoMV08QcqUGuPW65Qfm1o9Y4zKZBpGS+7bImXLTAZU= -cloud.google.com/go/auth v0.23.3 h1:UMK+oBtuNGMCR/6i6mmySUItqjOazpJrbmZyhGbGBWo= -cloud.google.com/go/auth v0.23.3/go.mod h1:fClbry28fo7XkxhSeT6AQtAVAp6Jy0fW9N99PoPNPFM= -cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc= -cloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c= -cloud.google.com/go/compute/metadata v0.9.1 h1:CTE1OWBQ0vnF5uHwdFAQJvMQ0Fi/KRcqqKTo9V0F8Ik= -cloud.google.com/go/compute/metadata v0.9.1/go.mod h1:NtnlvB6X3t4R6xSWyVX/ZWk493PCxGQlhI/iqxh4M8I= +cloud.google.com/go/auth v0.24.0 h1:UYMbF8otPZnLAkNJ5/LYQYOq0ARcJS1P4JqTeMKbCYU= +cloud.google.com/go/auth v0.24.0/go.mod h1:IFG/AMA1VWfuTrdbieEsB2GcpJyJV/phGAvogkOoPR4= +cloud.google.com/go/auth/oauth2adapt v0.3.0 h1:FY8oSZpCYoUNv6QxVODuMjQz4IlSOVeiQtZ08vLPz88= +cloud.google.com/go/auth/oauth2adapt v0.3.0/go.mod h1:7+2uCm7++XFO+/lN06c2HXpDXb/NMNn2/UwyBPbTnkk= +cloud.google.com/go/compute/metadata v0.10.0 h1:pyKMUQSwchgkIBBJGdILqQbs/BNJXqwSA7Ej6LAvvtY= +cloud.google.com/go/compute/metadata v0.10.0/go.mod h1:rGFHRrIif570kSibjFTMbt6/4/tzgJWFGI/HVol4GIk= cloud.google.com/go/iam v1.12.0 h1:Aki3bX9aHUDKPHfnRJfDcTdVedvy6quGBQcTqx3DRXk= cloud.google.com/go/iam v1.12.0/go.mod h1:FEZ4lXpADAC2AIpQY7LANNjjwyQ2jK439CI2VaD+sLY= cloud.google.com/go/logging v1.19.0 h1:NCqhdVUg3wQ8Cobdf16FDSuTGi3+6+hdSBHrY5TsR6Q= @@ -61,8 +61,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.3.22 h1:NU4XpII6jD+Dxcot94fqjE+AfJoE/lQP9q3faYGzC/c= github.com/googleapis/enterprise-certificate-proxy v0.3.22/go.mod h1:L3D/IQExI6LqEjBdXcZQ1WluSgigQmSwBboFstVPM4w= -github.com/googleapis/gax-go/v2 v2.24.1 h1:AtqTN21IXMMWo99LiEVAiBfNNQmO40d8xUfZI640mc0= -github.com/googleapis/gax-go/v2 v2.24.1/go.mod h1:bWeBei0NVwaNZKb2y1HUBS7gLXIF3/Tu3pq7j8D2Tb0= +github.com/googleapis/gax-go/v2 v2.26.2 h1:ydkmNXxj7bEmmeK5AihkKnWxyOyBR9TDebvp5L5izk8= +github.com/googleapis/gax-go/v2 v2.26.2/go.mod h1:sMKqnMesnKH+3wiRJROcttA+cJoZoGbZl1vDQ8XYtGk= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/spiffe/go-spiffe/v2 v2.8.1 h1:eXZMLsu+3MLEPJyGJkolqtVrteZfQdUpOWj6LTiDl/E= @@ -109,8 +109,8 @@ golang.org/x/time v0.16.0 h1:vMb6ptszcQMkcwiRTAuNNU50gom6++Q/6gY2hDM6VDE= golang.org/x/time v0.16.0/go.mod h1:rVKOqvZeKvrDKTQiAHJ7wmwP0RzleSphoEA9RcdLA0s= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= -google.golang.org/api v0.299.0 h1:b3K+ydSMd0kh6TQI6bJyApRQfqQX2MfSOaVkpM59mJw= -google.golang.org/api v0.299.0/go.mod h1:zlR3GVA8b2R5nv5Ij9UWe37StVB3cxDD7DBFi4ZFsHw= +google.golang.org/api v0.300.0 h1:2rvPV2bqnPuHOaF4gGOBiT1IIc6JVXYyHCkZeqdzjNk= +google.golang.org/api v0.300.0/go.mod h1:tKfTSDfK+0FlOVl8N30VL5fU5TuaEkJjvdyTIKNwzPg= google.golang.org/genproto v0.0.0-20260715232425-e75dac1f907d h1:C9v1o0/4quuhOAfmRXA2j+we0PqZIp8traLdeogF3Ms= google.golang.org/genproto v0.0.0-20260715232425-e75dac1f907d/go.mod h1:Wz2wFJntZFmLGo7pLDXZ3wYk5hyc0Mb+SkHhDDXT+lU= google.golang.org/genproto/googleapis/api v0.0.0-20260715232425-e75dac1f907d h1:QwnJwPte4XXAkhPu26LTDIahnsMSUV0kK8HkxbC+Pc4= diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/CHANGES.md b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/CHANGES.md index b28726ccf..a194a7ba5 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/CHANGES.md +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/CHANGES.md @@ -1,5 +1,17 @@ # Changes +## [0.24.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.23.3...auth/v0.24.0) (2026-09-23) + + +### Features + +* **all:** Update supported go versions ([#20520](https://github.com/googleapis/google-cloud-go/issues/20520)) ([90413d3](https://github.com/googleapis/google-cloud-go/commit/90413d3e9d381ef4b92e3c496d98b023c5b2d8cc)) + + +### Bug Fixes + +* **auth:** Honor DisableAsyncRefresh and EarlyTokenRefresh consistently ([#20564](https://github.com/googleapis/google-cloud-go/issues/20564)) ([39f0ea5](https://github.com/googleapis/google-cloud-go/commit/39f0ea51dcbcae2bef1e8c900bdf2e675a19199c)), refs [#20563](https://github.com/googleapis/google-cloud-go/issues/20563) + ## [0.23.3](https://github.com/googleapis/google-cloud-go/compare/auth/v0.23.2...auth/v0.23.3) (2026-09-17) diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/auth.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/auth.go index c6d801583..fd6a11ddf 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/auth.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/auth.go @@ -386,7 +386,7 @@ func (c *cachedTokenProvider) tokenBlocking(ctx context.Context) (*Token, error) c.mu.Lock() defer c.mu.Unlock() c.isRefreshErr = false - if c.cachedToken.IsValid() || (!c.autoRefresh && !c.cachedToken.isEmpty()) { + if c.cachedToken.isValidWithEarlyExpiry(c.expireEarly) || (!c.autoRefresh && !c.cachedToken.isEmpty()) { return c.cachedToken, nil } t, err := c.tp.Token(ctx) diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/detect.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/detect.go index 9ce369d79..f79cca4dc 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/detect.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/detect.go @@ -458,16 +458,17 @@ func clientCredConfigFromJSON(b []byte, opts *DetectOptions) *auth.Options3LO { } } return &auth.Options3LO{ - ClientID: c.ClientID, - ClientSecret: c.ClientSecret, - RedirectURL: c.RedirectURIs[0], - Scopes: opts.scopes(), - AuthURL: c.AuthURI, - TokenURL: c.TokenURI, - Client: opts.client(), - Logger: opts.logger(), - EarlyTokenExpiry: opts.EarlyTokenRefresh, - AuthHandlerOpts: handleOpts, + ClientID: c.ClientID, + ClientSecret: c.ClientSecret, + RedirectURL: c.RedirectURIs[0], + Scopes: opts.scopes(), + AuthURL: c.AuthURI, + TokenURL: c.TokenURI, + Client: opts.client(), + Logger: opts.logger(), + EarlyTokenExpiry: opts.EarlyTokenRefresh, + DisableAsyncRefresh: opts.DisableAsyncRefresh, + AuthHandlerOpts: handleOpts, // TODO(codyoss): refactor this out. We need to add in auto-detection // for this use case. AuthStyle: auth.StyleInParams, diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/filetypes.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/filetypes.go index a82995582..59932fc6d 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/filetypes.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/filetypes.go @@ -109,7 +109,8 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) { } return auth.NewCredentials(&auth.CredentialsOptions{ TokenProvider: auth.NewCachedTokenProvider(tp, &auth.CachedTokenProviderOptions{ - ExpireEarly: opts.EarlyTokenRefresh, + ExpireEarly: opts.EarlyTokenRefresh, + DisableAsyncRefresh: opts.DisableAsyncRefresh, }), JSON: b, ProjectIDProvider: internalauth.StaticCredentialsProperty(projectID), @@ -172,16 +173,17 @@ func handleServiceAccount(f *credsfile.ServiceAccountFile, opts *DetectOptions) func handleUserCredential(f *credsfile.UserCredentialsFile, opts *DetectOptions) (auth.TokenProvider, error) { opts3LO := &auth.Options3LO{ - ClientID: f.ClientID, - ClientSecret: f.ClientSecret, - Scopes: opts.scopes(), - AuthURL: googleAuthURL, - TokenURL: opts.tokenURL(), - AuthStyle: auth.StyleInParams, - EarlyTokenExpiry: opts.EarlyTokenRefresh, - RefreshToken: f.RefreshToken, - Client: opts.client(), - Logger: opts.logger(), + ClientID: f.ClientID, + ClientSecret: f.ClientSecret, + Scopes: opts.scopes(), + AuthURL: googleAuthURL, + TokenURL: opts.tokenURL(), + AuthStyle: auth.StyleInParams, + EarlyTokenExpiry: opts.EarlyTokenRefresh, + DisableAsyncRefresh: opts.DisableAsyncRefresh, + RefreshToken: f.RefreshToken, + Client: opts.client(), + Logger: opts.logger(), } return auth.New3LOTokenProvider(opts3LO) } @@ -199,6 +201,8 @@ func handleExternalAccount(f *credsfile.ExternalAccountFile, opts *DetectOptions QuotaProjectID: f.QuotaProjectID, Scopes: opts.scopes(), WorkforcePoolUserProject: f.WorkforcePoolUserProject, + EarlyTokenRefresh: opts.EarlyTokenRefresh, + DisableAsyncRefresh: opts.DisableAsyncRefresh, Client: opts.client(), Logger: opts.logger(), IsDefaultClient: opts.Client == nil, @@ -243,15 +247,17 @@ func handleExternalAccount(f *credsfile.ExternalAccountFile, opts *DetectOptions func handleExternalAccountAuthorizedUser(f *credsfile.ExternalAccountAuthorizedUserFile, opts *DetectOptions) (auth.TokenProvider, error) { externalOpts := &externalaccountuser.Options{ - Audience: f.Audience, - RefreshToken: f.RefreshToken, - TokenURL: f.TokenURL, - TokenInfoURL: f.TokenInfoURL, - ClientID: f.ClientID, - ClientSecret: f.ClientSecret, - Scopes: opts.scopes(), - Client: opts.client(), - Logger: opts.logger(), + Audience: f.Audience, + RefreshToken: f.RefreshToken, + TokenURL: f.TokenURL, + TokenInfoURL: f.TokenInfoURL, + ClientID: f.ClientID, + ClientSecret: f.ClientSecret, + Scopes: opts.scopes(), + EarlyTokenRefresh: opts.EarlyTokenRefresh, + DisableAsyncRefresh: opts.DisableAsyncRefresh, + Client: opts.client(), + Logger: opts.logger(), } tp, err := externalaccountuser.NewTokenProvider(externalOpts) if err != nil { diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/externalaccount.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/externalaccount.go index f4f49f175..ae38487fa 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/externalaccount.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/internal/externalaccount/externalaccount.go @@ -100,6 +100,13 @@ type Options struct { // for AWS credentials. One of SubjectTokenProvider, // AWSSecurityCredentialProvider or CredentialSource must be provided. Optional. AwsSecurityCredentialsProvider AwsSecurityCredentialsProvider + // EarlyTokenRefresh configures how early before a token expires that it + // should be refreshed. If unset, the default value is 3 minutes and 45 + // seconds. Optional. + EarlyTokenRefresh time.Duration + // DisableAsyncRefresh configures a synchronous workflow that refreshes + // stale tokens while blocking. The default is false. Optional. + DisableAsyncRefresh bool // Client for token request. Client *http.Client // IsDefaultClient marks whether the client passed in is a default client that can be overriden. @@ -249,8 +256,12 @@ func NewTokenProvider(opts *Options) (auth.TokenProvider, error) { logger: logger, } + cacheOpts := &auth.CachedTokenProviderOptions{ + ExpireEarly: opts.EarlyTokenRefresh, + DisableAsyncRefresh: opts.DisableAsyncRefresh, + } if opts.ServiceAccountImpersonationURL == "" { - return auth.NewCachedTokenProvider(tp, nil), nil + return auth.NewCachedTokenProvider(tp, cacheOpts), nil } scopes := make([]string, len(opts.Scopes)) @@ -261,14 +272,14 @@ func NewTokenProvider(opts *Options) (auth.TokenProvider, error) { Client: client, URL: opts.ServiceAccountImpersonationURL, Scopes: scopes, - Tp: auth.NewCachedTokenProvider(tp, nil), + Tp: auth.NewCachedTokenProvider(tp, cacheOpts), TokenLifetimeSeconds: opts.ServiceAccountImpersonationLifetimeSeconds, Logger: logger, }) if err != nil { return nil, err } - return auth.NewCachedTokenProvider(imp, nil), nil + return auth.NewCachedTokenProvider(imp, cacheOpts), nil } type subjectTokenProvider interface { diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/internal/externalaccountuser/externalaccountuser.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/internal/externalaccountuser/externalaccountuser.go index ae39206e5..e4a34b1e5 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/internal/externalaccountuser/externalaccountuser.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/credentials/internal/externalaccountuser/externalaccountuser.go @@ -51,6 +51,14 @@ type Options struct { // Scopes contains the desired scopes for the returned access token. Scopes []string + // EarlyTokenRefresh configures how early before a token expires that it + // should be refreshed. If unset, the default value is 3 minutes and 45 + // seconds. Optional. + EarlyTokenRefresh time.Duration + // DisableAsyncRefresh configures a synchronous workflow that refreshes + // stale tokens while blocking. The default is false. Optional. + DisableAsyncRefresh bool + // Client for token request. Client *http.Client // Logger for logging. @@ -71,7 +79,10 @@ func NewTokenProvider(opts *Options) (auth.TokenProvider, error) { tp := &tokenProvider{ o: opts, } - return auth.NewCachedTokenProvider(tp, nil), nil + return auth.NewCachedTokenProvider(tp, &auth.CachedTokenProviderOptions{ + ExpireEarly: opts.EarlyTokenRefresh, + DisableAsyncRefresh: opts.DisableAsyncRefresh, + }), nil } type tokenProvider struct { diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/transport/transport.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/transport/transport.go index fb0a8a1e0..c4f4c26b7 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/transport/transport.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/transport/transport.go @@ -67,15 +67,16 @@ func CloneDetectOptions(oldDo *credentials.DetectOptions) *credentials.DetectOpt } newDo := &credentials.DetectOptions{ // Simple types - TokenBindingType: oldDo.TokenBindingType, - Audience: oldDo.Audience, - Subject: oldDo.Subject, - EarlyTokenRefresh: oldDo.EarlyTokenRefresh, - TokenURL: oldDo.TokenURL, - STSAudience: oldDo.STSAudience, - CredentialsFile: oldDo.CredentialsFile, - UseSelfSignedJWT: oldDo.UseSelfSignedJWT, - UniverseDomain: oldDo.UniverseDomain, + TokenBindingType: oldDo.TokenBindingType, + Audience: oldDo.Audience, + Subject: oldDo.Subject, + EarlyTokenRefresh: oldDo.EarlyTokenRefresh, + DisableAsyncRefresh: oldDo.DisableAsyncRefresh, + TokenURL: oldDo.TokenURL, + STSAudience: oldDo.STSAudience, + CredentialsFile: oldDo.CredentialsFile, + UseSelfSignedJWT: oldDo.UseSelfSignedJWT, + UniverseDomain: oldDo.UniverseDomain, // These fields are pointer types that we just want to use exactly as // the user set, copy the ref diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/version.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/version.go index 0021a6c4c..eda0ad9f8 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/version.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/internal/version.go @@ -17,4 +17,4 @@ package internal // Version is the current tagged release of the library. -const Version = "0.23.3" +const Version = "0.24.0" diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/oauth2adapt/CHANGES.md b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/oauth2adapt/CHANGES.md index 42716752e..4332fc2a8 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/oauth2adapt/CHANGES.md +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/oauth2adapt/CHANGES.md @@ -1,4 +1,11 @@ -# Changelog +# Changes + +## [0.3.0](https://github.com/googleapis/google-cloud-go/compare/auth/oauth2adapt/v0.2.8...auth/oauth2adapt/v0.3.0) (2026-09-23) + + +### Features + +* **all:** Update supported go versions ([#20520](https://github.com/googleapis/google-cloud-go/issues/20520)) ([90413d3](https://github.com/googleapis/google-cloud-go/commit/90413d3e9d381ef4b92e3c496d98b023c5b2d8cc)) ## [0.2.8](https://github.com/googleapis/google-cloud-go/compare/auth/oauth2adapt/v0.2.7...auth/oauth2adapt/v0.2.8) (2025-03-17) diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/threelegged.go b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/threelegged.go index 07804dc16..9a9d02657 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/threelegged.go +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/auth/threelegged.go @@ -67,6 +67,9 @@ type Options3LO struct { // refreshed. If not set the default value is 3 minutes and 45 seconds. // Optional. EarlyTokenExpiry time.Duration + // DisableAsyncRefresh configures a synchronous workflow that refreshes + // stale tokens while blocking. The default is false. Optional. + DisableAsyncRefresh bool // AuthHandlerOpts provides a set of options for doing a // 3-legged OAuth2 flow with a custom [AuthorizationHandler]. Optional. @@ -192,7 +195,8 @@ func New3LOTokenProvider(opts *Options3LO) (TokenProvider, error) { return new3LOTokenProviderWithAuthHandler(opts), nil } return NewCachedTokenProvider(&tokenProvider3LO{opts: opts, refreshToken: opts.RefreshToken, client: opts.client()}, &CachedTokenProviderOptions{ - ExpireEarly: opts.EarlyTokenExpiry, + ExpireEarly: opts.EarlyTokenExpiry, + DisableAsyncRefresh: opts.DisableAsyncRefresh, }), nil } @@ -211,7 +215,8 @@ type AuthorizationHandlerOptions struct { func new3LOTokenProviderWithAuthHandler(opts *Options3LO) TokenProvider { return NewCachedTokenProvider(&tokenProviderWithHandler{opts: opts, state: opts.AuthHandlerOpts.State}, &CachedTokenProviderOptions{ - ExpireEarly: opts.EarlyTokenExpiry, + ExpireEarly: opts.EarlyTokenExpiry, + DisableAsyncRefresh: opts.DisableAsyncRefresh, }) } diff --git a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/compute/metadata/CHANGES.md b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/compute/metadata/CHANGES.md index 726de96a9..f03d5cd38 100644 --- a/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/compute/metadata/CHANGES.md +++ b/ci/resources/stemcell-version-bump/vendor/cloud.google.com/go/compute/metadata/CHANGES.md @@ -1,5 +1,12 @@ # Changes +## [0.10.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.9.1...compute/metadata/v0.10.0) (2026-09-23) + + +### Features + +* **all:** Update supported go versions ([#20520](https://github.com/googleapis/google-cloud-go/issues/20520)) ([90413d3](https://github.com/googleapis/google-cloud-go/commit/90413d3e9d381ef4b92e3c496d98b023c5b2d8cc)) + ## [0.9.1](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.9.0...compute/metadata/v0.9.1) (2026-09-17) diff --git a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/.release-please-manifest.json b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/.release-please-manifest.json index 07deff77a..c955a3b15 100644 --- a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/.release-please-manifest.json +++ b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/.release-please-manifest.json @@ -1,3 +1,3 @@ { - "v2": "2.24.1" + "v2": "2.26.2" } diff --git a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/CHANGES.md b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/CHANGES.md index 29b17d54b..03a7df68c 100644 --- a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/CHANGES.md +++ b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/CHANGES.md @@ -1,5 +1,37 @@ # Changes +## [2.26.2](https://github.com/googleapis/gax-go/compare/v2.26.1...v2.26.2) (2026-09-26) + + +### Bug Fixes + +* **o11y:** name client request spans as {Service}.{Method} ([#560](https://github.com/googleapis/gax-go/issues/560)) ([1a022c8](https://github.com/googleapis/gax-go/commit/1a022c86141e8e02574dfdfbc979cc95111411e0)) + +## [2.26.1](https://github.com/googleapis/gax-go/compare/v2.26.0...v2.26.1) (2026-09-26) + + +### Bug Fixes + +* correct 1.27 protojson handling ([#558](https://github.com/googleapis/gax-go/issues/558)) ([c1e035d](https://github.com/googleapis/gax-go/commit/c1e035db278d4e60f22da30e5b4772788dd76b20)) +* **o11y:** remove deprioritized gcp.resource.destination.id span attribute ([#559](https://github.com/googleapis/gax-go/issues/559)) ([a6f48a2](https://github.com/googleapis/gax-go/commit/a6f48a2061f4cd09cd54054032a2200d519d0283)) + +## [2.26.0](https://github.com/googleapis/gax-go/compare/v2.25.0...v2.26.0) (2026-09-22) + + +### Features + +* **o11y:** add ClientLogging configuration ([95a5614](https://github.com/googleapis/gax-go/commit/95a5614930f1be8b152b9df8d05fa27e4b1ad9ac)) +* **o11y:** add recordActionableLog helper for L3 error logs ([3d6918a](https://github.com/googleapis/gax-go/commit/3d6918a7e86ee2e55b25f0c09e69f73bf91b6838)) +* **o11y:** add WithClientLogging CallOption ([0393829](https://github.com/googleapis/gax-go/commit/03938291cc30c7d01ad17a885f48e7edfe2623a5)) +* **o11y:** implement actionable error logging in Invoke ([a6867ed](https://github.com/googleapis/gax-go/commit/a6867ed2ea6da971192ba3a89aa9fcb3fa90cdc0)) + +## [2.25.0](https://github.com/googleapis/gax-go/compare/v2.24.1...v2.25.0) (2026-09-21) + + +### Features + +* update go min version to 1.26 ([#548](https://github.com/googleapis/gax-go/issues/548)) ([b943a7d](https://github.com/googleapis/gax-go/commit/b943a7d2b80b8c2acd519311084c92ec0a972b8b)) + ## [2.24.1](https://github.com/googleapis/gax-go/compare/v2.24.0...v2.24.1) (2026-09-03) diff --git a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/call_option.go b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/call_option.go index 8f5948eb3..b844a5eef 100644 --- a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/call_option.go +++ b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/call_option.go @@ -285,4 +285,44 @@ type CallSettings struct { // clientMetrics holds the pre-allocated OpenTelemetry metrics instruments // to use for this call. clientMetrics *ClientMetrics + + // clientTracing holds the pre-allocated OpenTelemetry tracer + // to use for this call. + clientTracing *ClientTracing + + // clientLogging holds the pre-allocated OpenTelemetry/slog logger + // to use for this call. + clientLogging *ClientLogging +} + +type clientTracingOpt struct { + ct *ClientTracing +} + +// Resolve applies the ClientTracing to the CallSettings. +func (o clientTracingOpt) Resolve(s *CallSettings) { + s.clientTracing = o.ct +} + +// WithClientTracing applies tracing instrumentation to the CallSettings. +// +// This is for internal use only. +func WithClientTracing(ct *ClientTracing) CallOption { + return clientTracingOpt{ct: ct} +} + +type clientLoggingOpt struct { + cl *ClientLogging +} + +// Resolve applies the ClientLogging to the CallSettings. +func (o clientLoggingOpt) Resolve(s *CallSettings) { + s.clientLogging = o.cl +} + +// WithClientLogging applies logging instrumentation to the CallSettings. +// +// This is for internal use only. +func WithClientLogging(cl *ClientLogging) CallOption { + return clientLoggingOpt{cl: cl} } diff --git a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/internal/version.go b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/internal/version.go index 845d8697a..325b895de 100644 --- a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/internal/version.go +++ b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/internal/version.go @@ -17,4 +17,4 @@ package internal // Version is the current tagged release of the library. -const Version = "2.24.1" +const Version = "2.26.2" diff --git a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/invoke.go b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/invoke.go index ea16c3c5a..4b1f1a61d 100644 --- a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/invoke.go +++ b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/invoke.go @@ -37,6 +37,7 @@ import ( "github.com/googleapis/gax-go/v2/apierror" "github.com/googleapis/gax-go/v2/callctx" + "go.opentelemetry.io/otel/trace" ) // APICall is a user defined call stub. @@ -89,17 +90,42 @@ func invoke(ctx context.Context, call APICall, settings CallSettings, sp sleeper ctx = c } - if IsFeatureEnabled("METRICS") { - start := time.Now() - ctx = InjectTransportTelemetry(ctx, &TransportTelemetryData{}) + metricsEnabled := IsFeatureEnabled("METRICS") + tracingEnabled := IsFeatureEnabled("TRACING") + loggingEnabled := IsFeatureEnabled("LOGGING") + + retryCount := 0 + if metricsEnabled || tracingEnabled || loggingEnabled { + var start time.Time + if metricsEnabled { + start = time.Now() + } + if ExtractTransportTelemetry(ctx) == nil { + ctx = InjectTransportTelemetry(ctx, &TransportTelemetryData{}) + } + + var span trace.Span + if tracingEnabled { + ctx, span = startSpan(ctx, settings.clientTracing) + } + defer func() { - recordMetric(ctx, settings, time.Since(start), err) + if !metricsEnabled && !tracingEnabled && err == nil { + return + } + errInfo := ExtractTelemetryErrorInfo(ctx, err) + if metricsEnabled { + recordMetricWithInfo(ctx, settings, time.Since(start), &errInfo) + } + if tracingEnabled { + endSpan(ctx, span, &errInfo, err) + } + if loggingEnabled && err != nil { + recordActionableLog(ctx, settings.clientLogging, &errInfo, retryCount, err) + } }() } - retryCount := 0 - // Feature gate: GOOGLE_SDK_GO_EXPERIMENTAL_TRACING=true - tracingEnabled := IsFeatureEnabled("TRACING") for { ctxToUse := ctx if tracingEnabled { diff --git a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/proto_json_stream_go127.go b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/proto_json_stream_go127.go index cf647c428..93937e4d5 100644 --- a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/proto_json_stream_go127.go +++ b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/proto_json_stream_go127.go @@ -34,6 +34,7 @@ package gax import ( "encoding/json/jsontext" "errors" + "fmt" "io" "google.golang.org/protobuf/encoding/protojson" @@ -90,10 +91,14 @@ func (s *ProtoJSONStream) Recv() (proto.Message, error) { if kind == jsontext.KindBeginArray { // Read and discard the start of array. - err := s.stream.SkipValue() + tok, err := s.stream.ReadToken() if err != nil { return nil, err } + // Being pedantic here, because we missed this previously. + if tok.String() != "[" { + return nil, fmt.Errorf("unexpected opening token, expected '[', got %q", tok) + } } else { // stream isn't a JSON array. return nil, errBadOpening @@ -104,10 +109,13 @@ func (s *ProtoJSONStream) Recv() (proto.Message, error) { kind := s.stream.PeekKind() if kind == jsontext.KindEndArray { // We're at the end of the array. - err := s.stream.SkipValue() + tok, err := s.stream.ReadToken() if err != nil { return nil, err } + if tok.String() != "]" { + return nil, fmt.Errorf("unexpected closing token, expected ']', got %q", tok) + } return nil, io.EOF } diff --git a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/telemetry.go b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/telemetry.go index 2490c3690..58e389aae 100644 --- a/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/telemetry.go +++ b/ci/resources/stemcell-version-bump/vendor/github.com/googleapis/gax-go/v2/telemetry.go @@ -35,6 +35,7 @@ import ( "fmt" "log/slog" "strconv" + "strings" "sync" "time" @@ -42,7 +43,9 @@ import ( "github.com/googleapis/gax-go/v2/callctx" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" + otelcodes "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/trace" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) @@ -122,15 +125,20 @@ const ( ClientVersion = "client_version" // ClientArtifact is the library name. E.g. "cloud.google.com/go/storage". ClientArtifact = "client_artifact" + // ClientRepo is the source repository for the client library. E.g. "googleapis/google-cloud-go". + ClientRepo = "client_repo" // RPCSystem is the RPC system type. E.g. "grpc" or "http". RPCSystem = "rpc_system" // URLDomain is the nominal service domain. E.g. "storage.googleapis.com". URLDomain = "url_domain" // Constants for telemetry attribute keys. - keyGCPClientService = "gcp.client.service" - keyRPCSystemName = "rpc.system.name" - keyURLDomain = "url.domain" + keyGCPClientArtifact = "gcp.client.artifact" + keyGCPClientRepo = "gcp.client.repo" + keyGCPClientService = "gcp.client.service" + keyGCPClientVersion = "gcp.client.version" + keyRPCSystemName = "rpc.system.name" + keyURLDomain = "url.domain" // SchemaURL specifies the OpenTelemetry schema version. schemaURL = "https://opentelemetry.io/schemas/1.39.0" @@ -189,11 +197,39 @@ func (a attrOpt) Resolve(opts *telemetryOptions) { opts.attributes = a.attrs } +func (a attrOpt) ResolveTracing(opts *tracingOptions) { + if opts != nil { + opts.attributes = a.attrs + } +} + +func (a attrOpt) ResolveLogging(opts *loggingOptions) { + if opts == nil || len(a.attrs) == 0 { + return + } + if opts.attributes == nil { + opts.attributes = make(map[string]string, len(a.attrs)) + } + for k, v := range a.attrs { + opts.attributes[k] = v + } +} + // WithTelemetryAttributes specifies the static attributes attachments. func WithTelemetryAttributes(attr map[string]string) TelemetryOption { return &attrOpt{attrs: attr} } +// WithTracingAttributes specifies the static attributes attachments for tracing. +func WithTracingAttributes(attr map[string]string) TracingOption { + return &attrOpt{attrs: attr} +} + +// WithLoggingAttributes specifies the static attributes attachments for logging. +func WithLoggingAttributes(attr map[string]string) LoggingOption { + return &attrOpt{attrs: attr} +} + type boundariesOpt struct { boundaries []float64 } @@ -440,6 +476,12 @@ func ExtractTelemetryErrorInfo(ctx context.Context, err error) TelemetryErrorInf // recordMetric records a duration measurement for the configured metric. func recordMetric(ctx context.Context, settings CallSettings, d time.Duration, err error) { + errInfo := ExtractTelemetryErrorInfo(ctx, err) + recordMetricWithInfo(ctx, settings, d, &errInfo) +} + +// recordMetricWithInfo records a duration measurement using pre-extracted error info. +func recordMetricWithInfo(ctx context.Context, settings CallSettings, d time.Duration, errInfo *TelemetryErrorInfo) { if settings.clientMetrics == nil || settings.clientMetrics.durationHistogram() == nil { return } @@ -452,8 +494,6 @@ func recordMetric(ctx context.Context, settings CallSettings, d time.Duration, e attrs := make([]attribute.KeyValue, 0, len(settings.clientMetrics.attributes())+5) attrs = append(attrs, settings.clientMetrics.attributes()...) - errInfo := ExtractTelemetryErrorInfo(ctx, err) - if td := ExtractTransportTelemetry(ctx); td != nil { if td.ServerAddress() != "" { attrs = append(attrs, attribute.String("server.address", td.ServerAddress())) @@ -481,3 +521,379 @@ func recordMetric(ctx context.Context, settings CallSettings, d time.Duration, e settings.clientMetrics.durationHistogram().Record(recordCtx, d.Seconds(), metric.WithAttributes(attrs...)) } + +// startSpan starts a client request span if ClientTracing and its tracer are configured. +func startSpan(ctx context.Context, ct *ClientTracing) (context.Context, trace.Span) { + if ct == nil { + return ctx, nil + } + tracer := ct.tracer() + if tracer == nil { + return ctx, nil + } + spanName := resolveSpanName(ctx) + staticAttrs := ct.attributes() + attrs := make([]attribute.KeyValue, 0, len(staticAttrs)+1) + attrs = append(attrs, staticAttrs...) + if urlTemplate, ok := callctx.TelemetryFromContext(ctx, "url_template"); ok && urlTemplate != "" { + if sanitized := sanitizeURLTemplate(urlTemplate); sanitized != "" { + attrs = append(attrs, attribute.String("url.template", sanitized)) + } + } + return tracer.Start( + ctx, + spanName, + trace.WithSpanKind(trace.SpanKindClient), + trace.WithAttributes(attrs...), + ) +} + +// endSpan records terminal status, diagnostic error details, and ends the client span. +func endSpan(ctx context.Context, span trace.Span, errInfo *TelemetryErrorInfo, err error) { + if span == nil { + return + } + defer span.End() + + if errInfo == nil { + info := ExtractTelemetryErrorInfo(ctx, err) + errInfo = &info + } + + attrs := make([]attribute.KeyValue, 0, 3+len(errInfo.Metadata)) + + if err != nil { + span.RecordError(err) + span.SetStatus(otelcodes.Error, errInfo.StatusCode) + attrs = append(attrs, + attribute.String("error.type", errInfo.ErrorType), + attribute.String("rpc.response.status_code", errInfo.StatusCode), + ) + if errInfo.Domain != "" { + attrs = append(attrs, attribute.String("gcp.errors.domain", errInfo.Domain)) + } + for k, v := range errInfo.Metadata { + attrs = append(attrs, attribute.String("gcp.errors.metadata."+k, v)) + } + } else { + span.SetStatus(otelcodes.Ok, "") + attrs = append(attrs, attribute.String("rpc.response.status_code", "OK")) + } + + if len(attrs) > 0 { + span.SetAttributes(attrs...) + } +} + +// ClientTracing contains the pre-allocated OpenTelemetry tracer and attributes +// for a specific generated Google Cloud client library. +// There should be exactly one ClientTracing instance instantiated per generated client. +type ClientTracing struct { + get func() clientTracingData +} + +type clientTracingData struct { + tracer trace.Tracer + attr []attribute.KeyValue +} + +type tracingOptions struct { + provider trace.TracerProvider + attributes map[string]string +} + +// TracingOption is an option to configure a ClientTracing instance. +// TracingOption works by modifying relevant fields of tracingOptions. +type TracingOption interface { + // ResolveTracing applies the option by modifying opts. + ResolveTracing(opts *tracingOptions) +} + +type tracerProviderOpt struct { + p trace.TracerProvider +} + +func (p tracerProviderOpt) ResolveTracing(opts *tracingOptions) { + if opts != nil { + opts.provider = p.p + } +} + +// WithTracerProvider specifies the trace.TracerProvider to use for client request tracing. +func WithTracerProvider(p trace.TracerProvider) TracingOption { + return &tracerProviderOpt{p: p} +} + +func (config *tracingOptions) tracerProvider() trace.TracerProvider { + if config != nil && config.provider != nil { + return config.provider + } + // Fall back to global tracer provider to prevent silent no-op bug! + return otel.GetTracerProvider() +} + +// NewClientTracing initializes and returns a new ClientTracing instance. +// It is intended to be called once per generated client during initialization. +func NewClientTracing(opts ...TracingOption) *ClientTracing { + var config tracingOptions + for _, opt := range opts { + if opt != nil { + opt.ResolveTracing(&config) + } + } + + return &ClientTracing{ + get: sync.OnceValue(func() clientTracingData { + provider := config.tracerProvider() + + var tracerOpts []trace.TracerOption + if val, ok := config.attributes[ClientVersion]; ok { + tracerOpts = append(tracerOpts, trace.WithInstrumentationVersion(val)) + } + tracerOpts = append(tracerOpts, trace.WithSchemaURL(schemaURL)) + + tracer := provider.Tracer(config.attributes[ClientArtifact], tracerOpts...) + + var attr []attribute.KeyValue + for _, m := range [...]struct{ attrKey, otelKey string }{ + {URLDomain, keyURLDomain}, + {RPCSystem, keyRPCSystemName}, + {ClientService, keyGCPClientService}, + } { + if val, ok := config.attributes[m.attrKey]; ok { + attr = append(attr, attribute.String(m.otelKey, val)) + } + } + attr = attr[:len(attr):len(attr)] + + return clientTracingData{ + tracer: tracer, + attr: attr, + } + }), + } +} + +func (ct *ClientTracing) tracer() trace.Tracer { + if ct == nil || ct.get == nil { + return nil + } + return ct.get().tracer +} + +func (ct *ClientTracing) attributes() []attribute.KeyValue { + if ct == nil || ct.get == nil { + return nil + } + return ct.get().attr +} + +// formatServiceMethod formats a protobuf RPC name (such as +// "google.cloud.secretmanager.v1.SecretManagerService/GetSecret") +// into a span name formatted as "Service.Method" (such as "SecretManager.GetSecret"). +// If the input does not contain a slash separator, it returns the input unchanged. +func formatServiceMethod(rpcMethod string) string { + slashIdx := strings.LastIndex(rpcMethod, "/") + if slashIdx == -1 { + return rpcMethod + } + + service := rpcMethod[:slashIdx] + if dotIdx := strings.LastIndex(service, "."); dotIdx != -1 { + service = service[dotIdx+1:] + } + if trimmed := strings.TrimSuffix(service, "Service"); trimmed != "" { + service = trimmed + } + + method := rpcMethod[slashIdx+1:] + if service == "" || method == "" { + return rpcMethod + } + + return service + "." + method +} + +func resolveSpanName(ctx context.Context) string { + if clientMethod, ok := callctx.TelemetryFromContext(ctx, "client_method"); ok && clientMethod != "" { + return clientMethod + } + if rpcMethod, ok := callctx.TelemetryFromContext(ctx, "rpc_method"); ok && rpcMethod != "" { + return formatServiceMethod(rpcMethod) + } + httpMethod, okHTTP := callctx.TelemetryFromContext(ctx, "http_method") + urlTemplate, okURL := callctx.TelemetryFromContext(ctx, "url_template") + if okHTTP && httpMethod != "" && okURL && urlTemplate != "" { + if sanitized := sanitizeURLTemplate(urlTemplate); sanitized != "" { + return httpMethod + " " + sanitized + } + } + return "gcp.client.request" +} + +// sanitizeURLTemplate removes query parameters and URL fragments from a raw URL template, +// ensuring only the path template is retained. +func sanitizeURLTemplate(rawURL string) string { + if idx := strings.IndexAny(rawURL, "?#"); idx != -1 { + return rawURL[:idx] + } + return rawURL +} + +// ClientLogging contains the pre-allocated slog.Logger and static attributes +// for a specific generated Google Cloud client library. +// There should be exactly one ClientLogging instance instantiated per generated client. +type ClientLogging struct { + get func() clientLoggingData +} + +type clientLoggingData struct { + logger *slog.Logger + attr []slog.Attr +} + +type loggingOptions struct { + logger *slog.Logger + attributes map[string]string +} + +// LoggingOption is an option to configure a ClientLogging instance. +// LoggingOption works by modifying relevant fields of loggingOptions. +type LoggingOption interface { + // ResolveLogging applies the option by modifying opts. + ResolveLogging(opts *loggingOptions) +} + +type loggerProviderOpt struct { + logger *slog.Logger +} + +func (p loggerProviderOpt) ResolveLogging(opts *loggingOptions) { + if opts != nil { + opts.logger = p.logger + } +} + +// WithLoggerProvider specifies the slog.Logger to use for client request logging. +func WithLoggerProvider(logger *slog.Logger) LoggingOption { + return &loggerProviderOpt{logger: logger} +} + +func (config *loggingOptions) loggerProvider() *slog.Logger { + if config != nil && config.logger != nil { + return config.logger + } + // Fall back to default slog logger to prevent silent no-op bug! + return slog.Default() +} + +// NewClientLogging initializes and returns a new ClientLogging instance. +// It is intended to be called once per generated client during initialization. +func NewClientLogging(opts ...LoggingOption) *ClientLogging { + var config loggingOptions + for _, opt := range opts { + if opt != nil { + opt.ResolveLogging(&config) + } + } + + var attr []slog.Attr + for _, m := range [...]struct{ attrKey, slogKey string }{ + {ClientArtifact, keyGCPClientArtifact}, + {ClientRepo, keyGCPClientRepo}, + {ClientService, keyGCPClientService}, + {ClientVersion, keyGCPClientVersion}, + {RPCSystem, keyRPCSystemName}, + {URLDomain, keyURLDomain}, + } { + if val, ok := config.attributes[m.attrKey]; ok { + attr = append(attr, slog.String(m.slogKey, val)) + } + } + attr = attr[:len(attr):len(attr)] + customLogger := config.logger + + return &ClientLogging{ + get: sync.OnceValue(func() clientLoggingData { + logger := customLogger + if logger == nil { + logger = slog.Default() + } + + return clientLoggingData{ + logger: logger, + attr: attr, + } + }), + } +} + +func (cl *ClientLogging) logger() *slog.Logger { + if cl == nil || cl.get == nil { + return nil + } + return cl.get().logger +} + +func (cl *ClientLogging) attributes() []slog.Attr { + if cl == nil || cl.get == nil { + return nil + } + return cl.get().attr +} + +// recordActionableLog emits a structured warning log strictly upon terminal failure. +func recordActionableLog(ctx context.Context, cl *ClientLogging, errInfo *TelemetryErrorInfo, retries int, err error) { + if cl == nil || err == nil { + return + } + if ctx == nil { + ctx = context.Background() + } + logger := cl.logger() + if logger == nil || !logger.Enabled(ctx, slog.LevelWarn) { + return + } + + if errInfo == nil { + info := ExtractTelemetryErrorInfo(ctx, err) + errInfo = &info + } + + attrs := append([]slog.Attr(nil), cl.attributes()...) + + if rpcMethod, ok := callctx.TelemetryFromContext(ctx, "rpc_method"); ok && rpcMethod != "" { + attrs = append(attrs, slog.String("rpc.method", rpcMethod)) + } + if urlTemplate, ok := callctx.TelemetryFromContext(ctx, "url_template"); ok && urlTemplate != "" { + if sanitized := sanitizeURLTemplate(urlTemplate); sanitized != "" { + attrs = append(attrs, slog.String("url.template", sanitized)) + } + } + if td := ExtractTransportTelemetry(ctx); td != nil { + if td.ServerAddress() != "" { + attrs = append(attrs, slog.String("server.address", td.ServerAddress())) + } + if td.ServerPort() != 0 { + attrs = append(attrs, slog.Int("server.port", td.ServerPort())) + } + } + if errInfo.ErrorType != "" { + attrs = append(attrs, slog.String("error.type", errInfo.ErrorType)) + } + if errInfo.StatusCode != "" { + attrs = append(attrs, slog.String("rpc.response.status_code", errInfo.StatusCode)) + } + attrs = append(attrs, + slog.String("error.message", err.Error()), + slog.Int("resend_count", retries), + ) + if errInfo.Domain != "" { + attrs = append(attrs, slog.String("gcp.errors.domain", errInfo.Domain)) + } + for k, v := range errInfo.Metadata { + attrs = append(attrs, slog.String("gcp.errors.metadata."+k, v)) + } + + logger.LogAttrs(ctx, slog.LevelWarn, "gcp.client.request", attrs...) +} diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/version.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/version.go index 2a34e0bef..f2cd9f49c 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/version.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/internal/version.go @@ -5,4 +5,4 @@ package internal // Version is the current tagged release of the library. -const Version = "0.299.0" +const Version = "0.300.0" diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-api.json b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-api.json index 449df5535..f075cf4a4 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-api.json +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-api.json @@ -253,7 +253,7 @@ "location": "northamerica-south1" } ], - "etag": "\"35383135343338383530313436313234313131\"", + "etag": "\"3132373433353833303733323234363038313037\"", "icons": { "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png", "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png" @@ -4167,6 +4167,57 @@ "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/devstorage.full_control" ] + }, + "viewFullContext": { + "description": "Retrieves a specific object context with its extended data for a given object.", + "httpMethod": "GET", + "id": "storage.objects.viewFullContext", + "parameterOrder": [ + "bucket", + "object" + ], + "parameters": { + "bucket": { + "description": "Name of the bucket in which the object resides.", + "location": "path", + "required": true, + "type": "string" + }, + "contextKey": { + "description": "Key identifying the object context to retrieve.", + "location": "query", + "required": true, + "type": "string" + }, + "generation": { + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query", + "type": "string" + }, + "object": { + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "location": "path", + "required": true, + "type": "string" + }, + "userProject": { + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query", + "type": "string" + } + }, + "path": "b/{bucket}/o/{object}/viewFullContext", + "response": { + "$ref": "ObjectFullContext" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] } } }, @@ -4731,7 +4782,7 @@ } } }, - "revision": "20260911", + "revision": "20260926", "rootUrl": "https://storage.googleapis.com/", "schemas": { "AdvanceRelocateBucketOperationRequest": { @@ -6540,6 +6591,54 @@ }, "type": "object" }, + "ObjectFullContext": { + "description": "A full representation of an object context.", + "id": "ObjectFullContext", + "properties": { + "createTime": { + "description": "The time at which the object context was created. This value is in RFC 3339 format.", + "format": "date-time", + "type": "string" + }, + "extendedData": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "description": "The extended data of the object context.", + "type": "object" + }, + "key": { + "description": "The key of the object context.", + "type": "string" + }, + "kind": { + "default": "storage#objectFullContext", + "description": "The kind of item this is. For ObjectFullContext, this is always storage#objectFullContext.", + "type": "string" + }, + "type": { + "description": "The type of the object context.", + "enum": [ + "CUSTOM" + ], + "enumDescriptions": [ + "Custom object context." + ], + "type": "string" + }, + "updateTime": { + "description": "The time at which the object context was last updated. This value is in RFC 3339 format.", + "format": "date-time", + "type": "string" + }, + "value": { + "description": "The value of the object context.", + "type": "string" + } + }, + "type": "object" + }, "Objects": { "description": "A list of objects.", "id": "Objects", diff --git a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-gen.go b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-gen.go index 4c3c79ba6..628f32b85 100644 --- a/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-gen.go +++ b/ci/resources/stemcell-version-bump/vendor/google.golang.org/api/storage/v1/storage-gen.go @@ -2749,6 +2749,49 @@ func (s ObjectCustomContextPayload) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) } +// ObjectFullContext: A full representation of an object context. +type ObjectFullContext struct { + // CreateTime: The time at which the object context was created. This value is + // in RFC 3339 format. + CreateTime string `json:"createTime,omitempty"` + // ExtendedData: The extended data of the object context. + ExtendedData googleapi.RawMessage `json:"extendedData,omitempty"` + // Key: The key of the object context. + Key string `json:"key,omitempty"` + // Kind: The kind of item this is. For ObjectFullContext, this is always + // storage#objectFullContext. + Kind string `json:"kind,omitempty"` + // Type: The type of the object context. + // + // Possible values: + // "CUSTOM" - Custom object context. + Type string `json:"type,omitempty"` + // UpdateTime: The time at which the object context was last updated. This + // value is in RFC 3339 format. + UpdateTime string `json:"updateTime,omitempty"` + // Value: The value of the object context. + Value string `json:"value,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the server. + googleapi.ServerResponse `json:"-"` + // ForceSendFields is a list of field names (e.g. "CreateTime") to + // unconditionally include in API requests. By default, fields with empty or + // default values are omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more + // details. + ForceSendFields []string `json:"-"` + // NullFields is a list of field names (e.g. "CreateTime") to include in API + // requests with the JSON null value. By default, fields with empty values are + // omitted from API requests. See + // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. + NullFields []string `json:"-"` +} + +func (s ObjectFullContext) MarshalJSON() ([]byte, error) { + type NoMethod ObjectFullContext + return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields) +} + // Objects: A list of objects. type Objects struct { // Items: The list of items. @@ -13134,6 +13177,139 @@ func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) { return ret, nil } +type ObjectsViewFullContextCall struct { + s *Service + bucket string + object string + urlParams_ gensupport.URLParams + ifNoneMatch_ string + ctx_ context.Context + header_ http.Header +} + +// ViewFullContext: Retrieves a specific object context with its extended data +// for a given object. +// +// - bucket: Name of the bucket in which the object resides. +// - contextKey: Key identifying the object context to retrieve. +// - object: Name of the object. For information about how to URL encode object +// names to be path safe, see Encoding URI Path Parts +// (https://cloud.google.com/storage/docs/request-endpoints#encoding). +func (r *ObjectsService) ViewFullContext(bucket string, object string) *ObjectsViewFullContextCall { + c := &ObjectsViewFullContextCall{s: r.s, urlParams_: make(gensupport.URLParams)} + c.bucket = bucket + c.object = object + return c +} + +// Generation sets the optional parameter "generation": If present, selects a +// specific revision of this object (as opposed to the latest version, the +// default). +func (c *ObjectsViewFullContextCall) Generation(generation int64) *ObjectsViewFullContextCall { + c.urlParams_.Set("generation", fmt.Sprint(generation)) + return c +} + +// UserProject sets the optional parameter "userProject": The project to be +// billed for this request. Required for Requester Pays buckets. +func (c *ObjectsViewFullContextCall) UserProject(userProject string) *ObjectsViewFullContextCall { + c.urlParams_.Set("userProject", userProject) + return c +} + +// Fields allows partial responses to be retrieved. See +// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more +// details. +func (c *ObjectsViewFullContextCall) Fields(s ...googleapi.Field) *ObjectsViewFullContextCall { + c.urlParams_.Set("fields", googleapi.CombineFields(s)) + return c +} + +// IfNoneMatch sets an optional parameter which makes the operation fail if the +// object's ETag matches the given value. This is useful for getting updates +// only after the object has changed since the last request. +func (c *ObjectsViewFullContextCall) IfNoneMatch(entityTag string) *ObjectsViewFullContextCall { + c.ifNoneMatch_ = entityTag + return c +} + +// Context sets the context to be used in this call's Do method. +func (c *ObjectsViewFullContextCall) Context(ctx context.Context) *ObjectsViewFullContextCall { + c.ctx_ = ctx + return c +} + +// Header returns a http.Header that can be modified by the caller to add +// headers to the request. +func (c *ObjectsViewFullContextCall) Header() http.Header { + if c.header_ == nil { + c.header_ = make(http.Header) + } + return c.header_ +} + +func (c *ObjectsViewFullContextCall) doRequest(alt string) (*http.Response, error) { + reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) + if c.ifNoneMatch_ != "" { + reqHeaders.Set("If-None-Match", c.ifNoneMatch_) + } + c.urlParams_.Set("alt", alt) + c.urlParams_.Set("prettyPrint", "false") + urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/viewFullContext") + urls += "?" + c.urlParams_.Encode() + req, err := http.NewRequest("GET", urls, nil) + if err != nil { + return nil, err + } + req.Header = reqHeaders + googleapi.Expand(req.URL, map[string]string{ + "bucket": c.bucket, + "object": c.object, + }) + c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "storage.objects.viewFullContext", "request", internallog.HTTPRequest(req, nil)) + return gensupport.SendRequest(c.ctx_, c.s.client, req) +} + +// Do executes the "storage.objects.viewFullContext" call. +// Any non-2xx status code is an error. Response headers are in either +// *ObjectFullContext.ServerResponse.Header or (if a response was returned at +// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to +// check whether the returned error was because http.StatusNotModified was +// returned. +func (c *ObjectsViewFullContextCall) Do(opts ...googleapi.CallOption) (*ObjectFullContext, error) { + gensupport.SetOptions(c.urlParams_, opts...) + res, err := c.doRequest("json") + if res != nil && res.StatusCode == http.StatusNotModified { + if res.Body != nil { + res.Body.Close() + } + return nil, gensupport.WrapError(&googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + }) + } + if err != nil { + return nil, err + } + defer googleapi.CloseBody(res) + if err := googleapi.CheckResponse(res); err != nil { + return nil, gensupport.WrapError(err) + } + ret := &ObjectFullContext{ + ServerResponse: googleapi.ServerResponse{ + Header: res.Header, + HTTPStatusCode: res.StatusCode, + }, + } + target := &ret + b, err := gensupport.DecodeResponseBytes(target, res) + if err != nil { + return nil, err + } + c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "storage.objects.viewFullContext", "response", internallog.HTTPResponse(res, b)) + return ret, nil +} + type OperationsAdvanceRelocateBucketCall struct { s *Service bucket string diff --git a/ci/resources/stemcell-version-bump/vendor/modules.txt b/ci/resources/stemcell-version-bump/vendor/modules.txt index 9ec193496..dcb0ae07e 100644 --- a/ci/resources/stemcell-version-bump/vendor/modules.txt +++ b/ci/resources/stemcell-version-bump/vendor/modules.txt @@ -7,8 +7,8 @@ cloud.google.com/go/internal cloud.google.com/go/internal/optional cloud.google.com/go/internal/trace cloud.google.com/go/internal/version -# cloud.google.com/go/auth v0.23.3 -## explicit; go 1.25.0 +# cloud.google.com/go/auth v0.24.0 +## explicit; go 1.26.0 cloud.google.com/go/auth cloud.google.com/go/auth/credentials cloud.google.com/go/auth/credentials/idtoken @@ -29,11 +29,11 @@ cloud.google.com/go/auth/internal/retry cloud.google.com/go/auth/internal/transport cloud.google.com/go/auth/internal/transport/cert cloud.google.com/go/auth/internal/transport/headers -# cloud.google.com/go/auth/oauth2adapt v0.2.8 -## explicit; go 1.23.0 +# cloud.google.com/go/auth/oauth2adapt v0.3.0 +## explicit; go 1.26.0 cloud.google.com/go/auth/oauth2adapt -# cloud.google.com/go/compute/metadata v0.9.1 -## explicit; go 1.25.0 +# cloud.google.com/go/compute/metadata v0.10.0 +## explicit; go 1.26.0 cloud.google.com/go/compute/metadata # cloud.google.com/go/iam v1.12.0 ## explicit; go 1.25.0 @@ -166,8 +166,8 @@ github.com/google/uuid ## explicit; go 1.25.0 github.com/googleapis/enterprise-certificate-proxy/client github.com/googleapis/enterprise-certificate-proxy/client/util -# github.com/googleapis/gax-go/v2 v2.24.1 -## explicit; go 1.25.0 +# github.com/googleapis/gax-go/v2 v2.26.2 +## explicit; go 1.26.0 github.com/googleapis/gax-go/v2 github.com/googleapis/gax-go/v2/apierror github.com/googleapis/gax-go/v2/apierror/internal/proto @@ -323,7 +323,7 @@ golang.org/x/text/unicode/norm # golang.org/x/time v0.16.0 ## explicit; go 1.26.0 golang.org/x/time/rate -# google.golang.org/api v0.299.0 +# google.golang.org/api v0.300.0 ## explicit; go 1.26.0 google.golang.org/api/googleapi google.golang.org/api/googleapi/transport