build(deps): bump the go-deps group across 1 directory with 15 updates
Bumps the go-deps group with 12 updates in the / directory: | Package | From | To | | --- | --- | --- | | [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) | `1.41.0` | `1.42.0` | | [github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://github.com/Azure/azure-sdk-for-go) | `1.5.2` | `1.6.0` | | [github.com/Azure/go-autorest/autorest/azure/auth](https://github.com/Azure/go-autorest) | `0.5.12` | `0.5.13` | | [github.com/BurntSushi/toml](https://github.com/BurntSushi/toml) | `1.3.2` | `1.4.0` | | [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) | `1.53.6` | `1.54.2` | | [github.com/getsentry/sentry-go](https://github.com/getsentry/sentry-go) | `0.27.0` | `0.28.1` | | [github.com/gophercloud/gophercloud](https://github.com/gophercloud/gophercloud) | `1.11.0` | `1.12.0` | | [github.com/hashicorp/go-retryablehttp](https://github.com/hashicorp/go-retryablehttp) | `0.7.6` | `0.7.7` | | [github.com/openshift-online/ocm-sdk-go](https://github.com/openshift-online/ocm-sdk-go) | `0.1.420` | `0.1.425` | | [github.com/osbuild/images](https://github.com/osbuild/images) | `0.65.0` | `0.66.0` | | [github.com/spf13/cobra](https://github.com/spf13/cobra) | `1.8.0` | `1.8.1` | | [github.com/vmware/govmomi](https://github.com/vmware/govmomi) | `0.37.2` | `0.37.3` | Updates `cloud.google.com/go/storage` from 1.41.0 to 1.42.0 - [Release notes](https://github.com/googleapis/google-cloud-go/releases) - [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md) - [Commits](https://github.com/googleapis/google-cloud-go/compare/spanner/v1.41.0...spanner/v1.42.0) Updates `github.com/Azure/azure-sdk-for-go/sdk/azidentity` from 1.5.2 to 1.6.0 - [Release notes](https://github.com/Azure/azure-sdk-for-go/releases) - [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md) - [Commits](https://github.com/Azure/azure-sdk-for-go/compare/sdk/internal/v1.5.2...sdk/azcore/v1.6.0) Updates `github.com/Azure/go-autorest/autorest/azure/auth` from 0.5.12 to 0.5.13 - [Release notes](https://github.com/Azure/go-autorest/releases) - [Changelog](https://github.com/Azure/go-autorest/blob/main/CHANGELOG.md) - [Commits](https://github.com/Azure/go-autorest/compare/autorest/azure/auth/v0.5.12...autorest/azure/auth/v0.5.13) Updates `github.com/BurntSushi/toml` from 1.3.2 to 1.4.0 - [Release notes](https://github.com/BurntSushi/toml/releases) - [Commits](https://github.com/BurntSushi/toml/compare/v1.3.2...v1.4.0) Updates `github.com/aws/aws-sdk-go` from 1.53.6 to 1.54.2 - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.53.6...v1.54.2) Updates `github.com/getsentry/sentry-go` from 0.27.0 to 0.28.1 - [Release notes](https://github.com/getsentry/sentry-go/releases) - [Changelog](https://github.com/getsentry/sentry-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-go/compare/v0.27.0...v0.28.1) Updates `github.com/gophercloud/gophercloud` from 1.11.0 to 1.12.0 - [Release notes](https://github.com/gophercloud/gophercloud/releases) - [Changelog](https://github.com/gophercloud/gophercloud/blob/master/CHANGELOG.md) - [Commits](https://github.com/gophercloud/gophercloud/compare/v1.11.0...v1.12.0) Updates `github.com/hashicorp/go-retryablehttp` from 0.7.6 to 0.7.7 - [Changelog](https://github.com/hashicorp/go-retryablehttp/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/go-retryablehttp/compare/v0.7.6...v0.7.7) Updates `github.com/openshift-online/ocm-sdk-go` from 0.1.420 to 0.1.425 - [Release notes](https://github.com/openshift-online/ocm-sdk-go/releases) - [Changelog](https://github.com/openshift-online/ocm-sdk-go/blob/main/CHANGES.md) - [Commits](https://github.com/openshift-online/ocm-sdk-go/compare/v0.1.420...v0.1.425) Updates `github.com/osbuild/images` from 0.65.0 to 0.66.0 - [Release notes](https://github.com/osbuild/images/releases) - [Commits](https://github.com/osbuild/images/compare/v0.65.0...v0.66.0) Updates `github.com/spf13/cobra` from 1.8.0 to 1.8.1 - [Release notes](https://github.com/spf13/cobra/releases) - [Commits](https://github.com/spf13/cobra/compare/v1.8.0...v1.8.1) Updates `github.com/vmware/govmomi` from 0.37.2 to 0.37.3 - [Release notes](https://github.com/vmware/govmomi/releases) - [Changelog](https://github.com/vmware/govmomi/blob/main/CHANGELOG.md) - [Commits](https://github.com/vmware/govmomi/compare/v0.37.2...v0.37.3) Updates `golang.org/x/oauth2` from 0.20.0 to 0.21.0 - [Commits](https://github.com/golang/oauth2/compare/v0.20.0...v0.21.0) Updates `golang.org/x/sys` from 0.20.0 to 0.21.0 - [Commits](https://github.com/golang/sys/compare/v0.20.0...v0.21.0) Updates `google.golang.org/api` from 0.181.0 to 0.183.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.181.0...v0.183.0) --- updated-dependencies: - dependency-name: cloud.google.com/go/storage dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-deps - dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azidentity dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-deps - dependency-name: github.com/Azure/go-autorest/autorest/azure/auth dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-deps - dependency-name: github.com/BurntSushi/toml dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-deps - dependency-name: github.com/aws/aws-sdk-go dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-deps - dependency-name: github.com/getsentry/sentry-go dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-deps - dependency-name: github.com/gophercloud/gophercloud dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-deps - dependency-name: github.com/hashicorp/go-retryablehttp dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-deps - dependency-name: github.com/openshift-online/ocm-sdk-go dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-deps - dependency-name: github.com/osbuild/images dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-deps - dependency-name: github.com/spf13/cobra dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-deps - dependency-name: github.com/vmware/govmomi dependency-type: direct:production update-type: version-update:semver-patch dependency-group: go-deps - dependency-name: golang.org/x/oauth2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-deps - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-deps - dependency-name: google.golang.org/api dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-deps ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
parent
c13d37c3c0
commit
b8a2592719
223 changed files with 23323 additions and 15511 deletions
24
vendor/cloud.google.com/go/auth/CHANGES.md
generated
vendored
24
vendor/cloud.google.com/go/auth/CHANGES.md
generated
vendored
|
|
@ -1,5 +1,29 @@
|
|||
# Changelog
|
||||
|
||||
## [0.5.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.5.0...auth/v0.5.1) (2024-05-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **auth:** Pass through client to 2LO and 3LO flows ([#10290](https://github.com/googleapis/google-cloud-go/issues/10290)) ([685784e](https://github.com/googleapis/google-cloud-go/commit/685784ea84358c15e9214bdecb307d37aa3b6d2f))
|
||||
|
||||
## [0.5.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.4.2...auth/v0.5.0) (2024-05-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **auth:** Adds X509 workload certificate provider ([#10233](https://github.com/googleapis/google-cloud-go/issues/10233)) ([17a9db7](https://github.com/googleapis/google-cloud-go/commit/17a9db73af35e3d1a7a25ac4fd1377a103de6150))
|
||||
|
||||
## [0.4.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.4.1...auth/v0.4.2) (2024-05-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **auth:** Enable client certificates by default only for GDU ([#10151](https://github.com/googleapis/google-cloud-go/issues/10151)) ([7c52978](https://github.com/googleapis/google-cloud-go/commit/7c529786275a39b7e00525f7d5e7be0d963e9e15))
|
||||
* **auth:** Handle non-Transport DefaultTransport ([#10162](https://github.com/googleapis/google-cloud-go/issues/10162)) ([fa3bfdb](https://github.com/googleapis/google-cloud-go/commit/fa3bfdb23aaa45b34394a8b61e753b3587506782)), refs [#10159](https://github.com/googleapis/google-cloud-go/issues/10159)
|
||||
* **auth:** Have refresh time match docs ([#10147](https://github.com/googleapis/google-cloud-go/issues/10147)) ([bcb5568](https://github.com/googleapis/google-cloud-go/commit/bcb5568c07a54dd3d2e869d15f502b0741a609e8))
|
||||
* **auth:** Update compute token fetching error with named prefix ([#10180](https://github.com/googleapis/google-cloud-go/issues/10180)) ([4573504](https://github.com/googleapis/google-cloud-go/commit/4573504828d2928bebedc875d87650ba227829ea))
|
||||
|
||||
## [0.4.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.4.0...auth/v0.4.1) (2024-05-09)
|
||||
|
||||
|
||||
|
|
|
|||
2
vendor/cloud.google.com/go/auth/auth.go
generated
vendored
2
vendor/cloud.google.com/go/auth/auth.go
generated
vendored
|
|
@ -39,7 +39,7 @@ const (
|
|||
|
||||
// 3 minutes and 45 seconds before expiration. The shortest MDS cache is 4 minutes,
|
||||
// so we give it 15 seconds to refresh it's cache before attempting to refresh a token.
|
||||
defaultExpiryDelta = 215 * time.Second
|
||||
defaultExpiryDelta = 225 * time.Second
|
||||
|
||||
universeDomainDefault = "googleapis.com"
|
||||
)
|
||||
|
|
|
|||
4
vendor/cloud.google.com/go/auth/credentials/compute.go
generated
vendored
4
vendor/cloud.google.com/go/auth/credentials/compute.go
generated
vendored
|
|
@ -64,9 +64,9 @@ func (cs computeProvider) Token(ctx context.Context) (*auth.Token, error) {
|
|||
v.Set("scopes", strings.Join(cs.scopes, ","))
|
||||
tokenURI.RawQuery = v.Encode()
|
||||
}
|
||||
tokenJSON, err := metadata.Get(tokenURI.String())
|
||||
tokenJSON, err := metadata.GetWithContext(ctx, tokenURI.String())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("credentials: cannot fetch token: %w", err)
|
||||
}
|
||||
var res metadataTokenResp
|
||||
if err := json.NewDecoder(strings.NewReader(tokenJSON)).Decode(&res); err != nil {
|
||||
|
|
|
|||
2
vendor/cloud.google.com/go/auth/credentials/filetypes.go
generated
vendored
2
vendor/cloud.google.com/go/auth/credentials/filetypes.go
generated
vendored
|
|
@ -137,6 +137,7 @@ func handleServiceAccount(f *credsfile.ServiceAccountFile, opts *DetectOptions)
|
|||
Scopes: opts.scopes(),
|
||||
TokenURL: f.TokenURL,
|
||||
Subject: opts.Subject,
|
||||
Client: opts.client(),
|
||||
}
|
||||
if opts2LO.TokenURL == "" {
|
||||
opts2LO.TokenURL = jwtTokenURL
|
||||
|
|
@ -154,6 +155,7 @@ func handleUserCredential(f *credsfile.UserCredentialsFile, opts *DetectOptions)
|
|||
AuthStyle: auth.StyleInParams,
|
||||
EarlyTokenExpiry: opts.EarlyTokenRefresh,
|
||||
RefreshToken: f.RefreshToken,
|
||||
Client: opts.client(),
|
||||
}
|
||||
return auth.New3LOTokenProvider(opts3LO)
|
||||
}
|
||||
|
|
|
|||
2
vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go
generated
vendored
2
vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go
generated
vendored
|
|
@ -47,7 +47,7 @@ var (
|
|||
|
||||
// Options used to configure a [GRPCClientConnPool] from [Dial].
|
||||
type Options struct {
|
||||
// DisableTelemetry disables default telemetry (OpenCensus). An example
|
||||
// DisableTelemetry disables default telemetry (OpenTelemetry). An example
|
||||
// reason to do so would be to bind custom telemetry that overrides the
|
||||
// defaults.
|
||||
DisableTelemetry bool
|
||||
|
|
|
|||
11
vendor/cloud.google.com/go/auth/httptransport/httptransport.go
generated
vendored
11
vendor/cloud.google.com/go/auth/httptransport/httptransport.go
generated
vendored
|
|
@ -33,7 +33,7 @@ type ClientCertProvider = func(*tls.CertificateRequestInfo) (*tls.Certificate, e
|
|||
|
||||
// Options used to configure a [net/http.Client] from [NewClient].
|
||||
type Options struct {
|
||||
// DisableTelemetry disables default telemetry (OpenCensus). An example
|
||||
// DisableTelemetry disables default telemetry (OpenTelemetry). An example
|
||||
// reason to do so would be to bind custom telemetry that overrides the
|
||||
// defaults.
|
||||
DisableTelemetry bool
|
||||
|
|
@ -152,7 +152,14 @@ func AddAuthorizationMiddleware(client *http.Client, creds *auth.Credentials) er
|
|||
}
|
||||
base := client.Transport
|
||||
if base == nil {
|
||||
base = http.DefaultTransport.(*http.Transport).Clone()
|
||||
if dt, ok := http.DefaultTransport.(*http.Transport); ok {
|
||||
base = dt.Clone()
|
||||
} else {
|
||||
// Directly reuse the DefaultTransport if the application has
|
||||
// replaced it with an implementation of RoundTripper other than
|
||||
// http.Transport.
|
||||
base = http.DefaultTransport
|
||||
}
|
||||
}
|
||||
client.Transport = &authTransport{
|
||||
creds: creds,
|
||||
|
|
|
|||
8
vendor/cloud.google.com/go/auth/internal/transport/cba.go
generated
vendored
8
vendor/cloud.google.com/go/auth/internal/transport/cba.go
generated
vendored
|
|
@ -217,7 +217,7 @@ func getTransportConfig(opts *Options) (*transportConfig, error) {
|
|||
// encountered while initializing the default source will be reported as client
|
||||
// error (ex. corrupt metadata file).
|
||||
func getClientCertificateSource(opts *Options) (cert.Provider, error) {
|
||||
if !isClientCertificateEnabled() {
|
||||
if !isClientCertificateEnabled(opts) {
|
||||
return nil, nil
|
||||
} else if opts.ClientCertProvider != nil {
|
||||
return opts.ClientCertProvider, nil
|
||||
|
|
@ -226,14 +226,14 @@ func getClientCertificateSource(opts *Options) (cert.Provider, error) {
|
|||
|
||||
}
|
||||
|
||||
// isClientCertificateEnabled returns true by default, unless explicitly set to false via env var.
|
||||
func isClientCertificateEnabled() bool {
|
||||
// isClientCertificateEnabled returns true by default for all GDU universe domain, unless explicitly overridden by env var
|
||||
func isClientCertificateEnabled(opts *Options) bool {
|
||||
if value, ok := os.LookupEnv(googleAPIUseCertSource); ok {
|
||||
// error as false is OK
|
||||
b, _ := strconv.ParseBool(value)
|
||||
return b
|
||||
}
|
||||
return true
|
||||
return opts.isUniverseDomainGDU()
|
||||
}
|
||||
|
||||
type transportConfig struct {
|
||||
|
|
|
|||
117
vendor/cloud.google.com/go/auth/internal/transport/cert/workload_cert.go
generated
vendored
Normal file
117
vendor/cloud.google.com/go/auth/internal/transport/cert/workload_cert.go
generated
vendored
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
// Copyright 2024 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package cert
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/googleapis/enterprise-certificate-proxy/client/util"
|
||||
)
|
||||
|
||||
type certConfigs struct {
|
||||
Workload *workloadSource `json:"workload"`
|
||||
}
|
||||
|
||||
type workloadSource struct {
|
||||
CertPath string `json:"cert_path"`
|
||||
KeyPath string `json:"key_path"`
|
||||
}
|
||||
|
||||
type certificateConfig struct {
|
||||
CertConfigs certConfigs `json:"cert_configs"`
|
||||
}
|
||||
|
||||
// NewWorkloadX509CertProvider creates a certificate source
|
||||
// that reads a certificate and private key file from the local file system.
|
||||
// This is intended to be used for workload identity federation.
|
||||
//
|
||||
// The configFilePath points to a config file containing relevant parameters
|
||||
// such as the certificate and key file paths.
|
||||
// If configFilePath is empty, the client will attempt to load the config from
|
||||
// a well-known gcloud location.
|
||||
func NewWorkloadX509CertProvider(configFilePath string) (Provider, error) {
|
||||
if configFilePath == "" {
|
||||
envFilePath := util.GetConfigFilePathFromEnv()
|
||||
if envFilePath != "" {
|
||||
configFilePath = envFilePath
|
||||
} else {
|
||||
configFilePath = util.GetDefaultConfigFilePath()
|
||||
}
|
||||
}
|
||||
|
||||
certFile, keyFile, err := getCertAndKeyFiles(configFilePath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
source := &workloadSource{
|
||||
CertPath: certFile,
|
||||
KeyPath: keyFile,
|
||||
}
|
||||
return source.getClientCertificate, nil
|
||||
}
|
||||
|
||||
// getClientCertificate attempts to load the certificate and key from the files specified in the
|
||||
// certificate config.
|
||||
func (s *workloadSource) getClientCertificate(info *tls.CertificateRequestInfo) (*tls.Certificate, error) {
|
||||
cert, err := tls.LoadX509KeyPair(s.CertPath, s.KeyPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &cert, nil
|
||||
}
|
||||
|
||||
// getCertAndKeyFiles attempts to read the provided config file and return the certificate and private
|
||||
// key file paths.
|
||||
func getCertAndKeyFiles(configFilePath string) (string, string, error) {
|
||||
jsonFile, err := os.Open(configFilePath)
|
||||
if err != nil {
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
return "", "", errSourceUnavailable
|
||||
}
|
||||
return "", "", err
|
||||
}
|
||||
|
||||
byteValue, err := io.ReadAll(jsonFile)
|
||||
if err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
|
||||
var config certificateConfig
|
||||
if err := json.Unmarshal(byteValue, &config); err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
|
||||
if config.CertConfigs.Workload == nil {
|
||||
return "", "", errors.New("no Workload Identity Federation certificate information found in the certificate configuration file")
|
||||
}
|
||||
|
||||
certFile := config.CertConfigs.Workload.CertPath
|
||||
keyFile := config.CertConfigs.Workload.KeyPath
|
||||
|
||||
if certFile == "" {
|
||||
return "", "", errors.New("certificate configuration is missing the certificate file location")
|
||||
}
|
||||
|
||||
if keyFile == "" {
|
||||
return "", "", errors.New("certificate configuration is missing the key file location")
|
||||
}
|
||||
|
||||
return certFile, keyFile, nil
|
||||
}
|
||||
24
vendor/cloud.google.com/go/internal/.repo-metadata-full.json
generated
vendored
24
vendor/cloud.google.com/go/internal/.repo-metadata-full.json
generated
vendored
|
|
@ -776,7 +776,7 @@
|
|||
"language": "go",
|
||||
"client_library_type": "generated",
|
||||
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/commerce/latest/consumer/procurement/apiv1",
|
||||
"release_level": "preview",
|
||||
"release_level": "stable",
|
||||
"library_type": "GAPIC_AUTO"
|
||||
},
|
||||
"cloud.google.com/go/compute/apiv1": {
|
||||
|
|
@ -826,7 +826,7 @@
|
|||
"language": "go",
|
||||
"client_library_type": "generated",
|
||||
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/config/latest/apiv1",
|
||||
"release_level": "preview",
|
||||
"release_level": "stable",
|
||||
"library_type": "GAPIC_AUTO"
|
||||
},
|
||||
"cloud.google.com/go/contactcenterinsights/apiv1": {
|
||||
|
|
@ -1666,7 +1666,7 @@
|
|||
"language": "go",
|
||||
"client_library_type": "generated",
|
||||
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/migrationcenter/latest/apiv1",
|
||||
"release_level": "preview",
|
||||
"release_level": "stable",
|
||||
"library_type": "GAPIC_AUTO"
|
||||
},
|
||||
"cloud.google.com/go/monitoring/apiv3/v2": {
|
||||
|
|
@ -1706,7 +1706,7 @@
|
|||
"language": "go",
|
||||
"client_library_type": "generated",
|
||||
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/netapp/latest/apiv1",
|
||||
"release_level": "preview",
|
||||
"release_level": "stable",
|
||||
"library_type": "GAPIC_AUTO"
|
||||
},
|
||||
"cloud.google.com/go/networkconnectivity/apiv1": {
|
||||
|
|
@ -2076,7 +2076,7 @@
|
|||
"language": "go",
|
||||
"client_library_type": "generated",
|
||||
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/redis/latest/cluster/apiv1",
|
||||
"release_level": "preview",
|
||||
"release_level": "stable",
|
||||
"library_type": "GAPIC_AUTO"
|
||||
},
|
||||
"cloud.google.com/go/resourcemanager/apiv2": {
|
||||
|
|
@ -2219,6 +2219,16 @@
|
|||
"release_level": "stable",
|
||||
"library_type": "GAPIC_AUTO"
|
||||
},
|
||||
"cloud.google.com/go/security/publicca/apiv1": {
|
||||
"api_shortname": "publicca",
|
||||
"distribution_name": "cloud.google.com/go/security/publicca/apiv1",
|
||||
"description": "Public Certificate Authority API",
|
||||
"language": "go",
|
||||
"client_library_type": "generated",
|
||||
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/security/latest/publicca/apiv1",
|
||||
"release_level": "preview",
|
||||
"library_type": "GAPIC_AUTO"
|
||||
},
|
||||
"cloud.google.com/go/security/publicca/apiv1beta1": {
|
||||
"api_shortname": "publicca",
|
||||
"distribution_name": "cloud.google.com/go/security/publicca/apiv1beta1",
|
||||
|
|
@ -2336,7 +2346,7 @@
|
|||
"language": "go",
|
||||
"client_library_type": "generated",
|
||||
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/servicehealth/latest/apiv1",
|
||||
"release_level": "preview",
|
||||
"release_level": "stable",
|
||||
"library_type": "GAPIC_AUTO"
|
||||
},
|
||||
"cloud.google.com/go/servicemanagement/apiv1": {
|
||||
|
|
@ -2866,7 +2876,7 @@
|
|||
"language": "go",
|
||||
"client_library_type": "generated",
|
||||
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/workstations/latest/apiv1",
|
||||
"release_level": "preview",
|
||||
"release_level": "stable",
|
||||
"library_type": "GAPIC_AUTO"
|
||||
},
|
||||
"cloud.google.com/go/workstations/apiv1beta": {
|
||||
|
|
|
|||
19
vendor/cloud.google.com/go/storage/CHANGES.md
generated
vendored
19
vendor/cloud.google.com/go/storage/CHANGES.md
generated
vendored
|
|
@ -1,6 +1,25 @@
|
|||
# Changes
|
||||
|
||||
|
||||
## [1.42.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.41.0...storage/v1.42.0) (2024-06-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **storage:** Add new package transfermanager. This package is intended for parallel uploads and downloads, and is in preview. It is not stable, and is likely to change. ([#10045](https://github.com/googleapis/google-cloud-go/issues/10045)) ([cde5cbb](https://github.com/googleapis/google-cloud-go/commit/cde5cbba3145d5a702683656a42158621234fe71))
|
||||
* **storage:** Add bucket HierarchicalNamespace ([#10315](https://github.com/googleapis/google-cloud-go/issues/10315)) ([b92406c](https://github.com/googleapis/google-cloud-go/commit/b92406ccfadfdcee379e86d6f78c901d772401a9)), refs [#10146](https://github.com/googleapis/google-cloud-go/issues/10146)
|
||||
* **storage:** Add BucketName to BucketHandle ([#10127](https://github.com/googleapis/google-cloud-go/issues/10127)) ([203cc59](https://github.com/googleapis/google-cloud-go/commit/203cc599e5e2f2f821dc75b47c5a4c9073333f05))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **storage:** Set invocation headers on xml reads ([#10250](https://github.com/googleapis/google-cloud-go/issues/10250)) ([c87e1ab](https://github.com/googleapis/google-cloud-go/commit/c87e1ab6f9618b8b3f4d0005ac159abd87b0daaf))
|
||||
|
||||
|
||||
### Documentation
|
||||
|
||||
* **storage:** Update autoclass doc ([#10135](https://github.com/googleapis/google-cloud-go/issues/10135)) ([e4b2737](https://github.com/googleapis/google-cloud-go/commit/e4b2737ddc16d3bf8139a6def7326ac905f62acd))
|
||||
|
||||
## [1.41.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.40.0...storage/v1.41.0) (2024-05-13)
|
||||
|
||||
|
||||
|
|
|
|||
11
vendor/cloud.google.com/go/storage/acl.go
generated
vendored
11
vendor/cloud.google.com/go/storage/acl.go
generated
vendored
|
|
@ -16,8 +16,6 @@ package storage
|
|||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"reflect"
|
||||
|
||||
"cloud.google.com/go/internal/trace"
|
||||
"cloud.google.com/go/storage/internal/apiv2/storagepb"
|
||||
|
|
@ -162,15 +160,6 @@ func (a *ACLHandle) objectDelete(ctx context.Context, entity ACLEntity) error {
|
|||
return a.c.tc.DeleteObjectACL(ctx, a.bucket, a.object, entity, opts...)
|
||||
}
|
||||
|
||||
func (a *ACLHandle) configureCall(ctx context.Context, call interface{ Header() http.Header }) {
|
||||
vc := reflect.ValueOf(call)
|
||||
vc.MethodByName("Context").Call([]reflect.Value{reflect.ValueOf(ctx)})
|
||||
if a.userProject != "" {
|
||||
vc.MethodByName("UserProject").Call([]reflect.Value{reflect.ValueOf(a.userProject)})
|
||||
}
|
||||
setClientHeader(call.Header())
|
||||
}
|
||||
|
||||
func toObjectACLRules(items []*raw.ObjectAccessControl) []ACLRule {
|
||||
var rs []ACLRule
|
||||
for _, item := range items {
|
||||
|
|
|
|||
65
vendor/cloud.google.com/go/storage/bucket.go
generated
vendored
65
vendor/cloud.google.com/go/storage/bucket.go
generated
vendored
|
|
@ -116,6 +116,11 @@ func (b *BucketHandle) DefaultObjectACL() *ACLHandle {
|
|||
return &b.defaultObjectACL
|
||||
}
|
||||
|
||||
// BucketName returns the name of the bucket.
|
||||
func (b *BucketHandle) BucketName() string {
|
||||
return b.name
|
||||
}
|
||||
|
||||
// Object returns an ObjectHandle, which provides operations on the named object.
|
||||
// This call does not perform any network operations such as fetching the object or verifying its existence.
|
||||
// Use methods on ObjectHandle to perform network operations.
|
||||
|
|
@ -486,6 +491,13 @@ type BucketAttrs struct {
|
|||
// 7 day retention duration. In order to fully disable soft delete, you need
|
||||
// to set a policy with a RetentionDuration of 0.
|
||||
SoftDeletePolicy *SoftDeletePolicy
|
||||
|
||||
// HierarchicalNamespace contains the bucket's hierarchical namespace
|
||||
// configuration. Hierarchical namespace enabled buckets can contain
|
||||
// [cloud.google.com/go/storage/control/apiv2/controlpb.Folder] resources.
|
||||
// It cannot be modified after bucket creation time.
|
||||
// UniformBucketLevelAccess must also also be enabled on the bucket.
|
||||
HierarchicalNamespace *HierarchicalNamespace
|
||||
}
|
||||
|
||||
// BucketPolicyOnly is an alias for UniformBucketLevelAccess.
|
||||
|
|
@ -767,6 +779,7 @@ type Autoclass struct {
|
|||
// TerminalStorageClass: The storage class that objects in the bucket
|
||||
// eventually transition to if they are not read for a certain length of
|
||||
// time. Valid values are NEARLINE and ARCHIVE.
|
||||
// To modify TerminalStorageClass, Enabled must be set to true.
|
||||
TerminalStorageClass string
|
||||
// TerminalStorageClassUpdateTime represents the time of the most recent
|
||||
// update to "TerminalStorageClass".
|
||||
|
|
@ -786,6 +799,15 @@ type SoftDeletePolicy struct {
|
|||
RetentionDuration time.Duration
|
||||
}
|
||||
|
||||
// HierarchicalNamespace contains the bucket's hierarchical namespace
|
||||
// configuration. Hierarchical namespace enabled buckets can contain
|
||||
// [cloud.google.com/go/storage/control/apiv2/controlpb.Folder] resources.
|
||||
type HierarchicalNamespace struct {
|
||||
// Enabled indicates whether hierarchical namespace features are enabled on
|
||||
// the bucket. This can only be set at bucket creation time currently.
|
||||
Enabled bool
|
||||
}
|
||||
|
||||
func newBucket(b *raw.Bucket) (*BucketAttrs, error) {
|
||||
if b == nil {
|
||||
return nil, nil
|
||||
|
|
@ -824,6 +846,7 @@ func newBucket(b *raw.Bucket) (*BucketAttrs, error) {
|
|||
CustomPlacementConfig: customPlacementFromRaw(b.CustomPlacementConfig),
|
||||
Autoclass: toAutoclassFromRaw(b.Autoclass),
|
||||
SoftDeletePolicy: toSoftDeletePolicyFromRaw(b.SoftDeletePolicy),
|
||||
HierarchicalNamespace: toHierarchicalNamespaceFromRaw(b.HierarchicalNamespace),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
@ -858,6 +881,7 @@ func newBucketFromProto(b *storagepb.Bucket) *BucketAttrs {
|
|||
ProjectNumber: parseProjectNumber(b.GetProject()), // this can return 0 the project resource name is ID based
|
||||
Autoclass: toAutoclassFromProto(b.GetAutoclass()),
|
||||
SoftDeletePolicy: toSoftDeletePolicyFromProto(b.SoftDeletePolicy),
|
||||
HierarchicalNamespace: toHierarchicalNamespaceFromProto(b.HierarchicalNamespace),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -914,6 +938,7 @@ func (b *BucketAttrs) toRawBucket() *raw.Bucket {
|
|||
CustomPlacementConfig: b.CustomPlacementConfig.toRawCustomPlacement(),
|
||||
Autoclass: b.Autoclass.toRawAutoclass(),
|
||||
SoftDeletePolicy: b.SoftDeletePolicy.toRawSoftDeletePolicy(),
|
||||
HierarchicalNamespace: b.HierarchicalNamespace.toRawHierarchicalNamespace(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -975,6 +1000,7 @@ func (b *BucketAttrs) toProtoBucket() *storagepb.Bucket {
|
|||
CustomPlacementConfig: b.CustomPlacementConfig.toProtoCustomPlacement(),
|
||||
Autoclass: b.Autoclass.toProtoAutoclass(),
|
||||
SoftDeletePolicy: b.SoftDeletePolicy.toProtoSoftDeletePolicy(),
|
||||
HierarchicalNamespace: b.HierarchicalNamespace.toProtoHierarchicalNamespace(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1174,6 +1200,9 @@ type BucketAttrsToUpdate struct {
|
|||
RPO RPO
|
||||
|
||||
// If set, updates the autoclass configuration of the bucket.
|
||||
// To disable autoclass on the bucket, set to an empty &Autoclass{}.
|
||||
// To update the configuration for Autoclass.TerminalStorageClass,
|
||||
// Autoclass.Enabled must also be set to true.
|
||||
// See https://cloud.google.com/storage/docs/using-autoclass for more information.
|
||||
Autoclass *Autoclass
|
||||
|
||||
|
|
@ -2136,6 +2165,42 @@ func toSoftDeletePolicyFromProto(p *storagepb.Bucket_SoftDeletePolicy) *SoftDele
|
|||
}
|
||||
}
|
||||
|
||||
func (hns *HierarchicalNamespace) toProtoHierarchicalNamespace() *storagepb.Bucket_HierarchicalNamespace {
|
||||
if hns == nil {
|
||||
return nil
|
||||
}
|
||||
return &storagepb.Bucket_HierarchicalNamespace{
|
||||
Enabled: hns.Enabled,
|
||||
}
|
||||
}
|
||||
|
||||
func (hns *HierarchicalNamespace) toRawHierarchicalNamespace() *raw.BucketHierarchicalNamespace {
|
||||
if hns == nil {
|
||||
return nil
|
||||
}
|
||||
return &raw.BucketHierarchicalNamespace{
|
||||
Enabled: hns.Enabled,
|
||||
}
|
||||
}
|
||||
|
||||
func toHierarchicalNamespaceFromProto(p *storagepb.Bucket_HierarchicalNamespace) *HierarchicalNamespace {
|
||||
if p == nil {
|
||||
return nil
|
||||
}
|
||||
return &HierarchicalNamespace{
|
||||
Enabled: p.Enabled,
|
||||
}
|
||||
}
|
||||
|
||||
func toHierarchicalNamespaceFromRaw(r *raw.BucketHierarchicalNamespace) *HierarchicalNamespace {
|
||||
if r == nil {
|
||||
return nil
|
||||
}
|
||||
return &HierarchicalNamespace{
|
||||
Enabled: r.Enabled,
|
||||
}
|
||||
}
|
||||
|
||||
// Objects returns an iterator over the objects in the bucket that match the
|
||||
// Query q. If q is nil, no filtering is done. Objects will be iterated over
|
||||
// lexicographically by name.
|
||||
|
|
|
|||
1
vendor/cloud.google.com/go/storage/hmac.go
generated
vendored
1
vendor/cloud.google.com/go/storage/hmac.go
generated
vendored
|
|
@ -272,7 +272,6 @@ func (it *HMACKeysIterator) fetch(pageSize int, pageToken string) (token string,
|
|||
// TODO: Remove fetch method upon integration. This method is internalized into
|
||||
// httpStorageClient.ListHMACKeys() as it is the only caller.
|
||||
call := it.raw.List(it.projectID)
|
||||
setClientHeader(call.Header())
|
||||
if pageToken != "" {
|
||||
call = call.PageToken(pageToken)
|
||||
}
|
||||
|
|
|
|||
37
vendor/cloud.google.com/go/storage/http_client.go
generated
vendored
37
vendor/cloud.google.com/go/storage/http_client.go
generated
vendored
|
|
@ -176,7 +176,6 @@ func (c *httpStorageClient) CreateBucket(ctx context.Context, project, bucket st
|
|||
bkt.Location = "US"
|
||||
}
|
||||
req := c.raw.Buckets.Insert(project, bkt)
|
||||
setClientHeader(req.Header())
|
||||
if attrs != nil && attrs.PredefinedACL != "" {
|
||||
req.PredefinedAcl(attrs.PredefinedACL)
|
||||
}
|
||||
|
|
@ -207,7 +206,6 @@ func (c *httpStorageClient) ListBuckets(ctx context.Context, project string, opt
|
|||
|
||||
fetch := func(pageSize int, pageToken string) (token string, err error) {
|
||||
req := c.raw.Buckets.List(it.projectID)
|
||||
setClientHeader(req.Header())
|
||||
req.Projection("full")
|
||||
req.Prefix(it.Prefix)
|
||||
req.PageToken(pageToken)
|
||||
|
|
@ -245,7 +243,6 @@ func (c *httpStorageClient) ListBuckets(ctx context.Context, project string, opt
|
|||
func (c *httpStorageClient) DeleteBucket(ctx context.Context, bucket string, conds *BucketConditions, opts ...storageOption) error {
|
||||
s := callSettings(c.settings, opts...)
|
||||
req := c.raw.Buckets.Delete(bucket)
|
||||
setClientHeader(req.Header())
|
||||
if err := applyBucketConds("httpStorageClient.DeleteBucket", conds, req); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -259,7 +256,6 @@ func (c *httpStorageClient) DeleteBucket(ctx context.Context, bucket string, con
|
|||
func (c *httpStorageClient) GetBucket(ctx context.Context, bucket string, conds *BucketConditions, opts ...storageOption) (*BucketAttrs, error) {
|
||||
s := callSettings(c.settings, opts...)
|
||||
req := c.raw.Buckets.Get(bucket).Projection("full")
|
||||
setClientHeader(req.Header())
|
||||
err := applyBucketConds("httpStorageClient.GetBucket", conds, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -287,7 +283,6 @@ func (c *httpStorageClient) UpdateBucket(ctx context.Context, bucket string, uat
|
|||
s := callSettings(c.settings, opts...)
|
||||
rb := uattrs.toRawBucket()
|
||||
req := c.raw.Buckets.Patch(bucket, rb).Projection("full")
|
||||
setClientHeader(req.Header())
|
||||
err := applyBucketConds("httpStorageClient.UpdateBucket", conds, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
@ -340,7 +335,6 @@ func (c *httpStorageClient) ListObjects(ctx context.Context, bucket string, q *Q
|
|||
if it.query.SoftDeleted {
|
||||
req.SoftDeleted(it.query.SoftDeleted)
|
||||
}
|
||||
setClientHeader(req.Header())
|
||||
projection := it.query.Projection
|
||||
if projection == ProjectionDefault {
|
||||
projection = ProjectionFull
|
||||
|
|
@ -666,7 +660,7 @@ func (c *httpStorageClient) UpdateBucketACL(ctx context.Context, bucket string,
|
|||
}, s.retry, s.idempotent)
|
||||
}
|
||||
|
||||
// configureACLCall sets the context, user project and headers on the apiary library call.
|
||||
// configureACLCall sets the context and user project on the apiary library call.
|
||||
// This will panic if the call does not have the correct methods.
|
||||
func configureACLCall(ctx context.Context, userProject string, call interface{ Header() http.Header }) {
|
||||
vc := reflect.ValueOf(call)
|
||||
|
|
@ -674,7 +668,6 @@ func configureACLCall(ctx context.Context, userProject string, call interface{ H
|
|||
if userProject != "" {
|
||||
vc.MethodByName("UserProject").Call([]reflect.Value{reflect.ValueOf(userProject)})
|
||||
}
|
||||
setClientHeader(call.Header())
|
||||
}
|
||||
|
||||
// Object ACL methods.
|
||||
|
|
@ -760,7 +753,6 @@ func (c *httpStorageClient) ComposeObject(ctx context.Context, req *composeObjec
|
|||
return nil, err
|
||||
}
|
||||
var obj *raw.Object
|
||||
setClientHeader(call.Header())
|
||||
|
||||
var err error
|
||||
retryCall := func(ctx context.Context) error { obj, err = call.Context(ctx).Do(); return err }
|
||||
|
|
@ -809,7 +801,6 @@ func (c *httpStorageClient) RewriteObject(ctx context.Context, req *rewriteObjec
|
|||
|
||||
var res *raw.RewriteResponse
|
||||
var err error
|
||||
setClientHeader(call.Header())
|
||||
|
||||
retryCall := func(ctx context.Context) error { res, err = call.Context(ctx).Do(); return err }
|
||||
|
||||
|
|
@ -864,17 +855,18 @@ func (c *httpStorageClient) newRangeReaderXML(ctx context.Context, params *newRa
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// Set custom headers passed in via the context. This is only required for XML;
|
||||
// for gRPC & JSON this is handled in the GAPIC and Apiary layers respectively.
|
||||
ctxHeaders := callctx.HeadersFromContext(ctx)
|
||||
for k, vals := range ctxHeaders {
|
||||
for _, v := range vals {
|
||||
req.Header.Add(k, v)
|
||||
}
|
||||
}
|
||||
|
||||
reopen := readerReopen(ctx, req.Header, params, s,
|
||||
func(ctx context.Context) (*http.Response, error) { return c.hc.Do(req.WithContext(ctx)) },
|
||||
func(ctx context.Context) (*http.Response, error) {
|
||||
// Set custom headers passed in via the context. This is only required for XML;
|
||||
// for gRPC & JSON this is handled in the GAPIC and Apiary layers respectively.
|
||||
ctxHeaders := callctx.HeadersFromContext(ctx)
|
||||
for k, vals := range ctxHeaders {
|
||||
for _, v := range vals {
|
||||
req.Header.Set(k, v)
|
||||
}
|
||||
}
|
||||
return c.hc.Do(req.WithContext(ctx))
|
||||
},
|
||||
func() error { return setConditionsHeaders(req.Header, params.conds) },
|
||||
func() { req.URL.RawQuery = fmt.Sprintf("generation=%d", params.gen) })
|
||||
|
||||
|
|
@ -888,7 +880,6 @@ func (c *httpStorageClient) newRangeReaderXML(ctx context.Context, params *newRa
|
|||
func (c *httpStorageClient) newRangeReaderJSON(ctx context.Context, params *newRangeReaderParams, s *settings) (r *Reader, err error) {
|
||||
call := c.raw.Objects.Get(params.bucket, params.object)
|
||||
|
||||
setClientHeader(call.Header())
|
||||
call.Projection("full")
|
||||
|
||||
if s.userProject != "" {
|
||||
|
|
@ -1004,7 +995,6 @@ func (c *httpStorageClient) OpenWriter(params *openWriterParams, opts ...storage
|
|||
func (c *httpStorageClient) GetIamPolicy(ctx context.Context, resource string, version int32, opts ...storageOption) (*iampb.Policy, error) {
|
||||
s := callSettings(c.settings, opts...)
|
||||
call := c.raw.Buckets.GetIamPolicy(resource).OptionsRequestedPolicyVersion(int64(version))
|
||||
setClientHeader(call.Header())
|
||||
if s.userProject != "" {
|
||||
call.UserProject(s.userProject)
|
||||
}
|
||||
|
|
@ -1025,7 +1015,6 @@ func (c *httpStorageClient) SetIamPolicy(ctx context.Context, resource string, p
|
|||
|
||||
rp := iamToStoragePolicy(policy)
|
||||
call := c.raw.Buckets.SetIamPolicy(resource, rp)
|
||||
setClientHeader(call.Header())
|
||||
if s.userProject != "" {
|
||||
call.UserProject(s.userProject)
|
||||
}
|
||||
|
|
@ -1039,7 +1028,6 @@ func (c *httpStorageClient) SetIamPolicy(ctx context.Context, resource string, p
|
|||
func (c *httpStorageClient) TestIamPermissions(ctx context.Context, resource string, permissions []string, opts ...storageOption) ([]string, error) {
|
||||
s := callSettings(c.settings, opts...)
|
||||
call := c.raw.Buckets.TestIamPermissions(resource, permissions)
|
||||
setClientHeader(call.Header())
|
||||
if s.userProject != "" {
|
||||
call.UserProject(s.userProject)
|
||||
}
|
||||
|
|
@ -1088,7 +1076,6 @@ func (c *httpStorageClient) ListHMACKeys(ctx context.Context, project, serviceAc
|
|||
}
|
||||
fetch := func(pageSize int, pageToken string) (token string, err error) {
|
||||
call := c.raw.Projects.HmacKeys.List(project)
|
||||
setClientHeader(call.Header())
|
||||
if pageToken != "" {
|
||||
call = call.PageToken(pageToken)
|
||||
}
|
||||
|
|
|
|||
4
vendor/cloud.google.com/go/storage/internal/apiv2/storage_client.go
generated
vendored
4
vendor/cloud.google.com/go/storage/internal/apiv2/storage_client.go
generated
vendored
|
|
@ -962,7 +962,9 @@ func (c *gRPCClient) Connection() *grpc.ClientConn {
|
|||
func (c *gRPCClient) setGoogleClientInfo(keyval ...string) {
|
||||
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
|
||||
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version)
|
||||
c.xGoogHeaders = []string{"x-goog-api-client", gax.XGoogHeader(kv...)}
|
||||
c.xGoogHeaders = []string{
|
||||
"x-goog-api-client", gax.XGoogHeader(kv...),
|
||||
}
|
||||
}
|
||||
|
||||
// Close closes the connection to the API service. The user should invoke this when
|
||||
|
|
|
|||
4
vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage.pb.go
generated
vendored
4
vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage.pb.go
generated
vendored
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2023 Google LLC
|
||||
// Copyright 2024 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.33.0
|
||||
// protoc-gen-go v1.34.1
|
||||
// protoc v4.25.3
|
||||
// source: google/storage/v2/storage.proto
|
||||
|
||||
|
|
|
|||
2
vendor/cloud.google.com/go/storage/internal/version.go
generated
vendored
2
vendor/cloud.google.com/go/storage/internal/version.go
generated
vendored
|
|
@ -15,4 +15,4 @@
|
|||
package internal
|
||||
|
||||
// Version is the current tagged release of the library.
|
||||
const Version = "1.41.0"
|
||||
const Version = "1.42.0"
|
||||
|
|
|
|||
16
vendor/cloud.google.com/go/storage/invoke.go
generated
vendored
16
vendor/cloud.google.com/go/storage/invoke.go
generated
vendored
|
|
@ -84,7 +84,21 @@ func setInvocationHeaders(ctx context.Context, invocationID string, attempts int
|
|||
invocationHeader := fmt.Sprintf("gccl-invocation-id/%v gccl-attempt-count/%v", invocationID, attempts)
|
||||
xGoogHeader := strings.Join([]string{invocationHeader, xGoogDefaultHeader}, " ")
|
||||
|
||||
ctx = callctx.SetHeaders(ctx, xGoogHeaderKey, xGoogHeader)
|
||||
// TODO: remove this once the respective transport packages merge xGoogHeader.
|
||||
// Also remove gl-go at that time, as it will be repeated.
|
||||
hdrs := callctx.HeadersFromContext(ctx)
|
||||
for _, v := range hdrs[xGoogHeaderKey] {
|
||||
xGoogHeader = strings.Join([]string{xGoogHeader, v}, " ")
|
||||
}
|
||||
|
||||
if hdrs[xGoogHeaderKey] != nil {
|
||||
// Replace the key instead of adding it, if there was anything to merge with.
|
||||
hdrs[xGoogHeaderKey] = []string{xGoogHeader}
|
||||
} else {
|
||||
// TODO: keep this line when removing the above code.
|
||||
ctx = callctx.SetHeaders(ctx, xGoogHeaderKey, xGoogHeader)
|
||||
}
|
||||
|
||||
ctx = callctx.SetHeaders(ctx, idempotencyHeaderKey, invocationID)
|
||||
return ctx
|
||||
}
|
||||
|
|
|
|||
19
vendor/cloud.google.com/go/storage/option.go
generated
vendored
19
vendor/cloud.google.com/go/storage/option.go
generated
vendored
|
|
@ -44,10 +44,14 @@ type storageClientOption interface {
|
|||
ApplyStorageOpt(*storageConfig)
|
||||
}
|
||||
|
||||
// WithJSONReads is an option that may be passed to a Storage Client on creation.
|
||||
// It sets the client to use the JSON API for object reads. Currently, the
|
||||
// default API used for reads is XML.
|
||||
// Setting this option is required to use the GenerationNotMatch condition.
|
||||
// WithJSONReads is an option that may be passed to [NewClient].
|
||||
// It sets the client to use the Cloud Storage JSON API for object
|
||||
// reads. Currently, the default API used for reads is XML, but JSON will
|
||||
// become the default in a future release.
|
||||
//
|
||||
// Setting this option is required to use the GenerationNotMatch condition. We
|
||||
// also recommend using JSON reads to ensure consistency with other client
|
||||
// operations (all of which use JSON by default).
|
||||
//
|
||||
// Note that when this option is set, reads will return a zero date for
|
||||
// [ReaderObjectAttrs].LastModified and may return a different value for
|
||||
|
|
@ -56,10 +60,11 @@ func WithJSONReads() option.ClientOption {
|
|||
return &withReadAPI{useJSON: true}
|
||||
}
|
||||
|
||||
// WithXMLReads is an option that may be passed to a Storage Client on creation.
|
||||
// It sets the client to use the XML API for object reads.
|
||||
// WithXMLReads is an option that may be passed to [NewClient].
|
||||
// It sets the client to use the Cloud Storage XML API for object reads.
|
||||
//
|
||||
// This is the current default.
|
||||
// This is the current default, but the default will switch to JSON in a future
|
||||
// release.
|
||||
func WithXMLReads() option.ClientOption {
|
||||
return &withReadAPI{useJSON: false}
|
||||
}
|
||||
|
|
|
|||
12
vendor/cloud.google.com/go/storage/reader.go
generated
vendored
12
vendor/cloud.google.com/go/storage/reader.go
generated
vendored
|
|
@ -72,6 +72,12 @@ type ReaderObjectAttrs struct {
|
|||
// ErrObjectNotExist will be returned if the object is not found.
|
||||
//
|
||||
// The caller must call Close on the returned Reader when done reading.
|
||||
//
|
||||
// By default, reads are made using the Cloud Storage XML API. We recommend
|
||||
// using the JSON API instead, which can be done by setting [WithJSONReads]
|
||||
// when calling [NewClient]. This ensures consistency with other client
|
||||
// operations, which all use JSON. JSON will become the default in a future
|
||||
// release.
|
||||
func (o *ObjectHandle) NewReader(ctx context.Context) (*Reader, error) {
|
||||
return o.NewRangeReader(ctx, 0, -1)
|
||||
}
|
||||
|
|
@ -86,6 +92,12 @@ func (o *ObjectHandle) NewReader(ctx context.Context) (*Reader, error) {
|
|||
// decompressive transcoding per https://cloud.google.com/storage/docs/transcoding
|
||||
// that file will be served back whole, regardless of the requested range as
|
||||
// Google Cloud Storage dictates.
|
||||
//
|
||||
// By default, reads are made using the Cloud Storage XML API. We recommend
|
||||
// using the JSON API instead, which can be done by setting [WithJSONReads]
|
||||
// when calling [NewClient]. This ensures consistency with other client
|
||||
// operations, which all use JSON. JSON will become the default in a future
|
||||
// release.
|
||||
func (o *ObjectHandle) NewRangeReader(ctx context.Context, offset, length int64) (r *Reader, err error) {
|
||||
// This span covers the life of the reader. It is closed via the context
|
||||
// in Reader.Close.
|
||||
|
|
|
|||
10
vendor/cloud.google.com/go/storage/storage.go
generated
vendored
10
vendor/cloud.google.com/go/storage/storage.go
generated
vendored
|
|
@ -117,10 +117,6 @@ type Client struct {
|
|||
|
||||
// tc is the transport-agnostic client implemented with either gRPC or HTTP.
|
||||
tc storageClient
|
||||
// useGRPC flags whether the client uses gRPC. This is needed while the
|
||||
// integration piece is only partially complete.
|
||||
// TODO: remove before merging to main.
|
||||
useGRPC bool
|
||||
}
|
||||
|
||||
// NewClient creates a new Google Cloud Storage client using the HTTP transport.
|
||||
|
|
@ -237,7 +233,7 @@ func NewGRPCClient(ctx context.Context, opts ...option.ClientOption) (*Client, e
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return &Client{tc: tc, useGRPC: true}, nil
|
||||
return &Client{tc: tc}, nil
|
||||
}
|
||||
|
||||
// Close closes the Client.
|
||||
|
|
@ -975,7 +971,8 @@ func (o *ObjectHandle) Update(ctx context.Context, uattrs ObjectAttrsToUpdate) (
|
|||
gen: o.gen,
|
||||
encryptionKey: o.encryptionKey,
|
||||
conds: o.conds,
|
||||
overrideRetention: o.overrideRetention}, opts...)
|
||||
overrideRetention: o.overrideRetention,
|
||||
}, opts...)
|
||||
}
|
||||
|
||||
// BucketName returns the name of the bucket.
|
||||
|
|
@ -2356,7 +2353,6 @@ func toProtoChecksums(sendCRC32C bool, attrs *ObjectAttrs) *storagepb.ObjectChec
|
|||
func (c *Client) ServiceAccount(ctx context.Context, projectID string) (string, error) {
|
||||
o := makeStorageOpts(true, c.retry, "")
|
||||
return c.tc.GetServiceAccount(ctx, projectID, o...)
|
||||
|
||||
}
|
||||
|
||||
// bucketResourceName formats the given project ID and bucketResourceName ID
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue