vendor: make vendor-update

This commit is contained in:
Aliaksandr Valialkin 2021-10-11 21:51:32 +03:00
parent 2c6d86226f
commit 1eaaf8ad51
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1
25 changed files with 1986 additions and 163 deletions

9
go.mod
View file

@ -1,8 +1,7 @@
module github.com/VictoriaMetrics/VictoriaMetrics module github.com/VictoriaMetrics/VictoriaMetrics
require ( require (
cloud.google.com/go v0.97.0 // indirect cloud.google.com/go/storage v1.18.0
cloud.google.com/go/storage v1.17.0
github.com/VictoriaMetrics/fastcache v1.7.0 github.com/VictoriaMetrics/fastcache v1.7.0
// Do not use the original github.com/valyala/fasthttp because of issues // Do not use the original github.com/valyala/fasthttp because of issues
@ -11,7 +10,7 @@ require (
github.com/VictoriaMetrics/metrics v1.18.0 github.com/VictoriaMetrics/metrics v1.18.0
github.com/VictoriaMetrics/metricsql v0.27.0 github.com/VictoriaMetrics/metricsql v0.27.0
github.com/VividCortex/ewma v1.2.0 // indirect github.com/VividCortex/ewma v1.2.0 // indirect
github.com/aws/aws-sdk-go v1.40.58 github.com/aws/aws-sdk-go v1.41.0
github.com/cespare/xxhash/v2 v2.1.2 github.com/cespare/xxhash/v2 v2.1.2
github.com/cheggaaa/pb/v3 v3.0.8 github.com/cheggaaa/pb/v3 v3.0.8
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
@ -30,11 +29,11 @@ require (
github.com/valyala/fasttemplate v1.2.1 github.com/valyala/fasttemplate v1.2.1
github.com/valyala/gozstd v1.13.0 github.com/valyala/gozstd v1.13.0
github.com/valyala/quicktemplate v1.7.0 github.com/valyala/quicktemplate v1.7.0
golang.org/x/net v0.0.0-20211007125505-59d4e928ea9d golang.org/x/net v0.0.0-20211011170408-caeb26a5c8c0
golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac
google.golang.org/api v0.58.0 google.golang.org/api v0.58.0
google.golang.org/genproto v0.0.0-20211007155348-82e027067bd4 // indirect google.golang.org/genproto v0.0.0-20211011165927-a5fb3255271e // indirect
google.golang.org/grpc v1.41.0 // indirect google.golang.org/grpc v1.41.0 // indirect
gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v2 v2.4.0
) )

17
go.sum
View file

@ -46,8 +46,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
cloud.google.com/go/storage v1.17.0 h1:CDpe3jS3EiD5nGlbtvyA4EUfkF6k9GMrxLR8+hLmoec= cloud.google.com/go/storage v1.18.0 h1:HM5Hu/BqgmWbo7pT9KFYGUccwzA8ZWDICJww9m5t9UA=
cloud.google.com/go/storage v1.17.0/go.mod h1:0wRtHSM3Npk/QJYdwcpRNVRVJlH2OxyWF9Dws3J+MtE= cloud.google.com/go/storage v1.18.0/go.mod h1:h0NImijCz/2WHwLh03BvmWdrNe4I/pzUdvUHoxIUroU=
collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE= collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/Azure/azure-sdk-for-go v41.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v41.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
@ -153,8 +153,8 @@ github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZve
github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48=
github.com/aws/aws-sdk-go v1.35.31/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.35.31/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q=
github.com/aws/aws-sdk-go v1.40.58 h1:SFa94nBsXyaS+cXluXlvqLwsQdeD7A/unJcWEld1xZ0= github.com/aws/aws-sdk-go v1.41.0 h1:XUzHLFWQVhmFtmKTodnAo5QdooPQfpVfilCxIV3aLoE=
github.com/aws/aws-sdk-go v1.40.58/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go v1.41.0/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q=
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4=
github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o=
@ -1155,8 +1155,8 @@ golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qx
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20211007125505-59d4e928ea9d h1:QWMn1lFvU/nZ58ssWqiFJMd3DKIII8NYc4sn708XgKs= golang.org/x/net v0.0.0-20211011170408-caeb26a5c8c0 h1:qOfNqBm5gk93LjGZo1MJaKY6Bph39zOKz1Hz2ogHj1w=
golang.org/x/net v0.0.0-20211007125505-59d4e928ea9d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211011170408-caeb26a5c8c0/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@ -1498,10 +1498,9 @@ google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEc
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/genproto v0.0.0-20211007155348-82e027067bd4 h1:YXPV/eKW0ZWRdB5tyI6aPoaa2Wxb4OSlFrTREMdwn64= google.golang.org/genproto v0.0.0-20211011165927-a5fb3255271e h1:B3r2Cb5u7Od6/WGb95VHDMp99VU/fuqPYZb6VM8IozI=
google.golang.org/genproto v0.0.0-20211007155348-82e027067bd4/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211011165927-a5fb3255271e/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=

View file

@ -1,5 +1,18 @@
# Changes # Changes
## [1.18.0](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.17.0...storage/v1.18.0) (2021-10-11)
### Features
* **storage:** returned wrapped error for timeouts ([#4802](https://www.github.com/googleapis/google-cloud-go/issues/4802)) ([0e102a3](https://www.github.com/googleapis/google-cloud-go/commit/0e102a385dc67a06f6b444b3a93e6998428529be)), refs [#4197](https://www.github.com/googleapis/google-cloud-go/issues/4197)
* **storage:** SignedUrl can use existing creds to authenticate ([#4604](https://www.github.com/googleapis/google-cloud-go/issues/4604)) ([b824c89](https://www.github.com/googleapis/google-cloud-go/commit/b824c897e6941270747b612f6d36a8d6ae081315))
### Bug Fixes
* **storage:** update PAP to use inherited instead of unspecified ([#4909](https://www.github.com/googleapis/google-cloud-go/issues/4909)) ([dac26b1](https://www.github.com/googleapis/google-cloud-go/commit/dac26b1af2f2972f12775341173bcc5f982438b8))
## [1.17.0](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.16.1...storage/v1.17.0) (2021-09-28) ## [1.17.0](https://www.github.com/googleapis/google-cloud-go/compare/storage/v1.16.1...storage/v1.17.0) (2021-09-28)

View file

@ -16,15 +16,22 @@ package storage
import ( import (
"context" "context"
"encoding/base64"
"encoding/json"
"errors"
"fmt" "fmt"
"net/http" "net/http"
"reflect" "reflect"
"time" "time"
"cloud.google.com/go/compute/metadata"
"cloud.google.com/go/internal/optional" "cloud.google.com/go/internal/optional"
"cloud.google.com/go/internal/trace" "cloud.google.com/go/internal/trace"
"golang.org/x/xerrors"
"google.golang.org/api/googleapi" "google.golang.org/api/googleapi"
"google.golang.org/api/iamcredentials/v1"
"google.golang.org/api/iterator" "google.golang.org/api/iterator"
"google.golang.org/api/option"
raw "google.golang.org/api/storage/v1" raw "google.golang.org/api/storage/v1"
) )
@ -166,7 +173,8 @@ func (b *BucketHandle) Attrs(ctx context.Context) (attrs *BucketAttrs, err error
resp, err = req.Context(ctx).Do() resp, err = req.Context(ctx).Do()
return err return err
}) })
if e, ok := err.(*googleapi.Error); ok && e.Code == http.StatusNotFound { var e *googleapi.Error
if ok := xerrors.As(err, &e); ok && e.Code == http.StatusNotFound {
return nil, ErrBucketNotExist return nil, ErrBucketNotExist
} }
if err != nil { if err != nil {
@ -223,6 +231,115 @@ func (b *BucketHandle) newPatchCall(uattrs *BucketAttrsToUpdate) (*raw.BucketsPa
return req, nil return req, nil
} }
// SignedURL returns a URL for the specified object. Signed URLs allow anyone
// access to a restricted resource for a limited time without needing a
// Google account or signing in. For more information about signed URLs, see
// https://cloud.google.com/storage/docs/accesscontrol#signed_urls_query_string_authentication
//
// This method only requires the Method and Expires fields in the specified
// SignedURLOptions opts to be non-nil. If not provided, it attempts to fill the
// GoogleAccessID and PrivateKey from the GOOGLE_APPLICATION_CREDENTIALS environment variable.
// If no private key is found, it attempts to use the GoogleAccessID to sign the URL.
// This requires the IAM Service Account Credentials API to be enabled
// (https://console.developers.google.com/apis/api/iamcredentials.googleapis.com/overview)
// and iam.serviceAccounts.signBlob permissions on the GoogleAccessID service account.
// If you do not want these fields set for you, you may pass them in through opts or use
// SignedURL(bucket, name string, opts *SignedURLOptions) instead.
func (b *BucketHandle) SignedURL(object string, opts *SignedURLOptions) (string, error) {
if opts.GoogleAccessID != "" && (opts.SignBytes != nil || len(opts.PrivateKey) > 0) {
return SignedURL(b.name, object, opts)
}
// Make a copy of opts so we don't modify the pointer parameter.
newopts := opts.clone()
if newopts.GoogleAccessID == "" {
id, err := b.detectDefaultGoogleAccessID()
if err != nil {
return "", err
}
newopts.GoogleAccessID = id
}
if newopts.SignBytes == nil && len(newopts.PrivateKey) == 0 {
if len(b.c.creds.JSON) > 0 {
var sa struct {
PrivateKey string `json:"private_key"`
}
err := json.Unmarshal(b.c.creds.JSON, &sa)
if err == nil && sa.PrivateKey != "" {
newopts.PrivateKey = []byte(sa.PrivateKey)
}
}
// Don't error out if we can't unmarshal the private key from the client,
// fallback to the default sign function for the service account.
if len(newopts.PrivateKey) == 0 {
newopts.SignBytes = b.defaultSignBytesFunc(newopts.GoogleAccessID)
}
}
return SignedURL(b.name, object, newopts)
}
// TODO: Add a similar wrapper for GenerateSignedPostPolicyV4 allowing users to
// omit PrivateKey/SignBytes
func (b *BucketHandle) detectDefaultGoogleAccessID() (string, error) {
returnErr := errors.New("no credentials found on client and not on GCE (Google Compute Engine)")
if len(b.c.creds.JSON) > 0 {
var sa struct {
ClientEmail string `json:"client_email"`
}
err := json.Unmarshal(b.c.creds.JSON, &sa)
if err == nil && sa.ClientEmail != "" {
return sa.ClientEmail, nil
} else if err != nil {
returnErr = err
} else {
returnErr = errors.New("storage: empty client email in credentials")
}
}
// Don't error out if we can't unmarshal, fallback to GCE check.
if metadata.OnGCE() {
email, err := metadata.Email("default")
if err == nil && email != "" {
return email, nil
} else if err != nil {
returnErr = err
} else {
returnErr = errors.New("got empty email from GCE metadata service")
}
}
return "", fmt.Errorf("storage: unable to detect default GoogleAccessID: %v", returnErr)
}
func (b *BucketHandle) defaultSignBytesFunc(email string) func([]byte) ([]byte, error) {
return func(in []byte) ([]byte, error) {
ctx := context.Background()
// It's ok to recreate this service per call since we pass in the http client,
// circumventing the cost of recreating the auth/transport layer
svc, err := iamcredentials.NewService(ctx, option.WithHTTPClient(b.c.hc))
if err != nil {
return nil, fmt.Errorf("unable to create iamcredentials client: %v", err)
}
resp, err := svc.Projects.ServiceAccounts.SignBlob(fmt.Sprintf("projects/-/serviceAccounts/%s", email), &iamcredentials.SignBlobRequest{
Payload: base64.StdEncoding.EncodeToString(in),
}).Do()
if err != nil {
return nil, fmt.Errorf("unable to sign bytes: %v", err)
}
out, err := base64.StdEncoding.DecodeString(resp.SignedBlob)
if err != nil {
return nil, fmt.Errorf("unable to base64 decode response: %v", err)
}
return out, nil
}
}
// BucketAttrs represents the metadata for a Google Cloud Storage bucket. // BucketAttrs represents the metadata for a Google Cloud Storage bucket.
// Read-only fields are ignored by BucketHandle.Create. // Read-only fields are ignored by BucketHandle.Create.
type BucketAttrs struct { type BucketAttrs struct {
@ -376,23 +493,29 @@ const (
// not set in a call to GCS. // not set in a call to GCS.
PublicAccessPreventionUnknown PublicAccessPrevention = iota PublicAccessPreventionUnknown PublicAccessPrevention = iota
// PublicAccessPreventionUnspecified corresponds to a value of "unspecified" // PublicAccessPreventionUnspecified corresponds to a value of "unspecified".
// and is the default for buckets. // Deprecated: use PublicAccessPreventionInherited
PublicAccessPreventionUnspecified PublicAccessPreventionUnspecified
// PublicAccessPreventionEnforced corresponds to a value of "enforced". This // PublicAccessPreventionEnforced corresponds to a value of "enforced". This
// enforces Public Access Prevention on the bucket. // enforces Public Access Prevention on the bucket.
PublicAccessPreventionEnforced PublicAccessPreventionEnforced
publicAccessPreventionUnknown string = "" // PublicAccessPreventionInherited corresponds to a value of "inherited"
publicAccessPreventionUnspecified = "unspecified" // and is the default for buckets.
publicAccessPreventionEnforced = "enforced" PublicAccessPreventionInherited
publicAccessPreventionUnknown string = ""
// TODO: remove unspecified when change is fully completed
publicAccessPreventionUnspecified = "unspecified"
publicAccessPreventionEnforced = "enforced"
publicAccessPreventionInherited = "inherited"
) )
func (p PublicAccessPrevention) String() string { func (p PublicAccessPrevention) String() string {
switch p { switch p {
case PublicAccessPreventionUnspecified: case PublicAccessPreventionInherited, PublicAccessPreventionUnspecified:
return publicAccessPreventionUnspecified return publicAccessPreventionInherited
case PublicAccessPreventionEnforced: case PublicAccessPreventionEnforced:
return publicAccessPreventionEnforced return publicAccessPreventionEnforced
default: default:
@ -1212,8 +1335,8 @@ func toPublicAccessPrevention(b *raw.BucketIamConfiguration) PublicAccessPrevent
return PublicAccessPreventionUnknown return PublicAccessPreventionUnknown
} }
switch b.PublicAccessPrevention { switch b.PublicAccessPrevention {
case publicAccessPreventionUnspecified: case publicAccessPreventionInherited, publicAccessPreventionUnspecified:
return PublicAccessPreventionUnspecified return PublicAccessPreventionInherited
case publicAccessPreventionEnforced: case publicAccessPreventionEnforced:
return PublicAccessPreventionEnforced return PublicAccessPreventionEnforced
default: default:
@ -1313,7 +1436,8 @@ func (it *ObjectIterator) fetch(pageSize int, pageToken string) (string, error)
return err return err
}) })
if err != nil { if err != nil {
if e, ok := err.(*googleapi.Error); ok && e.Code == http.StatusNotFound { var e *googleapi.Error
if ok := xerrors.As(err, &e); ok && e.Code == http.StatusNotFound {
err = ErrBucketNotExist err = ErrBucketNotExist
} }
return "", err return "", err

View file

@ -247,9 +247,10 @@ as the documentation of GenerateSignedPostPolicyV4.
Errors Errors
Errors returned by this client are often of the type [`googleapi.Error`](https://godoc.org/google.golang.org/api/googleapi#Error). Errors returned by this client are often of the type [`googleapi.Error`](https://godoc.org/google.golang.org/api/googleapi#Error).
These errors can be introspected for more information by type asserting to the richer `googleapi.Error` type. For example: These errors can be introspected for more information by using `errors.As` with the richer `googleapi.Error` type. For example:
if e, ok := err.(*googleapi.Error); ok { var e *googleapi.Error
if ok := errors.As(err, &e); ok {
if e.Code == 409 { ... } if e.Code == 409 { ... }
} }
*/ */

View file

@ -3,14 +3,14 @@ module cloud.google.com/go/storage
go 1.11 go 1.11
require ( require (
cloud.google.com/go v0.94.1 cloud.google.com/go v0.97.0
github.com/golang/protobuf v1.5.2 github.com/golang/protobuf v1.5.2
github.com/google/go-cmp v0.5.6 github.com/google/go-cmp v0.5.6
github.com/googleapis/gax-go/v2 v2.1.0 github.com/googleapis/gax-go/v2 v2.1.0
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
google.golang.org/api v0.57.0 google.golang.org/api v0.57.0
google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6 google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0
google.golang.org/grpc v1.40.0 google.golang.org/grpc v1.40.0
google.golang.org/protobuf v1.27.1 google.golang.org/protobuf v1.27.1
) )

View file

@ -23,8 +23,9 @@ cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSU
cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY=
cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ=
cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI=
cloud.google.com/go v0.94.1 h1:DwuSvDZ1pTYGbXo8yOJevCTr3BoBlE+OVkHAKiYQUXc=
cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4=
cloud.google.com/go v0.97.0 h1:3DXvAyifywvq64LfkKaMOmkWPS1CikIQdMe2lY9vxU8=
cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
@ -488,8 +489,8 @@ google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEc
google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6 h1:2ncG/LajxmrclaZH+ppVi02rQxz4eXYJzGHdFN4Y9UA= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0 h1:5Tbluzus3QxoAJx4IefGt1W0HQZW4nuMrVk684jI74Q=
google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=

View file

@ -36,7 +36,7 @@ func runWithRetry(ctx context.Context, call func() error) error {
return true, nil return true, nil
} }
if shouldRetry(err) { if shouldRetry(err) {
return false, nil return false, err
} }
return true, err return true, err
}) })

View file

@ -30,7 +30,6 @@ import (
"cloud.google.com/go/internal/trace" "cloud.google.com/go/internal/trace"
"google.golang.org/api/googleapi" "google.golang.org/api/googleapi"
storagepb "google.golang.org/genproto/googleapis/storage/v2" storagepb "google.golang.org/genproto/googleapis/storage/v2"
"google.golang.org/protobuf/proto"
) )
var crc32cTable = crc32.MakeTable(crc32.Castagnoli) var crc32cTable = crc32.MakeTable(crc32.Castagnoli)
@ -475,8 +474,10 @@ func (o *ObjectHandle) newRangeReaderWithGRPC(ctx context.Context, offset, lengt
} }
req.ReadOffset = start req.ReadOffset = start
// TODO: refactor this to use applyCondsProto. if err := applyCondsProto("reopenWithGRPC", o.gen, o.conds, req); err != nil {
setRequestConditions(req, o.conds) cancel()
return nil, nil, err
}
var stream storagepb.Storage_ReadObjectClient var stream storagepb.Storage_ReadObjectClient
var msg *storagepb.ReadObjectResponse var msg *storagepb.ReadObjectResponse
@ -632,10 +633,7 @@ func (r *Reader) readWithGRPC(p []byte) (int, error) {
if leftover > 0 { if leftover > 0 {
// Wasn't able to copy all of the data in the message, store for // Wasn't able to copy all of the data in the message, store for
// future Read calls. // future Read calls.
// TODO: Instead of acquiring a new block of memory, should we reuse r.leftovers = content[n:]
// the existing leftovers slice, expanding it if necessary?
r.leftovers = make([]byte, leftover)
copy(r.leftovers, content[n:])
} }
r.seen += int64(n) r.seen += int64(n)
@ -684,29 +682,6 @@ func (r *Reader) reopenStream(seen int64) (*storagepb.ReadObjectResponse, error)
return res.response, nil return res.response, nil
} }
// setRequestConditions is used to apply the given Conditions to a gRPC request
// message.
//
// This is an experimental API and not intended for public use.
func setRequestConditions(req *storagepb.ReadObjectRequest, conds *Conditions) {
if conds == nil {
return
}
if conds.MetagenerationMatch != 0 {
req.IfMetagenerationMatch = proto.Int64(conds.MetagenerationMatch)
} else if conds.MetagenerationNotMatch != 0 {
req.IfMetagenerationNotMatch = proto.Int64(conds.MetagenerationNotMatch)
}
switch {
case conds.GenerationNotMatch != 0:
req.IfGenerationNotMatch = proto.Int64(conds.GenerationNotMatch)
case conds.GenerationMatch != 0:
req.IfGenerationMatch = proto.Int64(conds.GenerationMatch)
case conds.DoesNotExist:
req.IfGenerationMatch = proto.Int64(0)
}
}
// Size returns the size of the object in bytes. // Size returns the size of the object in bytes.
// The returned value is always the same and is not affected by // The returned value is always the same and is not affected by
// calls to Read or Close. // calls to Read or Close.

View file

@ -41,10 +41,13 @@ import (
"cloud.google.com/go/internal/trace" "cloud.google.com/go/internal/trace"
"cloud.google.com/go/internal/version" "cloud.google.com/go/internal/version"
gapic "cloud.google.com/go/storage/internal/apiv2" gapic "cloud.google.com/go/storage/internal/apiv2"
"golang.org/x/oauth2/google"
"golang.org/x/xerrors"
"google.golang.org/api/googleapi" "google.golang.org/api/googleapi"
"google.golang.org/api/option" "google.golang.org/api/option"
"google.golang.org/api/option/internaloption" "google.golang.org/api/option/internaloption"
raw "google.golang.org/api/storage/v1" raw "google.golang.org/api/storage/v1"
"google.golang.org/api/transport"
htransport "google.golang.org/api/transport/http" htransport "google.golang.org/api/transport/http"
storagepb "google.golang.org/genproto/googleapis/storage/v2" storagepb "google.golang.org/genproto/googleapis/storage/v2"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
@ -97,6 +100,7 @@ type Client struct {
scheme string scheme string
// ReadHost is the default host used on the reader. // ReadHost is the default host used on the reader.
readHost string readHost string
creds *google.Credentials
// gc is an optional gRPC-based, GAPIC client. // gc is an optional gRPC-based, GAPIC client.
// //
@ -111,6 +115,7 @@ type Client struct {
// Clients should be reused instead of created as needed. The methods of Client // Clients should be reused instead of created as needed. The methods of Client
// are safe for concurrent use by multiple goroutines. // are safe for concurrent use by multiple goroutines.
func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) {
var creds *google.Credentials
// In general, it is recommended to use raw.NewService instead of htransport.NewClient // In general, it is recommended to use raw.NewService instead of htransport.NewClient
// since raw.NewService configures the correct default endpoints when initializing the // since raw.NewService configures the correct default endpoints when initializing the
@ -121,10 +126,19 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error
// need to account for STORAGE_EMULATOR_HOST override when setting the default endpoints. // need to account for STORAGE_EMULATOR_HOST override when setting the default endpoints.
if host := os.Getenv("STORAGE_EMULATOR_HOST"); host == "" { if host := os.Getenv("STORAGE_EMULATOR_HOST"); host == "" {
// Prepend default options to avoid overriding options passed by the user. // Prepend default options to avoid overriding options passed by the user.
opts = append([]option.ClientOption{option.WithScopes(ScopeFullControl), option.WithUserAgent(userAgent)}, opts...) opts = append([]option.ClientOption{option.WithScopes(ScopeFullControl, "https://www.googleapis.com/auth/cloud-platform"), option.WithUserAgent(userAgent)}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint("https://storage.googleapis.com/storage/v1/")) opts = append(opts, internaloption.WithDefaultEndpoint("https://storage.googleapis.com/storage/v1/"))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint("https://storage.mtls.googleapis.com/storage/v1/")) opts = append(opts, internaloption.WithDefaultMTLSEndpoint("https://storage.mtls.googleapis.com/storage/v1/"))
c, err := transport.Creds(ctx, opts...)
if err != nil {
return nil, err
}
creds = c
opts = append(opts, internaloption.WithCredentials(creds))
} else { } else {
var hostURL *url.URL var hostURL *url.URL
@ -171,6 +185,7 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error
raw: rawService, raw: rawService,
scheme: u.Scheme, scheme: u.Scheme,
readHost: u.Host, readHost: u.Host,
creds: creds,
}, nil }, nil
} }
@ -209,6 +224,7 @@ func (c *Client) Close() error {
// Set fields to nil so that subsequent uses will panic. // Set fields to nil so that subsequent uses will panic.
c.hc = nil c.hc = nil
c.raw = nil c.raw = nil
c.creds = nil
if c.gc != nil { if c.gc != nil {
return c.gc.Close() return c.gc.Close()
} }
@ -395,6 +411,23 @@ type SignedURLOptions struct {
Scheme SigningScheme Scheme SigningScheme
} }
func (opts *SignedURLOptions) clone() *SignedURLOptions {
return &SignedURLOptions{
GoogleAccessID: opts.GoogleAccessID,
SignBytes: opts.SignBytes,
PrivateKey: opts.PrivateKey,
Method: opts.Method,
Expires: opts.Expires,
ContentType: opts.ContentType,
Headers: opts.Headers,
QueryParameters: opts.QueryParameters,
MD5: opts.MD5,
Style: opts.Style,
Insecure: opts.Insecure,
Scheme: opts.Scheme,
}
}
var ( var (
tabRegex = regexp.MustCompile(`[\t]+`) tabRegex = regexp.MustCompile(`[\t]+`)
// I was tempted to call this spacex. :) // I was tempted to call this spacex. :)
@ -508,11 +541,11 @@ func v4SanitizeHeaders(hdrs []string) []string {
return sanitizedHeaders return sanitizedHeaders
} }
// SignedURL returns a URL for the specified object. Signed URLs allow // SignedURL returns a URL for the specified object. Signed URLs allow anyone
// the users access to a restricted resource for a limited time without having a // access to a restricted resource for a limited time without needing a
// Google account or signing in. For more information about the signed // Google account or signing in. For more information about signed URLs, see
// URLs, see https://cloud.google.com/storage/docs/accesscontrol#Signed-URLs. // https://cloud.google.com/storage/docs/accesscontrol#signed_urls_query_string_authentication
func SignedURL(bucket, name string, opts *SignedURLOptions) (string, error) { func SignedURL(bucket, object string, opts *SignedURLOptions) (string, error) {
now := utcNow() now := utcNow()
if err := validateOptions(opts, now); err != nil { if err := validateOptions(opts, now); err != nil {
return "", err return "", err
@ -521,13 +554,13 @@ func SignedURL(bucket, name string, opts *SignedURLOptions) (string, error) {
switch opts.Scheme { switch opts.Scheme {
case SigningSchemeV2: case SigningSchemeV2:
opts.Headers = v2SanitizeHeaders(opts.Headers) opts.Headers = v2SanitizeHeaders(opts.Headers)
return signedURLV2(bucket, name, opts) return signedURLV2(bucket, object, opts)
case SigningSchemeV4: case SigningSchemeV4:
opts.Headers = v4SanitizeHeaders(opts.Headers) opts.Headers = v4SanitizeHeaders(opts.Headers)
return signedURLV4(bucket, name, opts, now) return signedURLV4(bucket, object, opts, now)
default: // SigningSchemeDefault default: // SigningSchemeDefault
opts.Headers = v2SanitizeHeaders(opts.Headers) opts.Headers = v2SanitizeHeaders(opts.Headers)
return signedURLV2(bucket, name, opts) return signedURLV2(bucket, object, opts)
} }
} }
@ -867,7 +900,8 @@ func (o *ObjectHandle) Attrs(ctx context.Context) (attrs *ObjectAttrs, err error
var obj *raw.Object var obj *raw.Object
setClientHeader(call.Header()) setClientHeader(call.Header())
err = runWithRetry(ctx, func() error { obj, err = call.Do(); return err }) err = runWithRetry(ctx, func() error { obj, err = call.Do(); return err })
if e, ok := err.(*googleapi.Error); ok && e.Code == http.StatusNotFound { var e *googleapi.Error
if ok := xerrors.As(err, &e); ok && e.Code == http.StatusNotFound {
return nil, ErrObjectNotExist return nil, ErrObjectNotExist
} }
if err != nil { if err != nil {
@ -967,7 +1001,8 @@ func (o *ObjectHandle) Update(ctx context.Context, uattrs ObjectAttrsToUpdate) (
var obj *raw.Object var obj *raw.Object
setClientHeader(call.Header()) setClientHeader(call.Header())
err = runWithRetry(ctx, func() error { obj, err = call.Do(); return err }) err = runWithRetry(ctx, func() error { obj, err = call.Do(); return err })
if e, ok := err.(*googleapi.Error); ok && e.Code == http.StatusNotFound { var e *googleapi.Error
if ok := xerrors.As(err, &e); ok && e.Code == http.StatusNotFound {
return nil, ErrObjectNotExist return nil, ErrObjectNotExist
} }
if err != nil { if err != nil {
@ -1030,13 +1065,9 @@ func (o *ObjectHandle) Delete(ctx context.Context) error {
// Encryption doesn't apply to Delete. // Encryption doesn't apply to Delete.
setClientHeader(call.Header()) setClientHeader(call.Header())
err := runWithRetry(ctx, func() error { return call.Do() }) err := runWithRetry(ctx, func() error { return call.Do() })
switch e := err.(type) { var e *googleapi.Error
case nil: if ok := xerrors.As(err, &e); ok && e.Code == http.StatusNotFound {
return nil return ErrObjectNotExist
case *googleapi.Error:
if e.Code == http.StatusNotFound {
return ErrObjectNotExist
}
} }
return err return err
} }

View file

@ -24,9 +24,12 @@ import (
"unicode/utf8" "unicode/utf8"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"golang.org/x/xerrors"
"google.golang.org/api/googleapi" "google.golang.org/api/googleapi"
raw "google.golang.org/api/storage/v1" raw "google.golang.org/api/storage/v1"
storagepb "google.golang.org/genproto/googleapis/storage/v2" storagepb "google.golang.org/genproto/googleapis/storage/v2"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
) )
const ( const (
@ -217,7 +220,7 @@ func (w *Writer) Write(p []byte) (n int, err error) {
// Preserve existing functionality that when context is canceled, Write will return // Preserve existing functionality that when context is canceled, Write will return
// context.Canceled instead of "io: read/write on closed pipe". This hides the // context.Canceled instead of "io: read/write on closed pipe". This hides the
// pipe implementation detail from users and makes Write seem as though it's an RPC. // pipe implementation detail from users and makes Write seem as though it's an RPC.
if werr == context.Canceled || werr == context.DeadlineExceeded { if xerrors.Is(werr, context.Canceled) || xerrors.Is(werr, context.DeadlineExceeded) {
return n, werr return n, werr
} }
} }
@ -353,6 +356,7 @@ func (w *Writer) openGRPC() error {
// Note: This blocks until either the buffer is full or EOF is read. // Note: This blocks until either the buffer is full or EOF is read.
recvd, doneReading, err := read(pr, buf) recvd, doneReading, err := read(pr, buf)
if err != nil { if err != nil {
err = checkCanceled(err)
w.error(err) w.error(err)
pr.CloseWithError(err) pr.CloseWithError(err)
return return
@ -369,6 +373,7 @@ func (w *Writer) openGRPC() error {
if !doneReading && w.upid == "" { if !doneReading && w.upid == "" {
err = w.startResumableUpload() err = w.startResumableUpload()
if err != nil { if err != nil {
err = checkCanceled(err)
w.error(err) w.error(err)
pr.CloseWithError(err) pr.CloseWithError(err)
return return
@ -377,6 +382,7 @@ func (w *Writer) openGRPC() error {
o, off, finalized, err := w.uploadBuffer(toWrite, recvd, offset, doneReading) o, off, finalized, err := w.uploadBuffer(toWrite, recvd, offset, doneReading)
if err != nil { if err != nil {
err = checkCanceled(err)
w.error(err) w.error(err)
pr.CloseWithError(err) pr.CloseWithError(err)
return return
@ -637,3 +643,11 @@ func read(r io.Reader, buf []byte) (int, bool, error) {
} }
return recvd, done, err return recvd, done, err
} }
func checkCanceled(err error) error {
if status.Code(err) == codes.Canceled {
return context.Canceled
}
return err
}

View file

@ -7661,6 +7661,54 @@ var awsPartition = partition{
"us-west-2": endpoint{}, "us-west-2": endpoint{},
}, },
}, },
"textract": service{
Endpoints: endpoints{
"ap-northeast-2": endpoint{},
"ap-south-1": endpoint{},
"ap-southeast-1": endpoint{},
"ap-southeast-2": endpoint{},
"ca-central-1": endpoint{},
"eu-central-1": endpoint{},
"eu-west-1": endpoint{},
"eu-west-2": endpoint{},
"eu-west-3": endpoint{},
"fips-ca-central-1": endpoint{
Hostname: "textract-fips.ca-central-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "ca-central-1",
},
},
"fips-us-east-1": endpoint{
Hostname: "textract-fips.us-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-1",
},
},
"fips-us-east-2": endpoint{
Hostname: "textract-fips.us-east-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-east-2",
},
},
"fips-us-west-1": endpoint{
Hostname: "textract-fips.us-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-1",
},
},
"fips-us-west-2": endpoint{
Hostname: "textract-fips.us-west-2.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-west-2",
},
},
"us-east-1": endpoint{},
"us-east-2": endpoint{},
"us-west-1": endpoint{},
"us-west-2": endpoint{},
},
},
"transcribe": service{ "transcribe": service{
Defaults: endpoint{ Defaults: endpoint{
Protocols: []string{"https"}, Protocols: []string{"https"},
@ -11193,6 +11241,25 @@ var awsusgovPartition = partition{
"us-gov-west-1": endpoint{}, "us-gov-west-1": endpoint{},
}, },
}, },
"textract": service{
Endpoints: endpoints{
"fips-us-gov-east-1": endpoint{
Hostname: "textract-fips.us-gov-east-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-east-1",
},
},
"fips-us-gov-west-1": endpoint{
Hostname: "textract-fips.us-gov-west-1.amazonaws.com",
CredentialScope: credentialScope{
Region: "us-gov-west-1",
},
},
"us-gov-east-1": endpoint{},
"us-gov-west-1": endpoint{},
},
},
"transcribe": service{ "transcribe": service{
Defaults: endpoint{ Defaults: endpoint{
Protocols: []string{"https"}, Protocols: []string{"https"},

View file

@ -5,4 +5,4 @@ package aws
const SDKName = "aws-sdk-go" const SDKName = "aws-sdk-go"
// SDKVersion is the version of this SDK // SDKVersion is the version of this SDK
const SDKVersion = "1.40.58" const SDKVersion = "1.41.0"

View file

@ -82,13 +82,17 @@ func buildStruct(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag)
field, _ := value.Type().FieldByName(payload) field, _ := value.Type().FieldByName(payload)
tag = field.Tag tag = field.Tag
value = elemOf(value.FieldByName(payload)) value = elemOf(value.FieldByName(payload))
if !value.IsValid() && tag.Get("type") != "structure" {
if !value.IsValid() {
return nil return nil
} }
} }
buf.WriteByte('{') buf.WriteByte('{')
defer buf.WriteString("}")
if !value.IsValid() {
return nil
}
t := value.Type() t := value.Type()
first := true first := true
@ -144,8 +148,6 @@ func buildStruct(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag)
} }
buf.WriteString("}")
return nil return nil
} }

View file

@ -49,9 +49,8 @@ func Build(req *request.Request) {
buf = emptyJSON buf = emptyJSON
} }
if req.ClientInfo.TargetPrefix != "" || string(buf) != "{}" { // Always serialize the body, don't suppress it.
req.SetBufferBody(buf) req.SetBufferBody(buf)
}
if req.ClientInfo.TargetPrefix != "" { if req.ClientInfo.TargetPrefix != "" {
target := req.ClientInfo.TargetPrefix + "." + req.Operation.Name target := req.ClientInfo.TargetPrefix + "." + req.Operation.Name

View file

@ -28,18 +28,27 @@ func PayloadMember(i interface{}) interface{} {
return nil return nil
} }
// PayloadType returns the type of a payload field member of i if there is one, or "". const nopayloadPayloadType = "nopayload"
// PayloadType returns the type of a payload field member of i if there is one,
// or "".
func PayloadType(i interface{}) string { func PayloadType(i interface{}) string {
v := reflect.Indirect(reflect.ValueOf(i)) v := reflect.Indirect(reflect.ValueOf(i))
if !v.IsValid() { if !v.IsValid() {
return "" return ""
} }
if field, ok := v.Type().FieldByName("_"); ok { if field, ok := v.Type().FieldByName("_"); ok {
if noPayload := field.Tag.Get(nopayloadPayloadType); noPayload != "" {
return nopayloadPayloadType
}
if payloadName := field.Tag.Get("payload"); payloadName != "" { if payloadName := field.Tag.Get("payload"); payloadName != "" {
if member, ok := v.Type().FieldByName(payloadName); ok { if member, ok := v.Type().FieldByName(payloadName); ok {
return member.Tag.Get("type") return member.Tag.Get("type")
} }
} }
} }
return "" return ""
} }

View file

@ -550,7 +550,7 @@ func (s *AccountInfo) SetEmailAddress(v string) *AccountInfo {
} }
type GetRoleCredentialsInput struct { type GetRoleCredentialsInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure" nopayload:"true"`
// The token issued by the CreateToken API call. For more information, see CreateToken // The token issued by the CreateToken API call. For more information, see CreateToken
// (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
@ -726,7 +726,7 @@ func (s *InvalidRequestException) RequestID() string {
} }
type ListAccountRolesInput struct { type ListAccountRolesInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure" nopayload:"true"`
// The token issued by the CreateToken API call. For more information, see CreateToken // The token issued by the CreateToken API call. For more information, see CreateToken
// (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
@ -855,7 +855,7 @@ func (s *ListAccountRolesOutput) SetRoleList(v []*RoleInfo) *ListAccountRolesOut
} }
type ListAccountsInput struct { type ListAccountsInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure" nopayload:"true"`
// The token issued by the CreateToken API call. For more information, see CreateToken // The token issued by the CreateToken API call. For more information, see CreateToken
// (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
@ -970,7 +970,7 @@ func (s *ListAccountsOutput) SetNextToken(v string) *ListAccountsOutput {
} }
type LogoutInput struct { type LogoutInput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure" nopayload:"true"`
// The token issued by the CreateToken API call. For more information, see CreateToken // The token issued by the CreateToken API call. For more information, see CreateToken
// (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html) // (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
@ -1022,7 +1022,7 @@ func (s *LogoutInput) SetAccessToken(v string) *LogoutInput {
} }
type LogoutOutput struct { type LogoutOutput struct {
_ struct{} `type:"structure"` _ struct{} `type:"structure" nopayload:"true"`
} }
// String returns the string representation. // String returns the string representation.

View file

@ -0,0 +1,372 @@
{
"auth": {
"oauth2": {
"scopes": {
"https://www.googleapis.com/auth/cloud-platform": {
"description": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account."
}
}
}
},
"basePath": "",
"baseUrl": "https://iamcredentials.googleapis.com/",
"batchPath": "batch",
"canonicalName": "IAM Credentials",
"description": "Creates short-lived credentials for impersonating IAM service accounts. To enable this API, you must enable the IAM API (iam.googleapis.com). ",
"discoveryVersion": "v1",
"documentationLink": "https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials",
"fullyEncodeReservedExpansion": true,
"icons": {
"x16": "http://www.google.com/images/icons/product/search-16.gif",
"x32": "http://www.google.com/images/icons/product/search-32.gif"
},
"id": "iamcredentials:v1",
"kind": "discovery#restDescription",
"mtlsRootUrl": "https://iamcredentials.mtls.googleapis.com/",
"name": "iamcredentials",
"ownerDomain": "google.com",
"ownerName": "Google",
"parameters": {
"$.xgafv": {
"description": "V1 error format.",
"enum": [
"1",
"2"
],
"enumDescriptions": [
"v1 error format",
"v2 error format"
],
"location": "query",
"type": "string"
},
"access_token": {
"description": "OAuth access token.",
"location": "query",
"type": "string"
},
"alt": {
"default": "json",
"description": "Data format for response.",
"enum": [
"json",
"media",
"proto"
],
"enumDescriptions": [
"Responses with Content-Type of application/json",
"Media download with context-dependent Content-Type",
"Responses with Content-Type of application/x-protobuf"
],
"location": "query",
"type": "string"
},
"callback": {
"description": "JSONP",
"location": "query",
"type": "string"
},
"fields": {
"description": "Selector specifying which fields to include in a partial response.",
"location": "query",
"type": "string"
},
"key": {
"description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
"location": "query",
"type": "string"
},
"oauth_token": {
"description": "OAuth 2.0 token for the current user.",
"location": "query",
"type": "string"
},
"prettyPrint": {
"default": "true",
"description": "Returns response with indentations and line breaks.",
"location": "query",
"type": "boolean"
},
"quotaUser": {
"description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
"location": "query",
"type": "string"
},
"uploadType": {
"description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
"location": "query",
"type": "string"
},
"upload_protocol": {
"description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
"location": "query",
"type": "string"
}
},
"protocol": "rest",
"resources": {
"projects": {
"resources": {
"serviceAccounts": {
"methods": {
"generateAccessToken": {
"description": "Generates an OAuth 2.0 access token for a service account.",
"flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:generateAccessToken",
"httpMethod": "POST",
"id": "iamcredentials.projects.serviceAccounts.generateAccessToken",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.",
"location": "path",
"pattern": "^projects/[^/]+/serviceAccounts/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}:generateAccessToken",
"request": {
"$ref": "GenerateAccessTokenRequest"
},
"response": {
"$ref": "GenerateAccessTokenResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"generateIdToken": {
"description": "Generates an OpenID Connect ID token for a service account.",
"flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:generateIdToken",
"httpMethod": "POST",
"id": "iamcredentials.projects.serviceAccounts.generateIdToken",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.",
"location": "path",
"pattern": "^projects/[^/]+/serviceAccounts/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}:generateIdToken",
"request": {
"$ref": "GenerateIdTokenRequest"
},
"response": {
"$ref": "GenerateIdTokenResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"signBlob": {
"description": "Signs a blob using a service account's system-managed private key.",
"flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signBlob",
"httpMethod": "POST",
"id": "iamcredentials.projects.serviceAccounts.signBlob",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.",
"location": "path",
"pattern": "^projects/[^/]+/serviceAccounts/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}:signBlob",
"request": {
"$ref": "SignBlobRequest"
},
"response": {
"$ref": "SignBlobResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
},
"signJwt": {
"description": "Signs a JWT using a service account's system-managed private key.",
"flatPath": "v1/projects/{projectsId}/serviceAccounts/{serviceAccountsId}:signJwt",
"httpMethod": "POST",
"id": "iamcredentials.projects.serviceAccounts.signJwt",
"parameterOrder": [
"name"
],
"parameters": {
"name": {
"description": "Required. The resource name of the service account for which the credentials are requested, in the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.",
"location": "path",
"pattern": "^projects/[^/]+/serviceAccounts/[^/]+$",
"required": true,
"type": "string"
}
},
"path": "v1/{+name}:signJwt",
"request": {
"$ref": "SignJwtRequest"
},
"response": {
"$ref": "SignJwtResponse"
},
"scopes": [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
}
}
}
},
"revision": "20210813",
"rootUrl": "https://iamcredentials.googleapis.com/",
"schemas": {
"GenerateAccessTokenRequest": {
"id": "GenerateAccessTokenRequest",
"properties": {
"delegates": {
"description": "The sequence of service accounts in a delegation chain. Each service account must be granted the `roles/iam.serviceAccountTokenCreator` role on its next service account in the chain. The last service account in the chain must be granted the `roles/iam.serviceAccountTokenCreator` role on the service account that is specified in the `name` field of the request. The delegates must have the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.",
"items": {
"type": "string"
},
"type": "array"
},
"lifetime": {
"description": "The desired lifetime duration of the access token in seconds. By default, the maximum allowed value is 1 hour. To set a lifetime of up to 12 hours, you can add the service account as an allowed value in an Organization Policy that enforces the `constraints/iam.allowServiceAccountCredentialLifetimeExtension` constraint. See detailed instructions at https://cloud.google.com/iam/help/credentials/lifetime If a value is not specified, the token's lifetime will be set to a default value of 1 hour.",
"format": "google-duration",
"type": "string"
},
"scope": {
"description": "Required. Code to identify the scopes to be included in the OAuth 2.0 access token. See https://developers.google.com/identity/protocols/googlescopes for more information. At least one value required.",
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"GenerateAccessTokenResponse": {
"id": "GenerateAccessTokenResponse",
"properties": {
"accessToken": {
"description": "The OAuth 2.0 access token.",
"type": "string"
},
"expireTime": {
"description": "Token expiration time. The expiration time is always set.",
"format": "google-datetime",
"type": "string"
}
},
"type": "object"
},
"GenerateIdTokenRequest": {
"id": "GenerateIdTokenRequest",
"properties": {
"audience": {
"description": "Required. The audience for the token, such as the API or account that this token grants access to.",
"type": "string"
},
"delegates": {
"description": "The sequence of service accounts in a delegation chain. Each service account must be granted the `roles/iam.serviceAccountTokenCreator` role on its next service account in the chain. The last service account in the chain must be granted the `roles/iam.serviceAccountTokenCreator` role on the service account that is specified in the `name` field of the request. The delegates must have the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.",
"items": {
"type": "string"
},
"type": "array"
},
"includeEmail": {
"description": "Include the service account email in the token. If set to `true`, the token will contain `email` and `email_verified` claims.",
"type": "boolean"
}
},
"type": "object"
},
"GenerateIdTokenResponse": {
"id": "GenerateIdTokenResponse",
"properties": {
"token": {
"description": "The OpenId Connect ID token.",
"type": "string"
}
},
"type": "object"
},
"SignBlobRequest": {
"id": "SignBlobRequest",
"properties": {
"delegates": {
"description": "The sequence of service accounts in a delegation chain. Each service account must be granted the `roles/iam.serviceAccountTokenCreator` role on its next service account in the chain. The last service account in the chain must be granted the `roles/iam.serviceAccountTokenCreator` role on the service account that is specified in the `name` field of the request. The delegates must have the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.",
"items": {
"type": "string"
},
"type": "array"
},
"payload": {
"description": "Required. The bytes to sign.",
"format": "byte",
"type": "string"
}
},
"type": "object"
},
"SignBlobResponse": {
"id": "SignBlobResponse",
"properties": {
"keyId": {
"description": "The ID of the key used to sign the blob. The key used for signing will remain valid for at least 12 hours after the blob is signed. To verify the signature, you can retrieve the public key in several formats from the following endpoints: - RSA public key wrapped in an X.509 v3 certificate: `https://www.googleapis.com/service_accounts/v1/metadata/x509/{ACCOUNT_EMAIL}` - Raw key in JSON format: `https://www.googleapis.com/service_accounts/v1/metadata/raw/{ACCOUNT_EMAIL}` - JSON Web Key (JWK): `https://www.googleapis.com/service_accounts/v1/metadata/jwk/{ACCOUNT_EMAIL}`",
"type": "string"
},
"signedBlob": {
"description": "The signature for the blob. Does not include the original blob. After the key pair referenced by the `key_id` response field expires, Google no longer exposes the public key that can be used to verify the blob. As a result, the receiver can no longer verify the signature.",
"format": "byte",
"type": "string"
}
},
"type": "object"
},
"SignJwtRequest": {
"id": "SignJwtRequest",
"properties": {
"delegates": {
"description": "The sequence of service accounts in a delegation chain. Each service account must be granted the `roles/iam.serviceAccountTokenCreator` role on its next service account in the chain. The last service account in the chain must be granted the `roles/iam.serviceAccountTokenCreator` role on the service account that is specified in the `name` field of the request. The delegates must have the following format: `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard character is required; replacing it with a project ID is invalid.",
"items": {
"type": "string"
},
"type": "array"
},
"payload": {
"description": "Required. The JWT payload to sign. Must be a serialized JSON object that contains a JWT Claims Set. For example: `{\"sub\": \"user@example.com\", \"iat\": 313435}` If the JWT Claims Set contains an expiration time (`exp`) claim, it must be an integer timestamp that is not in the past and no more than 12 hours in the future.",
"type": "string"
}
},
"type": "object"
},
"SignJwtResponse": {
"id": "SignJwtResponse",
"properties": {
"keyId": {
"description": "The ID of the key used to sign the JWT. The key used for signing will remain valid for at least 12 hours after the JWT is signed. To verify the signature, you can retrieve the public key in several formats from the following endpoints: - RSA public key wrapped in an X.509 v3 certificate: `https://www.googleapis.com/service_accounts/v1/metadata/x509/{ACCOUNT_EMAIL}` - Raw key in JSON format: `https://www.googleapis.com/service_accounts/v1/metadata/raw/{ACCOUNT_EMAIL}` - JSON Web Key (JWK): `https://www.googleapis.com/service_accounts/v1/metadata/jwk/{ACCOUNT_EMAIL}`",
"type": "string"
},
"signedJwt": {
"description": "The signed JWT. Contains the automatically generated header; the client-supplied payload; and the signature, which is generated using the key referenced by the `kid` field in the header. After the key pair referenced by the `key_id` response field expires, Google no longer exposes the public key that can be used to verify the JWT. As a result, the receiver can no longer verify the signature.",
"type": "string"
}
},
"type": "object"
}
},
"servicePath": "",
"title": "IAM Service Account Credentials API",
"version": "v1",
"version_module": true
}

File diff suppressed because it is too large Load diff

36
vendor/google.golang.org/api/transport/dial.go generated vendored Normal file
View file

@ -0,0 +1,36 @@
// Copyright 2015 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package transport
import (
"context"
"net/http"
"google.golang.org/grpc"
"google.golang.org/api/option"
gtransport "google.golang.org/api/transport/grpc"
htransport "google.golang.org/api/transport/http"
)
// NewHTTPClient returns an HTTP client for use communicating with a Google cloud
// service, configured with the given ClientOptions. It also returns the endpoint
// for the service as specified in the options.
func NewHTTPClient(ctx context.Context, opts ...option.ClientOption) (*http.Client, string, error) {
return htransport.NewClient(ctx, opts...)
}
// DialGRPC returns a GRPC connection for use communicating with a Google cloud
// service, configured with the given ClientOptions.
func DialGRPC(ctx context.Context, opts ...option.ClientOption) (*grpc.ClientConn, error) {
return gtransport.Dial(ctx, opts...)
}
// DialGRPCInsecure returns an insecure GRPC connection for use communicating
// with fake or mock Google cloud service implementations, such as emulators.
// The connection is configured with the given ClientOptions.
func DialGRPCInsecure(ctx context.Context, opts ...option.ClientOption) (*grpc.ClientConn, error) {
return gtransport.DialInsecure(ctx, opts...)
}

11
vendor/google.golang.org/api/transport/doc.go generated vendored Normal file
View file

@ -0,0 +1,11 @@
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package transport provides utility methods for creating authenticated
// transports to Google's HTTP and gRPC APIs. It is intended to be used in
// conjunction with google.golang.org/api/option.
//
// This package is not intended for use by end developers. Use the
// google.golang.org/api/option package to configure API clients.
package transport

26
vendor/google.golang.org/api/transport/go19.go generated vendored Normal file
View file

@ -0,0 +1,26 @@
// Copyright 2018 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build go1.9
// +build go1.9
package transport
import (
"context"
"golang.org/x/oauth2/google"
"google.golang.org/api/internal"
"google.golang.org/api/option"
)
// Creds constructs a google.Credentials from the information in the options,
// or obtains the default credentials in the same way as google.FindDefaultCredentials.
func Creds(ctx context.Context, opts ...option.ClientOption) (*google.Credentials, error) {
var ds internal.DialSettings
for _, opt := range opts {
opt.Apply(&ds)
}
return internal.Creds(ctx, &ds)
}

26
vendor/google.golang.org/api/transport/not_go19.go generated vendored Normal file
View file

@ -0,0 +1,26 @@
// Copyright 2018 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !go1.9
// +build !go1.9
package transport
import (
"context"
"golang.org/x/oauth2/google"
"google.golang.org/api/internal"
"google.golang.org/api/option"
)
// Creds constructs a google.DefaultCredentials from the information in the options,
// or obtains the default credentials in the same way as google.FindDefaultCredentials.
func Creds(ctx context.Context, opts ...option.ClientOption) (*google.DefaultCredentials, error) {
var ds internal.DialSettings
for _, opt := range opts {
opt.Apply(&ds)
}
return internal.Creds(ctx, &ds)
}

View file

@ -37,7 +37,7 @@ const (
) )
// Specifies the routing information that should be sent along with the request // Specifies the routing information that should be sent along with the request
// in the form of routing headers. // in the form of routing header.
// **NOTE:** All service configuration rules follow the "last one wins" order. // **NOTE:** All service configuration rules follow the "last one wins" order.
// //
// The examples below will apply to an RPC which has the following request type: // The examples below will apply to an RPC which has the following request type:
@ -66,7 +66,12 @@ const (
// app_profile_id: profiles/prof_qux // app_profile_id: profiles/prof_qux
// } // }
// //
// ## Example 1 // The routing header consists of one or multiple key-value pairs. Every key
// and value must be percent-encoded, and joined together in the format of
// `key1=value1&key2=value2`.
// In the examples below I am skipping the percent-encoding for readablity.
//
// Example 1
// //
// Extracting a field from the request to put into the routing header // Extracting a field from the request to put into the routing header
// unchanged, with the key equal to the field name. // unchanged, with the key equal to the field name.
@ -84,7 +89,7 @@ const (
// //
// x-goog-request-params: app_profile_id=profiles/prof_qux // x-goog-request-params: app_profile_id=profiles/prof_qux
// //
// ## Example 2 // Example 2
// //
// Extracting a field from the request to put into the routing header // Extracting a field from the request to put into the routing header
// unchanged, with the key different from the field name. // unchanged, with the key different from the field name.
@ -103,7 +108,7 @@ const (
// //
// x-goog-request-params: routing_id=profiles/prof_qux // x-goog-request-params: routing_id=profiles/prof_qux
// //
// ## Example 3 // Example 3
// //
// Extracting a field from the request to put into the routing // Extracting a field from the request to put into the routing
// header, while matching a path template syntax on the field's value. // header, while matching a path template syntax on the field's value.
@ -111,7 +116,7 @@ const (
// NB: it is more useful to send nothing than to send garbage for the purpose // NB: it is more useful to send nothing than to send garbage for the purpose
// of dynamic routing, since garbage pollutes cache. Thus the matching. // of dynamic routing, since garbage pollutes cache. Thus the matching.
// //
// ### Sub-example 3a // Sub-example 3a
// //
// The field matches the template. // The field matches the template.
// //
@ -131,7 +136,7 @@ const (
// x-goog-request-params: // x-goog-request-params:
// table_name=projects/proj_foo/instances/instance_bar/table/table_baz // table_name=projects/proj_foo/instances/instance_bar/table/table_baz
// //
// ### Sub-example 3b // Sub-example 3b
// //
// The field does not match the template. // The field does not match the template.
// //
@ -150,7 +155,7 @@ const (
// //
// <no routing header will be sent> // <no routing header will be sent>
// //
// ### Sub-example 3c // Sub-example 3c
// //
// Multiple alternative conflictingly named path templates are // Multiple alternative conflictingly named path templates are
// specified. The one that matches is used to construct the header. // specified. The one that matches is used to construct the header.
@ -176,7 +181,7 @@ const (
// x-goog-request-params: // x-goog-request-params:
// table_name=projects/proj_foo/instances/instance_bar/table/table_baz // table_name=projects/proj_foo/instances/instance_bar/table/table_baz
// //
// ## Example 4 // Example 4
// //
// Extracting a single routing header key-value pair by matching a // Extracting a single routing header key-value pair by matching a
// template syntax on (a part of) a single request field. // template syntax on (a part of) a single request field.
@ -195,7 +200,7 @@ const (
// //
// x-goog-request-params: routing_id=projects/proj_foo // x-goog-request-params: routing_id=projects/proj_foo
// //
// ## Example 5 // Example 5
// //
// Extracting a single routing header key-value pair by matching // Extracting a single routing header key-value pair by matching
// several conflictingly named path templates on (parts of) a single request // several conflictingly named path templates on (parts of) a single request
@ -223,12 +228,12 @@ const (
// x-goog-request-params: // x-goog-request-params:
// routing_id=projects/proj_foo/instances/instance_bar // routing_id=projects/proj_foo/instances/instance_bar
// //
// ## Example 6 // Example 6
// //
// Extracting multiple routing header key-value pairs by matching // Extracting multiple routing header key-value pairs by matching
// several non-conflicting path templates on (parts of) a single request field. // several non-conflicting path templates on (parts of) a single request field.
// //
// ### Sub-example 6a // Sub-example 6a
// //
// Make the templates strict, so that if the `table_name` does not // Make the templates strict, so that if the `table_name` does not
// have an instance information, nothing is sent. // have an instance information, nothing is sent.
@ -253,12 +258,12 @@ const (
// result: // result:
// //
// x-goog-request-params: // x-goog-request-params:
// project_id=projects/proj_foo,instance_id=instances/instance_bar // project_id=projects/proj_foo&instance_id=instances/instance_bar
// //
// ### Sub-example 6b // Sub-example 6b
// //
// Make the templates loose, so that if the `table_name` does not // Make the templates loose, so that if the `table_name` does not
// have an instance information, the project id part is sent. // have an instance information, just the project id part is sent.
// //
// annotation: // annotation:
// //
@ -281,9 +286,9 @@ const (
// information): // information):
// //
// x-goog-request-params: // x-goog-request-params:
// project_id=projects/proj_foo,instance_id=instances/instance_bar // project_id=projects/proj_foo&instance_id=instances/instance_bar
// //
// ## Example 7 // Example 7
// //
// Extracting multiple routing header key-value pairs by matching // Extracting multiple routing header key-value pairs by matching
// several path templates on multiple request fields. // several path templates on multiple request fields.
@ -313,9 +318,9 @@ const (
// result: // result:
// //
// x-goog-request-params: // x-goog-request-params:
// project_id=projects/proj_foo,routing_id=profiles/prof_qux // project_id=projects/proj_foo&routing_id=profiles/prof_qux
// //
// ## Example 8 // Example 8
// //
// Extracting a single routing header key-value pair by matching // Extracting a single routing header key-value pair by matching
// several conflictingly named path templates on several request fields. The // several conflictingly named path templates on several request fields. The
@ -346,7 +351,7 @@ const (
// //
// x-goog-request-params: routing_id=profiles/prof_qux // x-goog-request-params: routing_id=profiles/prof_qux
// //
// ## Example 9 // Example 9
// //
// Bringing it all together. // Bringing it all together.
// //
@ -389,20 +394,23 @@ const (
// result: // result:
// //
// x-goog-request-params: // x-goog-request-params:
// table_location=instances/instance_bar,routing_id=prof_qux // table_location=instances/instance_bar&routing_id=prof_qux
type Routing struct { type RoutingRule struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
// A collection of Routing Parameter specifications. // A collection of Routing Parameter specifications.
// **NOTE:** If multiple parameters have the same name, "last one wins" rule // **NOTE:** If multiple Routing Parameters describe the same key
// is used to determine which one gets sent. // (via the `path_template` field or via the `field` field when
RoutingParameters []*RoutingParameter `protobuf:"bytes,1,rep,name=routing_parameters,json=routingParameters,proto3" json:"routing_parameters,omitempty"` // `path_template` is not provided), "last one wins" rule
// determines which Parameter gets used.
// See the examples for more details.
RoutingParameters []*RoutingParameter `protobuf:"bytes,2,rep,name=routing_parameters,json=routingParameters,proto3" json:"routing_parameters,omitempty"`
} }
func (x *Routing) Reset() { func (x *RoutingRule) Reset() {
*x = Routing{} *x = RoutingRule{}
if protoimpl.UnsafeEnabled { if protoimpl.UnsafeEnabled {
mi := &file_google_api_routing_proto_msgTypes[0] mi := &file_google_api_routing_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -410,13 +418,13 @@ func (x *Routing) Reset() {
} }
} }
func (x *Routing) String() string { func (x *RoutingRule) String() string {
return protoimpl.X.MessageStringOf(x) return protoimpl.X.MessageStringOf(x)
} }
func (*Routing) ProtoMessage() {} func (*RoutingRule) ProtoMessage() {}
func (x *Routing) ProtoReflect() protoreflect.Message { func (x *RoutingRule) ProtoReflect() protoreflect.Message {
mi := &file_google_api_routing_proto_msgTypes[0] mi := &file_google_api_routing_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -428,12 +436,12 @@ func (x *Routing) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x) return mi.MessageOf(x)
} }
// Deprecated: Use Routing.ProtoReflect.Descriptor instead. // Deprecated: Use RoutingRule.ProtoReflect.Descriptor instead.
func (*Routing) Descriptor() ([]byte, []int) { func (*RoutingRule) Descriptor() ([]byte, []int) {
return file_google_api_routing_proto_rawDescGZIP(), []int{0} return file_google_api_routing_proto_rawDescGZIP(), []int{0}
} }
func (x *Routing) GetRoutingParameters() []*RoutingParameter { func (x *RoutingRule) GetRoutingParameters() []*RoutingParameter {
if x != nil { if x != nil {
return x.RoutingParameters return x.RoutingParameters
} }
@ -484,6 +492,24 @@ type RoutingParameter struct {
// - The value is extracted from the request message's `table_name` field // - The value is extracted from the request message's `table_name` field
// if it matches the full pattern specified: // if it matches the full pattern specified:
// `projects/*/instances/*/tables/*`. // `projects/*/instances/*/tables/*`.
//
// **NB:** If the `path_template` field is not provided, the key name is
// equal to the field name, and the whole field should be sent as a value.
// This makes the pattern for the field and the value functionally equivalent
// to `**`, and the configuration
//
// {
// field: "table_name"
// }
//
// is a functionally equivalent shorthand to:
//
// {
// field: "table_name"
// path_template: "{table_name=**}"
// }
//
// See Example 1 for more details.
PathTemplate string `protobuf:"bytes,2,opt,name=path_template,json=pathTemplate,proto3" json:"path_template,omitempty"` PathTemplate string `protobuf:"bytes,2,opt,name=path_template,json=pathTemplate,proto3" json:"path_template,omitempty"`
} }
@ -536,7 +562,7 @@ func (x *RoutingParameter) GetPathTemplate() string {
var file_google_api_routing_proto_extTypes = []protoimpl.ExtensionInfo{ var file_google_api_routing_proto_extTypes = []protoimpl.ExtensionInfo{
{ {
ExtendedType: (*descriptorpb.MethodOptions)(nil), ExtendedType: (*descriptorpb.MethodOptions)(nil),
ExtensionType: (*Routing)(nil), ExtensionType: (*RoutingRule)(nil),
Field: 72295729, Field: 72295729,
Name: "google.api.routing", Name: "google.api.routing",
Tag: "bytes,72295729,opt,name=routing", Tag: "bytes,72295729,opt,name=routing",
@ -546,7 +572,9 @@ var file_google_api_routing_proto_extTypes = []protoimpl.ExtensionInfo{
// Extension fields to descriptorpb.MethodOptions. // Extension fields to descriptorpb.MethodOptions.
var ( var (
// optional google.api.Routing routing = 72295729; // See RoutingRule.
//
// optional google.api.RoutingRule routing = 72295729;
E_Routing = &file_google_api_routing_proto_extTypes[0] E_Routing = &file_google_api_routing_proto_extTypes[0]
) )
@ -557,30 +585,30 @@ var file_google_api_routing_proto_rawDesc = []byte{
0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 0x0a, 0x07, 0x52, 0x6f, 0x75, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5a, 0x0a, 0x0b, 0x52, 0x6f, 0x75, 0x74,
0x69, 0x6e, 0x67, 0x12, 0x4b, 0x0a, 0x12, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x4b, 0x0a, 0x12, 0x72, 0x6f, 0x75, 0x74, 0x69,
0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x6e, 0x67, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20,
0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x6f, 0x75, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69,
0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x52, 0x11, 0x72, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65,
0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x73, 0x72, 0x52, 0x11, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x65,
0x22, 0x4d, 0x0a, 0x10, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x74, 0x65, 0x72, 0x73, 0x22, 0x4d, 0x0a, 0x10, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50,
0x65, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x61, 0x72, 0x61, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c,
0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x23,
0x74, 0x68, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0a, 0x0d, 0x70, 0x61, 0x74, 0x68, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18,
0x09, 0x52, 0x0c, 0x70, 0x61, 0x74, 0x68, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x3a, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x61, 0x74, 0x68, 0x54, 0x65, 0x6d, 0x70, 0x6c,
0x50, 0x0a, 0x07, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x61, 0x74, 0x65, 0x3a, 0x54, 0x0a, 0x07, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1e,
0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb1, 0xca, 0xbc, 0x22, 0x20, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb1,
0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0xca, 0xbc, 0x22, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65,
0x67, 0x42, 0x6a, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x52, 0x07, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x42, 0x6a, 0x0a, 0x0e, 0x63, 0x6f, 0x6d,
0x61, 0x70, 0x69, 0x42, 0x0c, 0x52, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x42, 0x0c, 0x52, 0x6f, 0x75,
0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x41, 0x67, 0x6f, 0x6f,
0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70,
0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x69, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x6e, 0x73, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0xa2, 0x02,
0x72, 0x6f, 0x74, 0x6f, 0x33, 0x04, 0x47, 0x41, 0x50, 0x49, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -597,14 +625,14 @@ func file_google_api_routing_proto_rawDescGZIP() []byte {
var file_google_api_routing_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_google_api_routing_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_google_api_routing_proto_goTypes = []interface{}{ var file_google_api_routing_proto_goTypes = []interface{}{
(*Routing)(nil), // 0: google.api.Routing (*RoutingRule)(nil), // 0: google.api.RoutingRule
(*RoutingParameter)(nil), // 1: google.api.RoutingParameter (*RoutingParameter)(nil), // 1: google.api.RoutingParameter
(*descriptorpb.MethodOptions)(nil), // 2: google.protobuf.MethodOptions (*descriptorpb.MethodOptions)(nil), // 2: google.protobuf.MethodOptions
} }
var file_google_api_routing_proto_depIdxs = []int32{ var file_google_api_routing_proto_depIdxs = []int32{
1, // 0: google.api.Routing.routing_parameters:type_name -> google.api.RoutingParameter 1, // 0: google.api.RoutingRule.routing_parameters:type_name -> google.api.RoutingParameter
2, // 1: google.api.routing:extendee -> google.protobuf.MethodOptions 2, // 1: google.api.routing:extendee -> google.protobuf.MethodOptions
0, // 2: google.api.routing:type_name -> google.api.Routing 0, // 2: google.api.routing:type_name -> google.api.RoutingRule
3, // [3:3] is the sub-list for method output_type 3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type 3, // [3:3] is the sub-list for method input_type
2, // [2:3] is the sub-list for extension type_name 2, // [2:3] is the sub-list for extension type_name
@ -619,7 +647,7 @@ func file_google_api_routing_proto_init() {
} }
if !protoimpl.UnsafeEnabled { if !protoimpl.UnsafeEnabled {
file_google_api_routing_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { file_google_api_routing_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Routing); i { switch v := v.(*RoutingRule); i {
case 0: case 0:
return &v.state return &v.state
case 1: case 1:

11
vendor/modules.txt vendored
View file

@ -1,5 +1,4 @@
# cloud.google.com/go v0.97.0 # cloud.google.com/go v0.97.0
## explicit
cloud.google.com/go cloud.google.com/go
cloud.google.com/go/compute/metadata cloud.google.com/go/compute/metadata
cloud.google.com/go/iam cloud.google.com/go/iam
@ -7,7 +6,7 @@ cloud.google.com/go/internal
cloud.google.com/go/internal/optional cloud.google.com/go/internal/optional
cloud.google.com/go/internal/trace cloud.google.com/go/internal/trace
cloud.google.com/go/internal/version cloud.google.com/go/internal/version
# cloud.google.com/go/storage v1.17.0 # cloud.google.com/go/storage v1.18.0
## explicit ## explicit
cloud.google.com/go/storage cloud.google.com/go/storage
cloud.google.com/go/storage/internal/apiv2 cloud.google.com/go/storage/internal/apiv2
@ -29,7 +28,7 @@ github.com/VictoriaMetrics/metricsql/binaryop
# github.com/VividCortex/ewma v1.2.0 # github.com/VividCortex/ewma v1.2.0
## explicit ## explicit
github.com/VividCortex/ewma github.com/VividCortex/ewma
# github.com/aws/aws-sdk-go v1.40.58 # github.com/aws/aws-sdk-go v1.41.0
## explicit ## explicit
github.com/aws/aws-sdk-go/aws github.com/aws/aws-sdk-go/aws
github.com/aws/aws-sdk-go/aws/arn github.com/aws/aws-sdk-go/aws/arn
@ -237,7 +236,7 @@ go.opencensus.io/trace/propagation
go.opencensus.io/trace/tracestate go.opencensus.io/trace/tracestate
# go.uber.org/atomic v1.9.0 # go.uber.org/atomic v1.9.0
go.uber.org/atomic go.uber.org/atomic
# golang.org/x/net v0.0.0-20211007125505-59d4e928ea9d # golang.org/x/net v0.0.0-20211011170408-caeb26a5c8c0
## explicit ## explicit
golang.org/x/net/context golang.org/x/net/context
golang.org/x/net/context/ctxhttp golang.org/x/net/context/ctxhttp
@ -278,6 +277,7 @@ golang.org/x/xerrors/internal
## explicit ## explicit
google.golang.org/api/googleapi google.golang.org/api/googleapi
google.golang.org/api/googleapi/transport google.golang.org/api/googleapi/transport
google.golang.org/api/iamcredentials/v1
google.golang.org/api/internal google.golang.org/api/internal
google.golang.org/api/internal/gensupport google.golang.org/api/internal/gensupport
google.golang.org/api/internal/impersonate google.golang.org/api/internal/impersonate
@ -286,6 +286,7 @@ google.golang.org/api/iterator
google.golang.org/api/option google.golang.org/api/option
google.golang.org/api/option/internaloption google.golang.org/api/option/internaloption
google.golang.org/api/storage/v1 google.golang.org/api/storage/v1
google.golang.org/api/transport
google.golang.org/api/transport/cert google.golang.org/api/transport/cert
google.golang.org/api/transport/grpc google.golang.org/api/transport/grpc
google.golang.org/api/transport/http google.golang.org/api/transport/http
@ -304,7 +305,7 @@ google.golang.org/appengine/internal/socket
google.golang.org/appengine/internal/urlfetch google.golang.org/appengine/internal/urlfetch
google.golang.org/appengine/socket google.golang.org/appengine/socket
google.golang.org/appengine/urlfetch google.golang.org/appengine/urlfetch
# google.golang.org/genproto v0.0.0-20211007155348-82e027067bd4 # google.golang.org/genproto v0.0.0-20211011165927-a5fb3255271e
## explicit ## explicit
google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/api/annotations
google.golang.org/genproto/googleapis/iam/v1 google.golang.org/genproto/googleapis/iam/v1