diff --git a/go.mod b/go.mod
index 3981ee97bf44a..105171d8314e4 100644
--- a/go.mod
+++ b/go.mod
@@ -1,10 +1,12 @@
module github.com/grafana/loki/v3
-go 1.21.8
+go 1.22
+
+toolchain go1.23.1
require (
- cloud.google.com/go/bigtable v1.29.0
- cloud.google.com/go/pubsub v1.42.0
+ cloud.google.com/go/bigtable v1.31.0
+ cloud.google.com/go/pubsub v1.43.0
cloud.google.com/go/storage v1.43.0
github.com/Azure/azure-pipeline-go v0.2.3
github.com/Azure/azure-storage-blob-go v0.14.0
@@ -34,7 +36,7 @@ require (
github.com/fatih/color v1.16.0
github.com/felixge/fgprof v0.9.4
github.com/fluent/fluent-bit-go v0.0.0-20230731091245-a7a013e2473c
- github.com/fsouza/fake-gcs-server v1.7.0
+ github.com/fsouza/fake-gcs-server v1.50.0
github.com/go-kit/log v0.2.1
github.com/go-logfmt/logfmt v0.6.0
github.com/go-redis/redis/v8 v8.11.5
@@ -96,13 +98,13 @@ require (
go.etcd.io/bbolt v1.3.10
go.uber.org/atomic v1.11.0
go.uber.org/goleak v1.3.0
- golang.org/x/crypto v0.26.0
- golang.org/x/net v0.28.0
+ golang.org/x/crypto v0.27.0
+ golang.org/x/net v0.29.0
golang.org/x/sync v0.8.0
- golang.org/x/sys v0.24.0
+ golang.org/x/sys v0.25.0
golang.org/x/time v0.6.0
- google.golang.org/api v0.193.0
- google.golang.org/grpc v1.65.0
+ google.golang.org/api v0.198.0
+ google.golang.org/grpc v1.67.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
@@ -148,8 +150,8 @@ require (
go.opentelemetry.io/collector/pdata v1.12.0
go4.org/netipx v0.0.0-20230125063823-8449b0a6169f
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8
- golang.org/x/oauth2 v0.22.0
- golang.org/x/text v0.17.0
+ golang.org/x/oauth2 v0.23.0
+ golang.org/x/text v0.18.0
google.golang.org/protobuf v1.34.2
gotest.tools v2.2.0+incompatible
k8s.io/apimachinery v0.29.3
@@ -158,7 +160,7 @@ require (
require (
cel.dev/expr v0.16.0 // indirect
- cloud.google.com/go/auth v0.9.0 // indirect
+ cloud.google.com/go/auth v0.9.4 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.4 // indirect
cloud.google.com/go/monitoring v1.21.0 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
@@ -170,12 +172,14 @@ require (
github.com/go-ini/ini v1.67.0 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/goccy/go-json v0.10.3 // indirect
+ github.com/gorilla/handlers v1.5.2 // indirect
github.com/hashicorp/go-msgpack/v2 v2.1.2 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/ncw/swift v1.0.53 // indirect
github.com/pires/go-proxyproto v0.7.0 // indirect
+ github.com/pkg/xattr v0.4.10 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/rivo/uniseg v0.4.7 // indirect
@@ -183,14 +187,14 @@ require (
github.com/tklauser/go-sysconf v0.3.12 // indirect
github.com/tklauser/numcpus v0.6.1 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
- go.opentelemetry.io/otel/sdk v1.28.0 // indirect
- go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect
+ go.opentelemetry.io/otel/sdk v1.29.0 // indirect
+ go.opentelemetry.io/otel/sdk/metric v1.29.0 // indirect
)
require (
cloud.google.com/go v0.115.1 // indirect
- cloud.google.com/go/compute/metadata v0.5.0 // indirect
- cloud.google.com/go/iam v1.2.0 // indirect
+ cloud.google.com/go/compute/metadata v0.5.1 // indirect
+ cloud.google.com/go/iam v1.2.1 // indirect
cloud.google.com/go/longrunning v0.6.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect
@@ -229,7 +233,7 @@ require (
github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
- github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20 // indirect
+ github.com/cncf/xds/go v0.0.0-20240822171458-6449f94b4d59 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
@@ -271,13 +275,13 @@ require (
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
- github.com/google/btree v1.1.2 // indirect
+ github.com/google/btree v1.1.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da // indirect
github.com/google/s2a-go v0.1.8 // indirect
- github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
+ github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
github.com/gophercloud/gophercloud v1.13.0 // indirect
github.com/grafana/pyroscope-go/godeltaprof v0.1.8 // indirect
@@ -348,19 +352,19 @@ require (
go.mongodb.org/mongo-driver v1.14.0 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/collector/semconv v0.105.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 // indirect
- go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
- go.opentelemetry.io/otel v1.28.0
- go.opentelemetry.io/otel/metric v1.28.0 // indirect
- go.opentelemetry.io/otel/trace v1.28.0
+ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 // indirect
+ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect
+ go.opentelemetry.io/otel v1.29.0
+ go.opentelemetry.io/otel/metric v1.29.0 // indirect
+ go.opentelemetry.io/otel/trace v1.29.0
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/mod v0.19.0 // indirect
- golang.org/x/term v0.23.0 // indirect
+ golang.org/x/term v0.24.0 // indirect
golang.org/x/tools v0.23.0 // indirect
- google.golang.org/genproto v0.0.0-20240820151423-278611b39280 // indirect
- google.golang.org/genproto/googleapis/api v0.0.0-20240820151423-278611b39280 // indirect
- google.golang.org/genproto/googleapis/rpc v0.0.0-20240820151423-278611b39280 // indirect
+ google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect
+ google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 // indirect
+ google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect
gopkg.in/fsnotify/fsnotify.v1 v1.4.7 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
diff --git a/go.sum b/go.sum
index fabf4aa4fdca5..e703832f0519a 100644
--- a/go.sum
+++ b/go.sum
@@ -41,8 +41,8 @@ cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPus
cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ=
cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o=
cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY=
-cloud.google.com/go/auth v0.9.0 h1:cYhKl1JUhynmxjXfrk4qdPc6Amw7i+GC9VLflgT0p5M=
-cloud.google.com/go/auth v0.9.0/go.mod h1:2HsApZBr9zGZhC9QAXsYVYaWk8kNUt37uny+XVKi7wM=
+cloud.google.com/go/auth v0.9.4 h1:DxF7imbEbiFu9+zdKC6cKBko1e8XeJnipNqIbWZ+kDI=
+cloud.google.com/go/auth v0.9.4/go.mod h1:SHia8n6//Ya940F1rLimhJCjjx7KE17t0ctFEci3HkA=
cloud.google.com/go/auth/oauth2adapt v0.2.4 h1:0GWE/FUsXhf6C+jAkWgYm7X9tK8cuEIfy19DBn6B6bY=
cloud.google.com/go/auth/oauth2adapt v0.2.4/go.mod h1:jC/jOpwFP6JBxhB3P5Rr0a9HLMC/Pe3eaL4NmdvqPtc=
cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0=
@@ -53,8 +53,8 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
cloud.google.com/go/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA=
-cloud.google.com/go/bigtable v1.29.0 h1:2CnFjKPwjpZMZdTi2RpppvxzD80zKzDYrLYEQw/NnAs=
-cloud.google.com/go/bigtable v1.29.0/go.mod h1:5p909nNdWaNUcWs6KGZO8mI5HUovstlmrIi7+eA5PTQ=
+cloud.google.com/go/bigtable v1.31.0 h1:/uVLxGVRbK4mxK/iO89VqXcL/zoTSmkltVfIDYVBluQ=
+cloud.google.com/go/bigtable v1.31.0/go.mod h1:N/mwZO+4TSHOeyiE1JxO+sRPnW4bnR7WLn9AEaiJqew=
cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY=
cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM=
cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY=
@@ -64,8 +64,8 @@ cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6m
cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s=
cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU=
cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U=
-cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY=
-cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY=
+cloud.google.com/go/compute/metadata v0.5.1 h1:NM6oZeZNlYjiwYje+sYFjEpP0Q0zCan1bmQW/KmIrGs=
+cloud.google.com/go/compute/metadata v0.5.1/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k=
cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0=
cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs=
cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM=
@@ -84,10 +84,10 @@ cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFP
cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o=
cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0=
cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY=
-cloud.google.com/go/iam v1.2.0 h1:kZKMKVNk/IsSSc/udOb83K0hL/Yh/Gcqpz+oAkoIFN8=
-cloud.google.com/go/iam v1.2.0/go.mod h1:zITGuWgsLZxd8OwAlX+eMFgZDXzBm7icj1PVTYG766Q=
-cloud.google.com/go/kms v1.18.5 h1:75LSlVs60hyHK3ubs2OHd4sE63OAMcM2BdSJc2bkuM4=
-cloud.google.com/go/kms v1.18.5/go.mod h1:yXunGUGzabH8rjUPImp2ndHiGolHeWJJ0LODLedicIY=
+cloud.google.com/go/iam v1.2.1 h1:QFct02HRb7H12J/3utj0qf5tobFh9V4vR6h9eX5EBRU=
+cloud.google.com/go/iam v1.2.1/go.mod h1:3VUIJDPpwT6p/amXRC5GY8fCCh70lxPygguVtI0Z4/g=
+cloud.google.com/go/kms v1.19.0 h1:x0OVJDl6UH1BSX4THKlMfdcFWoE4ruh90ZHuilZekrU=
+cloud.google.com/go/kms v1.19.0/go.mod h1:e4imokuPJUc17Trz2s6lEXFDt8bgDmvpVynH39bdrHM=
cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic=
cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8=
cloud.google.com/go/longrunning v0.6.0 h1:mM1ZmaNsQsnb+5n1DNPeL0KwQd9jQRqSqSDEkBZr+aI=
@@ -108,8 +108,8 @@ cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2k
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
-cloud.google.com/go/pubsub v1.42.0 h1:PVTbzorLryFL5ue8esTS2BfehUs0ahyNOY9qcd+HMOs=
-cloud.google.com/go/pubsub v1.42.0/go.mod h1:KADJ6s4MbTwhXmse/50SebEhE4SmUwHi48z3/dHar1Y=
+cloud.google.com/go/pubsub v1.43.0 h1:s3Qx+F96J7Kwey/uVHdK3QxFLIlOvvw4SfMYw2jFjb4=
+cloud.google.com/go/pubsub v1.43.0/go.mod h1:LNLfqItblovg7mHWgU5g84Vhza4J8kTxx0YqIeTzcXY=
cloud.google.com/go/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4=
cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o=
cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg=
@@ -459,8 +459,8 @@ github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWH
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
-github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20 h1:N+3sFI5GUjRKBi+i0TxYVST9h4Ie192jJWpHvthBBgg=
-github.com/cncf/xds/go v0.0.0-20240723142845-024c85f92f20/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
+github.com/cncf/xds/go v0.0.0-20240822171458-6449f94b4d59 h1:fLZ97KE86ELjEYJCEUVzmbhfzDxHHGwBrDVMd4XL6Bs=
+github.com/cncf/xds/go v0.0.0-20240822171458-6449f94b4d59/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
@@ -642,8 +642,8 @@ github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
-github.com/fsouza/fake-gcs-server v1.7.0 h1:Un0BXUXrRWYSmYyC1Rqm2e2WJfTPyDy/HGMz31emTi8=
-github.com/fsouza/fake-gcs-server v1.7.0/go.mod h1:5XIRs4YvwNbNoz+1JF8j6KLAyDh7RHGAyAK3EP2EsNk=
+github.com/fsouza/fake-gcs-server v1.50.0 h1:MRW1OuLyHnFKKLGNILiH+x6CMKqn/R05auJ5ET5PCyk=
+github.com/fsouza/fake-gcs-server v1.50.0/go.mod h1:itn0kDInXYbYXZ+2dLch83bR8lpp7YQ5czkZnH6IRH8=
github.com/fullstorydev/emulators/storage v0.0.0-20240401123056-edc69752f474 h1:TufioMBjkJ6/Oqmlye/ReuxHFS35HyLmypj/BNy/8GY=
github.com/fullstorydev/emulators/storage v0.0.0-20240401123056-edc69752f474/go.mod h1:PQwxF4UU8wuL+srGxr3BOhIW5zXqgucwVlO/nPZLsxw=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
@@ -934,8 +934,8 @@ github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW
github.com/google/btree v0.0.0-20160524151835-7d79101e329e/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
-github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
-github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
+github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
+github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I=
github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
@@ -1005,8 +1005,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
-github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs=
-github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
+github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw=
+github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
@@ -1029,8 +1029,9 @@ github.com/gophercloud/gophercloud v1.13.0 h1:8iY9d1DAbzMW6Vok1AxbbK5ZaUjzMp0tdy
github.com/gophercloud/gophercloud v1.13.0/go.mod h1:aAVqcocTSXh2vYFZ1JTvx4EQmfgzxRcNupUfxZbBNDM=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
+github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE=
+github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
-github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
@@ -1589,6 +1590,8 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
+github.com/pkg/xattr v0.4.10 h1:Qe0mtiNFHQZ296vRgUjRCoPHPqH7VdTOrZx3g0T+pGA=
+github.com/pkg/xattr v0.4.10/go.mod h1:di8WF84zAKk8jzR1UBTEWh9AUlIZZ7M/JNt8e9B6ktU=
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo=
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8=
github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
@@ -1886,8 +1889,8 @@ github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7
github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
-go.einride.tech/aip v0.67.1 h1:d/4TW92OxXBngkSOwWS2CH5rez869KpKMaN44mdxkFI=
-go.einride.tech/aip v0.67.1/go.mod h1:ZGX4/zKw8dcgzdLsrvpOOGxfxI2QSk12SlP7d6c0/XI=
+go.einride.tech/aip v0.68.0 h1:4seM66oLzTpz50u4K1zlJyOXQ3tCzcJN7I22tKkjipw=
+go.einride.tech/aip v0.68.0/go.mod h1:7y9FF8VtPWqpxuAxl0KQWqaULxW4zFIesD6zF5RIHHg=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
@@ -1929,24 +1932,24 @@ go.opentelemetry.io/collector/pdata v1.12.0 h1:Xx5VK1p4VO0md8MWm2icwC1MnJ7f8EimK
go.opentelemetry.io/collector/pdata v1.12.0/go.mod h1:MYeB0MmMAxeM0hstCFrCqWLzdyeYySim2dG6pDT6nYI=
go.opentelemetry.io/collector/semconv v0.105.0 h1:8p6dZ3JfxFTjbY38d8xlQGB1TQ3nPUvs+D0RERniZ1g=
go.opentelemetry.io/collector/semconv v0.105.0/go.mod h1:yMVUCNoQPZVq/IPfrHrnntZTWsLf5YGZ7qwKulIl5hw=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0 h1:9G6E0TXzGFVfTnawRzrPl83iHOAV7L8NJiR8RSGYV1g=
-go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.53.0/go.mod h1:azvtTADFQJA8mX80jIH/akaE7h+dbm/sVuaHqN13w74=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA=
-go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg=
-go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo=
-go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8=
+go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw=
+go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 h1:3Q/xZUyC1BBkualc9ROb4G8qkH90LXEIICcs5zv1OYY=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0/go.mod h1:s75jGIWA9OfCMzF0xr+ZgfrB5FEbbV7UuYo32ahUiFI=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0 h1:j9+03ymgYhPKmeXGk5Zu+cIZOlVzd9Zv7QIiyItjFBU=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.28.0/go.mod h1:Y5+XiUG4Emn1hTfciPzGPJaSI+RpDts6BnCIir0SLqk=
-go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q=
-go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s=
-go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE=
-go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg=
-go.opentelemetry.io/otel/sdk/metric v1.28.0 h1:OkuaKgKrgAbYrrY0t92c+cC+2F6hsFNnCQArXCKlg08=
-go.opentelemetry.io/otel/sdk/metric v1.28.0/go.mod h1:cWPjykihLAPvXKi4iZc1dpER3Jdq2Z0YLse3moQUCpg=
-go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g=
-go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI=
+go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc=
+go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8=
+go.opentelemetry.io/otel/sdk v1.29.0 h1:vkqKjk7gwhS8VaWb0POZKmIEDimRCMsopNYnriHyryo=
+go.opentelemetry.io/otel/sdk v1.29.0/go.mod h1:pM8Dx5WKnvxLCb+8lG1PRNIDxu9g9b9g59Qr7hfAAok=
+go.opentelemetry.io/otel/sdk/metric v1.29.0 h1:K2CfmJohnRgvZ9UAj2/FhIf/okdWcNdBwe1m8xFXiSY=
+go.opentelemetry.io/otel/sdk/metric v1.29.0/go.mod h1:6zZLdCl2fkauYoZIOn/soQIDSWFmNSRcICarHfuhNJQ=
+go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4=
+go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0=
go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8=
@@ -2012,8 +2015,8 @@ golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
-golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
-golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
+golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
+golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
@@ -2141,8 +2144,8 @@ golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
-golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
-golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
+golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
+golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
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-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -2167,8 +2170,8 @@ golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7Lm
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
-golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA=
-golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
+golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
+golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -2291,6 +2294,7 @@ golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220408201424-a24fb2fb8a0f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -2312,8 +2316,8 @@ golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
-golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
-golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
+golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
@@ -2323,8 +2327,8 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4=
-golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU=
-golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk=
+golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM=
+golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -2342,8 +2346,8 @@ golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
-golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
-golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
+golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
+golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.0.0-20161028155119-f51c12702a4d/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -2453,7 +2457,6 @@ gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6d
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc=
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
-google.golang.org/api v0.3.2/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
@@ -2499,8 +2502,8 @@ google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOI
google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw=
google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI=
google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
-google.golang.org/api v0.193.0 h1:eOGDoJFsLU+HpCBaDJex2fWiYujAw9KbXgpOAMePoUs=
-google.golang.org/api v0.193.0/go.mod h1:Po3YMV1XZx+mTku3cfJrlIYR03wiGrCOsdpC67hjZvw=
+google.golang.org/api v0.198.0 h1:OOH5fZatk57iN0A7tjJQzt6aPfYQ1JiWkt1yGseazks=
+google.golang.org/api v0.198.0/go.mod h1:/Lblzl3/Xqqk9hw/yS97TImKTUwnf1bv89v7+OagJzc=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
@@ -2611,12 +2614,12 @@ google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+S
google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo=
google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo=
google.golang.org/genproto v0.0.0-20220921223823-23cae91e6737/go.mod h1:2r/26NEF3bFmT3eC3aZreahSal0C3Shl8Gi6vyDYqOQ=
-google.golang.org/genproto v0.0.0-20240820151423-278611b39280 h1:oKt8r1ZvaPqBe3oeGTdyx1iNjuBS+VJcc9QdU1CD3d8=
-google.golang.org/genproto v0.0.0-20240820151423-278611b39280/go.mod h1:wxEc5TmU9JSLs1rSqG4z1YzeSNigp/9yIojIPuZVvKQ=
-google.golang.org/genproto/googleapis/api v0.0.0-20240820151423-278611b39280 h1:YDFM9oOjiFhaMAVgbDxfxW+66nRrsvzQzJ51wp3OxC0=
-google.golang.org/genproto/googleapis/api v0.0.0-20240820151423-278611b39280/go.mod h1:fO8wJzT2zbQbAjbIoos1285VfEIYKDDY+Dt+WpTkh6g=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240820151423-278611b39280 h1:XQMA2e105XNlEZ8NRF0HqnUOZzP14sUSsgL09kpdNnU=
-google.golang.org/genproto/googleapis/rpc v0.0.0-20240820151423-278611b39280/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
+google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 h1:BulPr26Jqjnd4eYDVe+YvyR7Yc2vJGkO5/0UxD0/jZU=
+google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:hL97c3SYopEHblzpxRL4lSs523++l8DYxGM1FQiYmb4=
+google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc=
+google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
@@ -2659,8 +2662,8 @@ google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu
google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
-google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
-google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
+google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw=
+google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
diff --git a/vendor/cloud.google.com/go/auth/CHANGES.md b/vendor/cloud.google.com/go/auth/CHANGES.md
index 8042bdae809b6..e82cf5a901a96 100644
--- a/vendor/cloud.google.com/go/auth/CHANGES.md
+++ b/vendor/cloud.google.com/go/auth/CHANGES.md
@@ -1,5 +1,39 @@
# Changelog
+## [0.9.4](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.3...auth/v0.9.4) (2024-09-11)
+
+
+### Bug Fixes
+
+* **auth:** Enable self-signed JWT for non-GDU universe domain ([#10831](https://github.com/googleapis/google-cloud-go/issues/10831)) ([f9869f7](https://github.com/googleapis/google-cloud-go/commit/f9869f7903cfd34d1b97c25d0dc5669d2c5138e6))
+
+## [0.9.3](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.2...auth/v0.9.3) (2024-09-03)
+
+
+### Bug Fixes
+
+* **auth:** Choose quota project envvar over file when both present ([#10807](https://github.com/googleapis/google-cloud-go/issues/10807)) ([2d8dd77](https://github.com/googleapis/google-cloud-go/commit/2d8dd7700eff92d4b95027be55e26e1e7aa79181)), refs [#10804](https://github.com/googleapis/google-cloud-go/issues/10804)
+
+## [0.9.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.1...auth/v0.9.2) (2024-08-30)
+
+
+### Bug Fixes
+
+* **auth:** Handle non-Transport DefaultTransport ([#10733](https://github.com/googleapis/google-cloud-go/issues/10733)) ([98d91dc](https://github.com/googleapis/google-cloud-go/commit/98d91dc8316b247498fab41ab35e57a0446fe556)), refs [#10742](https://github.com/googleapis/google-cloud-go/issues/10742)
+* **auth:** Make sure quota option takes precedence over env/file ([#10797](https://github.com/googleapis/google-cloud-go/issues/10797)) ([f1b050d](https://github.com/googleapis/google-cloud-go/commit/f1b050d56d804b245cab048c2980d32b0eaceb4e)), refs [#10795](https://github.com/googleapis/google-cloud-go/issues/10795)
+
+
+### Documentation
+
+* **auth:** Fix Go doc comment link ([#10751](https://github.com/googleapis/google-cloud-go/issues/10751)) ([015acfa](https://github.com/googleapis/google-cloud-go/commit/015acfab4d172650928bb1119bc2cd6307b9a437))
+
+## [0.9.1](https://github.com/googleapis/google-cloud-go/compare/auth/v0.9.0...auth/v0.9.1) (2024-08-22)
+
+
+### Bug Fixes
+
+* **auth:** Setting expireEarly to default when the value is 0 ([#10732](https://github.com/googleapis/google-cloud-go/issues/10732)) ([5e67869](https://github.com/googleapis/google-cloud-go/commit/5e67869a31e9e8ecb4eeebd2cfa11a761c3b1948))
+
## [0.9.0](https://github.com/googleapis/google-cloud-go/compare/auth/v0.8.1...auth/v0.9.0) (2024-08-16)
diff --git a/vendor/cloud.google.com/go/auth/auth.go b/vendor/cloud.google.com/go/auth/auth.go
index 41e03f293546e..bc37ea85fb51f 100644
--- a/vendor/cloud.google.com/go/auth/auth.go
+++ b/vendor/cloud.google.com/go/auth/auth.go
@@ -12,6 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+// Package auth provides utilities for managing Google Cloud credentials,
+// including functionality for creating, caching, and refreshing OAuth2 tokens.
+// It offers customizable options for different OAuth2 flows, such as 2-legged
+// (2LO) and 3-legged (3LO) OAuth, along with support for PKCE and automatic
+// token management.
package auth
import (
@@ -130,7 +135,9 @@ func (t *Token) isEmpty() bool {
}
// Credentials holds Google credentials, including
-// [Application Default Credentials](https://developers.google.com/accounts/docs/application-default-credentials).
+// [Application Default Credentials].
+//
+// [Application Default Credentials]: https://developers.google.com/accounts/docs/application-default-credentials
type Credentials struct {
json []byte
projectID CredentialsPropertyProvider
@@ -258,7 +265,7 @@ func (ctpo *CachedTokenProviderOptions) autoRefresh() bool {
}
func (ctpo *CachedTokenProviderOptions) expireEarly() time.Duration {
- if ctpo == nil {
+ if ctpo == nil || ctpo.ExpireEarly == 0 {
return defaultExpiryDelta
}
return ctpo.ExpireEarly
diff --git a/vendor/cloud.google.com/go/auth/credentials/detect.go b/vendor/cloud.google.com/go/auth/credentials/detect.go
index cce6224186a73..010afc37c8fe4 100644
--- a/vendor/cloud.google.com/go/auth/credentials/detect.go
+++ b/vendor/cloud.google.com/go/auth/credentials/detect.go
@@ -98,8 +98,8 @@ func DetectDefault(opts *DetectOptions) (*auth.Credentials, error) {
if OnGCE() {
return auth.NewCredentials(&auth.CredentialsOptions{
TokenProvider: computeTokenProvider(opts),
- ProjectIDProvider: auth.CredentialsPropertyFunc(func(context.Context) (string, error) {
- return metadata.ProjectID()
+ ProjectIDProvider: auth.CredentialsPropertyFunc(func(ctx context.Context) (string, error) {
+ return metadata.ProjectIDWithContext(ctx)
}),
UniverseDomainProvider: &internal.ComputeUniverseDomainProvider{},
}), nil
diff --git a/vendor/cloud.google.com/go/auth/credentials/filetypes.go b/vendor/cloud.google.com/go/auth/credentials/filetypes.go
index b426e16d29757..6591b181132f7 100644
--- a/vendor/cloud.google.com/go/auth/credentials/filetypes.go
+++ b/vendor/cloud.google.com/go/auth/credentials/filetypes.go
@@ -33,7 +33,7 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) {
return nil, err
}
- var projectID, quotaProjectID, universeDomain string
+ var projectID, universeDomain string
var tp auth.TokenProvider
switch fileType {
case credsfile.ServiceAccountKey:
@@ -56,7 +56,6 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) {
if err != nil {
return nil, err
}
- quotaProjectID = f.QuotaProjectID
universeDomain = f.UniverseDomain
case credsfile.ExternalAccountKey:
f, err := credsfile.ParseExternalAccount(b)
@@ -67,7 +66,6 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) {
if err != nil {
return nil, err
}
- quotaProjectID = f.QuotaProjectID
universeDomain = resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain)
case credsfile.ExternalAccountAuthorizedUserKey:
f, err := credsfile.ParseExternalAccountAuthorizedUser(b)
@@ -78,7 +76,6 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) {
if err != nil {
return nil, err
}
- quotaProjectID = f.QuotaProjectID
universeDomain = f.UniverseDomain
case credsfile.ImpersonatedServiceAccountKey:
f, err := credsfile.ParseImpersonatedServiceAccount(b)
@@ -108,9 +105,9 @@ func fileCredentials(b []byte, opts *DetectOptions) (*auth.Credentials, error) {
TokenProvider: auth.NewCachedTokenProvider(tp, &auth.CachedTokenProviderOptions{
ExpireEarly: opts.EarlyTokenRefresh,
}),
- JSON: b,
- ProjectIDProvider: internalauth.StaticCredentialsProperty(projectID),
- QuotaProjectIDProvider: internalauth.StaticCredentialsProperty(quotaProjectID),
+ JSON: b,
+ ProjectIDProvider: internalauth.StaticCredentialsProperty(projectID),
+ // TODO(codyoss): only set quota project here if there was a user override
UniverseDomainProvider: internalauth.StaticCredentialsProperty(universeDomain),
}), nil
}
@@ -127,8 +124,14 @@ func resolveUniverseDomain(optsUniverseDomain, fileUniverseDomain string) string
}
func handleServiceAccount(f *credsfile.ServiceAccountFile, opts *DetectOptions) (auth.TokenProvider, error) {
+ ud := resolveUniverseDomain(opts.UniverseDomain, f.UniverseDomain)
if opts.UseSelfSignedJWT {
return configureSelfSignedJWT(f, opts)
+ } else if ud != "" && ud != internalauth.DefaultUniverseDomain {
+ // For non-GDU universe domains, token exchange is impossible and services
+ // must support self-signed JWTs.
+ opts.UseSelfSignedJWT = true
+ return configureSelfSignedJWT(f, opts)
}
opts2LO := &auth.Options2LO{
Email: f.ClientEmail,
diff --git a/vendor/cloud.google.com/go/auth/credentials/selfsignedjwt.go b/vendor/cloud.google.com/go/auth/credentials/selfsignedjwt.go
index b62a8ae4d5d70..6ae29de6c2789 100644
--- a/vendor/cloud.google.com/go/auth/credentials/selfsignedjwt.go
+++ b/vendor/cloud.google.com/go/auth/credentials/selfsignedjwt.go
@@ -17,6 +17,7 @@ package credentials
import (
"context"
"crypto/rsa"
+ "errors"
"fmt"
"strings"
"time"
@@ -35,6 +36,9 @@ var (
// configureSelfSignedJWT uses the private key in the service account to create
// a JWT without making a network call.
func configureSelfSignedJWT(f *credsfile.ServiceAccountFile, opts *DetectOptions) (auth.TokenProvider, error) {
+ if len(opts.scopes()) == 0 && opts.Audience == "" {
+ return nil, errors.New("credentials: both scopes and audience are empty")
+ }
pk, err := internal.ParseKey([]byte(f.PrivateKey))
if err != nil {
return nil, fmt.Errorf("credentials: could not parse key: %w", err)
diff --git a/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go b/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go
index 0442a5938a800..21488e29f0b71 100644
--- a/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go
+++ b/vendor/cloud.google.com/go/auth/grpctransport/grpctransport.go
@@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+// Package grpctransport provides functionality for managing gRPC client
+// connections to Google Cloud services.
package grpctransport
import (
@@ -38,7 +40,7 @@ const (
// Check env to decide if using google-c2p resolver for DirectPath traffic.
enableDirectPathXdsEnvVar = "GOOGLE_CLOUD_ENABLE_DIRECT_PATH_XDS"
- quotaProjectHeaderKey = "X-Goog-User-Project"
+ quotaProjectHeaderKey = "X-goog-user-project"
)
var (
@@ -271,7 +273,10 @@ func dial(ctx context.Context, secure bool, opts *Options) (*grpc.ClientConn, er
if metadata == nil {
metadata = make(map[string]string, 1)
}
- metadata[quotaProjectHeaderKey] = qp
+ // Don't overwrite user specified quota
+ if _, ok := metadata[quotaProjectHeaderKey]; !ok {
+ metadata[quotaProjectHeaderKey] = qp
+ }
}
grpcOpts = append(grpcOpts,
grpc.WithPerRPCCredentials(&grpcCredentialsProvider{
@@ -291,7 +296,7 @@ func dial(ctx context.Context, secure bool, opts *Options) (*grpc.ClientConn, er
grpcOpts = addOCStatsHandler(grpcOpts, opts)
grpcOpts = append(grpcOpts, opts.GRPCDialOpts...)
- return grpc.DialContext(ctx, endpoint, grpcOpts...)
+ return grpc.NewClient(endpoint, grpcOpts...)
}
// grpcKeyProvider satisfies https://pkg.go.dev/google.golang.org/grpc/credentials#PerRPCCredentials.
diff --git a/vendor/cloud.google.com/go/auth/httptransport/httptransport.go b/vendor/cloud.google.com/go/auth/httptransport/httptransport.go
index 969c8d4d2008c..30fedf9562f96 100644
--- a/vendor/cloud.google.com/go/auth/httptransport/httptransport.go
+++ b/vendor/cloud.google.com/go/auth/httptransport/httptransport.go
@@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+// Package httptransport provides functionality for managing HTTP client
+// connections to Google Cloud services.
package httptransport
import (
diff --git a/vendor/cloud.google.com/go/auth/httptransport/transport.go b/vendor/cloud.google.com/go/auth/httptransport/transport.go
index 07eea474446b3..274bb01254c92 100644
--- a/vendor/cloud.google.com/go/auth/httptransport/transport.go
+++ b/vendor/cloud.google.com/go/auth/httptransport/transport.go
@@ -31,7 +31,7 @@ import (
)
const (
- quotaProjectHeaderKey = "X-Goog-User-Project"
+ quotaProjectHeaderKey = "X-goog-user-project"
)
func newTransport(base http.RoundTripper, opts *Options) (http.RoundTripper, error) {
@@ -76,7 +76,10 @@ func newTransport(base http.RoundTripper, opts *Options) (http.RoundTripper, err
if headers == nil {
headers = make(map[string][]string, 1)
}
- headers.Set(quotaProjectHeaderKey, qp)
+ // Don't overwrite user specified quota
+ if v := headers.Get(quotaProjectHeaderKey); v == "" {
+ headers.Set(quotaProjectHeaderKey, qp)
+ }
}
creds.TokenProvider = auth.NewCachedTokenProvider(creds.TokenProvider, nil)
trans = &authTransport{
@@ -94,7 +97,11 @@ func newTransport(base http.RoundTripper, opts *Options) (http.RoundTripper, err
// http.DefaultTransport.
// If TLSCertificate is available, set TLSClientConfig as well.
func defaultBaseTransport(clientCertSource cert.Provider, dialTLSContext func(context.Context, string, string) (net.Conn, error)) http.RoundTripper {
- trans := http.DefaultTransport.(*http.Transport).Clone()
+ defaultTransport, ok := http.DefaultTransport.(*http.Transport)
+ if !ok {
+ defaultTransport = transport.BaseTransport()
+ }
+ trans := defaultTransport.Clone()
trans.MaxIdleConnsPerHost = 100
if clientCertSource != nil {
diff --git a/vendor/cloud.google.com/go/auth/internal/transport/cert/secureconnect_cert.go b/vendor/cloud.google.com/go/auth/internal/transport/cert/secureconnect_cert.go
index 3227aba280c8e..738cb21618e79 100644
--- a/vendor/cloud.google.com/go/auth/internal/transport/cert/secureconnect_cert.go
+++ b/vendor/cloud.google.com/go/auth/internal/transport/cert/secureconnect_cert.go
@@ -62,11 +62,11 @@ func NewSecureConnectProvider(configFilePath string) (Provider, error) {
file, err := os.ReadFile(configFilePath)
if err != nil {
- if errors.Is(err, os.ErrNotExist) {
- // Config file missing means Secure Connect is not supported.
- return nil, errSourceUnavailable
- }
- return nil, err
+ // Config file missing means Secure Connect is not supported.
+ // There are non-os.ErrNotExist errors that may be returned.
+ // (e.g. if the home directory is /dev/null, *nix systems will
+ // return ENOTDIR instead of ENOENT)
+ return nil, errSourceUnavailable
}
var metadata secureConnectMetadata
diff --git a/vendor/cloud.google.com/go/auth/internal/transport/s2a.go b/vendor/cloud.google.com/go/auth/internal/transport/s2a.go
index 4df73edce986e..37894bfcd013b 100644
--- a/vendor/cloud.google.com/go/auth/internal/transport/s2a.go
+++ b/vendor/cloud.google.com/go/auth/internal/transport/s2a.go
@@ -15,6 +15,7 @@
package transport
import (
+ "context"
"encoding/json"
"fmt"
"log"
@@ -84,7 +85,7 @@ func getMetadataMTLSAutoConfig() {
}
var httpGetMetadataMTLSConfig = func() (string, error) {
- return metadata.Get(configEndpointSuffix)
+ return metadata.GetWithContext(context.Background(), configEndpointSuffix)
}
func queryConfig() (*mtlsConfig, error) {
diff --git a/vendor/cloud.google.com/go/auth/internal/transport/transport.go b/vendor/cloud.google.com/go/auth/internal/transport/transport.go
index 718a6b1714586..cc586ec5b1a5d 100644
--- a/vendor/cloud.google.com/go/auth/internal/transport/transport.go
+++ b/vendor/cloud.google.com/go/auth/internal/transport/transport.go
@@ -81,12 +81,14 @@ func ValidateUniverseDomain(clientUniverseDomain, credentialsUniverseDomain stri
// DefaultHTTPClientWithTLS constructs an HTTPClient using the provided tlsConfig, to support mTLS.
func DefaultHTTPClientWithTLS(tlsConfig *tls.Config) *http.Client {
- trans := baseTransport()
+ trans := BaseTransport()
trans.TLSClientConfig = tlsConfig
return &http.Client{Transport: trans}
}
-func baseTransport() *http.Transport {
+// BaseTransport returns a default [http.Transport] which can be used if
+// [http.DefaultTransport] has been overwritten.
+func BaseTransport() *http.Transport {
return &http.Transport{
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
diff --git a/vendor/cloud.google.com/go/bigtable/CHANGES.md b/vendor/cloud.google.com/go/bigtable/CHANGES.md
index 05b4291c9fd32..d102ec70e16be 100644
--- a/vendor/cloud.google.com/go/bigtable/CHANGES.md
+++ b/vendor/cloud.google.com/go/bigtable/CHANGES.md
@@ -1,5 +1,32 @@
# Changes
+## [1.31.0](https://github.com/googleapis/google-cloud-go/compare/bigtable/v1.30.0...bigtable/v1.31.0) (2024-08-28)
+
+
+### Features
+
+* **bigtable:** Using new auth library ([#10766](https://github.com/googleapis/google-cloud-go/issues/10766)) ([8daf304](https://github.com/googleapis/google-cloud-go/commit/8daf304faf3808690996ad3a45d2890b107a0939))
+
+
+### Performance Improvements
+
+* **bigtable:** Use RecvMsg instead of Recv ([#10674](https://github.com/googleapis/google-cloud-go/issues/10674)) ([7e4fbc5](https://github.com/googleapis/google-cloud-go/commit/7e4fbc5612441c59bfaa1e5b9bbd06e3387b5c02))
+
+## [1.30.0](https://github.com/googleapis/google-cloud-go/compare/bigtable/v1.29.0...bigtable/v1.30.0) (2024-08-26)
+
+
+### Features
+
+* **bigtable:** Add MarshalJSON to allow clients to get a stringified version of the protobuf ([#10679](https://github.com/googleapis/google-cloud-go/issues/10679)) ([663f399](https://github.com/googleapis/google-cloud-go/commit/663f3996ced66c312c8202535574d3ffcb72d283))
+* **bigtable:** Add nil checks to Equal method ([#10758](https://github.com/googleapis/google-cloud-go/issues/10758)) ([f1aad7f](https://github.com/googleapis/google-cloud-go/commit/f1aad7f3a05a959d0dd973e026026391deda7657))
+* **bigtable:** Add UpdateFamily to allow updating a family type ([#10759](https://github.com/googleapis/google-cloud-go/issues/10759)) ([ec0cbb2](https://github.com/googleapis/google-cloud-go/commit/ec0cbb20ba42b7ef03688a06dc0a380e9b27e394))
+* **bigtable:** Update go version for conformance tests ([#10743](https://github.com/googleapis/google-cloud-go/issues/10743)) ([74cf45e](https://github.com/googleapis/google-cloud-go/commit/74cf45efe7dc6f74cadac3f015a705f8dbf69622))
+
+
+### Bug Fixes
+
+* **bigtable:** Use new auth library ([#10670](https://github.com/googleapis/google-cloud-go/issues/10670)) ([fab520d](https://github.com/googleapis/google-cloud-go/commit/fab520d226340bbf1aedc001dcb7384651e075a0))
+
## [1.29.0](https://github.com/googleapis/google-cloud-go/compare/bigtable/v1.28.0...bigtable/v1.29.0) (2024-08-09)
diff --git a/vendor/cloud.google.com/go/bigtable/admin.go b/vendor/cloud.google.com/go/bigtable/admin.go
index 8dd9f929056fa..69f57f0efa7b8 100644
--- a/vendor/cloud.google.com/go/bigtable/admin.go
+++ b/vendor/cloud.google.com/go/bigtable/admin.go
@@ -667,41 +667,82 @@ func (ac *AdminClient) TableInfo(ctx context.Context, table string) (*TableInfo,
return ti, nil
}
-type gcPolicySettings struct {
+type updateFamilyOption struct {
ignoreWarnings bool
}
-// GCPolicyOption is the interface to change GC policy settings
+// GCPolicyOption is deprecated, kept for backwards compatibility, use UpdateFamilyOption in new code
type GCPolicyOption interface {
- apply(s *gcPolicySettings)
+ apply(s *updateFamilyOption)
}
+// UpdateFamilyOption is the interface to update family settings
+type UpdateFamilyOption GCPolicyOption
+
type ignoreWarnings bool
-func (w ignoreWarnings) apply(s *gcPolicySettings) {
+func (w ignoreWarnings) apply(s *updateFamilyOption) {
s.ignoreWarnings = bool(w)
}
-// IgnoreWarnings returns a gcPolicyOption that ignores safety checks when modifying the column families
+// IgnoreWarnings returns a updateFamilyOption that ignores safety checks when modifying the column families
func IgnoreWarnings() GCPolicyOption {
return ignoreWarnings(true)
}
-func (ac *AdminClient) setGCPolicy(ctx context.Context, table, family string, policy GCPolicy, opts ...GCPolicyOption) error {
+// SetGCPolicy specifies which cells in a column family should be garbage collected.
+// GC executes opportunistically in the background; table reads may return data
+// matching the GC policy.
+func (ac *AdminClient) SetGCPolicy(ctx context.Context, table, family string, policy GCPolicy) error {
+ return ac.UpdateFamily(ctx, table, family, Family{GCPolicy: policy})
+}
+
+// SetGCPolicyWithOptions is similar to SetGCPolicy but allows passing options
+func (ac *AdminClient) SetGCPolicyWithOptions(ctx context.Context, table, family string, policy GCPolicy, opts ...GCPolicyOption) error {
+ familyOpts := []UpdateFamilyOption{}
+ for _, opt := range opts {
+ if opt != nil {
+ familyOpts = append(familyOpts, opt.(UpdateFamilyOption))
+ }
+ }
+ return ac.UpdateFamily(ctx, table, family, Family{GCPolicy: policy}, familyOpts...)
+}
+
+// UpdateFamily updates column families' garbage colleciton policies and value type.
+func (ac *AdminClient) UpdateFamily(ctx context.Context, table, familyName string, family Family, opts ...UpdateFamilyOption) error {
ctx = mergeOutgoingMetadata(ctx, ac.md)
prefix := ac.instancePrefix()
- s := gcPolicySettings{}
+ s := updateFamilyOption{}
for _, opt := range opts {
if opt != nil {
opt.apply(&s)
}
}
+
+ cf := &btapb.ColumnFamily{}
+ mask := &field_mask.FieldMask{}
+ if family.GCPolicy != nil {
+ cf.GcRule = family.GCPolicy.proto()
+ mask.Paths = append(mask.Paths, "gc_rule")
+
+ }
+ if family.ValueType != nil {
+ cf.ValueType = family.ValueType.proto()
+ mask.Paths = append(mask.Paths, "value_type")
+ }
+
+ // No update
+ if len(mask.Paths) == 0 {
+ return nil
+ }
+
req := &btapb.ModifyColumnFamiliesRequest{
Name: prefix + "/tables/" + table,
Modifications: []*btapb.ModifyColumnFamiliesRequest_Modification{{
- Id: family,
- Mod: &btapb.ModifyColumnFamiliesRequest_Modification_Update{Update: &btapb.ColumnFamily{GcRule: policy.proto()}},
+ Id: familyName,
+ Mod: &btapb.ModifyColumnFamiliesRequest_Modification_Update{Update: cf},
+ UpdateMask: mask,
}},
IgnoreWarnings: s.ignoreWarnings,
}
@@ -709,18 +750,6 @@ func (ac *AdminClient) setGCPolicy(ctx context.Context, table, family string, po
return err
}
-// SetGCPolicy specifies which cells in a column family should be garbage collected.
-// GC executes opportunistically in the background; table reads may return data
-// matching the GC policy.
-func (ac *AdminClient) SetGCPolicy(ctx context.Context, table, family string, policy GCPolicy) error {
- return ac.SetGCPolicyWithOptions(ctx, table, family, policy)
-}
-
-// SetGCPolicyWithOptions is similar to SetGCPolicy but allows passing options
-func (ac *AdminClient) SetGCPolicyWithOptions(ctx context.Context, table, family string, policy GCPolicy, opts ...GCPolicyOption) error {
- return ac.setGCPolicy(ctx, table, family, policy, opts...)
-}
-
// DropRowRange permanently deletes a row range from the specified table.
func (ac *AdminClient) DropRowRange(ctx context.Context, table, rowKeyPrefix string) error {
ctx = mergeOutgoingMetadata(ctx, ac.md)
diff --git a/vendor/cloud.google.com/go/bigtable/bigtable.go b/vendor/cloud.google.com/go/bigtable/bigtable.go
index e12035db4e7a8..7a57b41372345 100644
--- a/vendor/cloud.google.com/go/bigtable/bigtable.go
+++ b/vendor/cloud.google.com/go/bigtable/bigtable.go
@@ -109,6 +109,7 @@ func NewClientWithConfig(ctx context.Context, project, instance string, config C
// Allow non-default service account in DirectPath.
o = append(o, internaloption.AllowNonDefaultServiceAccount(true))
+ o = append(o, internaloption.EnableNewAuthLibrary())
o = append(o, opts...)
connPool, err := gtransport.DialPool(ctx, o...)
if err != nil {
@@ -395,8 +396,10 @@ func (t *Table) readRows(ctx context.Context, arg RowSet, f func(Row) bool, mt *
// Ignore error since header is only being used to record builtin metrics
// Failure to record metrics should not fail the operation
*headerMD, _ = stream.Header()
+ res := new(btpb.ReadRowsResponse)
for {
- res, err := stream.Recv()
+ proto.Reset(res)
+ err := stream.RecvMsg(res)
if err == io.EOF {
*trailerMD = stream.Trailer()
break
@@ -437,7 +440,8 @@ func (t *Table) readRows(ctx context.Context, arg RowSet, f func(Row) bool, mt *
// Cancel and drain stream.
cancel()
for {
- if _, err := stream.Recv(); err != nil {
+ proto.Reset(res)
+ if err := stream.RecvMsg(res); err != nil {
*trailerMD = stream.Trailer()
// The stream has ended. We don't return an error
// because the caller has intentionally interrupted the scan.
diff --git a/vendor/cloud.google.com/go/bigtable/bttest/inmem.go b/vendor/cloud.google.com/go/bigtable/bttest/inmem.go
index c53bb2b4dc008..b2da28599ebf7 100644
--- a/vendor/cloud.google.com/go/bigtable/bttest/inmem.go
+++ b/vendor/cloud.google.com/go/bigtable/bttest/inmem.go
@@ -333,10 +333,15 @@ func (s *server) ModifyColumnFamilies(ctx context.Context, req *btapb.ModifyColu
return true
})
} else if modify := mod.GetUpdate(); modify != nil {
- if _, ok := tbl.families[mod.Id]; !ok {
+ newcf := newColumnFamily(req.Name+"/columnFamilies/"+mod.Id, 0, modify)
+ cf, ok := tbl.families[mod.Id]
+ if !ok {
return nil, fmt.Errorf("no such family %q", mod.Id)
}
- newcf := newColumnFamily(req.Name+"/columnFamilies/"+mod.Id, 0, modify)
+ if cf.valueType != newcf.valueType {
+ return nil, status.Errorf(codes.InvalidArgument, "Immutable fields 'value_type' cannot be updated")
+ }
+
// assume that we ALWAYS want to replace by the new setting
// we may need partial update through
tbl.families[mod.Id] = newcf
diff --git a/vendor/cloud.google.com/go/bigtable/conformance_test.sh b/vendor/cloud.google.com/go/bigtable/conformance_test.sh
index 35a126e2f94d8..bf6f520a6b0c0 100644
--- a/vendor/cloud.google.com/go/bigtable/conformance_test.sh
+++ b/vendor/cloud.google.com/go/bigtable/conformance_test.sh
@@ -50,10 +50,10 @@ trap cleanup EXIT
# Run the conformance tests
cd $conformanceTestsHome
-# Tests in https://github.com/googleapis/cloud-bigtable-clients-test/tree/main/tests can only be run on go1.20.2
-go install golang.org/dl/go1.20.2@latest
-go1.20.2 download
-go1.20.2 test -v -proxy_addr=:$testProxyPort | tee -a $sponge_log
+# Tests in https://github.com/googleapis/cloud-bigtable-clients-test/tree/main/tests can only be run on go1.22.5
+go install golang.org/dl/go1.22.5@latest
+go1.22.5 download
+go1.22.5 test -v -proxy_addr=:$testProxyPort | tee -a $sponge_log
RETURN_CODE=$?
echo "exiting with ${RETURN_CODE}"
diff --git a/vendor/cloud.google.com/go/bigtable/internal/version.go b/vendor/cloud.google.com/go/bigtable/internal/version.go
index a08cb7cabc62d..9c7380dc515f0 100644
--- a/vendor/cloud.google.com/go/bigtable/internal/version.go
+++ b/vendor/cloud.google.com/go/bigtable/internal/version.go
@@ -15,4 +15,4 @@
package internal
// Version is the current tagged release of the library.
-const Version = "1.29.0"
+const Version = "1.31.0"
diff --git a/vendor/cloud.google.com/go/bigtable/type.go b/vendor/cloud.google.com/go/bigtable/type.go
index 59f954f081f7b..4d0d8dbf5fe62 100644
--- a/vendor/cloud.google.com/go/bigtable/type.go
+++ b/vendor/cloud.google.com/go/bigtable/type.go
@@ -16,7 +16,11 @@ limitations under the License.
package bigtable
-import btapb "cloud.google.com/go/bigtable/admin/apiv2/adminpb"
+import (
+ btapb "cloud.google.com/go/bigtable/admin/apiv2/adminpb"
+ "google.golang.org/protobuf/encoding/protojson"
+ "google.golang.org/protobuf/proto"
+)
// Type wraps the protobuf representation of a type. See the protobuf definition
// for more details on types.
@@ -24,6 +28,34 @@ type Type interface {
proto() *btapb.Type
}
+var marshalOptions = protojson.MarshalOptions{AllowPartial: true, UseEnumNumbers: true}
+var unmarshalOptions = protojson.UnmarshalOptions{AllowPartial: true}
+
+// MarshalJSON returns the string representation of the Type protobuf.
+func MarshalJSON(t Type) ([]byte, error) {
+ return marshalOptions.Marshal(t.proto())
+}
+
+// UnmarshalJSON returns a Type object from json bytes.
+func UnmarshalJSON(data []byte) (Type, error) {
+ result := &btapb.Type{}
+ if err := unmarshalOptions.Unmarshal(data, result); err != nil {
+ return nil, err
+ }
+ return ProtoToType(result), nil
+}
+
+// Equal compares Type objects.
+func Equal(a, b Type) bool {
+ if a == nil && b == nil {
+ return true
+ }
+ if a == nil || b == nil {
+ return false
+ }
+ return proto.Equal(a.proto(), b.proto())
+}
+
type unknown[T interface{}] struct {
wrapped *T
}
@@ -205,6 +237,8 @@ func ProtoToType(pb *btapb.Type) Type {
return int64ProtoToType(t.Int64Type)
case *btapb.Type_BytesType:
return bytesProtoToType(t.BytesType)
+ case *btapb.Type_StringType:
+ return stringProtoToType(t.StringType)
case *btapb.Type_AggregateType:
return aggregateProtoToType(t.AggregateType)
default:
@@ -229,6 +263,23 @@ func bytesProtoToType(b *btapb.Type_Bytes) BytesType {
return BytesType{Encoding: bytesEncodingProtoToType(b.Encoding)}
}
+func stringEncodingProtoToType(se *btapb.Type_String_Encoding) StringEncoding {
+ if se == nil {
+ return unknown[btapb.Type_String_Encoding]{wrapped: se}
+ }
+
+ switch se.Encoding.(type) {
+ case *btapb.Type_String_Encoding_Utf8Raw_:
+ return StringUtf8Encoding{}
+ default:
+ return unknown[btapb.Type_String_Encoding]{wrapped: se}
+ }
+}
+
+func stringProtoToType(s *btapb.Type_String) Type {
+ return StringType{Encoding: stringEncodingProtoToType(s.Encoding)}
+}
+
func int64EncodingProtoToEncoding(ie *btapb.Type_Int64_Encoding) Int64Encoding {
if ie == nil {
return unknown[btapb.Type_Int64_Encoding]{wrapped: ie}
@@ -246,7 +297,7 @@ func int64ProtoToType(i *btapb.Type_Int64) Type {
return Int64Type{Encoding: int64EncodingProtoToEncoding(i.Encoding)}
}
-func aggregateProtoToType(agg *btapb.Type_Aggregate) Type {
+func aggregateProtoToType(agg *btapb.Type_Aggregate) AggregateType {
if agg == nil {
return AggregateType{Input: nil, Aggregator: unknownAggregator{wrapped: agg}}
}
diff --git a/vendor/cloud.google.com/go/compute/metadata/CHANGES.md b/vendor/cloud.google.com/go/compute/metadata/CHANGES.md
index 9594e1e2793c6..811b6a0d06c77 100644
--- a/vendor/cloud.google.com/go/compute/metadata/CHANGES.md
+++ b/vendor/cloud.google.com/go/compute/metadata/CHANGES.md
@@ -1,5 +1,12 @@
# Changes
+## [0.5.1](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.5.0...compute/metadata/v0.5.1) (2024-09-12)
+
+
+### Bug Fixes
+
+* **compute/metadata:** Check error chain for retryable error ([#10840](https://github.com/googleapis/google-cloud-go/issues/10840)) ([2bdedef](https://github.com/googleapis/google-cloud-go/commit/2bdedeff621b223d63cebc4355fcf83bc68412cd))
+
## [0.5.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.4.0...compute/metadata/v0.5.0) (2024-07-10)
diff --git a/vendor/cloud.google.com/go/compute/metadata/retry_linux.go b/vendor/cloud.google.com/go/compute/metadata/retry_linux.go
index bb412f8917e31..2e53f01230090 100644
--- a/vendor/cloud.google.com/go/compute/metadata/retry_linux.go
+++ b/vendor/cloud.google.com/go/compute/metadata/retry_linux.go
@@ -17,10 +17,15 @@
package metadata
-import "syscall"
+import (
+ "errors"
+ "syscall"
+)
func init() {
// Initialize syscallRetryable to return true on transient socket-level
// errors. These errors are specific to Linux.
- syscallRetryable = func(err error) bool { return err == syscall.ECONNRESET || err == syscall.ECONNREFUSED }
+ syscallRetryable = func(err error) bool {
+ return errors.Is(err, syscall.ECONNRESET) || errors.Is(err, syscall.ECONNREFUSED)
+ }
}
diff --git a/vendor/cloud.google.com/go/iam/CHANGES.md b/vendor/cloud.google.com/go/iam/CHANGES.md
index 89f757b1161c3..498a15a5fcd52 100644
--- a/vendor/cloud.google.com/go/iam/CHANGES.md
+++ b/vendor/cloud.google.com/go/iam/CHANGES.md
@@ -1,6 +1,13 @@
# Changes
+## [1.2.1](https://github.com/googleapis/google-cloud-go/compare/iam/v1.2.0...iam/v1.2.1) (2024-09-12)
+
+
+### Bug Fixes
+
+* **iam:** Bump dependencies ([2ddeb15](https://github.com/googleapis/google-cloud-go/commit/2ddeb1544a53188a7592046b98913982f1b0cf04))
+
## [1.2.0](https://github.com/googleapis/google-cloud-go/compare/iam/v1.1.13...iam/v1.2.0) (2024-08-20)
diff --git a/vendor/cloud.google.com/go/pubsub/CHANGES.md b/vendor/cloud.google.com/go/pubsub/CHANGES.md
index 64aeb66a13021..88176bd51dfac 100644
--- a/vendor/cloud.google.com/go/pubsub/CHANGES.md
+++ b/vendor/cloud.google.com/go/pubsub/CHANGES.md
@@ -1,5 +1,20 @@
# Changes
+## [1.43.0](https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.42.0...pubsub/v1.43.0) (2024-09-09)
+
+
+### Features
+
+* **pubsub:** Add support for Go 1.23 iterators ([84461c0](https://github.com/googleapis/google-cloud-go/commit/84461c0ba464ec2f951987ba60030e37c8a8fc18))
+* **pubsub:** Allow trace extraction from protobuf message ([#10827](https://github.com/googleapis/google-cloud-go/issues/10827)) ([caa826c](https://github.com/googleapis/google-cloud-go/commit/caa826cea826473ebf4c806b57b0c3b0a2f0f365))
+
+
+### Bug Fixes
+
+* **pubsub:** Add attributes before startSpan ([#10800](https://github.com/googleapis/google-cloud-go/issues/10800)) ([48addbf](https://github.com/googleapis/google-cloud-go/commit/48addbff725ee2bb226ce0ab926415c27fd4ffad))
+* **pubsub:** Bump dependencies ([2ddeb15](https://github.com/googleapis/google-cloud-go/commit/2ddeb1544a53188a7592046b98913982f1b0cf04))
+* **pubsub:** Close grpc streams on retry ([#10624](https://github.com/googleapis/google-cloud-go/issues/10624)) ([79a0e11](https://github.com/googleapis/google-cloud-go/commit/79a0e118c88190cbe1b56250a75b67bd98b0d7f2))
+
## [1.42.0](https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.41.0...pubsub/v1.42.0) (2024-08-19)
diff --git a/vendor/cloud.google.com/go/pubsub/apiv1/auxiliary_go123.go b/vendor/cloud.google.com/go/pubsub/apiv1/auxiliary_go123.go
new file mode 100644
index 0000000000000..c7a04ffb92e96
--- /dev/null
+++ b/vendor/cloud.google.com/go/pubsub/apiv1/auxiliary_go123.go
@@ -0,0 +1,56 @@
+// 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
+//
+// https://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.
+
+// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
+
+//go:build go1.23
+
+package pubsub
+
+import (
+ "iter"
+
+ pubsubpb "cloud.google.com/go/pubsub/apiv1/pubsubpb"
+ "github.com/googleapis/gax-go/v2/iterator"
+)
+
+// All returns an iterator. If an error is returned by the iterator, the
+// iterator will stop after that iteration.
+func (it *SchemaIterator) All() iter.Seq2[*pubsubpb.Schema, error] {
+ return iterator.RangeAdapter(it.Next)
+}
+
+// All returns an iterator. If an error is returned by the iterator, the
+// iterator will stop after that iteration.
+func (it *SnapshotIterator) All() iter.Seq2[*pubsubpb.Snapshot, error] {
+ return iterator.RangeAdapter(it.Next)
+}
+
+// All returns an iterator. If an error is returned by the iterator, the
+// iterator will stop after that iteration.
+func (it *StringIterator) All() iter.Seq2[string, error] {
+ return iterator.RangeAdapter(it.Next)
+}
+
+// All returns an iterator. If an error is returned by the iterator, the
+// iterator will stop after that iteration.
+func (it *SubscriptionIterator) All() iter.Seq2[*pubsubpb.Subscription, error] {
+ return iterator.RangeAdapter(it.Next)
+}
+
+// All returns an iterator. If an error is returned by the iterator, the
+// iterator will stop after that iteration.
+func (it *TopicIterator) All() iter.Seq2[*pubsubpb.Topic, error] {
+ return iterator.RangeAdapter(it.Next)
+}
diff --git a/vendor/cloud.google.com/go/pubsub/internal/version.go b/vendor/cloud.google.com/go/pubsub/internal/version.go
index f37b860085c8d..e5b2de09172f5 100644
--- a/vendor/cloud.google.com/go/pubsub/internal/version.go
+++ b/vendor/cloud.google.com/go/pubsub/internal/version.go
@@ -15,4 +15,4 @@
package internal
// Version is the current tagged release of the library.
-const Version = "1.42.0"
+const Version = "1.43.0"
diff --git a/vendor/cloud.google.com/go/pubsub/iterator.go b/vendor/cloud.google.com/go/pubsub/iterator.go
index 9f60359040fbb..4f791fa6c06ae 100644
--- a/vendor/cloud.google.com/go/pubsub/iterator.go
+++ b/vendor/cloud.google.com/go/pubsub/iterator.go
@@ -335,14 +335,17 @@ func (it *messageIterator) receive(maxToPull int32) ([]*Message, error) {
if m.Attributes != nil {
ctx = propagation.TraceContext{}.Extract(ctx, newMessageCarrier(m))
}
- attr := getSubscriberOpts(it.projectID, it.subID, m)
- _, span := startSpan(ctx, subscribeSpanName, it.subID, attr...)
- span.SetAttributes(
- attribute.Bool(eosAttribute, it.enableExactlyOnceDelivery),
- attribute.String(ackIDAttribute, ackID),
- semconv.MessagingBatchMessageCount(len(msgs)),
- semconv.CodeFunction("receive"),
+ opts := getSubscriberOpts(it.projectID, it.subID, m)
+ opts = append(
+ opts,
+ trace.WithAttributes(
+ attribute.Bool(eosAttribute, it.enableExactlyOnceDelivery),
+ attribute.String(ackIDAttribute, ackID),
+ semconv.MessagingBatchMessageCount(len(msgs)),
+ semconv.CodeFunction("receive"),
+ ),
)
+ _, span := startSpan(ctx, subscribeSpanName, it.subID, opts...)
// Always store the subscribe span, even if sampling isn't enabled.
// This is useful since we need to propagate the sampling flag
// to the callback in Receive, so traces have an unbroken sampling decision.
@@ -658,11 +661,16 @@ func (it *messageIterator) sendAck(m map[string]*AckResult) {
// Create the single ack span for this request, and for each
// message, add Subscribe<->Ack links.
opts := getCommonOptions(it.projectID, it.subID)
- opts = append(opts, trace.WithLinks(links...))
+ opts = append(
+ opts,
+ trace.WithLinks(links...),
+ trace.WithAttributes(
+ semconv.MessagingBatchMessageCount(len(ackIDs)),
+ semconv.CodeFunction("sendAck"),
+ ),
+ )
_, ackSpan := startSpan(context.Background(), ackSpanName, it.subID, opts...)
defer ackSpan.End()
- ackSpan.SetAttributes(semconv.MessagingBatchMessageCount(len(ackIDs)),
- semconv.CodeFunction("sendAck"))
if ackSpan.SpanContext().IsSampled() {
for _, s := range subscribeSpans {
s.AddLink(trace.Link{
@@ -740,16 +748,25 @@ func (it *messageIterator) sendModAck(m map[string]*AckResult, deadline time.Dur
// Create the single modack/nack span for this request, and for each
// message, add Subscribe<->Modack links.
opts := getCommonOptions(it.projectID, it.subID)
- opts = append(opts, trace.WithLinks(links...))
- _, mSpan := startSpan(context.Background(), spanName, it.subID, opts...)
- defer mSpan.End()
+ opts = append(
+ opts,
+ trace.WithLinks(links...),
+ trace.WithAttributes(
+ semconv.MessagingBatchMessageCount(len(ackIDs)),
+ semconv.CodeFunction("sendModAck"),
+ ),
+ )
if !isNack {
- mSpan.SetAttributes(
- semconv.MessagingGCPPubsubMessageAckDeadline(int(deadlineSec)),
- attribute.Bool(receiptModackAttribute, isReceipt))
+ opts = append(
+ opts,
+ trace.WithAttributes(
+ semconv.MessagingGCPPubsubMessageAckDeadline(int(deadlineSec)),
+ attribute.Bool(receiptModackAttribute, isReceipt),
+ ),
+ )
}
- mSpan.SetAttributes(semconv.MessagingBatchMessageCount(len(ackIDs)),
- semconv.CodeFunction("sendModAck"))
+ _, mSpan := startSpan(context.Background(), spanName, it.subID, opts...)
+ defer mSpan.End()
if mSpan.SpanContext().IsSampled() {
for _, s := range subscribeSpans {
s.AddLink(trace.Link{
diff --git a/vendor/cloud.google.com/go/pubsub/pullstream.go b/vendor/cloud.google.com/go/pubsub/pullstream.go
index c5ea8f510af82..231e5a64ada9d 100644
--- a/vendor/cloud.google.com/go/pubsub/pullstream.go
+++ b/vendor/cloud.google.com/go/pubsub/pullstream.go
@@ -31,8 +31,9 @@ import (
// the stream on a retryable error.
type pullStream struct {
ctx context.Context
- open func() (pb.Subscriber_StreamingPullClient, error)
- cancel context.CancelFunc
+ cancel context.CancelFunc // cancel function of the context above
+ open func() (pb.Subscriber_StreamingPullClient, context.CancelFunc, error)
+ close context.CancelFunc // cancel function to close down the currently open stream
mu sync.Mutex
spc *pb.Subscriber_StreamingPullClient
@@ -50,8 +51,9 @@ func newPullStream(ctx context.Context, streamingPull streamingPullFunc, subName
return &pullStream{
ctx: ctx,
cancel: cancel,
- open: func() (pb.Subscriber_StreamingPullClient, error) {
- spc, err := streamingPull(ctx, gax.WithGRPCOptions(grpc.MaxCallRecvMsgSize(maxSendRecvBytes)))
+ open: func() (pb.Subscriber_StreamingPullClient, context.CancelFunc, error) {
+ sctx, close := context.WithCancel(ctx)
+ spc, err := streamingPull(sctx, gax.WithGRPCOptions(grpc.MaxCallRecvMsgSize(maxSendRecvBytes)))
if err == nil {
recordStat(ctx, StreamRequestCount, 1)
streamAckDeadline := int32(maxDurationPerLeaseExtension / time.Second)
@@ -69,9 +71,10 @@ func newPullStream(ctx context.Context, streamingPull streamingPullFunc, subName
})
}
if err != nil {
- return nil, err
+ close()
+ return nil, nil, err
}
- return spc, nil
+ return spc, close, nil
},
}
}
@@ -100,29 +103,33 @@ func (s *pullStream) get(spc *pb.Subscriber_StreamingPullClient) (*pb.Subscriber
if spc != s.spc {
return s.spc, nil
}
+ // we are about to open a new stream: if necessary, make sure the previous one is closed
+ if s.close != nil {
+ s.close()
+ }
// Either this is the very first call on this stream (s.spc == nil), or we have a valid
// retry request. Either way, open a new stream.
// The lock is held here for a long time, but it doesn't matter because no callers could get
// anything done anyway.
s.spc = new(pb.Subscriber_StreamingPullClient)
- *s.spc, s.err = s.openWithRetry() // Any error from openWithRetry is permanent.
+ *s.spc, s.close, s.err = s.openWithRetry() // Any error from openWithRetry is permanent.
return s.spc, s.err
}
-func (s *pullStream) openWithRetry() (pb.Subscriber_StreamingPullClient, error) {
+func (s *pullStream) openWithRetry() (pb.Subscriber_StreamingPullClient, context.CancelFunc, error) {
r := defaultRetryer{}
for {
recordStat(s.ctx, StreamOpenCount, 1)
- spc, err := s.open()
+ spc, close, err := s.open()
bo, shouldRetry := r.Retry(err)
if err != nil && shouldRetry {
recordStat(s.ctx, StreamRetryCount, 1)
if err := gax.Sleep(s.ctx, bo); err != nil {
- return nil, err
+ return nil, nil, err
}
continue
}
- return spc, err
+ return spc, close, err
}
}
diff --git a/vendor/cloud.google.com/go/pubsub/topic.go b/vendor/cloud.google.com/go/pubsub/topic.go
index 1991fa7f03ce8..cd6216e2f829a 100644
--- a/vendor/cloud.google.com/go/pubsub/topic.go
+++ b/vendor/cloud.google.com/go/pubsub/topic.go
@@ -748,8 +748,8 @@ func (t *Topic) Publish(ctx context.Context, msg *Message) *PublishResult {
var createSpan trace.Span
if t.enableTracing {
opts := getPublishSpanAttributes(t.c.projectID, t.ID(), msg)
+ opts = append(opts, trace.WithAttributes(semconv.CodeFunction("Publish")))
ctx, createSpan = startSpan(ctx, createSpanName, t.ID(), opts...)
- createSpan.SetAttributes(semconv.CodeFunction("Publish"))
}
ctx, err := tag.New(ctx, tag.Insert(keyStatus, "OK"), tag.Upsert(keyTopic, t.name))
if err != nil {
@@ -973,8 +973,14 @@ func (t *Topic) publishMessageBundle(ctx context.Context, bms []*bundledMessage)
opts := getCommonOptions(projectID, topicID)
// Add link to publish RPC span of createSpan(s).
opts = append(opts, trace.WithLinks(links...))
+ opts = append(
+ opts,
+ trace.WithAttributes(
+ semconv.MessagingBatchMessageCount(numMsgs),
+ semconv.CodeFunction("publishMessageBundle"),
+ ),
+ )
ctx, pSpan = startSpan(ctx, publishRPCSpanName, topicID, opts...)
- pSpan.SetAttributes(semconv.MessagingBatchMessageCount(numMsgs), semconv.CodeFunction("publishMessageBundle"))
defer pSpan.End()
// Add the reverse link to createSpan(s) of publish RPC span.
diff --git a/vendor/cloud.google.com/go/pubsub/trace.go b/vendor/cloud.google.com/go/pubsub/trace.go
index 1d41e9d894221..51112bb50f5f3 100644
--- a/vendor/cloud.google.com/go/pubsub/trace.go
+++ b/vendor/cloud.google.com/go/pubsub/trace.go
@@ -20,6 +20,7 @@ import (
"log"
"sync"
+ pb "cloud.google.com/go/pubsub/apiv1/pubsubpb"
"cloud.google.com/go/pubsub/internal"
"go.opencensus.io/stats"
"go.opencensus.io/stats/view"
@@ -273,33 +274,42 @@ func tracer() trace.Tracer {
var _ propagation.TextMapCarrier = (*messageCarrier)(nil)
-// messageCarrier injects and extracts traces from a pubsub.Message.
+// messageCarrier injects and extracts traces from pubsub.Message attributes.
type messageCarrier struct {
- msg *Message
+ attributes map[string]string
}
const googclientPrefix string = "googclient_"
// newMessageCarrier creates a new PubsubMessageCarrier.
func newMessageCarrier(msg *Message) messageCarrier {
- return messageCarrier{msg: msg}
+ return messageCarrier{attributes: msg.Attributes}
+}
+
+// NewMessageCarrierFromPB creates a propagation.TextMapCarrier that can be used to extract the trace
+// context from a protobuf PubsubMessage.
+//
+// Example:
+// ctx = propagation.TraceContext{}.Extract(ctx, pubsub.NewMessageCarrierFromPB(msg))
+func NewMessageCarrierFromPB(msg *pb.PubsubMessage) propagation.TextMapCarrier {
+ return messageCarrier{attributes: msg.Attributes}
}
// Get retrieves a single value for a given key.
func (c messageCarrier) Get(key string) string {
- return c.msg.Attributes[googclientPrefix+key]
+ return c.attributes[googclientPrefix+key]
}
// Set sets an attribute.
func (c messageCarrier) Set(key, val string) {
- c.msg.Attributes[googclientPrefix+key] = val
+ c.attributes[googclientPrefix+key] = val
}
// Keys returns a slice of all keys in the carrier.
func (c messageCarrier) Keys() []string {
i := 0
- out := make([]string, len(c.msg.Attributes))
- for k := range c.msg.Attributes {
+ out := make([]string, len(c.attributes))
+ for k := range c.attributes {
out[i] = k
i++
}
diff --git a/vendor/github.com/cncf/xds/go/xds/type/matcher/v3/cel.pb.go b/vendor/github.com/cncf/xds/go/xds/type/matcher/v3/cel.pb.go
index 0b702e5d0612e..7299227a3d952 100644
--- a/vendor/github.com/cncf/xds/go/xds/type/matcher/v3/cel.pb.go
+++ b/vendor/github.com/cncf/xds/go/xds/type/matcher/v3/cel.pb.go
@@ -7,7 +7,6 @@
package v3
import (
- _ "github.com/cncf/xds/go/xds/annotations/v3"
v3 "github.com/cncf/xds/go/xds/type/v3"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -84,26 +83,23 @@ var file_xds_type_matcher_v3_cel_proto_rawDesc = []byte{
0x0a, 0x1d, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x63, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x13, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
- 0x72, 0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
- 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x15, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f,
- 0x76, 0x33, 0x2f, 0x63, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61,
- 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x73, 0x0a, 0x0a, 0x43, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63,
- 0x68, 0x65, 0x72, 0x12, 0x43, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x5f, 0x6d, 0x61, 0x74, 0x63,
- 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79,
- 0x70, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x65, 0x6c, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73,
- 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x65,
- 0x78, 0x70, 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63,
- 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64,
- 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x60, 0xd2, 0xc6, 0xa4, 0xe1,
- 0x06, 0x02, 0x08, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
- 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
- 0x72, 0x2e, 0x76, 0x33, 0x42, 0x08, 0x43, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
- 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63,
- 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70,
- 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x33,
+ 0x72, 0x2e, 0x76, 0x33, 0x1a, 0x15, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x76,
+ 0x33, 0x2f, 0x63, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c,
+ 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x73, 0x0a, 0x0a, 0x43, 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68,
+ 0x65, 0x72, 0x12, 0x43, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70,
+ 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x43, 0x65, 0x6c, 0x45, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69,
+ 0x6f, 0x6e, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x65, 0x78,
+ 0x70, 0x72, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72,
+ 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65,
+ 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x58, 0x0a, 0x1e, 0x63, 0x6f, 0x6d,
+ 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65,
+ 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x08, 0x43, 0x65, 0x6c,
+ 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
+ 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f,
+ 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
+ 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/vendor/github.com/cncf/xds/go/xds/type/matcher/v3/http_inputs.pb.go b/vendor/github.com/cncf/xds/go/xds/type/matcher/v3/http_inputs.pb.go
index f53a4ee947829..4393bb7e29201 100644
--- a/vendor/github.com/cncf/xds/go/xds/type/matcher/v3/http_inputs.pb.go
+++ b/vendor/github.com/cncf/xds/go/xds/type/matcher/v3/http_inputs.pb.go
@@ -7,7 +7,6 @@
package v3
import (
- _ "github.com/cncf/xds/go/xds/annotations/v3"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -65,18 +64,16 @@ var file_xds_type_matcher_v3_http_inputs_proto_rawDesc = []byte{
0x0a, 0x25, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x68, 0x74, 0x74, 0x70, 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74,
0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x13, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70,
- 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x78, 0x64,
- 0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33,
- 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x1d, 0x0a,
- 0x1b, 0x48, 0x74, 0x74, 0x70, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43,
- 0x65, 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x42, 0x67, 0xd2, 0xc6,
- 0xa4, 0xe1, 0x06, 0x02, 0x08, 0x01, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68,
- 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63,
- 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0f, 0x48, 0x74, 0x74, 0x70, 0x49, 0x6e, 0x70, 0x75,
- 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75,
- 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67,
- 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68,
- 0x65, 0x72, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x22, 0x1d, 0x0a, 0x1b,
+ 0x48, 0x74, 0x74, 0x70, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x43, 0x65,
+ 0x6c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x42, 0x5f, 0x0a, 0x1e, 0x63,
+ 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79,
+ 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0f, 0x48,
+ 0x74, 0x74, 0x70, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
+ 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63,
+ 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70,
+ 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/vendor/github.com/cncf/xds/go/xds/type/matcher/v3/matcher.pb.go b/vendor/github.com/cncf/xds/go/xds/type/matcher/v3/matcher.pb.go
index f88e67e681fc0..d94b03b55958f 100644
--- a/vendor/github.com/cncf/xds/go/xds/type/matcher/v3/matcher.pb.go
+++ b/vendor/github.com/cncf/xds/go/xds/type/matcher/v3/matcher.pb.go
@@ -7,7 +7,6 @@
package v3
import (
- _ "github.com/cncf/xds/go/xds/annotations/v3"
v3 "github.com/cncf/xds/go/xds/core/v3"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
@@ -698,149 +697,146 @@ var file_xds_type_matcher_v3_matcher_proto_rawDesc = []byte{
0x0a, 0x21, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68,
0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x13, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61,
- 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x1a, 0x1f, 0x78, 0x64, 0x73, 0x2f, 0x61, 0x6e,
- 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x61,
- 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x78, 0x64, 0x73, 0x2f, 0x63,
- 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65,
- 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x72, 0x69,
- 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
- 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x22, 0x80, 0x10, 0x0a, 0x07, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x4d, 0x0a,
- 0x0c, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d,
- 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65,
- 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52,
- 0x0b, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x0c,
- 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x74, 0x72, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01,
+ 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x1a, 0x1b, 0x78, 0x64, 0x73, 0x2f, 0x63, 0x6f,
+ 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f,
+ 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x74, 0x72, 0x69, 0x6e,
+ 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
+ 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x22, 0xf6, 0x0f, 0x0a, 0x07, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x4d, 0x0a, 0x0c,
+ 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x28, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61,
0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
- 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x54, 0x72, 0x65, 0x65, 0x48, 0x00, 0x52, 0x0b,
- 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x54, 0x72, 0x65, 0x65, 0x12, 0x44, 0x0a, 0x0b, 0x6f,
- 0x6e, 0x5f, 0x6e, 0x6f, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x24, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63,
- 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4f,
- 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x09, 0x6f, 0x6e, 0x4e, 0x6f, 0x4d, 0x61, 0x74, 0x63,
- 0x68, 0x1a, 0x91, 0x01, 0x0a, 0x07, 0x4f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x38, 0x0a,
- 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c,
- 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
- 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x48, 0x00, 0x52, 0x07,
- 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f,
- 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f,
- 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e,
- 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x06, 0x61, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x0a, 0x08, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68,
- 0x12, 0x03, 0xf8, 0x42, 0x01, 0x1a, 0xb6, 0x08, 0x0a, 0x0b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65,
- 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x5b, 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
- 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79,
- 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61,
- 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x73,
- 0x74, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x42, 0x08,
- 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
- 0x72, 0x73, 0x1a, 0x91, 0x06, 0x0a, 0x09, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65,
- 0x12, 0x6f, 0x0a, 0x10, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x69,
- 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x78, 0x64, 0x73,
- 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33,
- 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
- 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x53,
- 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x00,
- 0x52, 0x0f, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74,
- 0x65, 0x12, 0x61, 0x0a, 0x0a, 0x6f, 0x72, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65,
- 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63,
- 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x2e,
- 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63,
- 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x6f, 0x72, 0x4d, 0x61, 0x74,
- 0x63, 0x68, 0x65, 0x72, 0x12, 0x63, 0x0a, 0x0b, 0x61, 0x6e, 0x64, 0x5f, 0x6d, 0x61, 0x74, 0x63,
- 0x68, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x78, 0x64, 0x73, 0x2e,
+ 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0b,
+ 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x0c, 0x6d,
+ 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x5f, 0x74, 0x72, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x28, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74,
+ 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e,
+ 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x54, 0x72, 0x65, 0x65, 0x48, 0x00, 0x52, 0x0b, 0x6d,
+ 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x54, 0x72, 0x65, 0x65, 0x12, 0x44, 0x0a, 0x0b, 0x6f, 0x6e,
+ 0x5f, 0x6e, 0x6f, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x24, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68,
+ 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4f, 0x6e,
+ 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x09, 0x6f, 0x6e, 0x4e, 0x6f, 0x4d, 0x61, 0x74, 0x63, 0x68,
+ 0x1a, 0x91, 0x01, 0x0a, 0x07, 0x4f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x38, 0x0a, 0x07,
+ 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e,
+ 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
+ 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x48, 0x00, 0x52, 0x07, 0x6d,
+ 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72,
+ 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73,
+ 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x06, 0x61, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x42, 0x0f, 0x0a, 0x08, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x12,
+ 0x03, 0xf8, 0x42, 0x01, 0x1a, 0xb6, 0x08, 0x0a, 0x0b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
+ 0x4c, 0x69, 0x73, 0x74, 0x12, 0x5b, 0x0a, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x73,
+ 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70,
+ 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74,
+ 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74,
+ 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x42, 0x08, 0xfa,
+ 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x01, 0x52, 0x08, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
+ 0x73, 0x1a, 0x91, 0x06, 0x0a, 0x09, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x12,
+ 0x6f, 0x0a, 0x10, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63,
+ 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x42, 0x2e, 0x78, 0x64, 0x73, 0x2e,
0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e,
0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4c,
- 0x69, 0x73, 0x74, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x50, 0x72,
- 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x61,
- 0x6e, 0x64, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x55, 0x0a, 0x0b, 0x6e, 0x6f, 0x74,
- 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32,
- 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
- 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74,
- 0x63, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61,
- 0x74, 0x65, 0x48, 0x00, 0x52, 0x0a, 0x6e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
- 0x1a, 0xf3, 0x01, 0x0a, 0x0f, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x72, 0x65, 0x64, 0x69,
- 0x63, 0x61, 0x74, 0x65, 0x12, 0x41, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76,
- 0x33, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
- 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01,
- 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x45, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65,
- 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78,
- 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e,
- 0x76, 0x33, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
- 0x48, 0x00, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x46,
- 0x0a, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e,
- 0x76, 0x33, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
- 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f,
- 0x6d, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0e, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
- 0x72, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x1a, 0x6b, 0x0a, 0x0d, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63,
- 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x5a, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69,
- 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x78, 0x64, 0x73,
- 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33,
- 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
- 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x42, 0x08,
- 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x02, 0x52, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63,
- 0x61, 0x74, 0x65, 0x42, 0x11, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70,
- 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x1a, 0xb5, 0x01, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64,
- 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x5a, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69,
- 0x63, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x78, 0x64, 0x73,
- 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33,
- 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
- 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x42, 0x08,
- 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63,
- 0x61, 0x74, 0x65, 0x12, 0x49, 0x0a, 0x08, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65,
- 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63,
- 0x68, 0x65, 0x72, 0x2e, 0x4f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x08, 0xfa, 0x42, 0x05,
- 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x07, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x1a, 0xa9,
- 0x04, 0x0a, 0x0b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x54, 0x72, 0x65, 0x65, 0x12, 0x41,
- 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e,
- 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x79, 0x70, 0x65,
- 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
- 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75,
- 0x74, 0x12, 0x5b, 0x0a, 0x0f, 0x65, 0x78, 0x61, 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68,
- 0x5f, 0x6d, 0x61, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x78, 0x64, 0x73,
- 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33,
- 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
- 0x54, 0x72, 0x65, 0x65, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61, 0x70, 0x48, 0x00, 0x52,
- 0x0d, 0x65, 0x78, 0x61, 0x63, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61, 0x70, 0x12, 0x5d,
- 0x0a, 0x10, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6d,
- 0x61, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74,
+ 0x69, 0x73, 0x74, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x53, 0x69,
+ 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52,
+ 0x0f, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65,
+ 0x12, 0x61, 0x0a, 0x0a, 0x6f, 0x72, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e,
+ 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68,
+ 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x50,
+ 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61,
+ 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x6f, 0x72, 0x4d, 0x61, 0x74, 0x63,
+ 0x68, 0x65, 0x72, 0x12, 0x63, 0x0a, 0x0b, 0x61, 0x6e, 0x64, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68,
+ 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x40, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74,
0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d,
- 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x54, 0x72,
- 0x65, 0x65, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61, 0x70, 0x48, 0x00, 0x52, 0x0e, 0x70,
- 0x72, 0x65, 0x66, 0x69, 0x78, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61, 0x70, 0x12, 0x46, 0x0a,
- 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20,
+ 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4c, 0x69,
+ 0x73, 0x74, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x2e, 0x50, 0x72, 0x65,
+ 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x61, 0x6e,
+ 0x64, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x55, 0x0a, 0x0b, 0x6e, 0x6f, 0x74, 0x5f,
+ 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e,
+ 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
+ 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63,
+ 0x68, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74,
+ 0x65, 0x48, 0x00, 0x52, 0x0a, 0x6e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x1a,
+ 0xf3, 0x01, 0x0a, 0x0f, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63,
+ 0x61, 0x74, 0x65, 0x12, 0x41, 0x0a, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33,
+ 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x43,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52,
+ 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x45, 0x0a, 0x0b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f,
+ 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x78, 0x64,
+ 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76,
+ 0x33, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x48,
+ 0x00, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, 0x46, 0x0a,
+ 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76,
0x33, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d,
- 0x4d, 0x61, 0x74, 0x63, 0x68, 0x1a, 0xc0, 0x01, 0x0a, 0x08, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4d,
- 0x61, 0x70, 0x12, 0x56, 0x0a, 0x03, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
- 0x3a, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68,
- 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61,
- 0x74, 0x63, 0x68, 0x65, 0x72, 0x54, 0x72, 0x65, 0x65, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4d,
- 0x61, 0x70, 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05,
- 0x9a, 0x01, 0x02, 0x08, 0x01, 0x52, 0x03, 0x6d, 0x61, 0x70, 0x1a, 0x5c, 0x0a, 0x08, 0x4d, 0x61,
- 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75,
- 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79,
+ 0x4d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0e, 0x0a, 0x07, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72,
+ 0x12, 0x03, 0xf8, 0x42, 0x01, 0x1a, 0x6b, 0x0a, 0x0d, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61,
+ 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x5a, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63,
+ 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x78, 0x64, 0x73, 0x2e,
+ 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e,
+ 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4c,
+ 0x69, 0x73, 0x74, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x42, 0x08, 0xfa,
+ 0x42, 0x05, 0x92, 0x01, 0x02, 0x08, 0x02, 0x52, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61,
+ 0x74, 0x65, 0x42, 0x11, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65,
+ 0x12, 0x03, 0xf8, 0x42, 0x01, 0x1a, 0xb5, 0x01, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d,
+ 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x12, 0x5a, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63,
+ 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x78, 0x64, 0x73, 0x2e,
+ 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e,
+ 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x4c,
+ 0x69, 0x73, 0x74, 0x2e, 0x50, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61, 0x74, 0x65, 0x42, 0x08, 0xfa,
+ 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x09, 0x70, 0x72, 0x65, 0x64, 0x69, 0x63, 0x61,
+ 0x74, 0x65, 0x12, 0x49, 0x0a, 0x08, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e,
+ 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68,
+ 0x65, 0x72, 0x2e, 0x4f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x8a,
+ 0x01, 0x02, 0x10, 0x01, 0x52, 0x07, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x1a, 0xa9, 0x04,
+ 0x0a, 0x0b, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x54, 0x72, 0x65, 0x65, 0x12, 0x41, 0x0a,
+ 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78,
+ 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64,
+ 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42,
+ 0x08, 0xfa, 0x42, 0x05, 0x8a, 0x01, 0x02, 0x10, 0x01, 0x52, 0x05, 0x69, 0x6e, 0x70, 0x75, 0x74,
+ 0x12, 0x5b, 0x0a, 0x0f, 0x65, 0x78, 0x61, 0x63, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f,
+ 0x6d, 0x61, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x78, 0x64, 0x73, 0x2e,
+ 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e,
+ 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x54,
+ 0x72, 0x65, 0x65, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61, 0x70, 0x48, 0x00, 0x52, 0x0d,
+ 0x65, 0x78, 0x61, 0x63, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61, 0x70, 0x12, 0x5d, 0x0a,
+ 0x10, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x6d, 0x61,
+ 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79,
0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61,
- 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x05, 0x76,
- 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x10, 0x0a, 0x09, 0x74, 0x72, 0x65, 0x65,
- 0x5f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x3a, 0x08, 0xd2, 0xc6, 0xa4, 0xe1,
- 0x06, 0x02, 0x08, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x5f,
- 0x74, 0x79, 0x70, 0x65, 0x42, 0x5c, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x69, 0x74, 0x68,
- 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63,
- 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x50,
- 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
- 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x78,
- 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2f,
- 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x54, 0x72, 0x65,
+ 0x65, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61, 0x70, 0x48, 0x00, 0x52, 0x0e, 0x70, 0x72,
+ 0x65, 0x66, 0x69, 0x78, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61, 0x70, 0x12, 0x46, 0x0a, 0x0c,
+ 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x63, 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33,
+ 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x43,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x48, 0x00, 0x52, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4d,
+ 0x61, 0x74, 0x63, 0x68, 0x1a, 0xc0, 0x01, 0x0a, 0x08, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61,
+ 0x70, 0x12, 0x56, 0x0a, 0x03, 0x6d, 0x61, 0x70, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3a,
+ 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
+ 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4d, 0x61, 0x74,
+ 0x63, 0x68, 0x65, 0x72, 0x54, 0x72, 0x65, 0x65, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4d, 0x61,
+ 0x70, 0x2e, 0x4d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x9a,
+ 0x01, 0x02, 0x08, 0x01, 0x52, 0x03, 0x6d, 0x61, 0x70, 0x1a, 0x5c, 0x0a, 0x08, 0x4d, 0x61, 0x70,
+ 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x3a, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70,
+ 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x2e, 0x4d, 0x61, 0x74,
+ 0x63, 0x68, 0x65, 0x72, 0x2e, 0x4f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x05, 0x76, 0x61,
+ 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x10, 0x0a, 0x09, 0x74, 0x72, 0x65, 0x65, 0x5f,
+ 0x74, 0x79, 0x70, 0x65, 0x12, 0x03, 0xf8, 0x42, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x6d, 0x61, 0x74,
+ 0x63, 0x68, 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x42, 0x5c, 0x0a, 0x1e, 0x63, 0x6f, 0x6d,
+ 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x78, 0x64, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65,
+ 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0c, 0x4d, 0x61, 0x74,
+ 0x63, 0x68, 0x65, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x67, 0x69, 0x74,
+ 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x63, 0x66, 0x2f, 0x78, 0x64, 0x73,
+ 0x2f, 0x67, 0x6f, 0x2f, 0x78, 0x64, 0x73, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x2f, 0x6d, 0x61, 0x74,
+ 0x63, 0x68, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/vendor/github.com/fsouza/fake-gcs-server/LICENSE b/vendor/github.com/fsouza/fake-gcs-server/LICENSE
index 529faa468606e..a619aaecef9d1 100644
--- a/vendor/github.com/fsouza/fake-gcs-server/LICENSE
+++ b/vendor/github.com/fsouza/fake-gcs-server/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2017-2019, Francisco Souza
+Copyright (c) Francisco Souza
All rights reserved.
Redistribution and use in source and binary forms, with or without
diff --git a/vendor/github.com/fsouza/fake-gcs-server/fakestorage/bucket.go b/vendor/github.com/fsouza/fake-gcs-server/fakestorage/bucket.go
index e2fa2ad3716ee..4026f1a4a0deb 100644
--- a/vendor/github.com/fsouza/fake-gcs-server/fakestorage/bucket.go
+++ b/vendor/github.com/fsouza/fake-gcs-server/fakestorage/bucket.go
@@ -6,49 +6,161 @@ package fakestorage
import (
"encoding/json"
+ "errors"
+ "fmt"
+ "io"
"net/http"
+ "regexp"
+ "github.com/fsouza/fake-gcs-server/internal/backend"
"github.com/gorilla/mux"
)
+var bucketRegexp = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]$`)
+
// CreateBucket creates a bucket inside the server, so any API calls that
// require the bucket name will recognize this bucket.
//
// If the bucket already exists, this method does nothing.
+//
+// Deprecated: use CreateBucketWithOpts.
func (s *Server) CreateBucket(name string) {
- s.mtx.Lock()
- defer s.mtx.Unlock()
- err := s.backend.CreateBucket(name)
+ err := s.backend.CreateBucket(name, backend.BucketAttrs{VersioningEnabled: false, DefaultEventBasedHold: false})
+ if err != nil {
+ panic(err)
+ }
+}
+
+func (s *Server) updateBucket(r *http.Request) jsonResponse {
+ bucketName := unescapeMuxVars(mux.Vars(r))["bucketName"]
+ attrsToUpdate := getBucketAttrsToUpdate(r.Body)
+ err := s.backend.UpdateBucket(bucketName, attrsToUpdate)
if err != nil {
panic(err)
}
+ return jsonResponse{}
+}
+
+func getBucketAttrsToUpdate(body io.ReadCloser) backend.BucketAttrs {
+ var data struct {
+ DefaultEventBasedHold bool `json:"defaultEventBasedHold,omitempty"`
+ Versioning bucketVersioning `json:"versioning,omitempty"`
+ }
+ err := json.NewDecoder(body).Decode(&data)
+ if err != nil {
+ panic(err)
+ }
+ attrsToUpdate := backend.BucketAttrs{
+ DefaultEventBasedHold: data.DefaultEventBasedHold,
+ VersioningEnabled: data.Versioning.Enabled,
+ }
+ return attrsToUpdate
+}
+
+// CreateBucketOpts defines the properties of a bucket you can create with
+// CreateBucketWithOpts.
+type CreateBucketOpts struct {
+ Name string
+ VersioningEnabled bool
+ DefaultEventBasedHold bool
+}
+
+// CreateBucketWithOpts creates a bucket inside the server, so any API calls that
+// require the bucket name will recognize this bucket. Use CreateBucketOpts to
+// customize the options for this bucket
+//
+// If the underlying backend returns an error, this method panics.
+func (s *Server) CreateBucketWithOpts(opts CreateBucketOpts) {
+ err := s.backend.CreateBucket(opts.Name, backend.BucketAttrs{VersioningEnabled: opts.VersioningEnabled, DefaultEventBasedHold: opts.DefaultEventBasedHold})
+ if err != nil {
+ panic(err)
+ }
+}
+
+func (s *Server) createBucketByPost(r *http.Request) jsonResponse {
+ // Minimal version of Bucket from google.golang.org/api/storage/v1
+
+ var data struct {
+ Name string `json:"name,omitempty"`
+ Versioning *bucketVersioning `json:"versioning,omitempty"`
+ DefaultEventBasedHold bool `json:"defaultEventBasedHold,omitempty"`
+ }
+
+ // Read the bucket props from the request body JSON
+ decoder := json.NewDecoder(r.Body)
+ if err := decoder.Decode(&data); err != nil {
+ return jsonResponse{errorMessage: err.Error(), status: http.StatusBadRequest}
+ }
+ name := data.Name
+ versioning := false
+ if data.Versioning != nil {
+ versioning = data.Versioning.Enabled
+ }
+ defaultEventBasedHold := data.DefaultEventBasedHold
+ if err := validateBucketName(name); err != nil {
+ return jsonResponse{errorMessage: err.Error(), status: http.StatusBadRequest}
+ }
+
+ _, err := s.backend.GetBucket(name)
+ if err == nil {
+ return jsonResponse{
+ errorMessage: fmt.Sprintf(
+ "A Cloud Storage bucket named '%s' already exists. "+
+ "Try another name. Bucket names must be globally unique "+
+ "across all Google Cloud projects, including those "+
+ "outside of your organization.", name),
+ status: http.StatusConflict,
+ }
+ }
+
+ // Create the named bucket
+ if err := s.backend.CreateBucket(name, backend.BucketAttrs{VersioningEnabled: versioning, DefaultEventBasedHold: defaultEventBasedHold}); err != nil {
+ return jsonResponse{errorMessage: err.Error()}
+ }
+
+ // Return the created bucket:
+ bucket, err := s.backend.GetBucket(name)
+ if err != nil {
+ return jsonResponse{errorMessage: err.Error()}
+ }
+ return jsonResponse{data: newBucketResponse(bucket, s.options.BucketsLocation)}
}
-func (s *Server) listBuckets(w http.ResponseWriter, r *http.Request) {
- s.mtx.RLock()
- defer s.mtx.RUnlock()
+func (s *Server) listBuckets(r *http.Request) jsonResponse {
+ buckets, err := s.backend.ListBuckets()
+ if err != nil {
+ return jsonResponse{errorMessage: err.Error()}
+ }
+ return jsonResponse{data: newListBucketsResponse(buckets, s.options.BucketsLocation)}
+}
- bucketNames, err := s.backend.ListBuckets()
+func (s *Server) getBucket(r *http.Request) jsonResponse {
+ bucketName := unescapeMuxVars(mux.Vars(r))["bucketName"]
+ bucket, err := s.backend.GetBucket(bucketName)
+ if err != nil {
+ return jsonResponse{status: http.StatusNotFound}
+ }
+ return jsonResponse{data: newBucketResponse(bucket, s.options.BucketsLocation)}
+}
+
+func (s *Server) deleteBucket(r *http.Request) jsonResponse {
+ bucketName := unescapeMuxVars(mux.Vars(r))["bucketName"]
+ err := s.backend.DeleteBucket(bucketName)
+ if err == backend.BucketNotFound {
+ return jsonResponse{status: http.StatusNotFound}
+ }
+ if err == backend.BucketNotEmpty {
+ return jsonResponse{status: http.StatusPreconditionFailed, errorMessage: err.Error()}
+ }
if err != nil {
- http.Error(w, err.Error(), http.StatusInternalServerError)
- return
+ return jsonResponse{status: http.StatusInternalServerError, errorMessage: err.Error()}
}
- resp := newListBucketsResponse(bucketNames)
- json.NewEncoder(w).Encode(resp)
+ return jsonResponse{}
}
-func (s *Server) getBucket(w http.ResponseWriter, r *http.Request) {
- bucketName := mux.Vars(r)["bucketName"]
- s.mtx.RLock()
- defer s.mtx.RUnlock()
- encoder := json.NewEncoder(w)
- if err := s.backend.GetBucket(bucketName); err != nil {
- w.WriteHeader(http.StatusNotFound)
- err := newErrorResponse(http.StatusNotFound, "Not found", nil)
- encoder.Encode(err)
- return
+func validateBucketName(bucketName string) error {
+ if !bucketRegexp.MatchString(bucketName) {
+ return errors.New("invalid bucket name")
}
- resp := newBucketResponse(bucketName)
- w.WriteHeader(http.StatusOK)
- encoder.Encode(resp)
+ return nil
}
diff --git a/vendor/github.com/fsouza/fake-gcs-server/fakestorage/config.go b/vendor/github.com/fsouza/fake-gcs-server/fakestorage/config.go
new file mode 100644
index 0000000000000..a57d154279a5e
--- /dev/null
+++ b/vendor/github.com/fsouza/fake-gcs-server/fakestorage/config.go
@@ -0,0 +1,30 @@
+package fakestorage
+
+import (
+ "encoding/json"
+ "net/http"
+)
+
+func (s *Server) updateServerConfig(r *http.Request) jsonResponse {
+ var configOptions struct {
+ ExternalUrl string `json:"externalUrl,omitempty"`
+ PublicHost string `json:"publicHost,omitempty"`
+ }
+ err := json.NewDecoder(r.Body).Decode(&configOptions)
+ if err != nil {
+ return jsonResponse{
+ status: http.StatusBadRequest,
+ errorMessage: "Update server config payload can not be parsed.",
+ }
+ }
+
+ if configOptions.ExternalUrl != "" {
+ s.externalURL = configOptions.ExternalUrl
+ }
+
+ if configOptions.PublicHost != "" {
+ s.publicHost = configOptions.PublicHost
+ }
+
+ return jsonResponse{status: http.StatusOK}
+}
diff --git a/vendor/github.com/fsouza/fake-gcs-server/fakestorage/json_response.go b/vendor/github.com/fsouza/fake-gcs-server/fakestorage/json_response.go
new file mode 100644
index 0000000000000..99e8ce7d4ccab
--- /dev/null
+++ b/vendor/github.com/fsouza/fake-gcs-server/fakestorage/json_response.go
@@ -0,0 +1,84 @@
+package fakestorage
+
+import (
+ "encoding/json"
+ "errors"
+ "net/http"
+ "os"
+ "syscall"
+
+ "github.com/fsouza/fake-gcs-server/internal/backend"
+)
+
+type jsonResponse struct {
+ status int
+ header http.Header
+ data any
+ errorMessage string
+}
+
+type jsonHandler = func(r *http.Request) jsonResponse
+
+func jsonToHTTPHandler(h jsonHandler) http.HandlerFunc {
+ return func(w http.ResponseWriter, r *http.Request) {
+ resp := h(r)
+ w.Header().Set("Content-Type", "application/json")
+ for name, values := range resp.header {
+ for _, value := range values {
+ w.Header().Add(name, value)
+ }
+ }
+
+ status := resp.getStatus()
+ var data any
+ if status > 399 {
+ data = newErrorResponse(status, resp.getErrorMessage(status), resp.getErrorList(status))
+ } else {
+ data = resp.data
+ }
+
+ w.WriteHeader(status)
+ json.NewEncoder(w).Encode(data)
+ }
+}
+
+func (r *jsonResponse) getStatus() int {
+ if r.status > 0 {
+ return r.status
+ }
+ if r.errorMessage != "" {
+ return http.StatusInternalServerError
+ }
+ return http.StatusOK
+}
+
+func (r *jsonResponse) getErrorMessage(status int) string {
+ if r.errorMessage != "" {
+ return r.errorMessage
+ }
+ return http.StatusText(status)
+}
+
+func (r *jsonResponse) getErrorList(status int) []apiError {
+ if status == http.StatusOK {
+ return nil
+ } else {
+ return []apiError{{
+ Domain: "global",
+ Reason: http.StatusText(status),
+ Message: r.getErrorMessage(status),
+ }}
+ }
+}
+
+func errToJsonResponse(err error) jsonResponse {
+ status := 0
+ var pathError *os.PathError
+ if errors.As(err, &pathError) && pathError.Err == syscall.ENAMETOOLONG {
+ status = http.StatusBadRequest
+ }
+ if err == backend.PreConditionFailed {
+ status = http.StatusPreconditionFailed
+ }
+ return jsonResponse{errorMessage: err.Error(), status: status}
+}
diff --git a/vendor/github.com/fsouza/fake-gcs-server/fakestorage/mux_tranport.go b/vendor/github.com/fsouza/fake-gcs-server/fakestorage/mux_tranport.go
index afaa2efeac76a..b228c787ae682 100644
--- a/vendor/github.com/fsouza/fake-gcs-server/fakestorage/mux_tranport.go
+++ b/vendor/github.com/fsouza/fake-gcs-server/fakestorage/mux_tranport.go
@@ -7,16 +7,14 @@ package fakestorage
import (
"net/http"
"net/http/httptest"
-
- "github.com/gorilla/mux"
)
type muxTransport struct {
- router *mux.Router
+ handler http.Handler
}
func (t *muxTransport) RoundTrip(r *http.Request) (*http.Response, error) {
w := httptest.NewRecorder()
- t.router.ServeHTTP(w, r)
+ t.handler.ServeHTTP(w, r)
return w.Result(), nil
}
diff --git a/vendor/github.com/fsouza/fake-gcs-server/fakestorage/object.go b/vendor/github.com/fsouza/fake-gcs-server/fakestorage/object.go
index bc1d472f36e30..b229a452331e6 100644
--- a/vendor/github.com/fsouza/fake-gcs-server/fakestorage/object.go
+++ b/vendor/github.com/fsouza/fake-gcs-server/fakestorage/object.go
@@ -5,84 +5,357 @@
package fakestorage
import (
+ "bytes"
+ "compress/gzip"
"encoding/json"
+ "encoding/xml"
+ "errors"
"fmt"
+ "io"
"net/http"
+ "slices"
"sort"
"strconv"
"strings"
+ "time"
+ "cloud.google.com/go/storage"
"github.com/fsouza/fake-gcs-server/internal/backend"
+ "github.com/fsouza/fake-gcs-server/internal/notification"
"github.com/gorilla/mux"
)
-// Object represents the object that is stored within the fake server.
-type Object struct {
- BucketName string `json:"-"`
- Name string `json:"name"`
- Content []byte `json:"-"`
+var errInvalidGeneration = errors.New("invalid generation ID")
+
+// ObjectAttrs returns only the meta-data about an object without its contents.
+type ObjectAttrs struct {
+ BucketName string
+ Name string
+ Size int64
+ ContentType string
+ ContentEncoding string
+ ContentDisposition string
+ CacheControl string
// Crc32c checksum of Content. calculated by server when it's upload methods are used.
- Crc32c string `json:"crc32c,omitempty"`
- Md5Hash string `json:"md5hash,omitempty"`
+ Crc32c string
+ Md5Hash string
+ Etag string
+ ACL []storage.ACLRule
+ // Dates and generation can be manually injected, so you can do assertions on them,
+ // or let us fill these fields for you
+ Created time.Time
+ Updated time.Time
+ Deleted time.Time
+ CustomTime time.Time
+ Generation int64
+ Metadata map[string]string
}
-func (o *Object) id() string {
+func (o *ObjectAttrs) id() string {
return o.BucketName + "/" + o.Name
}
-type objectList []Object
+type jsonObject struct {
+ BucketName string `json:"bucket"`
+ Name string `json:"name"`
+ Size int64 `json:"size,string"`
+ ContentType string `json:"contentType"`
+ ContentEncoding string `json:"contentEncoding"`
+ ContentDisposition string `json:"contentDisposition"`
+ Crc32c string `json:"crc32c,omitempty"`
+ Md5Hash string `json:"md5Hash,omitempty"`
+ Etag string `json:"etag,omitempty"`
+ ACL []aclRule `json:"acl,omitempty"`
+ Created time.Time `json:"created,omitempty"`
+ Updated time.Time `json:"updated,omitempty"`
+ Deleted time.Time `json:"deleted,omitempty"`
+ CustomTime time.Time `json:"customTime,omitempty"`
+ Generation int64 `json:"generation,omitempty,string"`
+ Metadata map[string]string `json:"metadata,omitempty"`
+}
+
+// MarshalJSON for ObjectAttrs to use ACLRule instead of storage.ACLRule
+func (o ObjectAttrs) MarshalJSON() ([]byte, error) {
+ temp := jsonObject{
+ BucketName: o.BucketName,
+ Name: o.Name,
+ ContentType: o.ContentType,
+ ContentEncoding: o.ContentEncoding,
+ ContentDisposition: o.ContentDisposition,
+ Size: o.Size,
+ Crc32c: o.Crc32c,
+ Md5Hash: o.Md5Hash,
+ Etag: o.Etag,
+ Created: o.Created,
+ Updated: o.Updated,
+ Deleted: o.Deleted,
+ CustomTime: o.CustomTime,
+ Generation: o.Generation,
+ Metadata: o.Metadata,
+ }
+ temp.ACL = make([]aclRule, len(o.ACL))
+ for i, ACL := range o.ACL {
+ temp.ACL[i] = aclRule(ACL)
+ }
+ return json.Marshal(temp)
+}
+
+// UnmarshalJSON for ObjectAttrs to use ACLRule instead of storage.ACLRule
+func (o *ObjectAttrs) UnmarshalJSON(data []byte) error {
+ var temp jsonObject
+ if err := json.Unmarshal(data, &temp); err != nil {
+ return err
+ }
+ o.BucketName = temp.BucketName
+ o.Name = temp.Name
+ o.ContentType = temp.ContentType
+ o.ContentEncoding = temp.ContentEncoding
+ o.ContentDisposition = temp.ContentDisposition
+ o.Size = temp.Size
+ o.Crc32c = temp.Crc32c
+ o.Md5Hash = temp.Md5Hash
+ o.Etag = temp.Etag
+ o.Created = temp.Created
+ o.Updated = temp.Updated
+ o.Deleted = temp.Deleted
+ o.Generation = temp.Generation
+ o.Metadata = temp.Metadata
+ o.CustomTime = temp.CustomTime
+ o.ACL = make([]storage.ACLRule, len(temp.ACL))
+ for i, ACL := range temp.ACL {
+ o.ACL[i] = storage.ACLRule(ACL)
+ }
+
+ return nil
+}
+
+// Object represents an object that is stored within the fake server. The
+// content of this type is stored is buffered, i.e. it's stored in memory.
+// Use StreamingObject to stream the content from a reader, e.g a file.
+type Object struct {
+ ObjectAttrs
+ Content []byte `json:"-"`
+}
+
+type noopSeekCloser struct {
+ io.ReadSeeker
+}
+
+func (n noopSeekCloser) Close() error {
+ return nil
+}
+
+func (o Object) StreamingObject() StreamingObject {
+ return StreamingObject{
+ ObjectAttrs: o.ObjectAttrs,
+ Content: noopSeekCloser{bytes.NewReader(o.Content)},
+ }
+}
+
+// StreamingObject is the streaming version of Object.
+type StreamingObject struct {
+ ObjectAttrs
+ Content io.ReadSeekCloser `json:"-"`
+}
+
+func (o *StreamingObject) Close() error {
+ if o != nil && o.Content != nil {
+ return o.Content.Close()
+ }
+ return nil
+}
+
+func (o *StreamingObject) BufferedObject() (Object, error) {
+ data, err := io.ReadAll(o.Content)
+ return Object{
+ ObjectAttrs: o.ObjectAttrs,
+ Content: data,
+ }, err
+}
+
+// ACLRule is an alias of storage.ACLRule to have custom JSON marshal
+type aclRule storage.ACLRule
+
+// ProjectTeam is an alias of storage.ProjectTeam to have custom JSON marshal
+type projectTeam storage.ProjectTeam
+
+// MarshalJSON for ACLRule to customize field names
+func (acl aclRule) MarshalJSON() ([]byte, error) {
+ temp := struct {
+ Entity storage.ACLEntity `json:"entity"`
+ EntityID string `json:"entityId"`
+ Role storage.ACLRole `json:"role"`
+ Domain string `json:"domain"`
+ Email string `json:"email"`
+ ProjectTeam *projectTeam `json:"projectTeam"`
+ }{
+ Entity: acl.Entity,
+ EntityID: acl.EntityID,
+ Role: acl.Role,
+ Domain: acl.Domain,
+ Email: acl.Email,
+ ProjectTeam: (*projectTeam)(acl.ProjectTeam),
+ }
+ return json.Marshal(temp)
+}
-func (o objectList) Len() int {
- return len(o)
+// UnmarshalJSON for ACLRule to customize field names
+func (acl *aclRule) UnmarshalJSON(data []byte) error {
+ temp := struct {
+ Entity storage.ACLEntity `json:"entity"`
+ EntityID string `json:"entityId"`
+ Role storage.ACLRole `json:"role"`
+ Domain string `json:"domain"`
+ Email string `json:"email"`
+ ProjectTeam *projectTeam `json:"projectTeam"`
+ }{}
+ if err := json.Unmarshal(data, &temp); err != nil {
+ return err
+ }
+ acl.Entity = temp.Entity
+ acl.EntityID = temp.EntityID
+ acl.Role = temp.Role
+ acl.Domain = temp.Domain
+ acl.Email = temp.Email
+ acl.ProjectTeam = (*storage.ProjectTeam)(temp.ProjectTeam)
+ return nil
}
-func (o objectList) Less(i int, j int) bool {
- return o[i].Name < o[j].Name
+// MarshalJSON for ProjectTeam to customize field names
+func (team projectTeam) MarshalJSON() ([]byte, error) {
+ temp := struct {
+ ProjectNumber string `json:"projectNumber"`
+ Team string `json:"team"`
+ }{
+ ProjectNumber: team.ProjectNumber,
+ Team: team.Team,
+ }
+ return json.Marshal(temp)
}
-func (o *objectList) Swap(i int, j int) {
- d := *o
- d[i], d[j] = d[j], d[i]
+// UnmarshalJSON for ProjectTeam to customize field names
+func (team *projectTeam) UnmarshalJSON(data []byte) error {
+ temp := struct {
+ ProjectNumber string `json:"projectNumber"`
+ Team string `json:"team"`
+ }{}
+ if err := json.Unmarshal(data, &temp); err != nil {
+ return err
+ }
+ team.ProjectNumber = temp.ProjectNumber
+ team.Team = temp.Team
+ return nil
}
-// CreateObject stores the given object internally.
+// CreateObject is the non-streaming version of CreateObjectStreaming.
//
-// If the bucket within the object doesn't exist, it also creates it. If the
-// object already exists, it overrides the object.
+// In addition to streaming, CreateObjectStreaming returns an error instead of
+// panicking when an error occurs.
func (s *Server) CreateObject(obj Object) {
- s.mtx.Lock()
- defer s.mtx.Unlock()
- err := s.createObject(obj)
+ err := s.CreateObjectStreaming(obj.StreamingObject())
if err != nil {
panic(err)
}
}
-func (s *Server) createObject(obj Object) error {
- return s.backend.CreateObject(toBackendObjects([]Object{obj})[0])
+// CreateObjectStreaming stores the given object internally.
+//
+// If the bucket within the object doesn't exist, it also creates it. If the
+// object already exists, it overwrites the object.
+func (s *Server) CreateObjectStreaming(obj StreamingObject) error {
+ obj, err := s.createObject(obj, backend.NoConditions{})
+ if err != nil {
+ return err
+ }
+ obj.Close()
+ return nil
+}
+
+func (s *Server) createObject(obj StreamingObject, conditions backend.Conditions) (StreamingObject, error) {
+ oldBackendObj, err := s.backend.GetObject(obj.BucketName, obj.Name)
+ // Calling Close before checking err is okay on objects, and the object
+ // may need to be closed whether or not there's an error.
+ defer oldBackendObj.Close() //lint:ignore SA5001 // see above
+
+ prevVersionExisted := err == nil
+
+ // The caller is responsible for closing the created object.
+ newBackendObj, err := s.backend.CreateObject(toBackendObjects([]StreamingObject{obj})[0], conditions)
+ if err != nil {
+ return StreamingObject{}, err
+ }
+
+ var newObjEventAttr map[string]string
+ if prevVersionExisted {
+ newObjEventAttr = map[string]string{
+ "overwroteGeneration": strconv.FormatInt(oldBackendObj.Generation, 10),
+ }
+
+ oldObjEventAttr := map[string]string{
+ "overwrittenByGeneration": strconv.FormatInt(newBackendObj.Generation, 10),
+ }
+
+ bucket, _ := s.backend.GetBucket(obj.BucketName)
+ if bucket.VersioningEnabled {
+ s.eventManager.Trigger(&oldBackendObj, notification.EventArchive, oldObjEventAttr)
+ } else {
+ s.eventManager.Trigger(&oldBackendObj, notification.EventDelete, oldObjEventAttr)
+ }
+ }
+
+ newObj := fromBackendObjects([]backend.StreamingObject{newBackendObj})[0]
+ s.eventManager.Trigger(&newBackendObj, notification.EventFinalize, newObjEventAttr)
+ return newObj, nil
+}
+
+type ListOptions struct {
+ Prefix string
+ Delimiter string
+ Versions bool
+ StartOffset string
+ EndOffset string
+ IncludeTrailingDelimiter bool
}
// ListObjects returns a sorted list of objects that match the given criteria,
// or an error if the bucket doesn't exist.
-func (s *Server) ListObjects(bucketName, prefix, delimiter string) ([]Object, []string, error) {
- s.mtx.RLock()
- defer s.mtx.RUnlock()
- backendObjects, err := s.backend.ListObjects(bucketName)
+//
+// Deprecated: use ListObjectsWithOptions.
+func (s *Server) ListObjects(bucketName, prefix, delimiter string, versions bool) ([]ObjectAttrs, []string, error) {
+ return s.ListObjectsWithOptions(bucketName, ListOptions{
+ Prefix: prefix,
+ Delimiter: delimiter,
+ Versions: versions,
+ })
+}
+
+func (s *Server) ListObjectsWithOptions(bucketName string, options ListOptions) ([]ObjectAttrs, []string, error) {
+ backendObjects, err := s.backend.ListObjects(bucketName, options.Prefix, options.Versions)
if err != nil {
return nil, nil, err
}
- objects := fromBackendObjects(backendObjects)
- olist := objectList(objects)
- sort.Sort(&olist)
- var respObjects []Object
+ objects := fromBackendObjectsAttrs(backendObjects)
+ slices.SortFunc(objects, func(left, right ObjectAttrs) int {
+ return strings.Compare(left.Name, right.Name)
+ })
+ var respObjects []ObjectAttrs
prefixes := make(map[string]bool)
- for _, obj := range olist {
- if strings.HasPrefix(obj.Name, prefix) {
- objName := strings.Replace(obj.Name, prefix, "", 1)
- delimPos := strings.Index(objName, delimiter)
- if delimiter != "" && delimPos > -1 {
- prefixes[obj.Name[:len(prefix)+delimPos+1]] = true
- } else {
+ for _, obj := range objects {
+ if !strings.HasPrefix(obj.Name, options.Prefix) {
+ continue
+ }
+ objName := strings.Replace(obj.Name, options.Prefix, "", 1)
+ delimPos := strings.Index(objName, options.Delimiter)
+ if options.Delimiter != "" && delimPos > -1 {
+ prefix := obj.Name[:len(options.Prefix)+delimPos+1]
+ if isInOffset(prefix, options.StartOffset, options.EndOffset) {
+ prefixes[prefix] = true
+ }
+ if options.IncludeTrailingDelimiter && obj.Name == prefix {
+ respObjects = append(respObjects, obj)
+ }
+ } else {
+ if isInOffset(obj.Name, options.StartOffset, options.EndOffset) {
respObjects = append(respObjects, obj)
}
}
@@ -95,143 +368,818 @@ func (s *Server) ListObjects(bucketName, prefix, delimiter string) ([]Object, []
return respObjects, respPrefixes, nil
}
-func toBackendObjects(objects []Object) []backend.Object {
- backendObjects := []backend.Object{}
+func isInOffset(name, startOffset, endOffset string) bool {
+ if endOffset != "" && startOffset != "" {
+ return strings.Compare(name, endOffset) < 0 && strings.Compare(name, startOffset) >= 0
+ } else if endOffset != "" {
+ return strings.Compare(name, endOffset) < 0
+ } else if startOffset != "" {
+ return strings.Compare(name, startOffset) >= 0
+ } else {
+ return true
+ }
+}
+
+func getCurrentIfZero(date time.Time) time.Time {
+ if date.IsZero() {
+ return time.Now()
+ }
+ return date
+}
+
+func toBackendObjects(objects []StreamingObject) []backend.StreamingObject {
+ backendObjects := make([]backend.StreamingObject, 0, len(objects))
for _, o := range objects {
- backendObjects = append(backendObjects, backend.Object{
- BucketName: o.BucketName,
- Name: o.Name,
- Content: o.Content,
- Crc32c: o.Crc32c,
- Md5Hash: o.Md5Hash,
+ backendObjects = append(backendObjects, backend.StreamingObject{
+ ObjectAttrs: backend.ObjectAttrs{
+ BucketName: o.BucketName,
+ Name: o.Name,
+ ContentType: o.ContentType,
+ ContentEncoding: o.ContentEncoding,
+ ContentDisposition: o.ContentDisposition,
+ CacheControl: o.CacheControl,
+ ACL: o.ACL,
+ Created: getCurrentIfZero(o.Created).Format(timestampFormat),
+ Deleted: o.Deleted.Format(timestampFormat),
+ Updated: getCurrentIfZero(o.Updated).Format(timestampFormat),
+ CustomTime: o.CustomTime.Format(timestampFormat),
+ Generation: o.Generation,
+ Metadata: o.Metadata,
+ },
+ Content: o.Content,
})
}
return backendObjects
}
-func fromBackendObjects(objects []backend.Object) []Object {
- backendObjects := []Object{}
+func bufferedObjectsToBackendObjects(objects []Object) []backend.StreamingObject {
+ backendObjects := make([]backend.StreamingObject, 0, len(objects))
+ for _, bufferedObject := range objects {
+ o := bufferedObject.StreamingObject()
+ backendObjects = append(backendObjects, backend.StreamingObject{
+ ObjectAttrs: backend.ObjectAttrs{
+ BucketName: o.BucketName,
+ Name: o.Name,
+ ContentType: o.ContentType,
+ ContentEncoding: o.ContentEncoding,
+ ContentDisposition: o.ContentDisposition,
+ ACL: o.ACL,
+ Created: getCurrentIfZero(o.Created).Format(timestampFormat),
+ Deleted: o.Deleted.Format(timestampFormat),
+ Updated: getCurrentIfZero(o.Updated).Format(timestampFormat),
+ CustomTime: o.CustomTime.Format(timestampFormat),
+ Generation: o.Generation,
+ Metadata: o.Metadata,
+ Crc32c: o.Crc32c,
+ Md5Hash: o.Md5Hash,
+ Size: o.Size,
+ Etag: o.Etag,
+ },
+ Content: o.Content,
+ })
+ }
+ return backendObjects
+}
+
+func fromBackendObjects(objects []backend.StreamingObject) []StreamingObject {
+ backendObjects := make([]StreamingObject, 0, len(objects))
for _, o := range objects {
- backendObjects = append(backendObjects, Object{
- BucketName: o.BucketName,
- Name: o.Name,
- Content: o.Content,
- Crc32c: o.Crc32c,
- Md5Hash: o.Md5Hash,
+ backendObjects = append(backendObjects, StreamingObject{
+ ObjectAttrs: ObjectAttrs{
+ BucketName: o.BucketName,
+ Name: o.Name,
+ Size: o.Size,
+ ContentType: o.ContentType,
+ ContentEncoding: o.ContentEncoding,
+ ContentDisposition: o.ContentDisposition,
+ CacheControl: o.CacheControl,
+ Crc32c: o.Crc32c,
+ Md5Hash: o.Md5Hash,
+ Etag: o.Etag,
+ ACL: o.ACL,
+ Created: convertTimeWithoutError(o.Created),
+ Deleted: convertTimeWithoutError(o.Deleted),
+ Updated: convertTimeWithoutError(o.Updated),
+ CustomTime: convertTimeWithoutError(o.CustomTime),
+ Generation: o.Generation,
+ Metadata: o.Metadata,
+ },
+ Content: o.Content,
})
}
return backendObjects
}
-// GetObject returns the object with the given name in the given bucket, or an
-// error if the object doesn't exist.
+func fromBackendObjectsAttrs(objectAttrs []backend.ObjectAttrs) []ObjectAttrs {
+ oattrs := make([]ObjectAttrs, 0, len(objectAttrs))
+ for _, o := range objectAttrs {
+ oattrs = append(oattrs, ObjectAttrs{
+ BucketName: o.BucketName,
+ Name: o.Name,
+ Size: o.Size,
+ ContentType: o.ContentType,
+ ContentEncoding: o.ContentEncoding,
+ ContentDisposition: o.ContentDisposition,
+ CacheControl: o.CacheControl,
+ Crc32c: o.Crc32c,
+ Md5Hash: o.Md5Hash,
+ Etag: o.Etag,
+ ACL: o.ACL,
+ Created: convertTimeWithoutError(o.Created),
+ Deleted: convertTimeWithoutError(o.Deleted),
+ Updated: convertTimeWithoutError(o.Updated),
+ CustomTime: convertTimeWithoutError(o.CustomTime),
+ Generation: o.Generation,
+ Metadata: o.Metadata,
+ })
+ }
+ return oattrs
+}
+
+func convertTimeWithoutError(t string) time.Time {
+ r, _ := time.Parse(timestampFormat, t)
+ return r
+}
+
+// GetObject is the non-streaming version of GetObjectStreaming.
func (s *Server) GetObject(bucketName, objectName string) (Object, error) {
+ streamingObject, err := s.GetObjectStreaming(bucketName, objectName)
+ if err != nil {
+ return Object{}, err
+ }
+ return streamingObject.BufferedObject()
+}
+
+// GetObjectStreaming returns the object with the given name in the given
+// bucket, or an error if the object doesn't exist.
+func (s *Server) GetObjectStreaming(bucketName, objectName string) (StreamingObject, error) {
backendObj, err := s.backend.GetObject(bucketName, objectName)
+ if err != nil {
+ return StreamingObject{}, err
+ }
+ obj := fromBackendObjects([]backend.StreamingObject{backendObj})[0]
+ return obj, nil
+}
+
+// GetObjectWithGeneration is the non-streaming version of
+// GetObjectWithGenerationStreaming.
+func (s *Server) GetObjectWithGeneration(bucketName, objectName string, generation int64) (Object, error) {
+ streamingObject, err := s.GetObjectWithGenerationStreaming(bucketName, objectName, generation)
if err != nil {
return Object{}, err
}
- obj := fromBackendObjects([]backend.Object{backendObj})[0]
+ return streamingObject.BufferedObject()
+}
+
+// GetObjectWithGenerationStreaming returns the object with the given name and
+// given generation ID in the given bucket, or an error if the object doesn't
+// exist.
+//
+// If versioning is enabled, archived versions are considered.
+func (s *Server) GetObjectWithGenerationStreaming(bucketName, objectName string, generation int64) (StreamingObject, error) {
+ backendObj, err := s.backend.GetObjectWithGeneration(bucketName, objectName, generation)
+ if err != nil {
+ return StreamingObject{}, err
+ }
+ obj := fromBackendObjects([]backend.StreamingObject{backendObj})[0]
return obj, nil
}
-func (s *Server) listObjects(w http.ResponseWriter, r *http.Request) {
- bucketName := mux.Vars(r)["bucketName"]
- prefix := r.URL.Query().Get("prefix")
- delimiter := r.URL.Query().Get("delimiter")
- objs, prefixes, err := s.ListObjects(bucketName, prefix, delimiter)
- encoder := json.NewEncoder(w)
+func (s *Server) objectWithGenerationOnValidGeneration(bucketName, objectName, generationStr string) (StreamingObject, error) {
+ generation, err := strconv.ParseInt(generationStr, 10, 64)
+ if err != nil && generationStr != "" {
+ return StreamingObject{}, errInvalidGeneration
+ } else if generation > 0 {
+ return s.GetObjectWithGenerationStreaming(bucketName, objectName, generation)
+ }
+ return s.GetObjectStreaming(bucketName, objectName)
+}
+
+func (s *Server) listObjects(r *http.Request) jsonResponse {
+ bucketName := unescapeMuxVars(mux.Vars(r))["bucketName"]
+ objs, prefixes, err := s.ListObjectsWithOptions(bucketName, ListOptions{
+ Prefix: r.URL.Query().Get("prefix"),
+ Delimiter: r.URL.Query().Get("delimiter"),
+ Versions: r.URL.Query().Get("versions") == "true",
+ StartOffset: r.URL.Query().Get("startOffset"),
+ EndOffset: r.URL.Query().Get("endOffset"),
+ IncludeTrailingDelimiter: r.URL.Query().Get("includeTrailingDelimiter") == "true",
+ })
if err != nil {
- w.WriteHeader(http.StatusNotFound)
- errResp := newErrorResponse(http.StatusNotFound, "Not Found", nil)
- encoder.Encode(errResp)
- return
+ return jsonResponse{status: http.StatusNotFound}
}
- encoder.Encode(newListObjectsResponse(objs, prefixes))
+ return jsonResponse{data: newListObjectsResponse(objs, prefixes, s.externalURL)}
}
-func (s *Server) getObject(w http.ResponseWriter, r *http.Request) {
- vars := mux.Vars(r)
- encoder := json.NewEncoder(w)
- obj, err := s.GetObject(vars["bucketName"], vars["objectName"])
+func (s *Server) xmlListObjects(r *http.Request) xmlResponse {
+ bucketName := unescapeMuxVars(mux.Vars(r))["bucketName"]
+
+ opts := ListOptions{
+ Prefix: r.URL.Query().Get("prefix"),
+ Delimiter: r.URL.Query().Get("delimiter"),
+ Versions: r.URL.Query().Get("versions") == "true",
+ }
+
+ objs, prefixes, err := s.ListObjectsWithOptions(bucketName, opts)
if err != nil {
- errResp := newErrorResponse(http.StatusNotFound, "Not Found", nil)
- w.WriteHeader(http.StatusNotFound)
- encoder.Encode(errResp)
+ return xmlResponse{
+ status: http.StatusInternalServerError,
+ errorMessage: err.Error(),
+ }
+ }
+
+ result := ListBucketResult{
+ Name: bucketName,
+ Delimiter: opts.Delimiter,
+ Prefix: opts.Prefix,
+ KeyCount: len(objs),
+ }
+
+ if opts.Delimiter != "" {
+ for _, prefix := range prefixes {
+ result.CommonPrefixes = append(result.CommonPrefixes, CommonPrefix{Prefix: prefix})
+ }
+ }
+
+ for _, obj := range objs {
+ result.Contents = append(result.Contents, Contents{
+ Key: obj.Name,
+ Generation: obj.Generation,
+ Size: obj.Size,
+ LastModified: obj.Updated.Format(time.RFC3339),
+ ETag: ETag{Value: obj.Etag},
+ })
+ }
+
+ raw, err := xml.Marshal(result)
+ if err != nil {
+ return xmlResponse{
+ status: http.StatusInternalServerError,
+ errorMessage: err.Error(),
+ }
+ }
+
+ return xmlResponse{
+ status: http.StatusOK,
+ data: []byte(xml.Header + string(raw)),
+ }
+}
+
+func (s *Server) getObject(w http.ResponseWriter, r *http.Request) {
+ if alt := r.URL.Query().Get("alt"); alt == "media" || r.Method == http.MethodHead {
+ s.downloadObject(w, r)
return
}
- w.Header().Set("Accept-Ranges", "bytes")
- encoder.Encode(newObjectResponse(obj))
+
+ handler := jsonToHTTPHandler(func(r *http.Request) jsonResponse {
+ vars := unescapeMuxVars(mux.Vars(r))
+
+ projection := storage.ProjectionNoACL
+ if r.URL.Query().Has("projection") {
+ switch value := strings.ToLower(r.URL.Query().Get("projection")); value {
+ case "full":
+ projection = storage.ProjectionFull
+ case "noacl":
+ projection = storage.ProjectionNoACL
+ default:
+ return jsonResponse{
+ status: http.StatusBadRequest,
+ errorMessage: fmt.Sprintf("invalid projection: %q", value),
+ }
+ }
+ }
+
+ obj, err := s.objectWithGenerationOnValidGeneration(vars["bucketName"], vars["objectName"], r.FormValue("generation"))
+ // Calling Close before checking err is okay on objects, and the object
+ // may need to be closed whether or not there's an error.
+ defer obj.Close() //lint:ignore SA5001 // see above
+ if err != nil {
+ statusCode := http.StatusNotFound
+ var errMessage string
+ if errors.Is(err, errInvalidGeneration) {
+ statusCode = http.StatusBadRequest
+ errMessage = err.Error()
+ }
+ return jsonResponse{
+ status: statusCode,
+ errorMessage: errMessage,
+ }
+ }
+ header := make(http.Header)
+ header.Set("Accept-Ranges", "bytes")
+ return jsonResponse{
+ header: header,
+ data: newProjectedObjectResponse(obj.ObjectAttrs, s.externalURL, projection),
+ }
+ })
+
+ handler(w, r)
}
-func (s *Server) deleteObject(w http.ResponseWriter, r *http.Request) {
- s.mtx.Lock()
- defer s.mtx.Unlock()
- vars := mux.Vars(r)
- err := s.backend.DeleteObject(vars["bucketName"], vars["objectName"])
+func (s *Server) deleteObject(r *http.Request) jsonResponse {
+ vars := unescapeMuxVars(mux.Vars(r))
+ obj, err := s.GetObjectStreaming(vars["bucketName"], vars["objectName"])
+ // Calling Close before checking err is okay on objects, and the object
+ // may need to be closed whether or not there's an error.
+ defer obj.Close() //lint:ignore SA5001 // see above
+ if err == nil {
+ err = s.backend.DeleteObject(vars["bucketName"], vars["objectName"])
+ }
if err != nil {
- errResp := newErrorResponse(http.StatusNotFound, "Not Found", nil)
- w.WriteHeader(http.StatusNotFound)
- json.NewEncoder(w).Encode(errResp)
- return
+ return jsonResponse{status: http.StatusNotFound}
}
- w.WriteHeader(http.StatusOK)
+ bucket, _ := s.backend.GetBucket(obj.BucketName)
+ backendObj := toBackendObjects([]StreamingObject{obj})[0]
+ if bucket.VersioningEnabled {
+ s.eventManager.Trigger(&backendObj, notification.EventArchive, nil)
+ } else {
+ s.eventManager.Trigger(&backendObj, notification.EventDelete, nil)
+ }
+ return jsonResponse{}
}
-func (s *Server) rewriteObject(w http.ResponseWriter, r *http.Request) {
- vars := mux.Vars(r)
- obj, err := s.GetObject(vars["sourceBucket"], vars["sourceObject"])
+func (s *Server) listObjectACL(r *http.Request) jsonResponse {
+ vars := unescapeMuxVars(mux.Vars(r))
+
+ obj, err := s.GetObjectStreaming(vars["bucketName"], vars["objectName"])
if err != nil {
- http.Error(w, "not found", http.StatusNotFound)
- return
+ return jsonResponse{status: http.StatusNotFound}
+ }
+ defer obj.Close()
+
+ return jsonResponse{data: newACLListResponse(obj.ObjectAttrs)}
+}
+
+func (s *Server) setObjectACL(r *http.Request) jsonResponse {
+ vars := unescapeMuxVars(mux.Vars(r))
+
+ obj, err := s.GetObjectStreaming(vars["bucketName"], vars["objectName"])
+ if err != nil {
+ return jsonResponse{status: http.StatusNotFound}
+ }
+ defer obj.Close()
+
+ var data struct {
+ Entity string
+ Role string
+ }
+
+ decoder := json.NewDecoder(r.Body)
+ if err := decoder.Decode(&data); err != nil {
+ return jsonResponse{
+ status: http.StatusBadRequest,
+ errorMessage: err.Error(),
+ }
+ }
+
+ entity := storage.ACLEntity(data.Entity)
+ role := storage.ACLRole(data.Role)
+ obj.ACL = []storage.ACLRule{{
+ Entity: entity,
+ Role: role,
+ }}
+
+ obj, err = s.createObject(obj, backend.NoConditions{})
+ if err != nil {
+ return errToJsonResponse(err)
+ }
+ defer obj.Close()
+
+ return jsonResponse{data: newACLListResponse(obj.ObjectAttrs)}
+}
+
+func (s *Server) rewriteObject(r *http.Request) jsonResponse {
+ vars := unescapeMuxVars(mux.Vars(r))
+ obj, err := s.objectWithGenerationOnValidGeneration(vars["sourceBucket"], vars["sourceObject"], r.FormValue("sourceGeneration"))
+ // Calling Close before checking err is okay on objects, and the object
+ // may need to be closed whether or not there's an error.
+ defer obj.Close() //lint:ignore SA5001 // see above
+ if err != nil {
+ statusCode := http.StatusNotFound
+ var errMessage string
+ if errors.Is(err, errInvalidGeneration) {
+ statusCode = http.StatusBadRequest
+ errMessage = err.Error()
+ }
+ return jsonResponse{errorMessage: errMessage, status: statusCode}
+ }
+
+ var metadata multipartMetadata
+ err = json.NewDecoder(r.Body).Decode(&metadata)
+ if err != nil && err != io.EOF { // The body is optional
+ return jsonResponse{errorMessage: "Invalid metadata", status: http.StatusBadRequest}
+ }
+
+ // Only supplied metadata overwrites the new object's metdata
+ if len(metadata.Metadata) == 0 {
+ metadata.Metadata = obj.Metadata
+ }
+ if metadata.ContentType == "" {
+ metadata.ContentType = obj.ContentType
+ }
+ if metadata.ContentEncoding == "" {
+ metadata.ContentEncoding = obj.ContentEncoding
+ }
+ if metadata.ContentDisposition == "" {
+ metadata.ContentDisposition = obj.ContentDisposition
}
+
dstBucket := vars["destinationBucket"]
- newObject := Object{
- BucketName: dstBucket,
- Name: vars["destinationObject"],
- Content: append([]byte(nil), obj.Content...),
- Crc32c: obj.Crc32c,
- Md5Hash: obj.Md5Hash,
+ newObject := StreamingObject{
+ ObjectAttrs: ObjectAttrs{
+ BucketName: dstBucket,
+ Name: vars["destinationObject"],
+ ACL: obj.ACL,
+ ContentType: metadata.ContentType,
+ ContentEncoding: metadata.ContentEncoding,
+ ContentDisposition: metadata.ContentDisposition,
+ Metadata: metadata.Metadata,
+ },
+ Content: obj.Content,
}
- s.CreateObject(newObject)
- w.Header().Set("Content-Type", "application/json")
- json.NewEncoder(w).Encode(newObjectRewriteResponse(newObject))
+
+ created, err := s.createObject(newObject, backend.NoConditions{})
+ if err != nil {
+ return errToJsonResponse(err)
+ }
+ defer created.Close()
+
+ if vars["copyType"] == "copyTo" {
+ return jsonResponse{data: newObjectResponse(created.ObjectAttrs, s.externalURL)}
+ }
+ return jsonResponse{data: newObjectRewriteResponse(created.ObjectAttrs, s.externalURL)}
}
func (s *Server) downloadObject(w http.ResponseWriter, r *http.Request) {
- vars := mux.Vars(r)
- obj, err := s.GetObject(vars["bucketName"], vars["objectName"])
+ vars := unescapeMuxVars(mux.Vars(r))
+ obj, err := s.objectWithGenerationOnValidGeneration(vars["bucketName"], vars["objectName"], r.FormValue("generation"))
+ // Calling Close before checking err is okay on objects, and the object
+ // may need to be closed whether or not there's an error.
+ defer obj.Close() //lint:ignore SA5001 // see above
if err != nil {
- http.Error(w, "not found", http.StatusNotFound)
+ statusCode := http.StatusNotFound
+ message := http.StatusText(statusCode)
+ if errors.Is(err, errInvalidGeneration) {
+ statusCode = http.StatusBadRequest
+ message = err.Error()
+ }
+ http.Error(w, message, statusCode)
return
}
+
+ var content io.Reader
+ content = obj.Content
status := http.StatusOK
- start, end, content := s.handleRange(obj, r)
- if len(content) != len(obj.Content) {
+
+ transcoded := false
+ ranged := false
+ start := int64(0)
+ lastByte := int64(0)
+ satisfiable := true
+ contentLength := int64(0)
+
+ handledTranscoding := func() bool {
+ // This should also be false if the Cache-Control metadata field == "no-transform",
+ // but we don't currently support that field.
+ // See https://cloud.google.com/storage/docs/transcoding
+
+ if obj.ContentEncoding == "gzip" && !strings.Contains(r.Header.Get("accept-encoding"), "gzip") {
+ // GCS will transparently decompress gzipped content, see
+ // https://cloud.google.com/storage/docs/transcoding
+ // In this case, any Range header is ignored and the full content is returned.
+
+ // If the content is not a valid gzip file, ignore errors and continue
+ // without transcoding. Otherwise, return decompressed content.
+ gzipReader, err := gzip.NewReader(content)
+ if err == nil {
+ rawContent, err := io.ReadAll(gzipReader)
+ if err == nil {
+ transcoded = true
+ content = bytes.NewReader(rawContent)
+ contentLength = int64(len(rawContent))
+ obj.Size = contentLength
+ return true
+ }
+ }
+ }
+ return false
+ }
+
+ if !handledTranscoding() {
+ ranged, start, lastByte, satisfiable = s.handleRange(obj, r)
+ contentLength = lastByte - start + 1
+ }
+
+ if ranged && satisfiable {
+ _, err = obj.Content.Seek(start, io.SeekStart)
+ if err != nil {
+ http.Error(w, "could not seek", http.StatusInternalServerError)
+ return
+ }
+ content = io.LimitReader(obj.Content, contentLength)
status = http.StatusPartialContent
- w.Header().Set("Content-Range", fmt.Sprintf("bytes %d-%d/%d", start, end, len(obj.Content)))
+ w.Header().Set("Content-Range", fmt.Sprintf("bytes %d-%d/%d", start, lastByte, obj.Size))
}
w.Header().Set("Accept-Ranges", "bytes")
- w.Header().Set("Content-Length", strconv.Itoa(len(content)))
+ w.Header().Set("Content-Length", strconv.FormatInt(contentLength, 10))
+ w.Header().Set("X-Goog-Generation", strconv.FormatInt(obj.Generation, 10))
+ w.Header().Set("X-Goog-Hash", fmt.Sprintf("crc32c=%s,md5=%s", obj.Crc32c, obj.Md5Hash))
+ w.Header().Set("Last-Modified", obj.Updated.Format(http.TimeFormat))
+ w.Header().Set("ETag", fmt.Sprintf("%q", obj.Etag))
+ for name, value := range obj.Metadata {
+ w.Header().Set("X-Goog-Meta-"+name, value)
+ }
+ w.Header().Set("Access-Control-Allow-Origin", "*")
+
+ if ranged && !satisfiable {
+ status = http.StatusRequestedRangeNotSatisfiable
+ content = bytes.NewReader([]byte(fmt.Sprintf(``+
+ `InvalidRange
`+
+ `The requested range cannot be satisfied.`+
+ `%s `, r.Header.Get("Range"))))
+ w.Header().Set(contentTypeHeader, "application/xml; charset=UTF-8")
+ } else {
+ if obj.ContentType != "" {
+ w.Header().Set(contentTypeHeader, obj.ContentType)
+ }
+ if obj.CacheControl != "" {
+ w.Header().Set(cacheControlHeader, obj.CacheControl)
+ }
+ // If content was transcoded, the underlying encoding was removed so we shouldn't report it.
+ if obj.ContentEncoding != "" && !transcoded {
+ w.Header().Set("Content-Encoding", obj.ContentEncoding)
+ }
+ if obj.ContentDisposition != "" {
+ w.Header().Set("Content-Disposition", obj.ContentDisposition)
+ }
+ // X-Goog-Stored-Content-Encoding must be set to the original encoding,
+ // defaulting to "identity" if no encoding was set.
+ storedContentEncoding := "identity"
+ if obj.ContentEncoding != "" {
+ storedContentEncoding = obj.ContentEncoding
+ }
+ w.Header().Set("X-Goog-Stored-Content-Encoding", storedContentEncoding)
+ }
+
w.WriteHeader(status)
if r.Method == http.MethodGet {
- w.Write(content)
+ io.Copy(w, content)
}
}
-func (s *Server) handleRange(obj Object, r *http.Request) (start, end int, content []byte) {
- if reqRange := r.Header.Get("Range"); reqRange != "" {
- parts := strings.SplitN(reqRange, "=", 2)
- if len(parts) == 2 && parts[0] == "bytes" {
- rangeParts := strings.SplitN(parts[1], "-", 2)
- if len(rangeParts) == 2 {
- start, _ = strconv.Atoi(rangeParts[0])
- end, _ = strconv.Atoi(rangeParts[1])
- if end < 1 {
- end = len(obj.Content)
- }
- return start, end, obj.Content[start:end]
+func (s *Server) handleRange(obj StreamingObject, r *http.Request) (ranged bool, start int64, lastByte int64, satisfiable bool) {
+ start, end, err := parseRange(r.Header.Get("Range"), obj.Size)
+ if err != nil {
+ // If the range isn't valid, GCS returns all content.
+ return false, 0, obj.Size - 1, false
+ }
+ // GCS is pretty flexible when it comes to invalid ranges. A 416 http
+ // response is only returned when the range start is beyond the length of
+ // the content. Otherwise, the range is ignored.
+ switch {
+ // Invalid start. Return 416 and NO content.
+ // Examples:
+ // Length: 40, Range: bytes=50-60
+ // Length: 40, Range: bytes=50-
+ case start >= obj.Size:
+ // This IS a ranged request, but it ISN'T satisfiable.
+ return true, 0, 0, false
+ // Negative range, ignore range and return all content.
+ // Examples:
+ // Length: 40, Range: bytes=30-20
+ case end < start:
+ return false, 0, obj.Size - 1, false
+ // Return range. Clamp start and end.
+ // Examples:
+ // Length: 40, Range: bytes=-100
+ // Length: 40, Range: bytes=0-100
+ default:
+ if start < 0 {
+ start = 0
+ }
+ if end >= obj.Size {
+ end = obj.Size - 1
+ }
+ return true, start, end, true
+ }
+}
+
+// parseRange parses the range header and returns the corresponding start and
+// end indices in the content. The end index is inclusive. This function
+// doesn't validate that the start and end indices fall within the content
+// bounds. The content length is only used to handle "suffix length" and
+// range-to-end ranges.
+func parseRange(rangeHeaderValue string, contentLength int64) (start int64, end int64, err error) {
+ // For information about the range header, see:
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range
+ // https://httpwg.org/specs/rfc7233.html#header.range
+ // https://httpwg.org/specs/rfc7233.html#byte.ranges
+ // https://httpwg.org/specs/rfc7233.html#status.416
+ //
+ // =
+ //
+ // The following ranges are parsed:
+ // "bytes=40-50" (range with given start and end)
+ // "bytes=40-" (range to end of content)
+ // "bytes=-40" (suffix length, offset from end of string)
+ //
+ // The unit MUST be "bytes".
+ parts := strings.SplitN(rangeHeaderValue, "=", 2)
+ if len(parts) != 2 {
+ return 0, 0, fmt.Errorf("expecting `=` in range header, got: %s", rangeHeaderValue)
+ }
+ if parts[0] != "bytes" {
+ return 0, 0, fmt.Errorf("invalid range unit, expecting `bytes`, got: %s", parts[0])
+ }
+ rangeSpec := parts[1]
+ if len(rangeSpec) == 0 {
+ return 0, 0, errors.New("empty range")
+ }
+ if rangeSpec[0] == '-' {
+ offsetFromEnd, err := strconv.ParseInt(rangeSpec, 10, 64)
+ if err != nil {
+ return 0, 0, fmt.Errorf("invalid suffix length, got: %s", rangeSpec)
+ }
+ start = contentLength + offsetFromEnd
+ end = contentLength - 1
+ } else {
+ rangeParts := strings.SplitN(rangeSpec, "-", 2)
+ if len(rangeParts) != 2 {
+ return 0, 0, fmt.Errorf("only one range supported, got: %s", rangeSpec)
+ }
+ start, err = strconv.ParseInt(rangeParts[0], 10, 64)
+ if err != nil {
+ return 0, 0, fmt.Errorf("invalid range start, got: %s", rangeParts[0])
+ }
+ if rangeParts[1] == "" {
+ end = contentLength - 1
+ } else {
+ end, err = strconv.ParseInt(rangeParts[1], 10, 64)
+ if err != nil {
+ return 0, 0, fmt.Errorf("invalid range end, got: %s", rangeParts[1])
}
}
}
- return 0, 0, obj.Content
+ return start, end, nil
+}
+
+func (s *Server) patchObject(r *http.Request) jsonResponse {
+ vars := unescapeMuxVars(mux.Vars(r))
+ bucketName := vars["bucketName"]
+ objectName := vars["objectName"]
+
+ type acls struct {
+ Entity string
+ Role string
+ }
+
+ var payload struct {
+ ContentType string
+ ContentEncoding string
+ ContentDisposition string
+ Metadata map[string]string `json:"metadata"`
+ CustomTime string
+ Acl []acls
+ }
+ err := json.NewDecoder(r.Body).Decode(&payload)
+ if err != nil {
+ return jsonResponse{
+ status: http.StatusBadRequest,
+ errorMessage: "Metadata in the request couldn't decode",
+ }
+ }
+
+ var attrsToUpdate backend.ObjectAttrs
+
+ attrsToUpdate.ContentType = payload.ContentType
+ attrsToUpdate.ContentEncoding = payload.ContentEncoding
+ attrsToUpdate.ContentDisposition = payload.ContentDisposition
+ attrsToUpdate.Metadata = payload.Metadata
+ attrsToUpdate.CustomTime = payload.CustomTime
+
+ if len(payload.Acl) > 0 {
+ attrsToUpdate.ACL = []storage.ACLRule{}
+ for _, aclData := range payload.Acl {
+ newAcl := storage.ACLRule{Entity: storage.ACLEntity(aclData.Entity), Role: storage.ACLRole(aclData.Role)}
+ attrsToUpdate.ACL = append(attrsToUpdate.ACL, newAcl)
+ }
+ }
+
+ backendObj, err := s.backend.PatchObject(bucketName, objectName, attrsToUpdate)
+ if err != nil {
+ return jsonResponse{
+ status: http.StatusNotFound,
+ errorMessage: "Object not found to be PATCHed",
+ }
+ }
+ defer backendObj.Close()
+
+ s.eventManager.Trigger(&backendObj, notification.EventMetadata, nil)
+ return jsonResponse{data: fromBackendObjects([]backend.StreamingObject{backendObj})[0]}
+}
+
+func (s *Server) updateObject(r *http.Request) jsonResponse {
+ vars := unescapeMuxVars(mux.Vars(r))
+ bucketName := vars["bucketName"]
+ objectName := vars["objectName"]
+
+ type acls struct {
+ Entity string
+ Role string
+ }
+
+ var payload struct {
+ Metadata map[string]string `json:"metadata"`
+ ContentType string `json:"contentType"`
+ ContentDisposition string `json:"contentDisposition"`
+ CustomTime string
+ Acl []acls
+ }
+ err := json.NewDecoder(r.Body).Decode(&payload)
+ if err != nil {
+ return jsonResponse{
+ status: http.StatusBadRequest,
+ errorMessage: "Metadata in the request couldn't decode",
+ }
+ }
+
+ var attrsToUpdate backend.ObjectAttrs
+
+ attrsToUpdate.Metadata = payload.Metadata
+ attrsToUpdate.CustomTime = payload.CustomTime
+ attrsToUpdate.ContentType = payload.ContentType
+ attrsToUpdate.ContentDisposition = payload.ContentDisposition
+ if len(payload.Acl) > 0 {
+ attrsToUpdate.ACL = []storage.ACLRule{}
+ for _, aclData := range payload.Acl {
+ newAcl := storage.ACLRule{Entity: storage.ACLEntity(aclData.Entity), Role: storage.ACLRole(aclData.Role)}
+ attrsToUpdate.ACL = append(attrsToUpdate.ACL, newAcl)
+ }
+ }
+ backendObj, err := s.backend.UpdateObject(bucketName, objectName, attrsToUpdate)
+ if err != nil {
+ return jsonResponse{
+ status: http.StatusNotFound,
+ errorMessage: "Object not found to be updated",
+ }
+ }
+ defer backendObj.Close()
+
+ s.eventManager.Trigger(&backendObj, notification.EventMetadata, nil)
+ return jsonResponse{data: fromBackendObjects([]backend.StreamingObject{backendObj})[0]}
+}
+
+func (s *Server) composeObject(r *http.Request) jsonResponse {
+ vars := unescapeMuxVars(mux.Vars(r))
+ bucketName := vars["bucketName"]
+ destinationObject := vars["destinationObject"]
+
+ var composeRequest struct {
+ SourceObjects []struct {
+ Name string
+ }
+ Destination struct {
+ Bucket string
+ ContentType string
+ ContentDisposition string
+ Metadata map[string]string
+ }
+ }
+
+ decoder := json.NewDecoder(r.Body)
+ err := decoder.Decode(&composeRequest)
+ if err != nil {
+ return jsonResponse{
+ status: http.StatusBadRequest,
+ errorMessage: "Error parsing request body",
+ }
+ }
+
+ const maxComposeObjects = 32
+ if len(composeRequest.SourceObjects) > maxComposeObjects {
+ return jsonResponse{
+ status: http.StatusBadRequest,
+ errorMessage: fmt.Sprintf("The number of source components provided (%d) exceeds the maximum (%d)", len(composeRequest.SourceObjects), maxComposeObjects),
+ }
+ }
+
+ sourceNames := make([]string, 0, len(composeRequest.SourceObjects))
+ for _, n := range composeRequest.SourceObjects {
+ sourceNames = append(sourceNames, n.Name)
+ }
+
+ backendObj, err := s.backend.ComposeObject(bucketName, sourceNames, destinationObject, composeRequest.Destination.Metadata, composeRequest.Destination.ContentType)
+ if err != nil {
+ return jsonResponse{
+ status: http.StatusInternalServerError,
+ errorMessage: "Error running compose",
+ }
+ }
+ defer backendObj.Close()
+
+ obj := fromBackendObjects([]backend.StreamingObject{backendObj})[0]
+
+ s.eventManager.Trigger(&backendObj, notification.EventFinalize, nil)
+
+ return jsonResponse{data: newObjectResponse(obj.ObjectAttrs, s.externalURL)}
}
diff --git a/vendor/github.com/fsouza/fake-gcs-server/fakestorage/response.go b/vendor/github.com/fsouza/fake-gcs-server/fakestorage/response.go
index 92164cafb1057..f40dcd3fe9dd7 100644
--- a/vendor/github.com/fsouza/fake-gcs-server/fakestorage/response.go
+++ b/vendor/github.com/fsouza/fake-gcs-server/fakestorage/response.go
@@ -4,73 +4,200 @@
package fakestorage
-import "sort"
+import (
+ "fmt"
+ "net/url"
+ "time"
+
+ "cloud.google.com/go/storage"
+ "github.com/fsouza/fake-gcs-server/internal/backend"
+)
+
+const timestampFormat = "2006-01-02T15:04:05.999999Z07:00"
+
+func formatTime(t time.Time) string {
+ if t.IsZero() {
+ return ""
+ }
+ return t.Format(timestampFormat)
+}
type listResponse struct {
- Kind string `json:"kind"`
- Items []interface{} `json:"items"`
- Prefixes []string `json:"prefixes"`
+ Kind string `json:"kind"`
+ Items []any `json:"items,omitempty"`
+ Prefixes []string `json:"prefixes,omitempty"`
}
-func newListBucketsResponse(bucketNames []string) listResponse {
+func newListBucketsResponse(buckets []backend.Bucket, location string) listResponse {
resp := listResponse{
Kind: "storage#buckets",
- Items: make([]interface{}, len(bucketNames)),
+ Items: make([]any, len(buckets)),
}
- sort.Strings(bucketNames)
- for i, name := range bucketNames {
- resp.Items[i] = newBucketResponse(name)
+ for i, bucket := range buckets {
+ resp.Items[i] = newBucketResponse(bucket, location)
}
return resp
}
type bucketResponse struct {
- Kind string `json:"kind"`
- ID string `json:"id"`
- Name string `json:"name"`
+ Kind string `json:"kind"`
+ ID string `json:"id"`
+ DefaultEventBasedHold bool `json:"defaultEventBasedHold"`
+ Name string `json:"name"`
+ Versioning *bucketVersioning `json:"versioning,omitempty"`
+ TimeCreated string `json:"timeCreated,omitempty"`
+ Updated string `json:"updated,omitempty"`
+ Location string `json:"location,omitempty"`
+ StorageClass string `json:"storageClass,omitempty"`
+ ProjectNumber string `json:"projectNumber"`
+ Metageneration string `json:"metageneration"`
+ Etag string `json:"etag"`
+ LocationType string `json:"locationType"`
}
-func newBucketResponse(bucketName string) bucketResponse {
+type bucketVersioning struct {
+ Enabled bool `json:"enabled"`
+}
+
+func newBucketResponse(bucket backend.Bucket, location string) bucketResponse {
return bucketResponse{
- Kind: "storage#bucket",
- ID: bucketName,
- Name: bucketName,
+ Kind: "storage#bucket",
+ ID: bucket.Name,
+ Name: bucket.Name,
+ DefaultEventBasedHold: bucket.DefaultEventBasedHold,
+ Versioning: &bucketVersioning{bucket.VersioningEnabled},
+ TimeCreated: formatTime(bucket.TimeCreated),
+ Updated: formatTime(bucket.TimeCreated), // not tracking update times yet, reporting `updated` = `timeCreated`
+ Location: location,
+ StorageClass: "STANDARD",
+ ProjectNumber: "0",
+ Metageneration: "1",
+ Etag: "RVRhZw==",
+ LocationType: "region",
}
}
-func newListObjectsResponse(objs []Object, prefixes []string) listResponse {
+func newListObjectsResponse(objs []ObjectAttrs, prefixes []string, externalURL string) listResponse {
resp := listResponse{
Kind: "storage#objects",
- Items: make([]interface{}, len(objs)),
+ Items: make([]any, len(objs)),
Prefixes: prefixes,
}
for i, obj := range objs {
- resp.Items[i] = newObjectResponse(obj)
+ resp.Items[i] = newObjectResponse(obj, externalURL)
}
return resp
}
+// objectAccessControl is copied from the Google SDK to avoid direct
+// dependency.
+type objectAccessControl struct {
+ Bucket string `json:"bucket,omitempty"`
+ Domain string `json:"domain,omitempty"`
+ Email string `json:"email,omitempty"`
+ Entity string `json:"entity,omitempty"`
+ EntityID string `json:"entityId,omitempty"`
+ Etag string `json:"etag,omitempty"`
+ Generation int64 `json:"generation,omitempty,string"`
+ ID string `json:"id,omitempty"`
+ Kind string `json:"kind,omitempty"`
+ Object string `json:"object,omitempty"`
+ ProjectTeam struct {
+ ProjectNumber string `json:"projectNumber,omitempty"`
+ Team string `json:"team,omitempty"`
+ } `json:"projectTeam,omitempty"`
+ Role string `json:"role,omitempty"`
+ SelfLink string `json:"selfLink,omitempty"`
+}
+
type objectResponse struct {
- Kind string `json:"kind"`
- Name string `json:"name"`
- ID string `json:"id"`
- Bucket string `json:"bucket"`
- Size int64 `json:"size,string"`
- // Crc32c: CRC32c checksum, same as in google storage client code
- Crc32c string `json:"crc32c,omitempty"`
- Md5Hash string `json:"md5hash,omitempty"`
+ Kind string `json:"kind"`
+ Name string `json:"name"`
+ ID string `json:"id"`
+ Bucket string `json:"bucket"`
+ Size int64 `json:"size,string"`
+ ContentType string `json:"contentType,omitempty"`
+ ContentEncoding string `json:"contentEncoding,omitempty"`
+ ContentDisposition string `json:"contentDisposition,omitempty"`
+ Crc32c string `json:"crc32c,omitempty"`
+ ACL []*objectAccessControl `json:"acl,omitempty"`
+ Md5Hash string `json:"md5Hash,omitempty"`
+ Etag string `json:"etag,omitempty"`
+ StorageClass string `json:"storageClass"`
+ TimeCreated string `json:"timeCreated,omitempty"`
+ TimeDeleted string `json:"timeDeleted,omitempty"`
+ TimeStorageClassUpdated string `json:"timeStorageClassUpdated,omitempty"`
+ Updated string `json:"updated,omitempty"`
+ Generation int64 `json:"generation,string"`
+ CustomTime string `json:"customTime,omitempty"`
+ Metadata map[string]string `json:"metadata,omitempty"`
+ SelfLink string `json:"selfLink,omitempty"`
+ MediaLink string `json:"mediaLink,omitempty"`
+ Metageneration string `json:"metageneration,omitempty"`
}
-func newObjectResponse(obj Object) objectResponse {
+func newProjectedObjectResponse(obj ObjectAttrs, externalURL string, projection storage.Projection) objectResponse {
+ objResponse := newObjectResponse(obj, externalURL)
+ if projection == storage.ProjectionNoACL {
+ objResponse.ACL = nil
+ }
+ return objResponse
+}
+
+func newObjectResponse(obj ObjectAttrs, externalURL string) objectResponse {
+ acl := getAccessControlsListFromObject(obj)
+
return objectResponse{
- Kind: "storage#object",
- ID: obj.id(),
- Bucket: obj.BucketName,
- Name: obj.Name,
- Size: int64(len(obj.Content)),
- Crc32c: obj.Crc32c,
- Md5Hash: obj.Md5Hash,
+ Kind: "storage#object",
+ ID: obj.id(),
+ Bucket: obj.BucketName,
+ Name: obj.Name,
+ Size: obj.Size,
+ ContentType: obj.ContentType,
+ ContentEncoding: obj.ContentEncoding,
+ ContentDisposition: obj.ContentDisposition,
+ Crc32c: obj.Crc32c,
+ Md5Hash: obj.Md5Hash,
+ Etag: obj.Etag,
+ ACL: acl,
+ StorageClass: "STANDARD",
+ Metadata: obj.Metadata,
+ TimeCreated: formatTime(obj.Created),
+ TimeDeleted: formatTime(obj.Deleted),
+ TimeStorageClassUpdated: formatTime(obj.Updated),
+ Updated: formatTime(obj.Updated),
+ CustomTime: formatTime(obj.CustomTime),
+ Generation: obj.Generation,
+ SelfLink: fmt.Sprintf("%s/storage/v1/b/%s/o/%s", externalURL, url.PathEscape(obj.BucketName), url.PathEscape(obj.Name)),
+ MediaLink: fmt.Sprintf("%s/download/storage/v1/b/%s/o/%s?alt=media", externalURL, url.PathEscape(obj.BucketName), url.PathEscape(obj.Name)),
+ Metageneration: "1",
+ }
+}
+
+type aclListResponse struct {
+ Items []*objectAccessControl `json:"items"`
+}
+
+func newACLListResponse(obj ObjectAttrs) aclListResponse {
+ if len(obj.ACL) == 0 {
+ return aclListResponse{}
+ }
+ return aclListResponse{Items: getAccessControlsListFromObject(obj)}
+}
+
+func getAccessControlsListFromObject(obj ObjectAttrs) []*objectAccessControl {
+ aclItems := make([]*objectAccessControl, len(obj.ACL))
+ for idx, aclRule := range obj.ACL {
+ aclItems[idx] = &objectAccessControl{
+ Bucket: obj.BucketName,
+ Entity: string(aclRule.Entity),
+ Object: obj.Name,
+ Role: string(aclRule.Role),
+ Etag: "RVRhZw==",
+ Kind: "storage#objectAccessControl",
+ }
}
+ return aclItems
}
type rewriteResponse struct {
@@ -82,14 +209,14 @@ type rewriteResponse struct {
Resource objectResponse `json:"resource"`
}
-func newObjectRewriteResponse(obj Object) rewriteResponse {
+func newObjectRewriteResponse(obj ObjectAttrs, externalURL string) rewriteResponse {
return rewriteResponse{
Kind: "storage#rewriteResponse",
- TotalBytesRewritten: int64(len(obj.Content)),
- ObjectSize: int64(len(obj.Content)),
+ TotalBytesRewritten: obj.Size,
+ ObjectSize: obj.Size,
Done: true,
RewriteToken: "",
- Resource: newObjectResponse(obj),
+ Resource: newObjectResponse(obj, externalURL),
}
}
diff --git a/vendor/github.com/fsouza/fake-gcs-server/fakestorage/server.go b/vendor/github.com/fsouza/fake-gcs-server/fakestorage/server.go
index 165d9d7ec2ed4..dc6fa9bfd3390 100644
--- a/vendor/github.com/fsouza/fake-gcs-server/fakestorage/server.go
+++ b/vendor/github.com/fsouza/fake-gcs-server/fakestorage/server.go
@@ -5,30 +5,52 @@
package fakestorage
import (
+ "bufio"
+ "bytes"
+ "compress/gzip"
"context"
"crypto/tls"
+ "errors"
"fmt"
+ "io"
+ "mime"
+ "mime/multipart"
"net"
"net/http"
"net/http/httptest"
+ "net/http/httputil"
+ "net/textproto"
+ "net/url"
+ "os"
+ "path/filepath"
+ "strings"
"sync"
"cloud.google.com/go/storage"
"github.com/fsouza/fake-gcs-server/internal/backend"
+ "github.com/fsouza/fake-gcs-server/internal/checksum"
+ "github.com/fsouza/fake-gcs-server/internal/notification"
+ "github.com/gorilla/handlers"
"github.com/gorilla/mux"
+ "golang.org/x/oauth2/google"
"google.golang.org/api/option"
)
+const defaultPublicHost = "storage.googleapis.com"
+
// Server is the fake server.
//
// It provides a fake implementation of the Google Cloud Storage API.
type Server struct {
- backend backend.Storage
- uploads map[string]Object
- transport http.RoundTripper
- ts *httptest.Server
- mux *mux.Router
- mtx sync.RWMutex
+ backend backend.Storage
+ uploads sync.Map
+ transport http.RoundTripper
+ ts *httptest.Server
+ handler http.Handler
+ options Options
+ externalURL string
+ publicHost string
+ eventManager notification.EventManager
}
// NewServer creates a new instance of the server, pre-loaded with the given
@@ -41,6 +63,8 @@ func NewServer(objects []Object) *Server {
}
// NewServerWithHostPort creates a new server that listens on a custom host and port
+//
+// Deprecated: use NewServerWithOptions.
func NewServerWithHostPort(objects []Object, host string, port uint16) (*Server, error) {
return NewServerWithOptions(Options{
InitialObjects: objects,
@@ -49,30 +73,104 @@ func NewServerWithHostPort(objects []Object, host string, port uint16) (*Server,
})
}
-// Options are used to configure the server on creation
+type EventManagerOptions = notification.EventManagerOptions
+
+// Options are used to configure the server on creation.
type Options struct {
InitialObjects []Object
StorageRoot string
+ Seed string
+ Scheme string
Host string
Port uint16
// when set to true, the server will not actually start a TCP listener,
// client requests will get processed by an internal mocked transport.
NoListener bool
+
+ // Optional external URL, such as https://gcs.127.0.0.1.nip.io:4443
+ // Returned in the Location header for resumable uploads
+ // The "real" value is https://www.googleapis.com, the JSON API
+ // The default is whatever the server is bound to, such as https://0.0.0.0:4443
+ ExternalURL string
+
+ // Optional URL for public access
+ // An example is "storage.gcs.127.0.0.1.nip.io:4443", which will configure
+ // the server to serve objects at:
+ // https://storage.gcs.127.0.0.1.nip.io:4443//