diff --git a/cmd/uaa_login_strategy.go b/cmd/uaa_login_strategy.go index 7329eb5643..4f262a2b3e 100644 --- a/cmd/uaa_login_strategy.go +++ b/cmd/uaa_login_strategy.go @@ -59,12 +59,12 @@ func (c UAALoginStrategy) tryClient(uaa boshuaa.UAA) error { _, err := uaa.ClientCredentialsGrant() if err == nil { - c.ui.PrintLinef(c.successMsg) + c.ui.PrintLinef("%s", c.successMsg) } else { - c.ui.ErrorLinef(c.failureMsg) + c.ui.ErrorLinef("%s", c.failureMsg) } - // Dont bother saving client token since there is no way to refresh it + // Don't bother saving client token since there is no way to refresh it return err } @@ -114,7 +114,7 @@ func (c UAALoginStrategy) tryUserOnce(environment string, prompts []boshuaa.Prom accessToken, err := uaa.OwnerPasswordCredentialsGrant(answers) if err != nil { c.logger.Error(c.logTag, "Failed to get access token: %s", err) - c.ui.ErrorLinef(c.failureMsg) + c.ui.ErrorLinef("%s", c.failureMsg) return false, nil } @@ -134,7 +134,7 @@ func (c UAALoginStrategy) tryUserOnce(environment string, prompts []boshuaa.Prom return false, err } - c.ui.PrintLinef(c.successMsg) + c.ui.PrintLinef("%s", c.successMsg) return true, nil } diff --git a/director/factory_config_test.go b/director/factory_config_test.go index d24aa616f9..41f7bb42d8 100644 --- a/director/factory_config_test.go +++ b/director/factory_config_test.go @@ -59,7 +59,7 @@ var _ = Describe("NewConfigFromURL", func() { It("returns error if port cannot be extracted", func() { _, err := NewConfigFromURL("https://host::") Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("Extracting host/port from URL")) + Expect(err.Error()).To(ContainSubstring("invalid port")) }) It("returns error if port is empty", func() { @@ -71,7 +71,7 @@ var _ = Describe("NewConfigFromURL", func() { It("returns error if port cannot be parsed as int", func() { _, err := NewConfigFromURL("https://host:abc") Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(MatchRegexp("(Extracting port from URL|Parsing Director URL)")) // go1.12 validates port in Parse + Expect(err.Error()).To(ContainSubstring("Parsing Director URL")) }) }) @@ -88,7 +88,7 @@ var _ = Describe("FactoryConfig", func() { Expect(err.Error()).To(Equal("Missing 'Host'")) }) - It("returns error if host is empty", func() { + It("returns error if port is empty", func() { err := FactoryConfig{Host: "host"}.Validate() Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal("Missing 'Port'")) diff --git a/go.mod b/go.mod index a2c6429dd3..8ed900792a 100644 --- a/go.mod +++ b/go.mod @@ -1,35 +1,35 @@ module github.com/cloudfoundry/bosh-cli/v7 -go 1.25.0 +go 1.26.0 require ( - code.cloudfoundry.org/clock v1.86.0 + code.cloudfoundry.org/clock v1.88.0 code.cloudfoundry.org/workpool v0.0.0-20250911194158-1489753f182e github.com/cheggaaa/pb/v3 v3.2.1 - github.com/cloudfoundry/bosh-agent/v2 v2.890.0 - github.com/cloudfoundry/bosh-davcli v0.0.505 - github.com/cloudfoundry/bosh-gcscli v0.0.413 + github.com/cloudfoundry/bosh-agent/v2 v2.892.0 + github.com/cloudfoundry/bosh-davcli v0.0.510 + github.com/cloudfoundry/bosh-gcscli v0.0.418 github.com/cloudfoundry/bosh-s3cli v0.0.437 - github.com/cloudfoundry/bosh-utils v0.0.647 + github.com/cloudfoundry/bosh-utils v0.0.652 github.com/cloudfoundry/config-server v0.1.287 - github.com/cloudfoundry/socks5-proxy v0.2.187 + github.com/cloudfoundry/socks5-proxy v0.2.188 github.com/cppforlife/go-patch v0.2.0 github.com/cppforlife/go-semi-semantic v0.0.0-20160921010311-576b6af77ae4 github.com/dustin/go-humanize v1.0.1 github.com/fatih/color v1.19.0 - github.com/gopacket/gopacket v1.7.1 + github.com/gopacket/gopacket v1.7.2 github.com/hashicorp/go-multierror v1.1.1 github.com/jessevdk/go-flags v1.6.1 github.com/mattn/go-isatty v0.0.24 - github.com/maxbrunsfeld/counterfeiter/v6 v6.12.2 - github.com/onsi/ginkgo/v2 v2.32.1 + github.com/maxbrunsfeld/counterfeiter/v6 v6.13.0 + github.com/onsi/ginkgo/v2 v2.32.2 github.com/onsi/gomega v1.43.0 github.com/peterbourgon/diskv v2.0.1+incompatible github.com/spf13/cobra v1.10.2 github.com/vito/go-interact v1.0.2 - golang.org/x/crypto v0.55.0 - golang.org/x/text v0.41.0 - golang.org/x/tools v0.49.0 + golang.org/x/crypto v0.57.0 + golang.org/x/text v0.42.0 + golang.org/x/tools v0.50.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 ) @@ -42,31 +42,31 @@ require ( cloud.google.com/go/compute/metadata v0.9.0 // indirect cloud.google.com/go/iam v1.13.0 // indirect cloud.google.com/go/monitoring v1.30.0 // indirect - cloud.google.com/go/storage v1.67.0 // indirect - code.cloudfoundry.org/tlsconfig v0.53.0 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.36.0 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.60.0 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.60.0 // indirect + cloud.google.com/go/storage v1.67.1 // indirect + code.cloudfoundry.org/tlsconfig v0.67.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.38.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.62.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.62.0 // indirect github.com/Masterminds/semver/v3 v3.5.0 // indirect github.com/VividCortex/ewma v1.2.0 // indirect - github.com/aws/aws-sdk-go-v2 v1.46.0 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.0 // indirect github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.20 // indirect - github.com/aws/aws-sdk-go-v2/config v1.33.3 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.3 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.19.2 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.23.3 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.2 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.2 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.2 // indirect + github.com/aws/aws-sdk-go-v2/config v1.33.5 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.5 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.0 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.23.7 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.3 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.3 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.3 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.19 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.2 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.2 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.2 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.111.0 // indirect - github.com/aws/aws-sdk-go-v2/service/signin v1.9.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.37.0 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.42.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.49.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.3 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.3 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.113.1 // indirect + github.com/aws/aws-sdk-go-v2/service/signin v1.10.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.38.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.51.0 // indirect github.com/aws/smithy-go v1.28.1 // indirect github.com/bmatcuk/doublestar v1.3.4 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -82,16 +82,16 @@ require ( github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/google/btree v1.1.3 // indirect github.com/google/go-cmp v0.7.0 // indirect - github.com/google/pprof v0.0.0-20260903180319-d6c3cb2f37ec // indirect + github.com/google/pprof v0.0.0-20260906184651-6331bc6350fe // indirect github.com/google/s2a-go v0.1.9 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/googleapis/enterprise-certificate-proxy v0.3.21 // indirect + github.com/googleapis/enterprise-certificate-proxy v0.3.22 // indirect github.com/googleapis/gax-go/v2 v2.24.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jpillora/backoff v1.0.0 // indirect github.com/mattn/go-colorable v0.1.15 // indirect - github.com/mattn/go-runewidth v0.0.29 // indirect + github.com/mattn/go-runewidth v0.0.30 // indirect github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/spf13/pflag v1.0.10 // indirect @@ -106,18 +106,18 @@ require ( go.opentelemetry.io/otel/sdk/metric v1.46.0 // indirect go.opentelemetry.io/otel/trace v1.46.0 // indirect go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/mod v0.40.0 // indirect - golang.org/x/net v0.58.0 // indirect - golang.org/x/oauth2 v0.36.0 // indirect - golang.org/x/sync v0.22.0 // indirect - golang.org/x/sys v0.47.0 // indirect - golang.org/x/telemetry v0.0.0-20260814151720-d8c169486af1 // indirect - golang.org/x/term v0.45.0 // indirect - golang.org/x/time v0.15.0 // indirect - google.golang.org/api v0.296.0 // indirect - google.golang.org/genproto v0.0.0-20260904194346-d0f1323225a4 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260904194346-d0f1323225a4 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260904194346-d0f1323225a4 // indirect + golang.org/x/mod v0.41.0 // indirect + golang.org/x/net v0.59.0 // indirect + golang.org/x/oauth2 v0.37.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/telemetry v0.0.0-20260910141331-15ceca2b0a1f // indirect + golang.org/x/term v0.46.0 // indirect + golang.org/x/time v0.16.0 // indirect + google.golang.org/api v0.298.0 // indirect + google.golang.org/genproto v0.0.0-20260911204522-f61a6ca850bd // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260911204522-f61a6ca850bd // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260911204522-f61a6ca850bd // indirect google.golang.org/grpc v1.83.2 // indirect google.golang.org/protobuf v1.36.12 // indirect ) diff --git a/go.sum b/go.sum index a4ed535761..f5f952ed93 100644 --- a/go.sum +++ b/go.sum @@ -16,66 +16,66 @@ cloud.google.com/go/longrunning v1.2.0 h1:WjYH3YHBGCxGJP9M4dWGHBfXr/cFIjMkNgWcJj cloud.google.com/go/longrunning v1.2.0/go.mod h1:5KMQALFGOCtFoi2xSOA1u3H7WKlhmckgiyFw7+LGQp0= cloud.google.com/go/monitoring v1.30.0 h1:r/d+JUbyKmJ8b07iznuKfzVzrIXTWxHQ3lBRm3x2LlY= cloud.google.com/go/monitoring v1.30.0/go.mod h1:htlUR0QWVMrjFzZmN4LGnMAve9xB/eduwjmINxVZ8RM= -cloud.google.com/go/storage v1.67.0 h1:8xD3NvKuHE4c+b/kmSIVBdTc0BiOjplx+KecKGR9fr8= -cloud.google.com/go/storage v1.67.0/go.mod h1:UsS9OgFg/XHOSYakQ8ZtLWWeyGkk1WnmD/GsGfN0BHM= +cloud.google.com/go/storage v1.67.1 h1:cDeyjY1ik/2IBs4/nLytL6Orrtbi5M0G6beyGRl/9EQ= +cloud.google.com/go/storage v1.67.1/go.mod h1:UsS9OgFg/XHOSYakQ8ZtLWWeyGkk1WnmD/GsGfN0BHM= cloud.google.com/go/trace v1.16.0 h1:GmQovzFc5F0CNfl0VLgL64aoTtu7xsM0YajW2GlG9+E= cloud.google.com/go/trace v1.16.0/go.mod h1:r+bdAn16dKLSV1G2D5v3e58IlQlizfxWrUfjx7kM7X0= -code.cloudfoundry.org/clock v1.86.0 h1:+n03i5ExRv/lab8XWoQgIo+dOXQAIzqmIldA9MnKSUY= -code.cloudfoundry.org/clock v1.86.0/go.mod h1:eQZi+T5TaJ7gbyJF1Ov6BzgOnAFzW6f7FJKnvTitsp0= -code.cloudfoundry.org/tlsconfig v0.53.0 h1:ajprkio3g4V+C0AUJt3rXkkA0il+3sQZ9dJMRQ/e7Ug= -code.cloudfoundry.org/tlsconfig v0.53.0/go.mod h1:DMYiC50mOZC38kVQChNoHvLveqD+xohYJgfO9yusAFk= +code.cloudfoundry.org/clock v1.88.0 h1:rlPCGl0D5fV9vjNl8ww+QS3ffvhRl+zoQdCdv+uHtFg= +code.cloudfoundry.org/clock v1.88.0/go.mod h1:XUG+XI/odMYn6y9rqSX4+PqSBHrJ3jD7UR5dBNnc7/o= +code.cloudfoundry.org/tlsconfig v0.67.0 h1:NNlWRHeBrSlTMj8PpcEbU6VaVvtV0F/8KtyIayu1qAQ= +code.cloudfoundry.org/tlsconfig v0.67.0/go.mod h1:CDv3lTVNMitrFu1zEEENVtmX/mCR4I3oI2Hxb/uhwyE= code.cloudfoundry.org/workpool v0.0.0-20250911194158-1489753f182e h1:NsULHptleEmqtoC8j6A8J636L9APnGn8YC0c7vocLww= code.cloudfoundry.org/workpool v0.0.0-20250911194158-1489753f182e/go.mod h1:O9HdfntfyDvYRH9nh03XdpnGMbjyZVi8nb2Kh+6hDho= filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.36.0 h1:3SdxXLkgAfiHRWcGTq6fneq9jgoJzneiY0yPQnjoT2E= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.36.0/go.mod h1:1iIdl0k+ppn9wT0wzR9H7HkSvIui/4qgtnKW10cQtds= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.60.0 h1:HldzheTs05E3ybqSitI/wHaof6+XERRudgZLjYbs3eE= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.60.0/go.mod h1:evkqaSczW9g2BQm1veCtgNhJ4wCCsRrOsSgNIn9LHQk= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.60.0 h1:Fx8NtDCmKH4ML2hUkPz4Dq250903vRDojMjVCDKwQuc= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.60.0/go.mod h1:V9g30lTKzfUsEW+gpWssck6u9IhARajmipodImLLcwI= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.60.0 h1:Oblia1QXBJlM/wOY9ARRUtsXdDYiMCzk3eCMikqoLbI= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.60.0/go.mod h1:SRAbhyZ4R4FagHMM9VtRgSY/lheRoht2fKelZXQUenk= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.38.0 h1:rmzbFS2CkHq0y2L5LkMVWm+QXjjNEXxjmhrJqga/QGk= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.38.0/go.mod h1:iIyrdhveU5Ow84ipRlxtjCOQnIM0DiqSMxuxm50xwZY= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.62.0 h1:5y2LR2pripbccOte6BpZ+guv5O5W0OQIfKvUYZrGaAQ= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.62.0/go.mod h1:b3f7EifFRqkVt142USoGIP62uUeZm7ALCPrs1ZjWXYo= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.62.0 h1:tRsXhJnn0w0TNwJpVrB94wsrimzjWKFzdQlUhRdNUzc= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.62.0/go.mod h1:ifhe5teRNcbxg9p353DhOkOgczzL/IBLYFqT1cm1zpM= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.62.0 h1:aPMa5qZU9dp4fU34o+jQgVIPFIOi20oxYg8TLigmZLg= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.62.0/go.mod h1:sg6Wqbl0BKKZ5zKnQj2q0qic/3ziF894SCx1LpbX37Y= github.com/Masterminds/semver/v3 v3.5.0 h1:kQceYJfbupGfZOKZQg0kou0DgAKhzDg2NZPAwZ/2OOE= github.com/Masterminds/semver/v3 v3.5.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow= github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= -github.com/aws/aws-sdk-go-v2 v1.46.0 h1:1kt7m/EKcEHt5mlyyxx9cSlMddRPIKbjb6DIQsu4HPk= -github.com/aws/aws-sdk-go-v2 v1.46.0/go.mod h1:bttEH6JqnUL8LepvDVfdrds/fZ5bCIxzpe3abyUrhDU= +github.com/aws/aws-sdk-go-v2 v1.47.0 h1:0jsHallhJCeaU0Ko48c/3FK1ctOQ7NpzggxriJOQ8MQ= +github.com/aws/aws-sdk-go-v2 v1.47.0/go.mod h1:bttEH6JqnUL8LepvDVfdrds/fZ5bCIxzpe3abyUrhDU= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.20 h1:GPRlPwz40I2B2VrBEASOA3Bi77NyeqejNLkifosX0rs= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.20/go.mod h1:g7PNzKcsOKWb4fkSRBA7BZVAS6Y8IcxzN+nRohhQ1Q8= -github.com/aws/aws-sdk-go-v2/config v1.33.3 h1:h090b3O5S17bF87/0ysHZuIT/7DCb4EBRFQX2PMVPCw= -github.com/aws/aws-sdk-go-v2/config v1.33.3/go.mod h1:YYDB1kTejxbfAbEVUqgCtkVp26xvNCHev9cLKABMGAk= -github.com/aws/aws-sdk-go-v2/credentials v1.20.3 h1:tToOYM/LXev4NpfWlIYGDvBvjHmJ3HXpRU9ppl+pM6k= -github.com/aws/aws-sdk-go-v2/credentials v1.20.3/go.mod h1:wfGneWyncO7p67wqXV2IQhPk14JqIc25woKlaArT3WI= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.19.2 h1:Ldv7RPHs7qwwTscRjAl3YBud32f3BvdAGRmSvAx5L38= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.19.2/go.mod h1:XyK6UV8xbo66ysVqLd2783C09pBYHOm8aKTRV5DVJ30= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.23.3 h1:LFtSxvl7JJjIui9NUh2K567D4IcTXoDWW2BEUDDlnbE= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.23.3/go.mod h1:42BqQB16UKuFS+jCOci2+tzTwr8+nsKhcr06OgMqykA= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.2 h1:q/PSLGuRWCChWg+dLnb9dWOnrCxJtnboXbBtFoqqRrI= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.2/go.mod h1:TD1jvU2LvXkJexct5vBqcd8QlNXh5EmRUeL/Z32p0n4= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.2 h1:6fl86IPqKEXoySqiOWdfgbEp9OVbn44zTfEICNEBDhY= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.2/go.mod h1:63HDfhFkdzBpI8WGXTSKUHPKS6mqldj4u3LJW7RZtSU= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.2 h1:XMgIRS+uW9F3yFKnXGRrI9pkHi99CXTmoz2kz2/TGBA= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.2/go.mod h1:vorxDzK+n3jiv9a5ST/LG0Eu9cSv1CRdKTpG6pDMs+M= +github.com/aws/aws-sdk-go-v2/config v1.33.5 h1:UA1dmokBFOLFoOyVBhO6HjM6edy0MIk5AZSkJVcksQw= +github.com/aws/aws-sdk-go-v2/config v1.33.5/go.mod h1:Dop8axzz0xx38GExIYWXdeyc8QQ7Cr+nPsxpD/LYy4U= +github.com/aws/aws-sdk-go-v2/credentials v1.20.5 h1:wklUVvHMc9xTQ3rcp49/ISpiMnhbCicJcA6n6S8m7J8= +github.com/aws/aws-sdk-go-v2/credentials v1.20.5/go.mod h1:fyEdrn6ccLFOkoK84j5bQyGTxp9zPt5l2XMhxf4DVZs= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.0 h1:AM4hHjww+PSFtt6E+UrBrPlZkWsePCLEt9AjkfQX+yM= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.0/go.mod h1:3x/yXezeQjpOvBb4jEMxrS8SXvpdvJ5abv6l5c1gWM8= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.23.7 h1:omtMzSxsMhRDJzG/1bzT4dLA+jybY/nQLwEuoxt52yI= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.23.7/go.mod h1:oTPLfqQ08mCCN1qIkuZUsu0x6Iv/N7YEDax5qhCwN+o= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.3 h1:Hp/VgjP0BysR3OgLlR057Vz2LcbbVnoWeJ+3qWiS/fY= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.3/go.mod h1:nwGV5qw7F1IZPgxCvA/ph8N2TAuz+BkRG/bXn808qMA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.3 h1:MUaM4f+kj1ZIBPZfUS8cxP1GKXXZtHJjAthy93AN7SM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.3/go.mod h1:6YmVmEVRI5ZZzRjCSsb9SryKH0hAlMRdgA7kG9aDvBU= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.3 h1:fuSCw4Z2qfRCztMPO3GXJNSiEp6Wee+WOLwrHHUMy9c= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.3/go.mod h1:6SxcHheD1pPR5+kWm1wGvjlL/YqUsh267sAfEmN4K7A= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.19 h1:bAdDl/HkGCcGPoe25ToSHEw23VIxt6CT5fLcg111BKg= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.19/go.mod h1:KaUzbLxv4CeSxh6ZCl9B4m7CuFenS8kUEaDs+f/DQr4= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.2 h1:CO485zrLOZBeq8mrdsudc8cjyhvC4LY4JFt8ZfHvXZ0= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.2/go.mod h1:cBAjVUKBr+5wnx1K3XWS8u5AZsqpA2S/0z7YtI6BGFc= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.2 h1:ZtHYnumr6QyxhzEzNZwzQTFJEXOswrZqTTkRxthwvr4= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.2/go.mod h1:a1NXrYpBd311gBzn1UI5UzJyyvXktM4xNh/ydPiPpqY= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.2 h1:Enx5JcIy/o90kio1LFZ/HguxIsos3clbGuSpGdyshX8= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.2/go.mod h1:Ldmll8/2VqaVerWWDf8IGG+6pAvZY04gs3tevq3nIFs= -github.com/aws/aws-sdk-go-v2/service/s3 v1.111.0 h1:4PokON/ISKuD6Zl062n4WfQNnEFBMHvfeJy73Jp7K+g= -github.com/aws/aws-sdk-go-v2/service/s3 v1.111.0/go.mod h1:6ZFrmv/qIAYFmG+2WhA7mFU8+edldRlISwT+tNnyLuA= -github.com/aws/aws-sdk-go-v2/service/signin v1.9.0 h1:c3k+k/CS4L+sAIH6fxikL+g5g2LpeNczaoyjjw1iMKI= -github.com/aws/aws-sdk-go-v2/service/signin v1.9.0/go.mod h1:AGIoQg99fBrOIQnF78TLx4lj18mc4gZ0hJx1UaLIFM4= -github.com/aws/aws-sdk-go-v2/service/sso v1.37.0 h1:+rqBaOq7jzInjY8M12hr+zEe85JpRll9BjMx38r33Ok= -github.com/aws/aws-sdk-go-v2/service/sso v1.37.0/go.mod h1:XFlVwUsw3sYh8Hw37umYVJnrcWrwXWRxbNw/JY0bblw= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.42.0 h1:hzM3GslEAOBcLn3DHH6ENToFi+vXP+n02W+x6zejAIM= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.42.0/go.mod h1:588e7skMkYIYkSUseT8E3WKFfbAfrA1bj3Zf+qxJtJY= -github.com/aws/aws-sdk-go-v2/service/sts v1.49.0 h1:N7Ey8obY3uSui+cxl0OUzFlFmkxSucoJnrniFhw+cLc= -github.com/aws/aws-sdk-go-v2/service/sts v1.49.0/go.mod h1:zMBwjSf4Pt8a1OHYiZ5rPD0PJRK1kQrUaxhS/Dbld8E= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.3 h1:BHKCSX4QXERe8So8rbWqaM7owqOmDJxATXgJwGng22A= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.3/go.mod h1:GqWeeKfYfezihA2KfFL9l7ohEdZWe1tuFWh3GfyNSnE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.3 h1:bON1rJf67TSTDCKg816AAIE4xSTtoo9tl0XRkO72R+I= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.3/go.mod h1:c5BBpjJcQXpfeq9iASyVKA3T6vX6B6LEXY4mL/gklDY= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.3 h1:L8vIOxylma91TcR96NFTEC07G3JDwSl+CvK2b+IODms= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.3/go.mod h1:fmPIZQzTExYuBNWFyi1P7IoDjvskgphXqK1yObMzusM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.113.1 h1:cFHmwLxZPvtoAlo79MboURL2+7b0TMHycnrcf5VZNXk= +github.com/aws/aws-sdk-go-v2/service/s3 v1.113.1/go.mod h1:/uA+2Qj4jd5qBWagVC1AyzzDFXVK997E7U04w7Kw0wI= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.0 h1:ZD5qFpWcaOKdTuhBi431pIDkCgrMkMlMT6jlpSPoIRI= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.0/go.mod h1:8Nuuf+tR346PjJ3MvZPh9pekbLiLQFWJhzMXfwy7alA= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.0 h1:JGeeBcMlhg1xtOXYpeCaTQBZObtXMPQCUqBcmr65NRA= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.0/go.mod h1:XwteswG9EOMRFm73UT0t+MbTwyLxMrEXkU6e+v92Lzo= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.0 h1:obhahQXDEdVEv8y5bTKXR30LVaxYe1kyYM0L7l2Iq+k= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.0/go.mod h1:6twZZ/aXHNy1vXUO8koUbp++MYzMASkOgEBdkbJYmO0= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.0 h1:Zpnqa6XtrNzXZnwbdCqHOXpXhMsa01ql/pcRQ1sb4hk= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.0/go.mod h1:/8JRcdTt//hG0Q4BTmGbuOplT7ABe+5rdtqUHqXvYIM= github.com/aws/smithy-go v1.28.1 h1:R/nXH00c8qcfCzQVELtRw+eLQWtzv+VAIEFJ1/xxXlQ= github.com/aws/smithy-go v1.28.1/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= github.com/bmatcuk/doublestar v1.3.4 h1:gPypJ5xD31uhX6Tf54sDPUOBXTqKH4c9aPY66CyQrS0= @@ -86,22 +86,22 @@ github.com/cheggaaa/pb/v3 v3.2.1 h1:aprZbFRG+B7+ug76S8QZ6Y1PW168UHzOmbC3wa+aU6I= github.com/cheggaaa/pb/v3 v3.2.1/go.mod h1:U9hSVxoKqJrZIE3PkFG1xXXNaK/Ilzg+EF/scpXzEdw= github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= -github.com/cloudfoundry/bosh-agent/v2 v2.890.0 h1:JpJHVacPCX0FWtdDlTJLqiLdo/yxPGiFfbDhCPOejWA= -github.com/cloudfoundry/bosh-agent/v2 v2.890.0/go.mod h1:uFQXQywuBTChVJZ3C4AS1kVi2T6cjohmOIDBXZZec+E= -github.com/cloudfoundry/bosh-davcli v0.0.505 h1:e+5aS9/a1uhQ+9z1Pjz+Of7a85aOacZZa77/XkPSuF8= -github.com/cloudfoundry/bosh-davcli v0.0.505/go.mod h1:kP3j34YUFEJ5bNogEbv4i2jTzYQmRsUyLjjtQCjvzPg= -github.com/cloudfoundry/bosh-gcscli v0.0.413 h1:PjfHzCl2glwlc4i22yK+bMfQibn7c+AMsUj+hZqaiJw= -github.com/cloudfoundry/bosh-gcscli v0.0.413/go.mod h1:A9+6nndbVkzwESXwbHN4GvBjkg49L0lnAKeImf361xk= +github.com/cloudfoundry/bosh-agent/v2 v2.892.0 h1:oa9+5429hmscg8ENKKDqdL3kmDdkoSBD0iQ5G6+qNdg= +github.com/cloudfoundry/bosh-agent/v2 v2.892.0/go.mod h1:L1zKhlxHUwfI/FpU2+QltS/CkCNmIwKMzXZkPilAvHk= +github.com/cloudfoundry/bosh-davcli v0.0.510 h1:BWEkGIhBTqEGvdDEOmuN53Ro/y0u25fAYPpT+RsvPIo= +github.com/cloudfoundry/bosh-davcli v0.0.510/go.mod h1:DI8NMejSYzDxfOcEvfYen1dW5TVO3Q2jX/SwDY+JN5E= +github.com/cloudfoundry/bosh-gcscli v0.0.418 h1:8Oj3r62KJ9f8FoMBhBfcbt5bar8JxLd7kIpN6BTCPeo= +github.com/cloudfoundry/bosh-gcscli v0.0.418/go.mod h1:H6lvv1pv0e7Ig01VU7xmJcezSxSnM5ctOB6VZpIDHfA= github.com/cloudfoundry/bosh-s3cli v0.0.437 h1:2K0FhANMAbzcZNtXCyIER9bLKu/UZMr9J/8ZRR/TwXA= github.com/cloudfoundry/bosh-s3cli v0.0.437/go.mod h1:qRHCiSwhTzbNl9Ky2G9bkuTcjC2bJc3qr+Wgwcel61A= -github.com/cloudfoundry/bosh-utils v0.0.647 h1:PjM6wo2GfR9mBOuTAPLX9/0GwusipCALCtZG/fWZ8T4= -github.com/cloudfoundry/bosh-utils v0.0.647/go.mod h1:QoS546ZJpksB92qPoLZD72mkSuXKbmLP0FaRWVnH7Nk= +github.com/cloudfoundry/bosh-utils v0.0.652 h1:wOFi+G1qYj0klBW6cVVqRLtyq6ZevysnYUG8usAO3v4= +github.com/cloudfoundry/bosh-utils v0.0.652/go.mod h1:UlRrSWfGcKj7AJgrmmVd/n4d1QGfNFhrdjazAYJKzZo= github.com/cloudfoundry/config-server v0.1.287 h1:5oNsV7IazZg4Lfaj2rDtagV10QBo9OIyJUDiqZw0sg8= github.com/cloudfoundry/config-server v0.1.287/go.mod h1:4d3INx9KCtdBs1fGntcd8WrHCvqQQx1Wr7J6pqj1ux4= github.com/cloudfoundry/go-socks5 v0.0.0-20250423223041-4ad5fea42851 h1:oy59UYcspoP44ggE8DM3kjxl1+sTFd802bbZlBBhBMk= github.com/cloudfoundry/go-socks5 v0.0.0-20250423223041-4ad5fea42851/go.mod h1:72EEm1oq5oXqGfu9XGtaRPWEcAFYd/P10cMNln0QhA8= -github.com/cloudfoundry/socks5-proxy v0.2.187 h1:a16yyUfTFQd7ZKima9cAH9evLNNybxAAYuOkEpghg/A= -github.com/cloudfoundry/socks5-proxy v0.2.187/go.mod h1:+a+xMFksjPabJXOZcgYNOb8EAzb/P+bn1n6MCQS+1L4= +github.com/cloudfoundry/socks5-proxy v0.2.188 h1:EDZcnN6LlWaKuAcn2ydLB4eCZtv7waXM+qMthEEwFQs= +github.com/cloudfoundry/socks5-proxy v0.2.188/go.mod h1:f2gssQrrbrfdD5SrHSRREhtAqI60E215AaAJWktovRM= github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 h1:aBangftG7EVZoUb69Os8IaYg++6uMOdKK83QtkkvJik= github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2/go.mod h1:qwXFYgsP6T7XnJtbKlf1HP8AjxZZyzxMmc+Lq5GjlU4= github.com/cppforlife/go-patch v0.2.0 h1:Y14MnCQjDlbw7WXT4k+u6DPAA9XnygN4BfrSpI/19RU= @@ -152,18 +152,18 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc= github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= -github.com/google/pprof v0.0.0-20260903180319-d6c3cb2f37ec h1:ZhR4jlKRUmzPEPd2RLiJRUi25rUrdKBrhQNVIbqpTNE= -github.com/google/pprof v0.0.0-20260903180319-d6c3cb2f37ec/go.mod h1:jl5iWTm0/hd5PjEYEOuwAJ57L/CibdZfrqZ5XA5GrCk= +github.com/google/pprof v0.0.0-20260906184651-6331bc6350fe h1:QAinXoAFJdGQYztXn3VpFey7KCwpedbZ/EkzbplQ0cY= +github.com/google/pprof v0.0.0-20260906184651-6331bc6350fe/go.mod h1:jl5iWTm0/hd5PjEYEOuwAJ57L/CibdZfrqZ5XA5GrCk= github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.3.21 h1:OFdQ3tnCX/zaQ0Cedur3D3z7kI6HiLX9g3TiAN4/DFU= -github.com/googleapis/enterprise-certificate-proxy v0.3.21/go.mod h1:L3D/IQExI6LqEjBdXcZQ1WluSgigQmSwBboFstVPM4w= +github.com/googleapis/enterprise-certificate-proxy v0.3.22 h1:NU4XpII6jD+Dxcot94fqjE+AfJoE/lQP9q3faYGzC/c= +github.com/googleapis/enterprise-certificate-proxy v0.3.22/go.mod h1:L3D/IQExI6LqEjBdXcZQ1WluSgigQmSwBboFstVPM4w= github.com/googleapis/gax-go/v2 v2.24.1 h1:AtqTN21IXMMWo99LiEVAiBfNNQmO40d8xUfZI640mc0= github.com/googleapis/gax-go/v2 v2.24.1/go.mod h1:bWeBei0NVwaNZKb2y1HUBS7gLXIF3/Tu3pq7j8D2Tb0= -github.com/gopacket/gopacket v1.7.1 h1:1C7/wrJ5HyiEAYDtStJHQk4rV0ChpanZDV9+3Ov3gaM= -github.com/gopacket/gopacket v1.7.1/go.mod h1:QKowPlTLrQU2rqV5C5I14Aoaid3l8da3kbddibc/Wgk= +github.com/gopacket/gopacket v1.7.2 h1:ttSVNW9A3eUFaSd9+D95aD03Knk2j7KfajhN5twYSHo= +github.com/gopacket/gopacket v1.7.2/go.mod h1:QKowPlTLrQU2rqV5C5I14Aoaid3l8da3kbddibc/Wgk= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -189,10 +189,10 @@ github.com/mattn/go-colorable v0.1.15 h1:+u9SLTRGnXv73cEsnsmoZBom+dMU88B2M0aDcWy github.com/mattn/go-colorable v0.1.15/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI= github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A= -github.com/mattn/go-runewidth v0.0.29 h1:3oGF3R/S2N9DQ3ptftzVIvg2eicmojCzlwBEmqEPDfQ= -github.com/mattn/go-runewidth v0.0.29/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8= -github.com/maxbrunsfeld/counterfeiter/v6 v6.12.2 h1:V23nK2R2B63g2GhygF9zVGpnigmhvoZoH8d0hrZwMGY= -github.com/maxbrunsfeld/counterfeiter/v6 v6.12.2/go.mod h1:Mr897yU9FmyKaQDPtRlVKibrjz40XXyOHUfyZBPSyZU= +github.com/mattn/go-runewidth v0.0.30 h1:+KUuiDA4fF0R1p5FeueHefjDm+GIM+kWfFnDjybOPgk= +github.com/mattn/go-runewidth v0.0.30/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8= +github.com/maxbrunsfeld/counterfeiter/v6 v6.13.0 h1:ybB78iZ/Hkh76F6t+MbN+DP9WFNkLX+tB5JWOctzPyY= +github.com/maxbrunsfeld/counterfeiter/v6 v6.13.0/go.mod h1:pLuSACD770jzP/sacZMoGDxz34d5uiUpo+xdj/pYF/Y= github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3vE= github.com/mfridman/tparse v0.18.0/go.mod h1:gEvqZTuCgEhPbYk/2lS3Kcxg1GmTxxU7kTC8DvP0i/A= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= @@ -201,8 +201,8 @@ github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.32.1 h1:6tlvcDm/3sE8lGJbZ4+d4mO3RLy24/tQWOFzVSQNIfw= -github.com/onsi/ginkgo/v2 v2.32.1/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44= +github.com/onsi/ginkgo/v2 v2.32.2 h1:2o6vyFvR6snrJWgRVztC+OwuqqPEMI1UzYl2s2iU7Cg= +github.com/onsi/ginkgo/v2 v2.32.2/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44= github.com/onsi/gomega v1.43.0 h1:VlG/1FxqNxhSO+lq/OHBNaaqwiBK/mO8JbVkX9Y+FeU= github.com/onsi/gomega v1.43.0/go.mod h1:REff/hsDsodHoKlWsP2mAPhu1+5/6hVYNf9rIEBpeSg= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= @@ -227,8 +227,8 @@ github.com/square/certstrap v1.3.0 h1:N9P0ZRA+DjT8pq5fGDj0z3FjafRKnBDypP0QHpMlaA github.com/square/certstrap v1.3.0/go.mod h1:wGZo9eE1B7WX2GKBn0htJ+B3OuRl2UsdCFySNooy9hU= github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= -github.com/tedsuo/ifrit v0.0.0-20260813155221-94822c932811 h1:A4cmZWps1laLIFZa5XyyVU03A3pkYCDdN7vDQfB8RvM= -github.com/tedsuo/ifrit v0.0.0-20260813155221-94822c932811/go.mod h1:U4gRO4lEOLwO3h4CO9BE6c28VB74a5R+HjCwG7o1Mw0= +github.com/tedsuo/ifrit v0.0.0-20260908181113-dd353a7daa27 h1:gKDGsw+NqSByQPkCbwKfTiTNo+d3tsdjQjKUYVG3jAY= +github.com/tedsuo/ifrit v0.0.0-20260908181113-dd353a7daa27/go.mod h1:U4gRO4lEOLwO3h4CO9BE6c28VB74a5R+HjCwG7o1Mw0= github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= @@ -265,43 +265,43 @@ go.opentelemetry.io/otel/sdk/metric v1.46.0 h1:0piZ26EG4RBfebb2jhDH6ERCYHoVWduc3 go.opentelemetry.io/otel/sdk/metric v1.46.0/go.mod h1:I1PbKrdVc8Qu8HYVDNtqVIwLwjNrhsV/uFuxfwg8mO4= go.opentelemetry.io/otel/trace v1.46.0 h1:OULy7ccdJnZtJ0UDYFOIGaCmiWzJ8Vi2G/Rsu60qs1c= go.opentelemetry.io/otel/trace v1.46.0/go.mod h1:J7GAXweO77XSFkB/rmAqk9D6ihszhFjLU+d9WuUxDLI= -go.step.sm/crypto v0.77.9 h1:gC/z6/XBlLpq9suHQxbcDS32QSGggpisIZVJr65LDJk= -go.step.sm/crypto v0.77.9/go.mod h1:/5BzDlwYA7C1q6h9OIv0+oR8lbQvK+rTGeBmLLl7hIo= +go.step.sm/crypto v0.90.0 h1:ZEWK0Ly0RyEC2S2OP1+N/SRbTRU+sW7go0tttHgyXkw= +go.step.sm/crypto v0.90.0/go.mod h1:dgT4uZ4cClpjCi6HZZAmLomgn5tOfpHTqb34lTFN2PQ= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= -golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M= -golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis= -golang.org/x/mod v0.40.0 h1:hUv+3cXcdRHz08UmSiOob7sadHig73uo5bkXxQ/tvUs= -golang.org/x/mod v0.40.0/go.mod h1:0/weTWkPWGBikyTWAX3dkjVztMmBA5hM0DH6BElSupE= -golang.org/x/net v0.58.0 h1:ynWG7rqYi4ccpTEuPZ2QGWHktVEM9DMCj9yzDE0Q7To= -golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU= -golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= -golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= -golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= -golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= -golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= -golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/telemetry v0.0.0-20260814151720-d8c169486af1 h1:tw/dhR3C+0y5Y8sTyXtV5GzjFE9hWblSlUUjF6Xs+Ko= -golang.org/x/telemetry v0.0.0-20260814151720-d8c169486af1/go.mod h1:LVehoXe41cL5SCVQilsV7Gg6BNG+Js6P9PhSbYTIUkQ= -golang.org/x/term v0.45.0 h1:NwWyBmoJCbfTHpxrWoZ9C6/VxOf7ic219I8xZZFdrf0= -golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= -golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= -golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= -golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= -golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= -golang.org/x/tools v0.49.0 h1:3NI7VXzL9+1WZD52Dx2ttoPwD5DWrFGpl9mFZDlmisI= -golang.org/x/tools v0.49.0/go.mod h1:SJNXV9DBKT0UbdttsQjbfJlAE/q+y36++zo3uL3N0Oo= +golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M= +golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA= +golang.org/x/mod v0.41.0 h1:qJmnOUb4YB+FsEuM3HcWucdZASCPGhsX6uljO6pog0c= +golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o= +golang.org/x/net v0.59.0 h1:5zfYln+w5XCxwrnMMJPufRgNoXEaGxl0wo5GqPXyues= +golang.org/x/net v0.59.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/oauth2 v0.37.0 h1:JUlcxA8oAtauLfiH8FX2/FkAWHAdi0QtGCGc+hofE98= +golang.org/x/oauth2 v0.37.0/go.mod h1:IxwZNxUULJmpBFf9K/9NTMSIfZZuvuTy1gGxhigP/58= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/telemetry v0.0.0-20260910141331-15ceca2b0a1f h1:5LLXkapW8RSq5f6l0ztG82Xt1OYp5uRIyMHuZVmkm4k= +golang.org/x/telemetry v0.0.0-20260910141331-15ceca2b0a1f/go.mod h1:i+ivNqjDnTF3WTElsdk5g9V5DTSBYgdNo7xTU9SDwYA= +golang.org/x/term v0.46.0 h1:3+OXuTbaKDgwk8jTi3aSLHRlmWqHEUDUtxnbFigO4YE= +golang.org/x/term v0.46.0/go.mod h1:+K02xbkittuwc0Am4abfA3Fc+XRGXkvBXNO88NCXPoc= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +golang.org/x/time v0.16.0 h1:vMb6ptszcQMkcwiRTAuNNU50gom6++Q/6gY2hDM6VDE= +golang.org/x/time v0.16.0/go.mod h1:rVKOqvZeKvrDKTQiAHJ7wmwP0RzleSphoEA9RcdLA0s= +golang.org/x/tools v0.50.0 h1:c2ifzfcuY7L90lZ2aKd8S4K2NpASF08SZx9ZuJkHmSU= +golang.org/x/tools v0.50.0/go.mod h1:7ulVMw3831Mwi5EZD6RomGyffr4VFjuNYXf2BbCEAV0= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= -google.golang.org/api v0.296.0 h1:Nn5EHeKdGx70MFClaV/II0gsWUm6xhEjb0xYLylVvaA= -google.golang.org/api v0.296.0/go.mod h1:02qB8+Ox1ZFzcaKFMguy1nQLJmSIyvV6Ff4txJEXtl4= -google.golang.org/genproto v0.0.0-20260904194346-d0f1323225a4 h1:6QRNo34FxJcE1LG6XfnmaQ17m6w21oXaKlKoBaF+UqE= -google.golang.org/genproto v0.0.0-20260904194346-d0f1323225a4/go.mod h1:eifJ91nefXnfP/bMkZsACVGm14ZtEL4eUXRLTryfbY4= -google.golang.org/genproto/googleapis/api v0.0.0-20260904194346-d0f1323225a4 h1:NCe/UiklGd/9xjT+ROBVhJ1kf6TRQaFedsR+z7u1gvo= -google.golang.org/genproto/googleapis/api v0.0.0-20260904194346-d0f1323225a4/go.mod h1:fJ2lYaWjqNknJyQBOCd0fA3HnEElJqGplH71a2txi+g= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260904194346-d0f1323225a4 h1:5t+ZydAFj5kGVLrgCvLmpmCf9ylGRd64hpEronfRaws= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260904194346-d0f1323225a4/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= +google.golang.org/api v0.298.0 h1:YW18RkHBMZBA1ergX0m4biagzgbiPTb2uTsRsDPWNRY= +google.golang.org/api v0.298.0/go.mod h1:02qB8+Ox1ZFzcaKFMguy1nQLJmSIyvV6Ff4txJEXtl4= +google.golang.org/genproto v0.0.0-20260911204522-f61a6ca850bd h1:s/EXdxMDrmT++u0VepJKO4U6dzOPJVRdHKmrazC1Qxg= +google.golang.org/genproto v0.0.0-20260911204522-f61a6ca850bd/go.mod h1:JfZ1Hyx5mAJgX/ip0vEicmPvzE6rIrbacB7rHMfjD7Q= +google.golang.org/genproto/googleapis/api v0.0.0-20260911204522-f61a6ca850bd h1:jgCQeWccunvocKNK2RjhQHNiSjSeMMuBpQ/5pbP+2lA= +google.golang.org/genproto/googleapis/api v0.0.0-20260911204522-f61a6ca850bd/go.mod h1:r4KD2hOq82JBWpTWkJ9NZLf6EwmRvAPIFmk7hPNtd+0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260911204522-f61a6ca850bd h1:29LZPNIJg+GEmJwZXruJJRwqy/wnWAYZXDtROToV/aQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260911204522-f61a6ca850bd/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= diff --git a/installation/blobextract/extractor_test.go b/installation/blobextract/extractor_test.go index 6ded71b4c3..c3eae2c5ad 100644 --- a/installation/blobextract/extractor_test.go +++ b/installation/blobextract/extractor_test.go @@ -4,7 +4,7 @@ import ( "errors" "os" - fakeblobstore "github.com/cloudfoundry/bosh-utils/blobstore/fakes" + fakeblobstore "github.com/cloudfoundry/bosh-utils/blobstore/blobstorefakes" boshcrypto "github.com/cloudfoundry/bosh-utils/crypto" fakecmd "github.com/cloudfoundry/bosh-utils/fileutil/fakes" boshlog "github.com/cloudfoundry/bosh-utils/logger" diff --git a/installation/job_renderer_test.go b/installation/job_renderer_test.go index fdb4790823..31a8cc3418 100644 --- a/installation/job_renderer_test.go +++ b/installation/job_renderer_test.go @@ -1,7 +1,7 @@ package installation_test import ( - fakeboshblob "github.com/cloudfoundry/bosh-utils/blobstore/fakes" + fakeboshblob "github.com/cloudfoundry/bosh-utils/blobstore/blobstorefakes" boshcrypto "github.com/cloudfoundry/bosh-utils/crypto" fakeboshcmd "github.com/cloudfoundry/bosh-utils/fileutil/fakes" boshlog "github.com/cloudfoundry/bosh-utils/logger" diff --git a/installation/pkg/compiler_test.go b/installation/pkg/compiler_test.go index d6fb6103b2..39b8c0a9f5 100644 --- a/installation/pkg/compiler_test.go +++ b/installation/pkg/compiler_test.go @@ -5,7 +5,7 @@ import ( "fmt" "path/filepath" - fakeblobstore "github.com/cloudfoundry/bosh-utils/blobstore/fakes" + fakeblobstore "github.com/cloudfoundry/bosh-utils/blobstore/blobstorefakes" boshcrypto "github.com/cloudfoundry/bosh-utils/crypto" fakecmd "github.com/cloudfoundry/bosh-utils/fileutil/fakes" boshlog "github.com/cloudfoundry/bosh-utils/logger" diff --git a/main.go b/main.go index 7f638764cb..a93e7d1294 100644 --- a/main.go +++ b/main.go @@ -137,7 +137,7 @@ func handlePanic() { func fail(err error, ui boshui.UI, logger boshlog.Logger) { if err != nil { logger.Error("CLI", err.Error()) - ui.ErrorLinef(boshuifmt.MultilineError(err)) + ui.ErrorLinef("%s", boshuifmt.MultilineError(err)) } ui.ErrorLinef("Exit code 1") ui.Flush() // todo make sure UI is flushed diff --git a/releasedir/index/fs_index_blobs_test.go b/releasedir/index/fs_index_blobs_test.go index 13b1fb2590..16fe16d5d5 100644 --- a/releasedir/index/fs_index_blobs_test.go +++ b/releasedir/index/fs_index_blobs_test.go @@ -6,7 +6,7 @@ import ( "path/filepath" "syscall" - fakeblob "github.com/cloudfoundry/bosh-utils/blobstore/fakes" + fakeblob "github.com/cloudfoundry/bosh-utils/blobstore/blobstorefakes" fakesys "github.com/cloudfoundry/bosh-utils/system/fakes" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" diff --git a/uaa/factory_config_test.go b/uaa/factory_config_test.go index b79475adf5..e17f43b3b0 100644 --- a/uaa/factory_config_test.go +++ b/uaa/factory_config_test.go @@ -65,7 +65,7 @@ var _ = Describe("NewConfigFromURL", func() { It("returns error if port cannot be extracted", func() { _, err := NewConfigFromURL("https://host::") Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(ContainSubstring("Extracting host/port from URL")) + Expect(err.Error()).To(ContainSubstring("invalid port")) }) It("returns error if port is empty", func() { @@ -77,7 +77,7 @@ var _ = Describe("NewConfigFromURL", func() { It("returns error if port cannot be parsed as int", func() { _, err := NewConfigFromURL("https://host:abc") Expect(err).To(HaveOccurred()) - Expect(err.Error()).To(MatchRegexp("(Extracting port from URL|Parsing UAA URL)")) // go1.12 validates port in Parse + Expect(err.Error()).To(ContainSubstring("Parsing UAA URL")) }) }) @@ -94,7 +94,7 @@ var _ = Describe("FactoryConfig", func() { Expect(err.Error()).To(Equal("Missing 'Host'")) }) - It("returns error if host is empty", func() { + It("returns error if port is empty", func() { err := Config{Host: "host"}.Validate() Expect(err).To(HaveOccurred()) Expect(err.Error()).To(Equal("Missing 'Port'")) diff --git a/vendor/cloud.google.com/go/storage/CHANGES.md b/vendor/cloud.google.com/go/storage/CHANGES.md index bada737eb2..9571abb716 100644 --- a/vendor/cloud.google.com/go/storage/CHANGES.md +++ b/vendor/cloud.google.com/go/storage/CHANGES.md @@ -1,6 +1,13 @@ # Changes +## [1.67.1](https://github.com/googleapis/google-cloud-go/compare/storage/v1.67.0...storage/v1.67.1) (2026-09-07) + + +### Bug Fixes + +* **storage:** Prevent panic when MultiRangeDownloader callback is nil ([#20377](https://github.com/googleapis/google-cloud-go/issues/20377)) ([a85e955](https://github.com/googleapis/google-cloud-go/commit/a85e955cacb0e4c9dd05165b8b3c02049e9e3a47)) + ## [1.67.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.66.0...storage/v1.67.0) (2026-09-03) diff --git a/vendor/cloud.google.com/go/storage/grpc_reader_multi_range.go b/vendor/cloud.google.com/go/storage/grpc_reader_multi_range.go index fa8d13c657..7dc5bc5f55 100644 --- a/vendor/cloud.google.com/go/storage/grpc_reader_multi_range.go +++ b/vendor/cloud.google.com/go/storage/grpc_reader_multi_range.go @@ -519,6 +519,9 @@ func (m *multiRangeDownloaderManager) getSpanCtx() context.Context { } func (m *multiRangeDownloaderManager) runCallback(origOffset, numBytes int64, err error, cb func(int64, int64, error)) { + if cb == nil { + return + } m.callbackWg.Add(1) go func() { defer m.callbackWg.Done() diff --git a/vendor/cloud.google.com/go/storage/internal/version.go b/vendor/cloud.google.com/go/storage/internal/version.go index 1293b4f85a..a8f8994d6b 100644 --- a/vendor/cloud.google.com/go/storage/internal/version.go +++ b/vendor/cloud.google.com/go/storage/internal/version.go @@ -17,4 +17,4 @@ package internal // Version is the current tagged release of the library. -const Version = "1.67.0" +const Version = "1.67.1" diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/README.md b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/README.md index 9515ee5205..b09b427fe3 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/README.md +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/README.md @@ -1,3 +1,6 @@ -# GCP Resource detection library +# GCP Resource detection library (DEPRECATED) + +> [!WARNING] +> This package is deprecated and will no longer be maintained. Please use upstream [`go.opentelemetry.io/contrib/detectors/gcp`](https://pkg.go.dev/go.opentelemetry.io/contrib/detectors/gcp) instead. This is a library intended to be used by Upstream OpenTelemetry resource detectors. It exists within this repository to allow for integration testing of the detection functions in real GCP environments. diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/app_engine.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/app_engine.go index 9ce7d96fe4..de49dd0a8c 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/app_engine.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/app_engine.go @@ -38,6 +38,8 @@ func (d *Detector) onAppEngine() bool { } // AppEngineServiceName returns the service name of the app engine service. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) AppEngineServiceName() (string, error) { if name, found := d.os.LookupEnv(gaeServiceEnv); found { return name, nil @@ -46,6 +48,8 @@ func (d *Detector) AppEngineServiceName() (string, error) { } // AppEngineServiceVersion returns the service version of the app engine service. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) AppEngineServiceVersion() (string, error) { if version, found := d.os.LookupEnv(gaeVersionEnv); found { return version, nil @@ -54,6 +58,8 @@ func (d *Detector) AppEngineServiceVersion() (string, error) { } // AppEngineServiceInstance returns the service instance of the app engine service. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) AppEngineServiceInstance() (string, error) { if instanceID, found := d.os.LookupEnv(gaeInstanceEnv); found { return instanceID, nil @@ -62,17 +68,23 @@ func (d *Detector) AppEngineServiceInstance() (string, error) { } // AppEngineFlexAvailabilityZoneAndRegion returns the zone and region in which this program is running. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) AppEngineFlexAvailabilityZoneAndRegion() (string, string, error) { // The GCE metadata server is available on App Engine Flex. return d.GCEAvailabilityZoneAndRegion() } // AppEngineStandardAvailabilityZone returns the zone the app engine service is running in. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) AppEngineStandardAvailabilityZone() (string, error) { return d.metadata.ZoneWithContext(context.TODO()) } // AppEngineStandardCloudRegion returns the region the app engine service is running in. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) AppEngineStandardCloudRegion() (string, error) { return d.FaaSCloudRegion() } diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/bms.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/bms.go index d3992a4f7e..742049ce78 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/bms.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/bms.go @@ -31,6 +31,8 @@ func (d *Detector) onBareMetalSolution() bool { } // BareMetalSolutionInstanceID returns the instance ID from the BMS_INSTANCE_ID environment variable. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) BareMetalSolutionInstanceID() (string, error) { if instanceID, found := d.os.LookupEnv(bmsInstanceIDEnv); found { return instanceID, nil @@ -39,6 +41,8 @@ func (d *Detector) BareMetalSolutionInstanceID() (string, error) { } // BareMetalSolutionCloudRegion returns the region from the BMS_REGION environment variable. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) BareMetalSolutionCloudRegion() (string, error) { if region, found := d.os.LookupEnv(bmsRegionEnv); found { return region, nil @@ -47,6 +51,8 @@ func (d *Detector) BareMetalSolutionCloudRegion() (string, error) { } // BareMetalSolutionProjectID returns the project ID from the BMS_PROJECT_ID environment variable. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) BareMetalSolutionProjectID() (string, error) { if project, found := d.os.LookupEnv(bmsProjectIDEnv); found { return project, nil diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/detector.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/detector.go index e27a49a297..41ca02d9cf 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/detector.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/detector.go @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Package gcp provides functions for detecting the GCP platform and resources. +// +// Deprecated: This package is deprecated and will no longer be maintained. +// Use [go.opentelemetry.io/contrib/detectors/gcp] instead. package gcp import ( @@ -28,12 +32,18 @@ var errEnvVarNotFound = errors.New("environment variable not found") // NewDetector returns a *Detector which can get detect the platform, // and fetch attributes of the platform on which it is running. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func NewDetector() *Detector { return &Detector{metadata: metadata.NewClient(nil), os: realOSProvider{}} } +// Platform represents a Google Cloud platform type. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. type Platform int64 +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. const ( UnknownPlatform Platform = iota GKE @@ -48,6 +58,8 @@ const ( ) // CloudPlatform returns the platform on which this program is running. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) CloudPlatform() Platform { switch { case d.onBareMetalSolution(): @@ -73,6 +85,8 @@ func (d *Detector) CloudPlatform() Platform { } // ProjectID returns the ID of the project in which this program is running. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) ProjectID() (string, error) { // N.B. d.metadata.ProjectIDWithContext(context.TODO()) is cached globally, so if we use it here it's untestable. s, err := d.metadata.GetWithContext(context.TODO(), "project/project-id") @@ -87,6 +101,8 @@ func (d *Detector) instanceID() (string, error) { } // Detector collects resource information for all GCP platforms. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. type Detector struct { metadata *metadata.Client os osProvider diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/faas.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/faas.go index 49f8818999..76186bef6d 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/faas.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/faas.go @@ -64,6 +64,8 @@ func (d *Detector) onCloudRunWorkerPool() bool { } // FaaSName returns the name of the Cloud Run, Cloud Run jobs or Cloud Functions service. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) FaaSName() (string, error) { if name, found := d.os.LookupEnv(faasServiceEnv); found { return name, nil @@ -78,6 +80,8 @@ func (d *Detector) FaaSName() (string, error) { } // FaaSVersion returns the revision of the Cloud Run or Cloud Functions service. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) FaaSVersion() (string, error) { if version, found := d.os.LookupEnv(cloudRunRevisionEnv); found { return version, nil @@ -89,6 +93,8 @@ func (d *Detector) FaaSVersion() (string, error) { } // CloudRunJobExecution returns the execution id of the Cloud Run jobs. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) CloudRunJobExecution() (string, error) { if eid, found := d.os.LookupEnv(cloudRunJobExecutionEnv); found { return eid, nil @@ -97,6 +103,8 @@ func (d *Detector) CloudRunJobExecution() (string, error) { } // CloudRunJobTaskIndex returns the task index for the execution of the Cloud Run jobs. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) CloudRunJobTaskIndex() (string, error) { if tidx, found := d.os.LookupEnv(cloudRunJobTaskIndexEnv); found { return tidx, nil @@ -105,6 +113,8 @@ func (d *Detector) CloudRunJobTaskIndex() (string, error) { } // FaaSID returns the instance id of the Cloud Run or Cloud Function. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) FaaSID() (string, error) { return d.instanceID() } @@ -113,6 +123,8 @@ func (d *Detector) FaaSID() (string, error) { // It is in the format /projects//regions/. // // https://cloud.google.com/run/docs/reference/container-contract#metadata-server +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) FaaSCloudRegion() (string, error) { region, err := d.metadata.GetWithContext(context.TODO(), regionMetadataAttr) if err != nil { diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/gce.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/gce.go index 794cfdf036..d4483ca4d8 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/gce.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/gce.go @@ -36,11 +36,15 @@ func (d *Detector) onGCE() bool { } // GCEHostType returns the machine type of the instance on which this program is running. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) GCEHostType() (string, error) { return d.metadata.GetWithContext(context.TODO(), machineTypeMetadataAttr) } // GCEHostID returns the instance ID of the instance on which this program is running. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) GCEHostID() (string, error) { return d.instanceID() } @@ -48,6 +52,8 @@ func (d *Detector) GCEHostID() (string, error) { // GCEHostName returns the instance name of the instance on which this program is running. // Recommended to use GCEInstanceName() or GCEInstanceHostname() to more accurately reflect which // value is returned. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) GCEHostName() (string, error) { return d.metadata.InstanceNameWithContext(context.TODO()) } @@ -55,17 +61,23 @@ func (d *Detector) GCEHostName() (string, error) { // GCEInstanceName returns the instance name of the instance on which this program is running. // This is the value visible in the Cloud Console UI, and the prefix for the default hostname // of the instance as defined by the default internal DNS name (see https://cloud.google.com/compute/docs/internal-dns#instance-fully-qualified-domain-names). +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) GCEInstanceName() (string, error) { return d.metadata.InstanceNameWithContext(context.TODO()) } // GCEInstanceHostname returns the full value of the default or custom hostname of the instance // on which this program is running. See https://cloud.google.com/compute/docs/instances/custom-hostname-vm. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) GCEInstanceHostname() (string, error) { return d.metadata.HostnameWithContext(context.TODO()) } // GCEAvailabilityZoneAndRegion returns the zone and region in which this program is running. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) GCEAvailabilityZoneAndRegion() (string, string, error) { zone, err := d.metadata.ZoneWithContext(context.TODO()) if err != nil { @@ -81,6 +93,9 @@ func (d *Detector) GCEAvailabilityZoneAndRegion() (string, string, error) { return zone, strings.Join(splitZone[0:2], "-"), nil } +// ManagedInstanceGroup describes a Google Compute Engine Managed Instance Group. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. type ManagedInstanceGroup struct { Name string Location string @@ -89,6 +104,9 @@ type ManagedInstanceGroup struct { var createdByMIGRE = regexp.MustCompile(`^projects/[^/]+/(zones|regions)/([^/]+)/instanceGroupManagers/([^/]+)$`) +// GCEManagedInstanceGroup returns the managed instance group that created this VM, if any. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) GCEManagedInstanceGroup() (ManagedInstanceGroup, error) { createdBy, err := d.metadata.InstanceAttributeValueWithContext(context.TODO(), createdByInstanceAttr) if _, ok := err.(metadata.NotDefinedError); ok { diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/gke.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/gke.go index 3ad577dfd9..1deb9b8cfb 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/gke.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp/gke.go @@ -51,16 +51,22 @@ func (d *Detector) onGKE() bool { } // GKEHostID returns the instance ID of the instance on which this program is running. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) GKEHostID() (string, error) { return d.GCEHostID() } // GKEClusterName returns the name if the GKE cluster in which this program is running. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) GKEClusterName() (string, error) { return d.metadata.InstanceAttributeValueWithContext(context.TODO(), clusterNameMetadataAttr) } // GKEHostType returns the machine type of the instance on which this program is running. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) GKEHostType() (string, error) { ctx := context.TODO() projectID, err := d.ProjectID() @@ -137,8 +143,12 @@ func lastPathSegment(s string) string { return s } +// LocationType represents the location type (Zone or Region). +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. type LocationType int64 +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. const ( UndefinedLocation LocationType = iota Zone @@ -146,6 +156,8 @@ const ( ) // GKEAvailabilityZoneOrRegion returns the location of the cluster and whether the cluster is zonal or regional. +// +// Deprecated: Use [go.opentelemetry.io/contrib/detectors/gcp] instead. func (d *Detector) GKEAvailabilityZoneOrRegion() (string, LocationType, error) { clusterLocation, err := d.metadata.InstanceAttributeValueWithContext(context.TODO(), clusterLocationMetadataAttr) if err != nil { diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/README.md b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/README.md index ea391705f2..cf6615acf8 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/README.md +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/README.md @@ -1,5 +1,9 @@ # OpenTelemetry Google Cloud Monitoring Exporter +> [!WARNING] +> The OpenTelemetry Google Cloud Monitoring exporter for Go is deprecated and will be archived after January 1st, 2027. +> Please migrate to the standard OpenTelemetry OTLP exporters. For migration instructions, see the [Migration Guide](../../MIGRATION.md). + [![Docs](https://godoc.org/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric?status.svg)](https://pkg.go.dev/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric) [![Apache License][license-image]][license-url] diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/cloudmonitoring.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/cloudmonitoring.go index 90dfcb344e..360a3a2b17 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/cloudmonitoring.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/cloudmonitoring.go @@ -12,12 +12,19 @@ // See the License for the specific language governing permissions and // limitations under the License. +// Package metric provides an OpenTelemetry metric exporter for Google Cloud Monitoring. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated and will be archived after January 1st, 2027. +// Please migrate to the OpenTelemetry OTLP exporters. For migration details, see +// https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/main/MIGRATION.md package metric import ( "context" "errors" "fmt" + "log" + "sync" sdkmetric "go.opentelemetry.io/otel/sdk/metric" @@ -25,8 +32,21 @@ import ( "golang.org/x/oauth2/google" ) +var logDeprecatedOnce sync.Once + +func logDeprecated() { + logDeprecatedOnce.Do(func() { + log.Println("Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated and will be archived after January 1st, 2027. Please migrate to the OpenTelemetry OTLP exporters. For migration details, see https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/main/MIGRATION.md") + }) +} + // New creates a new Exporter thats implements metric.Exporter. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated and will be archived after January 1st, 2027. +// Please migrate to the OpenTelemetry OTLP exporters. For migration details, see +// https://github.com/GoogleCloudPlatform/opentelemetry-operations-go/blob/main/MIGRATION.md func New(opts ...Option) (sdkmetric.Exporter, error) { + logDeprecated() o := options{ context: context.Background(), resourceAttributeFilter: DefaultResourceAttributesFilter, diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go index c4e01cbf1f..a046fdb41d 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go @@ -31,12 +31,16 @@ var userAgent = fmt.Sprintf("opentelemetry-go %s; google-cloud-metric-exporter % // MonitoredResourceDescription is the struct which holds information required to map OTel resource to specific // Google Cloud MonitoredResource. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. type MonitoredResourceDescription struct { mrLabels map[string]struct{} mrType string } // Option is function type that is passed to the exporter initialization function. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. type Option func(*options) // options is the struct to hold options for metricExporter and its client instance. @@ -98,6 +102,8 @@ type options struct { // from the default credential detection process. // Please find the detailed order of the default credential detection process on the doc: // https://godoc.org/golang.org/x/oauth2/google#FindDefaultCredentials +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. func WithProjectID(id string) func(o *options) { return func(o *options) { o.projectID = id @@ -106,6 +112,8 @@ func WithProjectID(id string) func(o *options) { // WithDestinationProjectQuota enables per-request usage of the destination // project's quota. For example, when setting gcp.project.id on a metric. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. func WithDestinationProjectQuota() func(o *options) { return func(o *options) { o.destinationProjectQuota = true @@ -116,6 +124,8 @@ func WithDestinationProjectQuota() func(o *options) { // metrics to Cloud Monitoring. This option is mutually exclusive with // WithMonitoringClientOptions. If both options are provided, // WithMonitoringClient is used and WithMonitoringClientOptions is ignored. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. func WithMonitoringClient(cl *monitoring.MetricClient) func(o *options) { return func(o *options) { o.monitoringClient = cl @@ -124,6 +134,8 @@ func WithMonitoringClient(cl *monitoring.MetricClient) func(o *options) { // WithMonitoringClientOptions add the options for Cloud Monitoring client instance. // Available options are defined in. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. func WithMonitoringClientOptions(opts ...apioption.ClientOption) func(o *options) { return func(o *options) { o.monitoringClientOptions = append(o.monitoringClientOptions, opts...) @@ -134,6 +146,8 @@ func WithMonitoringClientOptions(opts ...apioption.ClientOption) func(o *options // Note that the format has to follow the convention defined in the official document. // The default is "workload.googleapis.com/[metric name]". // ref. https://cloud.google.com/monitoring/custom-metrics/creating-metrics#custom_metric_names +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. func WithMetricDescriptorTypeFormatter(f func(metricdata.Metrics) string) func(o *options) { return func(o *options) { o.metricDescriptorTypeFormatter = f @@ -146,6 +160,8 @@ func WithMetricDescriptorTypeFormatter(f func(metricdata.Metrics) string) func(o // writing duplicate timeseries against the same monitored resource. Use // WithFilteredResourceAttributes(NoAttributes()) to disable the addition of // resource attributes to metric labels. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. func WithFilteredResourceAttributes(filter attribute.Filter) func(o *options) { return func(o *options) { o.resourceAttributeFilter = filter @@ -154,6 +170,8 @@ func WithFilteredResourceAttributes(filter attribute.Filter) func(o *options) { // DefaultResourceAttributesFilter is the default filter applied to resource // attributes. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. func DefaultResourceAttributesFilter(kv attribute.KeyValue) bool { return (kv.Key == semconv.ServiceNameKey || kv.Key == semconv.ServiceNamespaceKey || @@ -162,12 +180,16 @@ func DefaultResourceAttributesFilter(kv attribute.KeyValue) bool { // NoAttributes can be passed to WithFilteredResourceAttributes to disable // adding resource attributes as metric labels. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. func NoAttributes(attribute.KeyValue) bool { return false } // WithDisableCreateMetricDescriptors will disable the automatic creation of // MetricDescriptors when an unknown metric is set to be exported. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. func WithDisableCreateMetricDescriptors() func(o *options) { return func(o *options) { o.disableCreateMetricDescriptors = true @@ -175,6 +197,8 @@ func WithDisableCreateMetricDescriptors() func(o *options) { } // WithCompression sets the compression to use for gRPC requests. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. func WithCompression(c string) func(o *options) { return func(o *options) { o.compression = c @@ -183,6 +207,8 @@ func WithCompression(c string) func(o *options) { // WithSumOfSquaredDeviation sets the SumOfSquaredDeviation field on histograms. // It is an estimate, and is not the actual sum of squared deviations. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. func WithSumOfSquaredDeviation() func(o *options) { return func(o *options) { o.enableSumOfSquaredDeviation = true @@ -191,6 +217,8 @@ func WithSumOfSquaredDeviation() func(o *options) { // WithCreateServiceTimeSeries configures the exporter to use `CreateServiceTimeSeries` for creating timeseries. // If this is used, metric descriptors are not exported. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. func WithCreateServiceTimeSeries() func(o *options) { return func(o *options) { o.createServiceTimeSeries = true @@ -201,6 +229,8 @@ func WithCreateServiceTimeSeries() func(o *options) { // WithMonitoredResourceDescription configures the exporter to attempt to map the OpenTelemetry Resource to the provided // Google MonitoredResource. The provided mrLabels would be searched for in the OpenTelemetry Resource Attributes and if // found, would be included in the MonitoredResource labels. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. func WithMonitoredResourceDescription(mrType string, mrLabels []string) func(o *options) { return func(o *options) { mrLabelSet := make(map[string]struct{}) @@ -216,6 +246,8 @@ func WithMonitoredResourceDescription(mrType string, mrLabels []string) func(o * // WithContext allows callers to provide a context to create clients and fetch // application default credentials with. +// +// Deprecated: Google Cloud OpenTelemetry Monitoring exporter for Go is deprecated. Use standard OpenTelemetry OTLP exporters instead. func WithContext(ctx context.Context) func(o *options) { return func(o *options) { o.context = ctx diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/version.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/version.go index fb8b673961..e726528c32 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/version.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/version.go @@ -17,5 +17,5 @@ package metric // Version is the current release version of the OpenTelemetry // Operations Metric Exporter in use. func Version() string { - return "0.60.0" + return "0.62.0" } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go index 03a9b840d5..cd8dfbc25d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go @@ -3,4 +3,4 @@ package aws // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.46.0" +const goModuleVersion = "1.47.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go index bb31852c15..3b7e08b91e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/middleware.go @@ -229,6 +229,11 @@ func (r *Attempt) handleAttempt( service, operation, attemptNum) } + // Not an error for other transports: they have no header to set. + if req, ok := in.Request.(*http.Request); ok { + setRetryMetricsHeader(ctx, req) + } + var metadata smithymiddle.Metadata out, metadata, err = next.HandleFinalize(ctx, in) attemptResult.ResponseMetadata = metadata @@ -389,14 +394,22 @@ func absDuration(d time.Duration) time.Duration { } // MetricsHeader attaches SDK request metric header for retries to the transport +// +// Deprecated: AWS service clients no longer use this middleware. The +// Amz-Sdk-Request header is set by the Attempt middleware, which already holds +// the retry metadata the header describes. type MetricsHeader struct{} // ID returns the middleware identifier +// +// Deprecated: MetricsHeader is deprecated. func (r *MetricsHeader) ID() string { return "RetryMetricsHeader" } // HandleFinalize attaches the SDK request metric header to the transport layer +// +// Deprecated: MetricsHeader is deprecated. func (r MetricsHeader) HandleFinalize(ctx context.Context, in smithymiddle.FinalizeInput, next smithymiddle.FinalizeHandler) ( out smithymiddle.FinalizeOutput, metadata smithymiddle.Metadata, err error, ) { @@ -432,6 +445,34 @@ func (r MetricsHeader) HandleFinalize(ctx context.Context, in smithymiddle.Final return next.HandleFinalize(ctx, in) } +// setRetryMetricsHeader sets the Amz-Sdk-Request header from the retry metadata +// on the context. +func setRetryMetricsHeader(ctx context.Context, req *http.Request) { + retryMetadata, _ := getRetryMetadata(ctx) + + const retryMetricHeader = "Amz-Sdk-Request" + var parts []string + + parts = append(parts, "attempt="+strconv.Itoa(retryMetadata.AttemptNum)) + if retryMetadata.MaxAttempts != 0 { + parts = append(parts, "max="+strconv.Itoa(retryMetadata.MaxAttempts)) + } + + var ttl time.Time + if deadline, ok := ctx.Deadline(); ok { + ttl = deadline + } + + // Only append the TTL if it can be determined. + if !ttl.IsZero() && retryMetadata.AttemptClockSkew > 0 { + const unixTimeFormat = "20060102T150405Z" + ttl = ttl.Add(retryMetadata.AttemptClockSkew) + parts = append(parts, "ttl="+ttl.Format(unixTimeFormat)) + } + + req.Header[retryMetricHeader] = append(req.Header[retryMetricHeader][:0], strings.Join(parts, "; ")) +} + type retryMetadataKey struct{} // getRetryMetadata retrieves retryMetadata from the context and a bool @@ -474,9 +515,6 @@ func AddRetryMiddlewares(stack *smithymiddle.Stack, options AddRetryMiddlewaresO return err } - if err := stack.Finalize.Insert(&MetricsHeader{}, attempt.ID(), smithymiddle.After); err != nil { - return err - } return nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md index 2086afb4d2..458784b8a7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md @@ -1,3 +1,11 @@ +# v1.33.5 (2026-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.33.4 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.33.3 (2026-09-04) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go index 621beebafc..d6e6157928 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go @@ -3,4 +3,4 @@ package config // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.33.3" +const goModuleVersion = "1.33.5" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md index eea2e90ee3..308201cf7a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md @@ -1,3 +1,11 @@ +# v1.20.5 (2026-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.4 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.20.3 (2026-09-04) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go index 396f3430c4..5557c02bc7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go @@ -3,4 +3,4 @@ package credentials // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.20.3" +const goModuleVersion = "1.20.5" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md index fca92b7ee6..9e560547bf 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md @@ -1,3 +1,8 @@ +# v1.20.0 (2026-09-09) + +* **Feature**: Stop registering the `retry.MetricsHeader` middleware in generated clients. The `Amz-Sdk-Request` header is now set by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.19.2 (2026-09-04) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go index 56f66817e5..c53f4079b9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go @@ -3,4 +3,4 @@ package imds // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.19.2" +const goModuleVersion = "1.20.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md index 24fe7281a2..14715ef49c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/CHANGELOG.md @@ -1,3 +1,19 @@ +# v1.23.7 (2026-09-14) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.6 (2026-09-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.5 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.4 (2026-09-08) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.23.3 (2026-09-04) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go index 33abd9feaf..c8f531d1d2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/s3/manager/go_module_metadata.go @@ -3,4 +3,4 @@ package manager // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.23.3" +const goModuleVersion = "1.23.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md index 4451fcee86..613d88e02e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.5.3 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.5.2 (2026-09-04) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go index 02bef26b41..7f07b47820 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go @@ -3,4 +3,4 @@ package configsources // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.5.2" +const goModuleVersion = "1.5.3" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md index 3049b99406..446a0cc85a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md @@ -1,3 +1,7 @@ +# v2.8.3 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + # v2.8.2 (2026-09-04) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go index 7d51740112..5d26e7becc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go @@ -3,4 +3,4 @@ package endpoints // goModuleVersion is the tagged release for this module -const goModuleVersion = "2.8.2" +const goModuleVersion = "2.8.3" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md index 1898b4251a..4900beadd5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.5.3 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.5.2 (2026-09-04) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go index f33821d7d2..dc8e209087 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/v4a/go_module_metadata.go @@ -3,4 +3,4 @@ package v4a // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.5.2" +const goModuleVersion = "1.5.3" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md index 34b21a87cd..5e3a680ed5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.11.3 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.11.2 (2026-09-04) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go index 2dc666571c..c681eeb0b3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/checksum/go_module_metadata.go @@ -3,4 +3,4 @@ package checksum // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.11.2" +const goModuleVersion = "1.11.3" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md index aa69a09311..3e6ab8f020 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.14.3 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.14.2 (2026-09-04) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go index bdb98c425f..1112596ff9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go @@ -3,4 +3,4 @@ package presignedurl // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.14.2" +const goModuleVersion = "1.14.3" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md index 3600af1f17..baa5eab975 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.20.3 (2026-09-09) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.20.2 (2026-09-04) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go index a802f00171..c34cc3a949 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/s3shared/go_module_metadata.go @@ -3,4 +3,4 @@ package s3shared // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.20.2" +const goModuleVersion = "1.20.3" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md index bb6756bb50..2bc2a0a8f4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/CHANGELOG.md @@ -1,3 +1,17 @@ +# v1.113.1 (2026-09-11) + +* **Documentation**: Updated S3 Object Lock Default Retention documentation. + +# v1.113.0 (2026-09-09) + +* **Feature**: Stop registering the `retry.MetricsHeader` middleware in generated clients. The `Amz-Sdk-Request` header is now set by the retry middleware itself. +* **Bug Fix**: Expand S3 operations that check for an error inside an HTTP 200 response (wave 3/4) +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.112.0 (2026-09-08) + +* **Feature**: Adds support for Amazon S3 Object Lock variable retention. Existing S3 APIs that support S3 Object Lock parameters now support two new parameters EventHold and EventHoldDuration at the object level, and DefaultEventHoldDuration at the bucket level. + # v1.111.0 (2026-09-04) * **Feature**: Stop registering the `spanRetryLoop` middleware in generated clients. The retry loop's tracing span is now opened by the retry middleware itself. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_client.go index 442df4192a..3f826787af 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_client.go @@ -770,9 +770,6 @@ func addRetry(stack *middleware.Stack, o Options, c *Client) error { if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { return err } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err - } return nil } @@ -1220,9 +1217,6 @@ func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, op if _, ok := stack.Finalize.Get((*retry.Attempt)(nil).ID()); ok { stack.Finalize.Remove((*retry.Attempt)(nil).ID()) } - if _, ok := stack.Finalize.Get((*retry.MetricsHeader)(nil).ID()); ok { - stack.Finalize.Remove((*retry.MetricsHeader)(nil).ID()) - } stack.Deserialize.Clear() stack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID()) stack.Build.Remove("UserAgent") diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CopyObject.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CopyObject.go index 50c2059aec..473bb5e3c9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CopyObject.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CopyObject.go @@ -594,6 +594,24 @@ type CopyObjectInput struct { // [Amazon S3 condition key examples]: https://docs.aws.amazon.com/AmazonS3/latest/dev/amazon-s3-policy-keys.html MetadataDirective types.MetadataDirective + // The event hold status to apply to the object copy. Set to ON to enable or OFF + // to disable. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHold types.ObjectLockEventHold + + // The event hold duration in days to apply to the object copy. You cannot specify + // a duration in both days and years. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHoldDurationDays *int32 + + // The event hold duration in years to apply to the object copy. You cannot + // specify a duration in both days and years. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHoldDurationYears *int32 + // Specifies whether you want to apply a legal hold to the object copy. // // This functionality is not supported for directory buckets. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateMultipartUpload.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateMultipartUpload.go index 3b5a7491c0..eed46ce571 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateMultipartUpload.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_CreateMultipartUpload.go @@ -600,6 +600,24 @@ type CreateMultipartUploadInput struct { // A map of metadata to store with the object in S3. Metadata map[string]string + // Specifies the event hold status to apply to the uploaded object. Set to ON to + // enable or OFF to disable. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHold types.ObjectLockEventHold + + // Specifies the event hold duration in days to apply to the uploaded object. You + // cannot specify a duration in both days and years. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHoldDurationDays *int32 + + // Specifies the event hold duration in years to apply to the uploaded object. You + // cannot specify a duration in both days and years. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHoldDurationYears *int32 + // Specifies whether you want to apply a legal hold to the uploaded object. // // This functionality is not supported for directory buckets. @@ -904,6 +922,9 @@ func (c *Client) addOperationCreateMultipartUploadMiddlewares(stack *middleware. if err = disableAcceptEncodingGzip(stack); err != nil { return err } + if err = s3cust.HandleResponseErrorWith200Status(stack); err != nil { + return err + } if err = addRequestResponseLogging(stack, options); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObjects.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObjects.go index 8762420c1f..b0931f3ea7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObjects.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_DeleteObjects.go @@ -349,6 +349,9 @@ func (c *Client) addOperationDeleteObjectsMiddlewares(stack *middleware.Stack, o if err = disableAcceptEncodingGzip(stack); err != nil { return err } + if err = s3cust.HandleResponseErrorWith200Status(stack); err != nil { + return err + } if err = addRequestResponseLogging(stack, options); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAcl.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAcl.go index c654c73848..c3b17824eb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAcl.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketAcl.go @@ -151,6 +151,9 @@ func (c *Client) addOperationGetBucketAclMiddlewares(stack *middleware.Stack, op if err = disableAcceptEncodingGzip(stack); err != nil { return err } + if err = s3cust.HandleResponseErrorWith200Status(stack); err != nil { + return err + } if err = addRequestResponseLogging(stack, options); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketEncryption.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketEncryption.go index b3cd9f9e6a..b2f9a3b54c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketEncryption.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketEncryption.go @@ -168,6 +168,9 @@ func (c *Client) addOperationGetBucketEncryptionMiddlewares(stack *middleware.St if err = disableAcceptEncodingGzip(stack); err != nil { return err } + if err = s3cust.HandleResponseErrorWith200Status(stack); err != nil { + return err + } if err = addRequestResponseLogging(stack, options); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLocation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLocation.go index ec0296cbcc..00c37c6bc8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLocation.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetBucketLocation.go @@ -174,6 +174,9 @@ func (c *Client) addOperationGetBucketLocationMiddlewares(stack *middleware.Stac if err = disableAcceptEncodingGzip(stack); err != nil { return err } + if err = s3cust.HandleResponseErrorWith200Status(stack); err != nil { + return err + } if err = addRequestResponseLogging(stack, options); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObject.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObject.go index bb444280c7..097b71ce62 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObject.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObject.go @@ -444,7 +444,7 @@ type GetObjectOutput struct { CacheControl *string // The Base64 encoded, 32-bit CRC32 checksum of the object. This checksum is only - // present if the object was uploaded with the object. For more information, see [Checking object integrity] + // present if the checksum was uploaded with the object. For more information, see [Checking object integrity] // in the Amazon S3 User Guide. // // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html @@ -597,6 +597,24 @@ type GetObjectOutput struct { // This functionality is not supported for directory buckets. MissingMeta *int32 + // The event hold status for this object. This header is only returned if the + // requester has the s3:GetObjectRetention permission. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHold types.ObjectLockEventHold + + // The event hold duration in days for this object. Only returned when the event + // hold is enabled. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHoldDurationDays *int32 + + // The event hold duration in years for this object. Only returned when the event + // hold is enabled. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHoldDurationYears *int32 + // Indicates whether this object has an active legal hold. This field is only // returned if you have permission to view an object's legal hold status. // diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectTagging.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectTagging.go index 7e90a731cc..a619cb49e4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectTagging.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_GetObjectTagging.go @@ -181,6 +181,9 @@ func (c *Client) addOperationGetObjectTaggingMiddlewares(stack *middleware.Stack if err = disableAcceptEncodingGzip(stack); err != nil { return err } + if err = s3cust.HandleResponseErrorWith200Status(stack); err != nil { + return err + } if err = addRequestResponseLogging(stack, options); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadBucket.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadBucket.go index ea14aaebe9..e3a29def6d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadBucket.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadBucket.go @@ -241,6 +241,9 @@ func (c *Client) addOperationHeadBucketMiddlewares(stack *middleware.Stack, opti if err = disableAcceptEncodingGzip(stack); err != nil { return err } + if err = s3cust.HandleResponseErrorWith200Status(stack); err != nil { + return err + } if err = addRequestResponseLogging(stack, options); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadObject.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadObject.go index f69b6e0db1..fa9fff53c0 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadObject.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_HeadObject.go @@ -541,6 +541,24 @@ type HeadObjectOutput struct { // This functionality is not supported for directory buckets. MissingMeta *int32 + // The event hold status for this object. This header is only returned if the + // requester has the s3:GetObjectRetention permission. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHold types.ObjectLockEventHold + + // The event hold duration in days for this object. Only returned when the event + // hold is enabled. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHoldDurationDays *int32 + + // The event hold duration in years for this object. Only returned when the event + // hold is enabled. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHoldDurationYears *int32 + // Specifies whether a legal hold is in effect for this object. This header is // only returned if the requester has the s3:GetObjectLegalHold permission. This // header is not returned if the specified version of this object has never had a diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjectVersions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjectVersions.go index 4399cb5791..26193b06e9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjectVersions.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_ListObjectVersions.go @@ -265,6 +265,9 @@ func (c *Client) addOperationListObjectVersionsMiddlewares(stack *middleware.Sta if err = disableAcceptEncodingGzip(stack); err != nil { return err } + if err = s3cust.HandleResponseErrorWith200Status(stack); err != nil { + return err + } if err = addRequestResponseLogging(stack, options); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObject.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObject.go index 2f784866d2..3a3e19d80b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObject.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObject.go @@ -515,6 +515,24 @@ type PutObjectInput struct { // A map of metadata to store with the object in S3. Metadata map[string]string + // Specifies the event hold status to apply to this object. Set to ON to enable or + // OFF to disable. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHold types.ObjectLockEventHold + + // Specifies the event hold duration in days to apply to this object. You cannot + // specify a duration in both days and years. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHoldDurationDays *int32 + + // Specifies the event hold duration in years to apply to this object. You cannot + // specify a duration in both days and years. + // + // This functionality is not supported for directory buckets. + ObjectLockEventHoldDurationYears *int32 + // Specifies whether a legal hold will be applied to this object. For more // information about S3 Object Lock, see [Object Lock]in the Amazon S3 User Guide. // diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectRetention.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectRetention.go index da23d11691..19d11b09db 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectRetention.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectRetention.go @@ -190,6 +190,9 @@ func (c *Client) addOperationPutObjectRetentionMiddlewares(stack *middleware.Sta if err = disableAcceptEncodingGzip(stack); err != nil { return err } + if err = s3cust.HandleResponseErrorWith200Status(stack); err != nil { + return err + } if err = addRequestResponseLogging(stack, options); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectTagging.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectTagging.go index f73166f914..d0d28f8386 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectTagging.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/api_op_PutObjectTagging.go @@ -216,6 +216,9 @@ func (c *Client) addOperationPutObjectTaggingMiddlewares(stack *middleware.Stack if err = disableAcceptEncodingGzip(stack); err != nil { return err } + if err = s3cust.HandleResponseErrorWith200Status(stack); err != nil { + return err + } if err = addRequestResponseLogging(stack, options); err != nil { return err } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/deserializers.go index aa43bb2b03..57e88574b3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/deserializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/deserializers.go @@ -6974,6 +6974,29 @@ func awsRestxml_deserializeOpHttpBindingsGetObjectOutput(v *GetObjectOutput, res v.MissingMeta = ptr.Int32(int32(vv)) } + if headerValues := response.Header.Values("x-amz-object-lock-event-hold"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ObjectLockEventHold = types.ObjectLockEventHold(headerValues[0]) + } + + if headerValues := response.Header.Values("x-amz-object-lock-event-hold-duration-days"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.ObjectLockEventHoldDurationDays = ptr.Int32(int32(vv)) + } + + if headerValues := response.Header.Values("x-amz-object-lock-event-hold-duration-years"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.ObjectLockEventHoldDurationYears = ptr.Int32(int32(vv)) + } + if headerValues := response.Header.Values("x-amz-object-lock-legal-hold"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) v.ObjectLockLegalHoldStatus = types.ObjectLockLegalHoldStatus(headerValues[0]) @@ -8937,6 +8960,29 @@ func awsRestxml_deserializeOpHttpBindingsHeadObjectOutput(v *HeadObjectOutput, r v.MissingMeta = ptr.Int32(int32(vv)) } + if headerValues := response.Header.Values("x-amz-object-lock-event-hold"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ObjectLockEventHold = types.ObjectLockEventHold(headerValues[0]) + } + + if headerValues := response.Header.Values("x-amz-object-lock-event-hold-duration-days"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.ObjectLockEventHoldDurationDays = ptr.Int32(int32(vv)) + } + + if headerValues := response.Header.Values("x-amz-object-lock-event-hold-duration-years"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.ObjectLockEventHoldDurationYears = ptr.Int32(int32(vv)) + } + if headerValues := response.Header.Values("x-amz-object-lock-legal-hold"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) v.ObjectLockLegalHoldStatus = types.ObjectLockLegalHoldStatus(headerValues[0]) @@ -19414,6 +19460,12 @@ func awsRestxml_deserializeDocumentDefaultRetention(v **types.DefaultRetention, sv.Days = ptr.Int32(int32(i64)) } + case strings.EqualFold("DefaultEventHold", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentEventHoldDuration(&sv.DefaultEventHold, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("Mode", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -20490,6 +20542,76 @@ func awsRestxml_deserializeDocumentEventBridgeConfiguration(v **types.EventBridg return nil } +func awsRestxml_deserializeDocumentEventHoldDuration(v **types.EventHoldDuration, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EventHoldDuration + if *v == nil { + sv = &types.EventHoldDuration{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Days", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Days = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Years", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Years = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsRestxml_deserializeDocumentEventList(v *[]types.Event, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -24867,6 +24989,25 @@ func awsRestxml_deserializeDocumentObjectLockRetention(v **types.ObjectLockReten originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("EventHold", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EventHold = types.ObjectLockEventHold(xtv) + } + + case strings.EqualFold("EventHoldDuration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentEventHoldDuration(&sv.EventHoldDuration, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("Mode", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go index d869a4bda7..3e3ac6893b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/go_module_metadata.go @@ -3,4 +3,4 @@ package s3 // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.111.0" +const goModuleVersion = "1.113.1" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/presign_post.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/presign_post.go index 1295e712fb..cd4a6e7025 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/presign_post.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/presign_post.go @@ -272,7 +272,6 @@ func (c presignPostConverter) ConvertToPresignMiddleware(stack *middleware.Stack stack.Build.Remove("UserAgent") stack.Finalize.Remove((*acceptencodingcust.DisableGzip)(nil).ID()) stack.Finalize.Remove((*retry.Attempt)(nil).ID()) - stack.Finalize.Remove((*retry.MetricsHeader)(nil).ID()) stack.Deserialize.Clear() if err := stack.Finalize.Insert(&presignContextPolyfillMiddleware{}, "Signing", middleware.Before); err != nil { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/serializers.go index d11dd5529e..294066c61d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/serializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/serializers.go @@ -513,6 +513,21 @@ func awsRestxml_serializeOpHttpBindingsCopyObjectInput(v *CopyObjectInput, encod encoder.SetHeader(locationName).String(string(v.MetadataDirective)) } + if len(v.ObjectLockEventHold) > 0 { + locationName := "X-Amz-Object-Lock-Event-Hold" + encoder.SetHeader(locationName).String(string(v.ObjectLockEventHold)) + } + + if v.ObjectLockEventHoldDurationDays != nil { + locationName := "X-Amz-Object-Lock-Event-Hold-Duration-Days" + encoder.SetHeader(locationName).Integer(*v.ObjectLockEventHoldDurationDays) + } + + if v.ObjectLockEventHoldDurationYears != nil { + locationName := "X-Amz-Object-Lock-Event-Hold-Duration-Years" + encoder.SetHeader(locationName).Integer(*v.ObjectLockEventHoldDurationYears) + } + if len(v.ObjectLockLegalHoldStatus) > 0 { locationName := "X-Amz-Object-Lock-Legal-Hold" encoder.SetHeader(locationName).String(string(v.ObjectLockLegalHoldStatus)) @@ -1069,6 +1084,21 @@ func awsRestxml_serializeOpHttpBindingsCreateMultipartUploadInput(v *CreateMulti } } + if len(v.ObjectLockEventHold) > 0 { + locationName := "X-Amz-Object-Lock-Event-Hold" + encoder.SetHeader(locationName).String(string(v.ObjectLockEventHold)) + } + + if v.ObjectLockEventHoldDurationDays != nil { + locationName := "X-Amz-Object-Lock-Event-Hold-Duration-Days" + encoder.SetHeader(locationName).Integer(*v.ObjectLockEventHoldDurationDays) + } + + if v.ObjectLockEventHoldDurationYears != nil { + locationName := "X-Amz-Object-Lock-Event-Hold-Duration-Years" + encoder.SetHeader(locationName).Integer(*v.ObjectLockEventHoldDurationYears) + } + if len(v.ObjectLockLegalHoldStatus) > 0 { locationName := "X-Amz-Object-Lock-Legal-Hold" encoder.SetHeader(locationName).String(string(v.ObjectLockLegalHoldStatus)) @@ -8645,6 +8675,21 @@ func awsRestxml_serializeOpHttpBindingsPutObjectInput(v *PutObjectInput, encoder } } + if len(v.ObjectLockEventHold) > 0 { + locationName := "X-Amz-Object-Lock-Event-Hold" + encoder.SetHeader(locationName).String(string(v.ObjectLockEventHold)) + } + + if v.ObjectLockEventHoldDurationDays != nil { + locationName := "X-Amz-Object-Lock-Event-Hold-Duration-Days" + encoder.SetHeader(locationName).Integer(*v.ObjectLockEventHoldDurationDays) + } + + if v.ObjectLockEventHoldDurationYears != nil { + locationName := "X-Amz-Object-Lock-Event-Hold-Duration-Years" + encoder.SetHeader(locationName).Integer(*v.ObjectLockEventHoldDurationYears) + } + if len(v.ObjectLockLegalHoldStatus) > 0 { locationName := "X-Amz-Object-Lock-Legal-Hold" encoder.SetHeader(locationName).String(string(v.ObjectLockLegalHoldStatus)) @@ -12087,6 +12132,19 @@ func awsRestxml_serializeDocumentDefaultRetention(v *types.DefaultRetention, val el := value.MemberElement(root) el.Integer(*v.Days) } + if v.DefaultEventHold != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "DefaultEventHold", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentEventHoldDuration(v.DefaultEventHold, el); err != nil { + return err + } + } if len(v.Mode) > 0 { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ @@ -12342,6 +12400,33 @@ func awsRestxml_serializeDocumentEventBridgeConfiguration(v *types.EventBridgeCo return nil } +func awsRestxml_serializeDocumentEventHoldDuration(v *types.EventHoldDuration, value smithyxml.Value) error { + defer value.Close() + if v.Days != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Days", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.Integer(*v.Days) + } + if v.Years != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Years", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.Integer(*v.Years) + } + return nil +} + func awsRestxml_serializeDocumentEventList(v []types.Event, value smithyxml.Value) error { var array *smithyxml.Array if !value.IsFlattened() { @@ -14139,6 +14224,30 @@ func awsRestxml_serializeDocumentObjectLockLegalHold(v *types.ObjectLockLegalHol func awsRestxml_serializeDocumentObjectLockRetention(v *types.ObjectLockRetention, value smithyxml.Value) error { defer value.Close() + if len(v.EventHold) > 0 { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "EventHold", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(string(v.EventHold)) + } + if v.EventHoldDuration != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "EventHoldDuration", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentEventHoldDuration(v.EventHoldDuration, el); err != nil { + return err + } + } if len(v.Mode) > 0 { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/enums.go index 491d057215..91c710617f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/enums.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/enums.go @@ -506,6 +506,7 @@ const ( EventS3ObjectAnnotation Event = "s3:ObjectAnnotation:*" EventS3ObjectAnnotationPut Event = "s3:ObjectAnnotation:Put" EventS3ObjectAnnotationDelete Event = "s3:ObjectAnnotation:Delete" + EventS3ObjectRetentionPut Event = "s3:ObjectRetention:Put" ) // Values returns all known values for Event. Note that this can be expanded in @@ -544,6 +545,7 @@ func (Event) Values() []Event { "s3:ObjectAnnotation:*", "s3:ObjectAnnotation:Put", "s3:ObjectAnnotation:Delete", + "s3:ObjectRetention:Put", } } @@ -794,6 +796,8 @@ const ( InventoryOptionalFieldObjectLockRetainUntilDate InventoryOptionalField = "ObjectLockRetainUntilDate" InventoryOptionalFieldObjectLockMode InventoryOptionalField = "ObjectLockMode" InventoryOptionalFieldObjectLockLegalHoldStatus InventoryOptionalField = "ObjectLockLegalHoldStatus" + InventoryOptionalFieldObjectLockEventHoldStatus InventoryOptionalField = "ObjectLockEventHoldStatus" + InventoryOptionalFieldObjectLockEventHoldDuration InventoryOptionalField = "ObjectLockEventHoldDuration" InventoryOptionalFieldIntelligentTieringAccessTier InventoryOptionalField = "IntelligentTieringAccessTier" InventoryOptionalFieldBucketKeyStatus InventoryOptionalField = "BucketKeyStatus" InventoryOptionalFieldChecksumAlgorithm InventoryOptionalField = "ChecksumAlgorithm" @@ -818,6 +822,8 @@ func (InventoryOptionalField) Values() []InventoryOptionalField { "ObjectLockRetainUntilDate", "ObjectLockMode", "ObjectLockLegalHoldStatus", + "ObjectLockEventHoldStatus", + "ObjectLockEventHoldDuration", "IntelligentTieringAccessTier", "BucketKeyStatus", "ChecksumAlgorithm", @@ -1012,6 +1018,25 @@ func (ObjectLockEnabled) Values() []ObjectLockEnabled { } } +type ObjectLockEventHold string + +// Enum values for ObjectLockEventHold +const ( + ObjectLockEventHoldOn ObjectLockEventHold = "ON" + ObjectLockEventHoldOff ObjectLockEventHold = "OFF" +) + +// Values returns all known values for ObjectLockEventHold. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ObjectLockEventHold) Values() []ObjectLockEventHold { + return []ObjectLockEventHold{ + "ON", + "OFF", + } +} + type ObjectLockLegalHoldStatus string // Enum values for ObjectLockLegalHoldStatus diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/types.go index fec05ddfa8..61d8b4ca79 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/types.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/s3/types/types.go @@ -668,7 +668,7 @@ type ContinuationEvent struct { type CopyObjectResult struct { // The Base64 encoded, 32-bit CRC32 checksum of the object. This checksum is only - // present if the object was uploaded with the object. For more information, see [Checking object integrity] + // present if the checksum was uploaded with the object. For more information, see [Checking object integrity] // in the Amazon S3 User Guide. // // [Checking object integrity]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html @@ -1039,6 +1039,11 @@ type DefaultRetention struct { // Must be used with Mode . Days *int32 + // The default event hold duration to be applied to new objects placed in the + // specified bucket. When configured, new objects will automatically have an event + // hold enabled with this duration. + DefaultEventHold *EventHoldDuration + // The default Object Lock retention mode you want to apply to new objects placed // in the specified bucket. Must be used with either Days or Years . Mode ObjectLockRetentionMode @@ -2270,6 +2275,21 @@ type EventBridgeConfiguration struct { noSmithyDocumentSerde } +// Contains the event hold duration configuration, specified in either days or +// years. +type EventHoldDuration struct { + + // The number of days for the event hold duration. The minimum value is 1 and the + // maximum value is 36,500. + Days *int32 + + // The number of years for the event hold duration. The minimum value is 1 and the + // maximum value is 100. + Years *int32 + + noSmithyDocumentSerde +} + // Optional configuration to replicate existing source bucket objects. // // This parameter is no longer supported. To replicate existing objects, see [Replicating existing objects with S3 Batch Replication] in @@ -3662,6 +3682,14 @@ type ObjectLockLegalHold struct { // A Retention configuration for an object. type ObjectLockRetention struct { + // The event hold status for the object. Set to ON to enable an event hold or OFF + // to disable it. + EventHold ObjectLockEventHold + + // The event hold duration for the object. Specifies how long the object remains + // protected after the event hold is released. + EventHoldDuration *EventHoldDuration + // Indicates the Retention mode for the specified object. Mode ObjectLockRetentionMode @@ -3674,10 +3702,15 @@ type ObjectLockRetention struct { // The container element for an Object Lock rule. type ObjectLockRule struct { - // The default Object Lock retention mode and period that you want to apply to new - // objects placed in the specified bucket. Bucket settings require both a mode and - // a period. The period can be either Days or Years but you must select one. You - // cannot specify Days and Years at the same time. + // The default Object Lock retention settings for new objects in this bucket. You + // can specify: + // + // - A default retention period, by using Days or Years . + // + // - A default event hold duration, by using DefaultEventHold . This setting also + // uses days or years. + // + // You can set one or both. You cannot use days and years in the same setting. DefaultRetention *DefaultRetention noSmithyDocumentSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/CHANGELOG.md index 1dec4a7f81..508afc370c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/CHANGELOG.md @@ -1,3 +1,8 @@ +# v1.10.0 (2026-09-09) + +* **Feature**: Stop registering the `retry.MetricsHeader` middleware in generated clients. The `Amz-Sdk-Request` header is now set by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.9.0 (2026-09-04) * **Feature**: Stop registering the `spanRetryLoop` middleware in generated clients. The retry loop's tracing span is now opened by the retry middleware itself. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_client.go index 7e6b118fca..b7040dc6b1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_client.go @@ -734,9 +734,6 @@ func addRetry(stack *middleware.Stack, o Options, c *Client) error { if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { return err } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err - } return nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/go_module_metadata.go index 2d9419f90a..4f75436db5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/go_module_metadata.go @@ -3,4 +3,4 @@ package signin // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.9.0" +const goModuleVersion = "1.10.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md index 0d77694906..7d6f317961 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md @@ -1,3 +1,8 @@ +# v1.38.0 (2026-09-09) + +* **Feature**: Stop registering the `retry.MetricsHeader` middleware in generated clients. The `Amz-Sdk-Request` header is now set by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.37.0 (2026-09-04) * **Feature**: Stop registering the `spanRetryLoop` middleware in generated clients. The retry loop's tracing span is now opened by the retry middleware itself. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go index c9c116145b..6fd750495b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go @@ -723,9 +723,6 @@ func addRetry(stack *middleware.Stack, o Options, c *Client) error { if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { return err } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err - } return nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go index 1d431586d4..b2848584db 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go @@ -3,4 +3,4 @@ package sso // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.37.0" +const goModuleVersion = "1.38.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md index 825e43780d..4b8fb09b35 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md @@ -1,3 +1,8 @@ +# v1.43.0 (2026-09-09) + +* **Feature**: Stop registering the `retry.MetricsHeader` middleware in generated clients. The `Amz-Sdk-Request` header is now set by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.42.0 (2026-09-04) * **Feature**: Stop registering the `spanRetryLoop` middleware in generated clients. The retry loop's tracing span is now opened by the retry middleware itself. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go index fe70ec69db..4992093a27 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go @@ -723,9 +723,6 @@ func addRetry(stack *middleware.Stack, o Options, c *Client) error { if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { return err } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err - } return nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go index 7ba5425695..27c757f311 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go @@ -3,4 +3,4 @@ package ssooidc // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.42.0" +const goModuleVersion = "1.43.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md index 0d4187d36a..207ab4fd57 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md @@ -1,3 +1,12 @@ +# v1.51.0 (2026-09-14) + +* **Feature**: Increases the maximum session token size to 4,096 bytes and removes the packed policy size limit. Adds SessionTokenSize and SessionTokenUtilization fields and a new MinimumSessionTokenSize parameter. PackedPolicySize is deprecated. + +# v1.50.0 (2026-09-09) + +* **Feature**: Stop registering the `retry.MetricsHeader` middleware in generated clients. The `Amz-Sdk-Request` header is now set by the retry middleware itself. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.49.0 (2026-09-04) * **Feature**: Stop registering the `spanRetryLoop` middleware in generated clients. The retry loop's tracing span is now opened by the retry middleware itself. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go index 1bef7df642..25412cf71c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go @@ -737,9 +737,6 @@ func addRetry(stack *middleware.Stack, o Options, c *Client) error { if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { return err } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err - } return nil } @@ -986,9 +983,6 @@ func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, op if _, ok := stack.Finalize.Get((*retry.Attempt)(nil).ID()); ok { stack.Finalize.Remove((*retry.Attempt)(nil).ID()) } - if _, ok := stack.Finalize.Get((*retry.MetricsHeader)(nil).ID()); ok { - stack.Finalize.Remove((*retry.MetricsHeader)(nil).ID()) - } stack.Deserialize.Clear() stack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID()) stack.Build.Remove("UserAgent") diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go index b1cd675601..958bfaa893 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go @@ -198,6 +198,12 @@ type AssumeRoleInput struct { // [How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html ExternalId *string + // The minimum size, in bytes, of the session token that STS issues for the + // request. STS increases the session token to at least this size, regardless of + // its actual content. The value must not exceed 4,096 bytes. When set to 0 or not + // specified, the session token size is unchanged. + MinimumSessionTokenSize *int32 + // An IAM policy in JSON format that you want to use as an inline session policy. // // This parameter is optional. Passing policies to this operation returns new @@ -385,8 +391,18 @@ type AssumeRoleOutput struct { // session tags combined passed in the request. The request fails if the packed // size is greater than 100 percent, which means the policies and tags exceeded the // allowed space. + // + // Deprecated: Deprecated. Replaced by SessionTokenUtilization. PackedPolicySize *int32 + // The size, in bytes, of the session token returned in the Credentials for this + // response. + SessionTokenSize *int32 + + // The percentage (0-100) of the maximum allowed session token size that the + // returned session token consumes. + SessionTokenUtilization *int32 + // The source identity specified by the principal that is calling the AssumeRole // operation. // diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go index 10f16e1655..e4050fce80 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go @@ -202,6 +202,12 @@ type AssumeRoleWithSAMLInput struct { // [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html DurationSeconds *int32 + // The minimum size, in bytes, of the session token that STS issues for the + // request. STS increases the session token to at least this size, regardless of + // its actual content. The value must not exceed 4,096 bytes. When set to 0 or not + // specified, the session token size is unchanged. + MinimumSessionTokenSize *int32 + // An IAM policy in JSON format that you want to use as an inline session policy. // // This parameter is optional. Passing policies to this operation returns new @@ -305,8 +311,18 @@ type AssumeRoleWithSAMLOutput struct { // session tags combined passed in the request. The request fails if the packed // size is greater than 100 percent, which means the policies and tags exceeded the // allowed space. + // + // Deprecated: Deprecated. Replaced by SessionTokenUtilization. PackedPolicySize *int32 + // The size, in bytes, of the session token returned in the Credentials for this + // response. + SessionTokenSize *int32 + + // The percentage (0-100) of the maximum allowed session token size that the + // returned session token consumes. + SessionTokenUtilization *int32 + // The value in the SourceIdentity attribute in the SAML assertion. The source // identity value persists across [chained role]sessions. // diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go index 97f51b8be7..662b45a829 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go @@ -222,6 +222,12 @@ type AssumeRoleWithWebIdentityInput struct { // [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html DurationSeconds *int32 + // The minimum size, in bytes, of the session token that STS issues for the + // request. STS increases the session token to at least this size, regardless of + // its actual content. The value must not exceed 4,096 bytes. When set to 0 or not + // specified, the session token size is unchanged. + MinimumSessionTokenSize *int32 + // An IAM policy in JSON format that you want to use as an inline session policy. // // This parameter is optional. Passing policies to this operation returns new @@ -320,6 +326,8 @@ type AssumeRoleWithWebIdentityOutput struct { // session tags combined passed in the request. The request fails if the packed // size is greater than 100 percent, which means the policies and tags exceeded the // allowed space. + // + // Deprecated: Deprecated. Replaced by SessionTokenUtilization. PackedPolicySize *int32 // The issuing authority of the web identity token presented. For OpenID Connect @@ -328,6 +336,14 @@ type AssumeRoleWithWebIdentityOutput struct { // the AssumeRoleWithWebIdentity request. Provider *string + // The size, in bytes, of the session token returned in the Credentials for this + // response. + SessionTokenSize *int32 + + // The percentage (0-100) of the maximum allowed session token size that the + // returned session token consumes. + SessionTokenUtilization *int32 + // The value of the source identity that is returned in the JSON web token (JWT) // from the identity provider. // diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go index 8946a9bb95..c3437ca439 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go @@ -88,6 +88,12 @@ type AssumeRootInput struct { // By default, the value is set to 900 seconds. DurationSeconds *int32 + // The minimum size, in bytes, of the session token that STS issues for the + // request. STS increases the session token to at least this size, regardless of + // its actual content. The value must not exceed 4,096 bytes. When set to 0 or not + // specified, the session token size is unchanged. + MinimumSessionTokenSize *int32 + noSmithyDocumentSerde } @@ -100,6 +106,14 @@ type AssumeRootOutput struct { // strongly recommend that you make no assumptions about the maximum size. Credentials *types.Credentials + // The size, in bytes, of the session token returned in the Credentials for this + // response. + SessionTokenSize *int32 + + // The percentage (0-100) of the maximum allowed session token size that the + // returned session token consumes. + SessionTokenUtilization *int32 + // The source identity specified by the principal that is calling the AssumeRoot // operation. // diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetDelegatedAccessToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetDelegatedAccessToken.go index 33370240ff..d3c8543f54 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetDelegatedAccessToken.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetDelegatedAccessToken.go @@ -52,6 +52,8 @@ type GetDelegatedAccessTokenOutput struct { // The policy size is calculated as the sum of all the session policies and // permission boundaries attached to the session. If the packed size exceeds 100%, // the request fails. + // + // Deprecated: Deprecated. This field is not populated for GetDelegatedAccessToken. PackedPolicySize *int32 // Metadata pertaining to the operation's result. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go index 09e7ab30b7..ce0aef697e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go @@ -142,6 +142,12 @@ type GetFederationTokenInput struct { // by using root user credentials defaults to one hour. DurationSeconds *int32 + // The minimum size, in bytes, of the session token that STS issues for the + // request. STS increases the session token to at least this size, regardless of + // its actual content. The value must not exceed 4,096 bytes. When set to 0 or not + // specified, the session token size is unchanged. + MinimumSessionTokenSize *int32 + // An IAM policy in JSON format that you want to use as an inline session policy. // // You must pass an inline or managed [session policy] to this operation. You can pass a single @@ -276,8 +282,18 @@ type GetFederationTokenOutput struct { // session tags combined passed in the request. The request fails if the packed // size is greater than 100 percent, which means the policies and tags exceeded the // allowed space. + // + // Deprecated: Deprecated. Replaced by SessionTokenUtilization. PackedPolicySize *int32 + // The size, in bytes, of the session token returned in the Credentials for this + // response. + SessionTokenSize *int32 + + // The percentage (0-100) of the maximum allowed session token size that the + // returned session token consumes. + SessionTokenUtilization *int32 + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go index ce0b895668..159aa08bac 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go @@ -89,6 +89,12 @@ type GetSessionTokenInput struct { // Services account owners defaults to one hour. DurationSeconds *int32 + // The minimum size, in bytes, of the session token that STS issues for the + // request. STS increases the session token to at least this size, regardless of + // its actual content. The value must not exceed 4,096 bytes. When set to 0 or not + // specified, the session token size is unchanged. + MinimumSessionTokenSize *int32 + // The identification number of the MFA device that is associated with the IAM // user who is making the GetSessionToken call. Specify this value if the IAM user // has a policy that requires MFA authentication. The value is either the serial @@ -127,6 +133,14 @@ type GetSessionTokenOutput struct { // strongly recommend that you make no assumptions about the maximum size. Credentials *types.Credentials + // The size, in bytes, of the session token returned in the Credentials for this + // response. + SessionTokenSize *int32 + + // The percentage (0-100) of the maximum allowed session token size that the + // returned session token consumes. + SessionTokenUtilization *int32 + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetWebIdentityToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetWebIdentityToken.go index b36723d475..255f77e521 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetWebIdentityToken.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetWebIdentityToken.go @@ -14,6 +14,8 @@ import ( // services that support OIDC discovery. The token is signed by Amazon Web Services // STS and can be publicly verified using the verification keys published at the // issuer's JWKS endpoint. +// +// The GetWebIdentityToken API is not available on the STS Global endpoint. func (c *Client) GetWebIdentityToken(ctx context.Context, params *GetWebIdentityTokenInput, optFns ...func(*Options)) (*GetWebIdentityTokenOutput, error) { if params == nil { params = &GetWebIdentityTokenInput{} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go index 45e073ffdc..2c8267d385 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go @@ -2728,6 +2728,40 @@ func awsAwsquery_deserializeOpDocumentAssumeRoleOutput(v **AssumeRoleOutput, dec sv.PackedPolicySize = ptr.Int32(int32(i64)) } + case strings.EqualFold("SessionTokenSize", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SessionTokenSize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SessionTokenUtilization", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SessionTokenUtilization = ptr.Int32(int32(i64)) + } + case strings.EqualFold("SourceIdentity", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -2845,6 +2879,40 @@ func awsAwsquery_deserializeOpDocumentAssumeRoleWithSAMLOutput(v **AssumeRoleWit sv.PackedPolicySize = ptr.Int32(int32(i64)) } + case strings.EqualFold("SessionTokenSize", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SessionTokenSize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SessionTokenUtilization", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SessionTokenUtilization = ptr.Int32(int32(i64)) + } + case strings.EqualFold("SourceIdentity", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -2975,6 +3043,40 @@ func awsAwsquery_deserializeOpDocumentAssumeRoleWithWebIdentityOutput(v **Assume sv.Provider = ptr.String(xtv) } + case strings.EqualFold("SessionTokenSize", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SessionTokenSize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SessionTokenUtilization", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SessionTokenUtilization = ptr.Int32(int32(i64)) + } + case strings.EqualFold("SourceIdentity", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -3043,6 +3145,40 @@ func awsAwsquery_deserializeOpDocumentAssumeRootOutput(v **AssumeRootOutput, dec return err } + case strings.EqualFold("SessionTokenSize", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SessionTokenSize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SessionTokenUtilization", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SessionTokenUtilization = ptr.Int32(int32(i64)) + } + case strings.EqualFold("SourceIdentity", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -3366,6 +3502,40 @@ func awsAwsquery_deserializeOpDocumentGetFederationTokenOutput(v **GetFederation sv.PackedPolicySize = ptr.Int32(int32(i64)) } + case strings.EqualFold("SessionTokenSize", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SessionTokenSize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SessionTokenUtilization", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SessionTokenUtilization = ptr.Int32(int32(i64)) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -3408,6 +3578,40 @@ func awsAwsquery_deserializeOpDocumentGetSessionTokenOutput(v **GetSessionTokenO return err } + case strings.EqualFold("SessionTokenSize", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SessionTokenSize = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("SessionTokenUtilization", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SessionTokenUtilization = ptr.Int32(int32(i64)) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go index cbb19c7f66..97efe4f933 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go @@ -5,9 +5,30 @@ // // # Security Token Service // -// Security Token Service (STS) enables you to request temporary, -// limited-privilege credentials for users. This guide provides descriptions of the -// STS API. For more information about using this service, see [Temporary Security Credentials]. +// Amazon Web Services provides Security Token Service (STS) as a web service that +// enables you to request temporary, limited-privilege credentials for users. This +// guide describes the STS API. For more information, see [Temporary Security Credentials]in the IAM User Guide. +// +// As an alternative to using the API, you can use one of the Amazon Web Services +// SDKs, which consist of libraries and sample code for various programming +// languages and platforms such as Java, Ruby, .NET, iOS, Android, and others. The +// SDKs provide a convenient way to create programmatic access to STS. For example, +// the SDKs can cryptographically sign requests, manage errors, and retry requests +// automatically. For information about the Amazon Web Services SDKs, see [Tools to Build on Amazon Web Services]. +// +// For information about setting up signatures and authorization through the API, +// see [Signing Amazon Web Services API Requests]in the Amazon Web Services General Reference. For general information about +// the Query API, see [Making Query Requests]in the IAM User Guide. For information about using security +// tokens with other Amazon Web Services products, see [Amazon Web Services Services That Work with IAM]in the IAM User Guide. +// +// For information about STS endpoints, see [STS Regions and endpoints] in the IAM User Guide. For +// information about logging STS API calls, see [Logging IAM and STS API calls with CloudTrail]in the IAM User Guide. // // [Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html +// [Making Query Requests]: https://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html +// [Tools to Build on Amazon Web Services]: http://aws.amazon.com/tools/ +// [Amazon Web Services Services That Work with IAM]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html +// [STS Regions and endpoints]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_region-endpoints.html +// [Logging IAM and STS API calls with CloudTrail]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html +// [Signing Amazon Web Services API Requests]: https://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html package sts diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go index 64619a08bd..f702133e11 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go @@ -3,4 +3,4 @@ package sts // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.49.0" +const goModuleVersion = "1.51.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go index 5e22738782..e361a3661e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go @@ -897,6 +897,11 @@ func awsAwsquery_serializeOpDocumentAssumeRoleInput(v *AssumeRoleInput, value qu objectKey.String(*v.ExternalId) } + if v.MinimumSessionTokenSize != nil { + objectKey := object.Key("MinimumSessionTokenSize") + objectKey.Integer(*v.MinimumSessionTokenSize) + } + if v.Policy != nil { objectKey := object.Key("Policy") objectKey.String(*v.Policy) @@ -967,6 +972,11 @@ func awsAwsquery_serializeOpDocumentAssumeRoleWithSAMLInput(v *AssumeRoleWithSAM objectKey.Integer(*v.DurationSeconds) } + if v.MinimumSessionTokenSize != nil { + objectKey := object.Key("MinimumSessionTokenSize") + objectKey.Integer(*v.MinimumSessionTokenSize) + } + if v.Policy != nil { objectKey := object.Key("Policy") objectKey.String(*v.Policy) @@ -1006,6 +1016,11 @@ func awsAwsquery_serializeOpDocumentAssumeRoleWithWebIdentityInput(v *AssumeRole objectKey.Integer(*v.DurationSeconds) } + if v.MinimumSessionTokenSize != nil { + objectKey := object.Key("MinimumSessionTokenSize") + objectKey.Integer(*v.MinimumSessionTokenSize) + } + if v.Policy != nil { objectKey := object.Key("Policy") objectKey.String(*v.Policy) @@ -1050,6 +1065,11 @@ func awsAwsquery_serializeOpDocumentAssumeRootInput(v *AssumeRootInput, value qu objectKey.Integer(*v.DurationSeconds) } + if v.MinimumSessionTokenSize != nil { + objectKey := object.Key("MinimumSessionTokenSize") + objectKey.Integer(*v.MinimumSessionTokenSize) + } + if v.TargetPrincipal != nil { objectKey := object.Key("TargetPrincipal") objectKey.String(*v.TargetPrincipal) @@ -1117,6 +1137,11 @@ func awsAwsquery_serializeOpDocumentGetFederationTokenInput(v *GetFederationToke objectKey.Integer(*v.DurationSeconds) } + if v.MinimumSessionTokenSize != nil { + objectKey := object.Key("MinimumSessionTokenSize") + objectKey.Integer(*v.MinimumSessionTokenSize) + } + if v.Name != nil { objectKey := object.Key("Name") objectKey.String(*v.Name) @@ -1153,6 +1178,11 @@ func awsAwsquery_serializeOpDocumentGetSessionTokenInput(v *GetSessionTokenInput objectKey.Integer(*v.DurationSeconds) } + if v.MinimumSessionTokenSize != nil { + objectKey := object.Key("MinimumSessionTokenSize") + objectKey.Integer(*v.MinimumSessionTokenSize) + } + if v.SerialNumber != nil { objectKey := object.Key("SerialNumber") objectKey.String(*v.SerialNumber) diff --git a/vendor/github.com/cloudfoundry/bosh-utils/blobstore/blobstore_interface.go b/vendor/github.com/cloudfoundry/bosh-utils/blobstore/blobstore_interface.go deleted file mode 100644 index 72a44ed19b..0000000000 --- a/vendor/github.com/cloudfoundry/bosh-utils/blobstore/blobstore_interface.go +++ /dev/null @@ -1,13 +0,0 @@ -package blobstore - -type Blobstore interface { - Get(blobID string) (fileName string, err error) - - CleanUp(fileName string) (err error) - - Create(fileName string) (blobID string, err error) - - Validate() (err error) - - Delete(blobId string) (err error) -} diff --git a/vendor/github.com/cloudfoundry/bosh-utils/blobstore/blobstorefakes/fake_blobstore.go b/vendor/github.com/cloudfoundry/bosh-utils/blobstore/blobstorefakes/fake_blobstore.go new file mode 100644 index 0000000000..777a196ca4 --- /dev/null +++ b/vendor/github.com/cloudfoundry/bosh-utils/blobstore/blobstorefakes/fake_blobstore.go @@ -0,0 +1,398 @@ +// Code generated by counterfeiter. DO NOT EDIT. +package blobstorefakes + +import ( + "sync" + + "github.com/cloudfoundry/bosh-utils/blobstore" +) + +type FakeBlobstore struct { + CleanUpStub func(string) error + cleanUpMutex sync.RWMutex + cleanUpArgsForCall []struct { + arg1 string + } + cleanUpReturns struct { + result1 error + } + cleanUpReturnsOnCall map[int]struct { + result1 error + } + CreateStub func(string) (string, error) + createMutex sync.RWMutex + createArgsForCall []struct { + arg1 string + } + createReturns struct { + result1 string + result2 error + } + createReturnsOnCall map[int]struct { + result1 string + result2 error + } + DeleteStub func(string) error + deleteMutex sync.RWMutex + deleteArgsForCall []struct { + arg1 string + } + deleteReturns struct { + result1 error + } + deleteReturnsOnCall map[int]struct { + result1 error + } + GetStub func(string) (string, error) + getMutex sync.RWMutex + getArgsForCall []struct { + arg1 string + } + getReturns struct { + result1 string + result2 error + } + getReturnsOnCall map[int]struct { + result1 string + result2 error + } + ValidateStub func() error + validateMutex sync.RWMutex + validateArgsForCall []struct { + } + validateReturns struct { + result1 error + } + validateReturnsOnCall map[int]struct { + result1 error + } + invocations map[string][][]interface{} + invocationsMutex sync.RWMutex +} + +func (fake *FakeBlobstore) CleanUp(arg1 string) error { + fake.cleanUpMutex.Lock() + ret, specificReturn := fake.cleanUpReturnsOnCall[len(fake.cleanUpArgsForCall)] + fake.cleanUpArgsForCall = append(fake.cleanUpArgsForCall, struct { + arg1 string + }{arg1}) + stub := fake.CleanUpStub + fakeReturns := fake.cleanUpReturns + fake.recordInvocation("CleanUp", []interface{}{arg1}) + fake.cleanUpMutex.Unlock() + if stub != nil { + return stub(arg1) + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeBlobstore) CleanUpCallCount() int { + fake.cleanUpMutex.RLock() + defer fake.cleanUpMutex.RUnlock() + return len(fake.cleanUpArgsForCall) +} + +func (fake *FakeBlobstore) CleanUpCalls(stub func(string) error) { + fake.cleanUpMutex.Lock() + defer fake.cleanUpMutex.Unlock() + fake.CleanUpStub = stub +} + +func (fake *FakeBlobstore) CleanUpArgsForCall(i int) string { + fake.cleanUpMutex.RLock() + defer fake.cleanUpMutex.RUnlock() + argsForCall := fake.cleanUpArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeBlobstore) CleanUpReturns(result1 error) { + fake.cleanUpMutex.Lock() + defer fake.cleanUpMutex.Unlock() + fake.CleanUpStub = nil + fake.cleanUpReturns = struct { + result1 error + }{result1} +} + +func (fake *FakeBlobstore) CleanUpReturnsOnCall(i int, result1 error) { + fake.cleanUpMutex.Lock() + defer fake.cleanUpMutex.Unlock() + fake.CleanUpStub = nil + if fake.cleanUpReturnsOnCall == nil { + fake.cleanUpReturnsOnCall = make(map[int]struct { + result1 error + }) + } + fake.cleanUpReturnsOnCall[i] = struct { + result1 error + }{result1} +} + +func (fake *FakeBlobstore) Create(arg1 string) (string, error) { + fake.createMutex.Lock() + ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)] + fake.createArgsForCall = append(fake.createArgsForCall, struct { + arg1 string + }{arg1}) + stub := fake.CreateStub + fakeReturns := fake.createReturns + fake.recordInvocation("Create", []interface{}{arg1}) + fake.createMutex.Unlock() + if stub != nil { + return stub(arg1) + } + if specificReturn { + return ret.result1, ret.result2 + } + return fakeReturns.result1, fakeReturns.result2 +} + +func (fake *FakeBlobstore) CreateCallCount() int { + fake.createMutex.RLock() + defer fake.createMutex.RUnlock() + return len(fake.createArgsForCall) +} + +func (fake *FakeBlobstore) CreateCalls(stub func(string) (string, error)) { + fake.createMutex.Lock() + defer fake.createMutex.Unlock() + fake.CreateStub = stub +} + +func (fake *FakeBlobstore) CreateArgsForCall(i int) string { + fake.createMutex.RLock() + defer fake.createMutex.RUnlock() + argsForCall := fake.createArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeBlobstore) CreateReturns(result1 string, result2 error) { + fake.createMutex.Lock() + defer fake.createMutex.Unlock() + fake.CreateStub = nil + fake.createReturns = struct { + result1 string + result2 error + }{result1, result2} +} + +func (fake *FakeBlobstore) CreateReturnsOnCall(i int, result1 string, result2 error) { + fake.createMutex.Lock() + defer fake.createMutex.Unlock() + fake.CreateStub = nil + if fake.createReturnsOnCall == nil { + fake.createReturnsOnCall = make(map[int]struct { + result1 string + result2 error + }) + } + fake.createReturnsOnCall[i] = struct { + result1 string + result2 error + }{result1, result2} +} + +func (fake *FakeBlobstore) Delete(arg1 string) error { + fake.deleteMutex.Lock() + ret, specificReturn := fake.deleteReturnsOnCall[len(fake.deleteArgsForCall)] + fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct { + arg1 string + }{arg1}) + stub := fake.DeleteStub + fakeReturns := fake.deleteReturns + fake.recordInvocation("Delete", []interface{}{arg1}) + fake.deleteMutex.Unlock() + if stub != nil { + return stub(arg1) + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeBlobstore) DeleteCallCount() int { + fake.deleteMutex.RLock() + defer fake.deleteMutex.RUnlock() + return len(fake.deleteArgsForCall) +} + +func (fake *FakeBlobstore) DeleteCalls(stub func(string) error) { + fake.deleteMutex.Lock() + defer fake.deleteMutex.Unlock() + fake.DeleteStub = stub +} + +func (fake *FakeBlobstore) DeleteArgsForCall(i int) string { + fake.deleteMutex.RLock() + defer fake.deleteMutex.RUnlock() + argsForCall := fake.deleteArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeBlobstore) DeleteReturns(result1 error) { + fake.deleteMutex.Lock() + defer fake.deleteMutex.Unlock() + fake.DeleteStub = nil + fake.deleteReturns = struct { + result1 error + }{result1} +} + +func (fake *FakeBlobstore) DeleteReturnsOnCall(i int, result1 error) { + fake.deleteMutex.Lock() + defer fake.deleteMutex.Unlock() + fake.DeleteStub = nil + if fake.deleteReturnsOnCall == nil { + fake.deleteReturnsOnCall = make(map[int]struct { + result1 error + }) + } + fake.deleteReturnsOnCall[i] = struct { + result1 error + }{result1} +} + +func (fake *FakeBlobstore) Get(arg1 string) (string, error) { + fake.getMutex.Lock() + ret, specificReturn := fake.getReturnsOnCall[len(fake.getArgsForCall)] + fake.getArgsForCall = append(fake.getArgsForCall, struct { + arg1 string + }{arg1}) + stub := fake.GetStub + fakeReturns := fake.getReturns + fake.recordInvocation("Get", []interface{}{arg1}) + fake.getMutex.Unlock() + if stub != nil { + return stub(arg1) + } + if specificReturn { + return ret.result1, ret.result2 + } + return fakeReturns.result1, fakeReturns.result2 +} + +func (fake *FakeBlobstore) GetCallCount() int { + fake.getMutex.RLock() + defer fake.getMutex.RUnlock() + return len(fake.getArgsForCall) +} + +func (fake *FakeBlobstore) GetCalls(stub func(string) (string, error)) { + fake.getMutex.Lock() + defer fake.getMutex.Unlock() + fake.GetStub = stub +} + +func (fake *FakeBlobstore) GetArgsForCall(i int) string { + fake.getMutex.RLock() + defer fake.getMutex.RUnlock() + argsForCall := fake.getArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeBlobstore) GetReturns(result1 string, result2 error) { + fake.getMutex.Lock() + defer fake.getMutex.Unlock() + fake.GetStub = nil + fake.getReturns = struct { + result1 string + result2 error + }{result1, result2} +} + +func (fake *FakeBlobstore) GetReturnsOnCall(i int, result1 string, result2 error) { + fake.getMutex.Lock() + defer fake.getMutex.Unlock() + fake.GetStub = nil + if fake.getReturnsOnCall == nil { + fake.getReturnsOnCall = make(map[int]struct { + result1 string + result2 error + }) + } + fake.getReturnsOnCall[i] = struct { + result1 string + result2 error + }{result1, result2} +} + +func (fake *FakeBlobstore) Validate() error { + fake.validateMutex.Lock() + ret, specificReturn := fake.validateReturnsOnCall[len(fake.validateArgsForCall)] + fake.validateArgsForCall = append(fake.validateArgsForCall, struct { + }{}) + stub := fake.ValidateStub + fakeReturns := fake.validateReturns + fake.recordInvocation("Validate", []interface{}{}) + fake.validateMutex.Unlock() + if stub != nil { + return stub() + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeBlobstore) ValidateCallCount() int { + fake.validateMutex.RLock() + defer fake.validateMutex.RUnlock() + return len(fake.validateArgsForCall) +} + +func (fake *FakeBlobstore) ValidateCalls(stub func() error) { + fake.validateMutex.Lock() + defer fake.validateMutex.Unlock() + fake.ValidateStub = stub +} + +func (fake *FakeBlobstore) ValidateReturns(result1 error) { + fake.validateMutex.Lock() + defer fake.validateMutex.Unlock() + fake.ValidateStub = nil + fake.validateReturns = struct { + result1 error + }{result1} +} + +func (fake *FakeBlobstore) ValidateReturnsOnCall(i int, result1 error) { + fake.validateMutex.Lock() + defer fake.validateMutex.Unlock() + fake.ValidateStub = nil + if fake.validateReturnsOnCall == nil { + fake.validateReturnsOnCall = make(map[int]struct { + result1 error + }) + } + fake.validateReturnsOnCall[i] = struct { + result1 error + }{result1} +} + +func (fake *FakeBlobstore) Invocations() map[string][][]interface{} { + fake.invocationsMutex.RLock() + defer fake.invocationsMutex.RUnlock() + copiedInvocations := map[string][][]interface{}{} + for key, value := range fake.invocations { + copiedInvocations[key] = value + } + return copiedInvocations +} + +func (fake *FakeBlobstore) recordInvocation(key string, args []interface{}) { + fake.invocationsMutex.Lock() + defer fake.invocationsMutex.Unlock() + if fake.invocations == nil { + fake.invocations = map[string][][]interface{}{} + } + if fake.invocations[key] == nil { + fake.invocations[key] = [][]interface{}{} + } + fake.invocations[key] = append(fake.invocations[key], args) +} + +var _ blobstore.Blobstore = new(FakeBlobstore) diff --git a/vendor/github.com/cloudfoundry/bosh-utils/blobstore/blobstorefakes/fake_digest_blobstore.go b/vendor/github.com/cloudfoundry/bosh-utils/blobstore/blobstorefakes/fake_digest_blobstore.go new file mode 100644 index 0000000000..4cb834a462 --- /dev/null +++ b/vendor/github.com/cloudfoundry/bosh-utils/blobstore/blobstorefakes/fake_digest_blobstore.go @@ -0,0 +1,406 @@ +// Code generated by counterfeiter. DO NOT EDIT. +package blobstorefakes + +import ( + "sync" + + "github.com/cloudfoundry/bosh-utils/blobstore" + "github.com/cloudfoundry/bosh-utils/crypto" +) + +type FakeDigestBlobstore struct { + CleanUpStub func(string) error + cleanUpMutex sync.RWMutex + cleanUpArgsForCall []struct { + arg1 string + } + cleanUpReturns struct { + result1 error + } + cleanUpReturnsOnCall map[int]struct { + result1 error + } + CreateStub func(string) (string, crypto.MultipleDigest, error) + createMutex sync.RWMutex + createArgsForCall []struct { + arg1 string + } + createReturns struct { + result1 string + result2 crypto.MultipleDigest + result3 error + } + createReturnsOnCall map[int]struct { + result1 string + result2 crypto.MultipleDigest + result3 error + } + DeleteStub func(string) error + deleteMutex sync.RWMutex + deleteArgsForCall []struct { + arg1 string + } + deleteReturns struct { + result1 error + } + deleteReturnsOnCall map[int]struct { + result1 error + } + GetStub func(string, crypto.Digest) (string, error) + getMutex sync.RWMutex + getArgsForCall []struct { + arg1 string + arg2 crypto.Digest + } + getReturns struct { + result1 string + result2 error + } + getReturnsOnCall map[int]struct { + result1 string + result2 error + } + ValidateStub func() error + validateMutex sync.RWMutex + validateArgsForCall []struct { + } + validateReturns struct { + result1 error + } + validateReturnsOnCall map[int]struct { + result1 error + } + invocations map[string][][]interface{} + invocationsMutex sync.RWMutex +} + +func (fake *FakeDigestBlobstore) CleanUp(arg1 string) error { + fake.cleanUpMutex.Lock() + ret, specificReturn := fake.cleanUpReturnsOnCall[len(fake.cleanUpArgsForCall)] + fake.cleanUpArgsForCall = append(fake.cleanUpArgsForCall, struct { + arg1 string + }{arg1}) + stub := fake.CleanUpStub + fakeReturns := fake.cleanUpReturns + fake.recordInvocation("CleanUp", []interface{}{arg1}) + fake.cleanUpMutex.Unlock() + if stub != nil { + return stub(arg1) + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeDigestBlobstore) CleanUpCallCount() int { + fake.cleanUpMutex.RLock() + defer fake.cleanUpMutex.RUnlock() + return len(fake.cleanUpArgsForCall) +} + +func (fake *FakeDigestBlobstore) CleanUpCalls(stub func(string) error) { + fake.cleanUpMutex.Lock() + defer fake.cleanUpMutex.Unlock() + fake.CleanUpStub = stub +} + +func (fake *FakeDigestBlobstore) CleanUpArgsForCall(i int) string { + fake.cleanUpMutex.RLock() + defer fake.cleanUpMutex.RUnlock() + argsForCall := fake.cleanUpArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeDigestBlobstore) CleanUpReturns(result1 error) { + fake.cleanUpMutex.Lock() + defer fake.cleanUpMutex.Unlock() + fake.CleanUpStub = nil + fake.cleanUpReturns = struct { + result1 error + }{result1} +} + +func (fake *FakeDigestBlobstore) CleanUpReturnsOnCall(i int, result1 error) { + fake.cleanUpMutex.Lock() + defer fake.cleanUpMutex.Unlock() + fake.CleanUpStub = nil + if fake.cleanUpReturnsOnCall == nil { + fake.cleanUpReturnsOnCall = make(map[int]struct { + result1 error + }) + } + fake.cleanUpReturnsOnCall[i] = struct { + result1 error + }{result1} +} + +func (fake *FakeDigestBlobstore) Create(arg1 string) (string, crypto.MultipleDigest, error) { + fake.createMutex.Lock() + ret, specificReturn := fake.createReturnsOnCall[len(fake.createArgsForCall)] + fake.createArgsForCall = append(fake.createArgsForCall, struct { + arg1 string + }{arg1}) + stub := fake.CreateStub + fakeReturns := fake.createReturns + fake.recordInvocation("Create", []interface{}{arg1}) + fake.createMutex.Unlock() + if stub != nil { + return stub(arg1) + } + if specificReturn { + return ret.result1, ret.result2, ret.result3 + } + return fakeReturns.result1, fakeReturns.result2, fakeReturns.result3 +} + +func (fake *FakeDigestBlobstore) CreateCallCount() int { + fake.createMutex.RLock() + defer fake.createMutex.RUnlock() + return len(fake.createArgsForCall) +} + +func (fake *FakeDigestBlobstore) CreateCalls(stub func(string) (string, crypto.MultipleDigest, error)) { + fake.createMutex.Lock() + defer fake.createMutex.Unlock() + fake.CreateStub = stub +} + +func (fake *FakeDigestBlobstore) CreateArgsForCall(i int) string { + fake.createMutex.RLock() + defer fake.createMutex.RUnlock() + argsForCall := fake.createArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeDigestBlobstore) CreateReturns(result1 string, result2 crypto.MultipleDigest, result3 error) { + fake.createMutex.Lock() + defer fake.createMutex.Unlock() + fake.CreateStub = nil + fake.createReturns = struct { + result1 string + result2 crypto.MultipleDigest + result3 error + }{result1, result2, result3} +} + +func (fake *FakeDigestBlobstore) CreateReturnsOnCall(i int, result1 string, result2 crypto.MultipleDigest, result3 error) { + fake.createMutex.Lock() + defer fake.createMutex.Unlock() + fake.CreateStub = nil + if fake.createReturnsOnCall == nil { + fake.createReturnsOnCall = make(map[int]struct { + result1 string + result2 crypto.MultipleDigest + result3 error + }) + } + fake.createReturnsOnCall[i] = struct { + result1 string + result2 crypto.MultipleDigest + result3 error + }{result1, result2, result3} +} + +func (fake *FakeDigestBlobstore) Delete(arg1 string) error { + fake.deleteMutex.Lock() + ret, specificReturn := fake.deleteReturnsOnCall[len(fake.deleteArgsForCall)] + fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct { + arg1 string + }{arg1}) + stub := fake.DeleteStub + fakeReturns := fake.deleteReturns + fake.recordInvocation("Delete", []interface{}{arg1}) + fake.deleteMutex.Unlock() + if stub != nil { + return stub(arg1) + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeDigestBlobstore) DeleteCallCount() int { + fake.deleteMutex.RLock() + defer fake.deleteMutex.RUnlock() + return len(fake.deleteArgsForCall) +} + +func (fake *FakeDigestBlobstore) DeleteCalls(stub func(string) error) { + fake.deleteMutex.Lock() + defer fake.deleteMutex.Unlock() + fake.DeleteStub = stub +} + +func (fake *FakeDigestBlobstore) DeleteArgsForCall(i int) string { + fake.deleteMutex.RLock() + defer fake.deleteMutex.RUnlock() + argsForCall := fake.deleteArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeDigestBlobstore) DeleteReturns(result1 error) { + fake.deleteMutex.Lock() + defer fake.deleteMutex.Unlock() + fake.DeleteStub = nil + fake.deleteReturns = struct { + result1 error + }{result1} +} + +func (fake *FakeDigestBlobstore) DeleteReturnsOnCall(i int, result1 error) { + fake.deleteMutex.Lock() + defer fake.deleteMutex.Unlock() + fake.DeleteStub = nil + if fake.deleteReturnsOnCall == nil { + fake.deleteReturnsOnCall = make(map[int]struct { + result1 error + }) + } + fake.deleteReturnsOnCall[i] = struct { + result1 error + }{result1} +} + +func (fake *FakeDigestBlobstore) Get(arg1 string, arg2 crypto.Digest) (string, error) { + fake.getMutex.Lock() + ret, specificReturn := fake.getReturnsOnCall[len(fake.getArgsForCall)] + fake.getArgsForCall = append(fake.getArgsForCall, struct { + arg1 string + arg2 crypto.Digest + }{arg1, arg2}) + stub := fake.GetStub + fakeReturns := fake.getReturns + fake.recordInvocation("Get", []interface{}{arg1, arg2}) + fake.getMutex.Unlock() + if stub != nil { + return stub(arg1, arg2) + } + if specificReturn { + return ret.result1, ret.result2 + } + return fakeReturns.result1, fakeReturns.result2 +} + +func (fake *FakeDigestBlobstore) GetCallCount() int { + fake.getMutex.RLock() + defer fake.getMutex.RUnlock() + return len(fake.getArgsForCall) +} + +func (fake *FakeDigestBlobstore) GetCalls(stub func(string, crypto.Digest) (string, error)) { + fake.getMutex.Lock() + defer fake.getMutex.Unlock() + fake.GetStub = stub +} + +func (fake *FakeDigestBlobstore) GetArgsForCall(i int) (string, crypto.Digest) { + fake.getMutex.RLock() + defer fake.getMutex.RUnlock() + argsForCall := fake.getArgsForCall[i] + return argsForCall.arg1, argsForCall.arg2 +} + +func (fake *FakeDigestBlobstore) GetReturns(result1 string, result2 error) { + fake.getMutex.Lock() + defer fake.getMutex.Unlock() + fake.GetStub = nil + fake.getReturns = struct { + result1 string + result2 error + }{result1, result2} +} + +func (fake *FakeDigestBlobstore) GetReturnsOnCall(i int, result1 string, result2 error) { + fake.getMutex.Lock() + defer fake.getMutex.Unlock() + fake.GetStub = nil + if fake.getReturnsOnCall == nil { + fake.getReturnsOnCall = make(map[int]struct { + result1 string + result2 error + }) + } + fake.getReturnsOnCall[i] = struct { + result1 string + result2 error + }{result1, result2} +} + +func (fake *FakeDigestBlobstore) Validate() error { + fake.validateMutex.Lock() + ret, specificReturn := fake.validateReturnsOnCall[len(fake.validateArgsForCall)] + fake.validateArgsForCall = append(fake.validateArgsForCall, struct { + }{}) + stub := fake.ValidateStub + fakeReturns := fake.validateReturns + fake.recordInvocation("Validate", []interface{}{}) + fake.validateMutex.Unlock() + if stub != nil { + return stub() + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeDigestBlobstore) ValidateCallCount() int { + fake.validateMutex.RLock() + defer fake.validateMutex.RUnlock() + return len(fake.validateArgsForCall) +} + +func (fake *FakeDigestBlobstore) ValidateCalls(stub func() error) { + fake.validateMutex.Lock() + defer fake.validateMutex.Unlock() + fake.ValidateStub = stub +} + +func (fake *FakeDigestBlobstore) ValidateReturns(result1 error) { + fake.validateMutex.Lock() + defer fake.validateMutex.Unlock() + fake.ValidateStub = nil + fake.validateReturns = struct { + result1 error + }{result1} +} + +func (fake *FakeDigestBlobstore) ValidateReturnsOnCall(i int, result1 error) { + fake.validateMutex.Lock() + defer fake.validateMutex.Unlock() + fake.ValidateStub = nil + if fake.validateReturnsOnCall == nil { + fake.validateReturnsOnCall = make(map[int]struct { + result1 error + }) + } + fake.validateReturnsOnCall[i] = struct { + result1 error + }{result1} +} + +func (fake *FakeDigestBlobstore) Invocations() map[string][][]interface{} { + fake.invocationsMutex.RLock() + defer fake.invocationsMutex.RUnlock() + copiedInvocations := map[string][][]interface{}{} + for key, value := range fake.invocations { + copiedInvocations[key] = value + } + return copiedInvocations +} + +func (fake *FakeDigestBlobstore) recordInvocation(key string, args []interface{}) { + fake.invocationsMutex.Lock() + defer fake.invocationsMutex.Unlock() + if fake.invocations == nil { + fake.invocations = map[string][][]interface{}{} + } + if fake.invocations[key] == nil { + fake.invocations[key] = [][]interface{}{} + } + fake.invocations[key] = append(fake.invocations[key], args) +} + +var _ blobstore.DigestBlobstore = new(FakeDigestBlobstore) diff --git a/vendor/github.com/cloudfoundry/bosh-utils/blobstore/fakes/fake_blobstore.go b/vendor/github.com/cloudfoundry/bosh-utils/blobstore/fakes/fake_blobstore.go deleted file mode 100644 index 9768f92dfa..0000000000 --- a/vendor/github.com/cloudfoundry/bosh-utils/blobstore/fakes/fake_blobstore.go +++ /dev/null @@ -1,237 +0,0 @@ -// This file was generated by counterfeiter -package fakes - -import ( - "sync" - - "github.com/cloudfoundry/bosh-utils/blobstore" -) - -type FakeBlobstore struct { - GetStub func(blobID string) (fileName string, err error) - getMutex sync.RWMutex - getArgsForCall []struct { - blobID string - } - getReturns struct { - result1 string - result2 error - } - CleanUpStub func(fileName string) (err error) - cleanUpMutex sync.RWMutex - cleanUpArgsForCall []struct { - fileName string - } - cleanUpReturns struct { - result1 error - } - CreateStub func(fileName string) (blobID string, err error) - createMutex sync.RWMutex - createArgsForCall []struct { - fileName string - } - createReturns struct { - result1 string - result2 error - } - ValidateStub func() (err error) - validateMutex sync.RWMutex - validateArgsForCall []struct{} - validateReturns struct { - result1 error - } - DeleteStub func(blobId string) (err error) - deleteMutex sync.RWMutex - deleteArgsForCall []struct { - blobId string - } - deleteReturns struct { - result1 error - } - invocations map[string][][]interface{} - invocationsMutex sync.RWMutex -} - -func (fake *FakeBlobstore) Get(blobID string) (fileName string, err error) { - fake.getMutex.Lock() - fake.getArgsForCall = append(fake.getArgsForCall, struct { - blobID string - }{blobID}) - fake.recordInvocation("Get", []interface{}{blobID}) - fake.getMutex.Unlock() - if fake.GetStub != nil { - return fake.GetStub(blobID) - } - return fake.getReturns.result1, fake.getReturns.result2 -} - -func (fake *FakeBlobstore) GetCallCount() int { - fake.getMutex.RLock() - defer fake.getMutex.RUnlock() - return len(fake.getArgsForCall) -} - -func (fake *FakeBlobstore) GetArgsForCall(i int) string { - fake.getMutex.RLock() - defer fake.getMutex.RUnlock() - return fake.getArgsForCall[i].blobID -} - -func (fake *FakeBlobstore) GetReturns(result1 string, result2 error) { - fake.GetStub = nil - fake.getReturns = struct { - result1 string - result2 error - }{result1, result2} -} - -func (fake *FakeBlobstore) CleanUp(fileName string) (err error) { - fake.cleanUpMutex.Lock() - fake.cleanUpArgsForCall = append(fake.cleanUpArgsForCall, struct { - fileName string - }{fileName}) - fake.recordInvocation("CleanUp", []interface{}{fileName}) - fake.cleanUpMutex.Unlock() - if fake.CleanUpStub != nil { - return fake.CleanUpStub(fileName) - } - return fake.cleanUpReturns.result1 -} - -func (fake *FakeBlobstore) CleanUpCallCount() int { - fake.cleanUpMutex.RLock() - defer fake.cleanUpMutex.RUnlock() - return len(fake.cleanUpArgsForCall) -} - -func (fake *FakeBlobstore) CleanUpArgsForCall(i int) string { - fake.cleanUpMutex.RLock() - defer fake.cleanUpMutex.RUnlock() - return fake.cleanUpArgsForCall[i].fileName -} - -func (fake *FakeBlobstore) CleanUpReturns(result1 error) { - fake.CleanUpStub = nil - fake.cleanUpReturns = struct { - result1 error - }{result1} -} - -func (fake *FakeBlobstore) Create(fileName string) (blobID string, err error) { - fake.createMutex.Lock() - fake.createArgsForCall = append(fake.createArgsForCall, struct { - fileName string - }{fileName}) - fake.recordInvocation("Create", []interface{}{fileName}) - fake.createMutex.Unlock() - if fake.CreateStub != nil { - return fake.CreateStub(fileName) - } - return fake.createReturns.result1, fake.createReturns.result2 -} - -func (fake *FakeBlobstore) CreateCallCount() int { - fake.createMutex.RLock() - defer fake.createMutex.RUnlock() - return len(fake.createArgsForCall) -} - -func (fake *FakeBlobstore) CreateArgsForCall(i int) string { - fake.createMutex.RLock() - defer fake.createMutex.RUnlock() - return fake.createArgsForCall[i].fileName -} - -func (fake *FakeBlobstore) CreateReturns(result1 string, result2 error) { - fake.CreateStub = nil - fake.createReturns = struct { - result1 string - result2 error - }{result1, result2} -} - -func (fake *FakeBlobstore) Validate() (err error) { - fake.validateMutex.Lock() - fake.validateArgsForCall = append(fake.validateArgsForCall, struct{}{}) - fake.recordInvocation("Validate", []interface{}{}) - fake.validateMutex.Unlock() - if fake.ValidateStub != nil { - return fake.ValidateStub() - } - return fake.validateReturns.result1 -} - -func (fake *FakeBlobstore) ValidateCallCount() int { - fake.validateMutex.RLock() - defer fake.validateMutex.RUnlock() - return len(fake.validateArgsForCall) -} - -func (fake *FakeBlobstore) ValidateReturns(result1 error) { - fake.ValidateStub = nil - fake.validateReturns = struct { - result1 error - }{result1} -} - -func (fake *FakeBlobstore) Delete(blobId string) (err error) { - fake.deleteMutex.Lock() - fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct { - blobId string - }{blobId}) - fake.recordInvocation("Delete", []interface{}{blobId}) - fake.deleteMutex.Unlock() - if fake.DeleteStub != nil { - return fake.DeleteStub(blobId) - } - return fake.deleteReturns.result1 -} - -func (fake *FakeBlobstore) DeleteCallCount() int { - fake.deleteMutex.RLock() - defer fake.deleteMutex.RUnlock() - return len(fake.deleteArgsForCall) -} - -func (fake *FakeBlobstore) DeleteArgsForCall(i int) string { - fake.deleteMutex.RLock() - defer fake.deleteMutex.RUnlock() - return fake.deleteArgsForCall[i].blobId -} - -func (fake *FakeBlobstore) DeleteReturns(result1 error) { - fake.DeleteStub = nil - fake.deleteReturns = struct { - result1 error - }{result1} -} - -func (fake *FakeBlobstore) Invocations() map[string][][]interface{} { - fake.invocationsMutex.RLock() - defer fake.invocationsMutex.RUnlock() - fake.getMutex.RLock() - defer fake.getMutex.RUnlock() - fake.cleanUpMutex.RLock() - defer fake.cleanUpMutex.RUnlock() - fake.createMutex.RLock() - defer fake.createMutex.RUnlock() - fake.validateMutex.RLock() - defer fake.validateMutex.RUnlock() - fake.deleteMutex.RLock() - defer fake.deleteMutex.RUnlock() - return fake.invocations -} - -func (fake *FakeBlobstore) recordInvocation(key string, args []interface{}) { - fake.invocationsMutex.Lock() - defer fake.invocationsMutex.Unlock() - if fake.invocations == nil { - fake.invocations = map[string][][]interface{}{} - } - if fake.invocations[key] == nil { - fake.invocations[key] = [][]interface{}{} - } - fake.invocations[key] = append(fake.invocations[key], args) -} - -var _ blobstore.Blobstore = new(FakeBlobstore) diff --git a/vendor/github.com/cloudfoundry/bosh-utils/blobstore/fakes/fake_digest_blobstore.go b/vendor/github.com/cloudfoundry/bosh-utils/blobstore/fakes/fake_digest_blobstore.go deleted file mode 100644 index 874160ec34..0000000000 --- a/vendor/github.com/cloudfoundry/bosh-utils/blobstore/fakes/fake_digest_blobstore.go +++ /dev/null @@ -1,242 +0,0 @@ -// This file was generated by counterfeiter -package fakes - -import ( - "sync" - - "github.com/cloudfoundry/bosh-utils/blobstore" - boshcrypto "github.com/cloudfoundry/bosh-utils/crypto" -) - -type FakeDigestBlobstore struct { - GetStub func(blobID string, digest boshcrypto.Digest) (fileName string, err error) - getMutex sync.RWMutex - getArgsForCall []struct { - blobID string - digest boshcrypto.Digest - } - getReturns struct { - result1 string - result2 error - } - CleanUpStub func(fileName string) (err error) - cleanUpMutex sync.RWMutex - cleanUpArgsForCall []struct { - fileName string - } - cleanUpReturns struct { - result1 error - } - CreateStub func(fileName string) (blobID string, digest boshcrypto.MultipleDigest, err error) - createMutex sync.RWMutex - createArgsForCall []struct { - fileName string - } - createReturns struct { - result1 string - result2 boshcrypto.MultipleDigest - result3 error - } - ValidateStub func() (err error) - validateMutex sync.RWMutex - validateArgsForCall []struct{} - validateReturns struct { - result1 error - } - DeleteStub func(blobId string) (err error) - deleteMutex sync.RWMutex - deleteArgsForCall []struct { - blobId string - } - deleteReturns struct { - result1 error - } - invocations map[string][][]interface{} - invocationsMutex sync.RWMutex -} - -func (fake *FakeDigestBlobstore) Get(blobID string, digest boshcrypto.Digest) (fileName string, err error) { - fake.getMutex.Lock() - fake.getArgsForCall = append(fake.getArgsForCall, struct { - blobID string - digest boshcrypto.Digest - }{blobID, digest}) - fake.recordInvocation("Get", []interface{}{blobID, digest}) - fake.getMutex.Unlock() - if fake.GetStub != nil { - return fake.GetStub(blobID, digest) - } - return fake.getReturns.result1, fake.getReturns.result2 -} - -func (fake *FakeDigestBlobstore) GetCallCount() int { - fake.getMutex.RLock() - defer fake.getMutex.RUnlock() - return len(fake.getArgsForCall) -} - -func (fake *FakeDigestBlobstore) GetArgsForCall(i int) (string, boshcrypto.Digest) { - fake.getMutex.RLock() - defer fake.getMutex.RUnlock() - return fake.getArgsForCall[i].blobID, fake.getArgsForCall[i].digest -} - -func (fake *FakeDigestBlobstore) GetReturns(result1 string, result2 error) { - fake.GetStub = nil - fake.getReturns = struct { - result1 string - result2 error - }{result1, result2} -} - -func (fake *FakeDigestBlobstore) CleanUp(fileName string) (err error) { - fake.cleanUpMutex.Lock() - fake.cleanUpArgsForCall = append(fake.cleanUpArgsForCall, struct { - fileName string - }{fileName}) - fake.recordInvocation("CleanUp", []interface{}{fileName}) - fake.cleanUpMutex.Unlock() - if fake.CleanUpStub != nil { - return fake.CleanUpStub(fileName) - } - return fake.cleanUpReturns.result1 -} - -func (fake *FakeDigestBlobstore) CleanUpCallCount() int { - fake.cleanUpMutex.RLock() - defer fake.cleanUpMutex.RUnlock() - return len(fake.cleanUpArgsForCall) -} - -func (fake *FakeDigestBlobstore) CleanUpArgsForCall(i int) string { - fake.cleanUpMutex.RLock() - defer fake.cleanUpMutex.RUnlock() - return fake.cleanUpArgsForCall[i].fileName -} - -func (fake *FakeDigestBlobstore) CleanUpReturns(result1 error) { - fake.CleanUpStub = nil - fake.cleanUpReturns = struct { - result1 error - }{result1} -} - -func (fake *FakeDigestBlobstore) Create(fileName string) (blobID string, digest boshcrypto.MultipleDigest, err error) { - fake.createMutex.Lock() - fake.createArgsForCall = append(fake.createArgsForCall, struct { - fileName string - }{fileName}) - fake.recordInvocation("Create", []interface{}{fileName}) - fake.createMutex.Unlock() - if fake.CreateStub != nil { - return fake.CreateStub(fileName) - } - return fake.createReturns.result1, fake.createReturns.result2, fake.createReturns.result3 -} - -func (fake *FakeDigestBlobstore) CreateCallCount() int { - fake.createMutex.RLock() - defer fake.createMutex.RUnlock() - return len(fake.createArgsForCall) -} - -func (fake *FakeDigestBlobstore) CreateArgsForCall(i int) string { - fake.createMutex.RLock() - defer fake.createMutex.RUnlock() - return fake.createArgsForCall[i].fileName -} - -func (fake *FakeDigestBlobstore) CreateReturns(result1 string, result2 boshcrypto.MultipleDigest, result3 error) { - fake.CreateStub = nil - fake.createReturns = struct { - result1 string - result2 boshcrypto.MultipleDigest - result3 error - }{result1, result2, result3} -} - -func (fake *FakeDigestBlobstore) Validate() (err error) { - fake.validateMutex.Lock() - fake.validateArgsForCall = append(fake.validateArgsForCall, struct{}{}) - fake.recordInvocation("Validate", []interface{}{}) - fake.validateMutex.Unlock() - if fake.ValidateStub != nil { - return fake.ValidateStub() - } - return fake.validateReturns.result1 -} - -func (fake *FakeDigestBlobstore) ValidateCallCount() int { - fake.validateMutex.RLock() - defer fake.validateMutex.RUnlock() - return len(fake.validateArgsForCall) -} - -func (fake *FakeDigestBlobstore) ValidateReturns(result1 error) { - fake.ValidateStub = nil - fake.validateReturns = struct { - result1 error - }{result1} -} - -func (fake *FakeDigestBlobstore) Delete(blobId string) (err error) { - fake.deleteMutex.Lock() - fake.deleteArgsForCall = append(fake.deleteArgsForCall, struct { - blobId string - }{blobId}) - fake.recordInvocation("Delete", []interface{}{blobId}) - fake.deleteMutex.Unlock() - if fake.DeleteStub != nil { - return fake.DeleteStub(blobId) - } - return fake.deleteReturns.result1 -} - -func (fake *FakeDigestBlobstore) DeleteCallCount() int { - fake.deleteMutex.RLock() - defer fake.deleteMutex.RUnlock() - return len(fake.deleteArgsForCall) -} - -func (fake *FakeDigestBlobstore) DeleteArgsForCall(i int) string { - fake.deleteMutex.RLock() - defer fake.deleteMutex.RUnlock() - return fake.deleteArgsForCall[i].blobId -} - -func (fake *FakeDigestBlobstore) DeleteReturns(result1 error) { - fake.DeleteStub = nil - fake.deleteReturns = struct { - result1 error - }{result1} -} - -func (fake *FakeDigestBlobstore) Invocations() map[string][][]interface{} { - fake.invocationsMutex.RLock() - defer fake.invocationsMutex.RUnlock() - fake.getMutex.RLock() - defer fake.getMutex.RUnlock() - fake.cleanUpMutex.RLock() - defer fake.cleanUpMutex.RUnlock() - fake.createMutex.RLock() - defer fake.createMutex.RUnlock() - fake.validateMutex.RLock() - defer fake.validateMutex.RUnlock() - fake.deleteMutex.RLock() - defer fake.deleteMutex.RUnlock() - return fake.invocations -} - -func (fake *FakeDigestBlobstore) recordInvocation(key string, args []interface{}) { - fake.invocationsMutex.Lock() - defer fake.invocationsMutex.Unlock() - if fake.invocations == nil { - fake.invocations = map[string][][]interface{}{} - } - if fake.invocations[key] == nil { - fake.invocations[key] = [][]interface{}{} - } - fake.invocations[key] = append(fake.invocations[key], args) -} - -var _ blobstore.DigestBlobstore = new(FakeDigestBlobstore) diff --git a/vendor/github.com/cloudfoundry/bosh-utils/blobstore/digest_blobstore_interface.go b/vendor/github.com/cloudfoundry/bosh-utils/blobstore/interfaces.go similarity index 52% rename from vendor/github.com/cloudfoundry/bosh-utils/blobstore/digest_blobstore_interface.go rename to vendor/github.com/cloudfoundry/bosh-utils/blobstore/interfaces.go index 337608b3b2..195b4b1b42 100644 --- a/vendor/github.com/cloudfoundry/bosh-utils/blobstore/digest_blobstore_interface.go +++ b/vendor/github.com/cloudfoundry/bosh-utils/blobstore/interfaces.go @@ -1,12 +1,27 @@ package blobstore +//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate + import ( boshcrypto "github.com/cloudfoundry/bosh-utils/crypto" ) +//counterfeiter:generate . Blobstore +type Blobstore interface { + Get(blobID string) (fileName string, err error) + + CleanUp(fileName string) (err error) + + Create(fileName string) (blobID string, err error) + + Validate() (err error) + + Delete(blobId string) (err error) +} + +//counterfeiter:generate . DigestBlobstore type DigestBlobstore interface { - // Assuming that local file system is available, - // file handle is returned to downloaded blob. + // Assuming that local file system is available, file handle is returned to downloaded blob. // Caller must not assume anything about layout of such scratch space. // Cleanup call is needed to properly cleanup downloaded blob. diff --git a/vendor/github.com/cloudfoundry/bosh-utils/crypto/cryptofakes/fake_archive_digest_file_path_reader.go b/vendor/github.com/cloudfoundry/bosh-utils/crypto/cryptofakes/fake_archive_digest_file_path_reader.go index 9edce05e81..90600f28d1 100644 --- a/vendor/github.com/cloudfoundry/bosh-utils/crypto/cryptofakes/fake_archive_digest_file_path_reader.go +++ b/vendor/github.com/cloudfoundry/bosh-utils/crypto/cryptofakes/fake_archive_digest_file_path_reader.go @@ -1,4 +1,4 @@ -// This file was generated by counterfeiter +// Code generated by counterfeiter. DO NOT EDIT. package cryptofakes import ( @@ -10,35 +10,44 @@ import ( ) type FakeArchiveDigestFilePathReader struct { - OpenFileStub func(path string, flag int, perm os.FileMode) (system.File, error) + OpenFileStub func(string, int, os.FileMode) (system.File, error) openFileMutex sync.RWMutex openFileArgsForCall []struct { - path string - flag int - perm os.FileMode + arg1 string + arg2 int + arg3 os.FileMode } openFileReturns struct { result1 system.File result2 error } + openFileReturnsOnCall map[int]struct { + result1 system.File + result2 error + } invocations map[string][][]interface{} invocationsMutex sync.RWMutex } -func (fake *FakeArchiveDigestFilePathReader) OpenFile(path string, flag int, perm os.FileMode) (system.File, error) { +func (fake *FakeArchiveDigestFilePathReader) OpenFile(arg1 string, arg2 int, arg3 os.FileMode) (system.File, error) { fake.openFileMutex.Lock() + ret, specificReturn := fake.openFileReturnsOnCall[len(fake.openFileArgsForCall)] fake.openFileArgsForCall = append(fake.openFileArgsForCall, struct { - path string - flag int - perm os.FileMode - }{path, flag, perm}) - fake.recordInvocation("OpenFile", []interface{}{path, flag, perm}) + arg1 string + arg2 int + arg3 os.FileMode + }{arg1, arg2, arg3}) + stub := fake.OpenFileStub + fakeReturns := fake.openFileReturns + fake.recordInvocation("OpenFile", []interface{}{arg1, arg2, arg3}) fake.openFileMutex.Unlock() - if fake.OpenFileStub != nil { - return fake.OpenFileStub(path, flag, perm) - } else { - return fake.openFileReturns.result1, fake.openFileReturns.result2 + if stub != nil { + return stub(arg1, arg2, arg3) } + if specificReturn { + return ret.result1, ret.result2 + } + return fakeReturns.result1, fakeReturns.result2 } func (fake *FakeArchiveDigestFilePathReader) OpenFileCallCount() int { @@ -47,13 +56,22 @@ func (fake *FakeArchiveDigestFilePathReader) OpenFileCallCount() int { return len(fake.openFileArgsForCall) } +func (fake *FakeArchiveDigestFilePathReader) OpenFileCalls(stub func(string, int, os.FileMode) (system.File, error)) { + fake.openFileMutex.Lock() + defer fake.openFileMutex.Unlock() + fake.OpenFileStub = stub +} + func (fake *FakeArchiveDigestFilePathReader) OpenFileArgsForCall(i int) (string, int, os.FileMode) { fake.openFileMutex.RLock() defer fake.openFileMutex.RUnlock() - return fake.openFileArgsForCall[i].path, fake.openFileArgsForCall[i].flag, fake.openFileArgsForCall[i].perm + argsForCall := fake.openFileArgsForCall[i] + return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3 } func (fake *FakeArchiveDigestFilePathReader) OpenFileReturns(result1 system.File, result2 error) { + fake.openFileMutex.Lock() + defer fake.openFileMutex.Unlock() fake.OpenFileStub = nil fake.openFileReturns = struct { result1 system.File @@ -61,12 +79,30 @@ func (fake *FakeArchiveDigestFilePathReader) OpenFileReturns(result1 system.File }{result1, result2} } +func (fake *FakeArchiveDigestFilePathReader) OpenFileReturnsOnCall(i int, result1 system.File, result2 error) { + fake.openFileMutex.Lock() + defer fake.openFileMutex.Unlock() + fake.OpenFileStub = nil + if fake.openFileReturnsOnCall == nil { + fake.openFileReturnsOnCall = make(map[int]struct { + result1 system.File + result2 error + }) + } + fake.openFileReturnsOnCall[i] = struct { + result1 system.File + result2 error + }{result1, result2} +} + func (fake *FakeArchiveDigestFilePathReader) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.openFileMutex.RLock() - defer fake.openFileMutex.RUnlock() - return fake.invocations + copiedInvocations := map[string][][]interface{}{} + for key, value := range fake.invocations { + copiedInvocations[key] = value + } + return copiedInvocations } func (fake *FakeArchiveDigestFilePathReader) recordInvocation(key string, args []interface{}) { diff --git a/vendor/github.com/cloudfoundry/bosh-utils/crypto/interfaces.go b/vendor/github.com/cloudfoundry/bosh-utils/crypto/interfaces.go index b42438fa0c..0e0618f835 100644 --- a/vendor/github.com/cloudfoundry/bosh-utils/crypto/interfaces.go +++ b/vendor/github.com/cloudfoundry/bosh-utils/crypto/interfaces.go @@ -1,5 +1,7 @@ package crypto +//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate + import ( "io" "os" @@ -14,7 +16,7 @@ type Digest interface { String() string } -//go:generate counterfeiter . ArchiveDigestFilePathReader +//counterfeiter:generate . ArchiveDigestFilePathReader type ArchiveDigestFilePathReader interface { OpenFile(path string, flag int, perm os.FileMode) (boshsys.File, error) } diff --git a/vendor/github.com/cloudfoundry/bosh-utils/logger/loggerfakes/fake_logger.go b/vendor/github.com/cloudfoundry/bosh-utils/logger/loggerfakes/fake_logger.go index 337d09b949..6a2d2ec57d 100644 --- a/vendor/github.com/cloudfoundry/bosh-utils/logger/loggerfakes/fake_logger.go +++ b/vendor/github.com/cloudfoundry/bosh-utils/logger/loggerfakes/fake_logger.go @@ -532,30 +532,6 @@ func (fake *FakeLogger) WarnArgsForCall(i int) (string, string, []interface{}) { func (fake *FakeLogger) Invocations() map[string][][]interface{} { fake.invocationsMutex.RLock() defer fake.invocationsMutex.RUnlock() - fake.debugMutex.RLock() - defer fake.debugMutex.RUnlock() - fake.debugWithDetailsMutex.RLock() - defer fake.debugWithDetailsMutex.RUnlock() - fake.errorMutex.RLock() - defer fake.errorMutex.RUnlock() - fake.errorWithDetailsMutex.RLock() - defer fake.errorWithDetailsMutex.RUnlock() - fake.flushMutex.RLock() - defer fake.flushMutex.RUnlock() - fake.flushTimeoutMutex.RLock() - defer fake.flushTimeoutMutex.RUnlock() - fake.handlePanicMutex.RLock() - defer fake.handlePanicMutex.RUnlock() - fake.infoMutex.RLock() - defer fake.infoMutex.RUnlock() - fake.toggleForcedDebugMutex.RLock() - defer fake.toggleForcedDebugMutex.RUnlock() - fake.useRFC3339TimestampsMutex.RLock() - defer fake.useRFC3339TimestampsMutex.RUnlock() - fake.useTagsMutex.RLock() - defer fake.useTagsMutex.RUnlock() - fake.warnMutex.RLock() - defer fake.warnMutex.RUnlock() copiedInvocations := map[string][][]interface{}{} for key, value := range fake.invocations { copiedInvocations[key] = value diff --git a/vendor/github.com/gopacket/gopacket/decode.go b/vendor/github.com/gopacket/gopacket/decode.go index a53312d2a3..6937ebd2d8 100644 --- a/vendor/github.com/gopacket/gopacket/decode.go +++ b/vendor/github.com/gopacket/gopacket/decode.go @@ -10,6 +10,9 @@ import ( "errors" ) +// ErrUnsupportedLayer is returned by decoders when they encounter a layer type that they do not support. +var ErrUnsupportedLayer = errors.New("Layer type not currently supported") + // DecodeFeedback is used by DecodingLayer layers to provide decoding metadata. type DecodeFeedback interface { // SetTruncated should be called if during decoding you notice that a packet @@ -154,5 +157,5 @@ func (d *DecodeFailure) LayerType() LayerType { return LayerTypeDecodeFailure } // decodeUnknown "decodes" unsupported data types by returning an error. // This decoder will thus always return a DecodeFailure layer. func decodeUnknown(data []byte, p PacketBuilder) error { - return errors.New("Layer type not currently supported") + return ErrUnsupportedLayer } diff --git a/vendor/github.com/gopacket/gopacket/layers/sctp.go b/vendor/github.com/gopacket/gopacket/layers/sctp.go index 0871f942b3..25ac7a63cf 100644 --- a/vendor/github.com/gopacket/gopacket/layers/sctp.go +++ b/vendor/github.com/gopacket/gopacket/layers/sctp.go @@ -190,14 +190,34 @@ type SCTPParameter struct { Value []byte } -func decodeSCTPParameter(data []byte) SCTPParameter { +// Minimum lengths covering the fixed fields each SCTP decoder reads. +const ( + sctpParameterMinLength = 4 + sctpInitMinLength = 20 + sctpSackMinLength = 16 + sctpShutdownMinLength = 8 +) + +func decodeSCTPParameter(data []byte) (SCTPParameter, error) { + if len(data) < sctpParameterMinLength { + return SCTPParameter{}, errors.New("invalid SCTP parameter length") + } length := binary.BigEndian.Uint16(data[2:4]) + if length < sctpParameterMinLength || int(length) > len(data) { + return SCTPParameter{}, errors.New("invalid SCTP parameter length") + } return SCTPParameter{ Type: binary.BigEndian.Uint16(data[0:2]), Length: length, Value: data[4:length], ActualLength: roundUpToNearest4(int(length)), - } + }, nil +} + +// nextSCTPParameter skips past p. The last parameter's padding may lie +// outside the chunk length (RFC 9260 3.2), so the skip is clamped. +func nextSCTPParameter(data []byte, p SCTPParameter) []byte { + return data[min(p.ActualLength, len(data)):] } func (p SCTPParameter) Bytes() []byte { @@ -425,6 +445,9 @@ func decodeSCTPInit(data []byte, p gopacket.PacketBuilder) error { if err != nil { return err } + if chunk.Length < sctpInitMinLength { + return errors.New("invalid SCTP init chunk length") + } sc := &SCTPInit{ SCTPChunk: chunk, InitiateTag: binary.BigEndian.Uint32(data[4:8]), @@ -435,9 +458,12 @@ func decodeSCTPInit(data []byte, p gopacket.PacketBuilder) error { } paramData := data[20:sc.ActualLength] for len(paramData) > 0 { - p := SCTPInitParameter(decodeSCTPParameter(paramData)) - paramData = paramData[p.ActualLength:] - sc.Parameters = append(sc.Parameters, p) + param, err := decodeSCTPParameter(paramData) + if err != nil { + return err + } + paramData = nextSCTPParameter(paramData, param) + sc.Parameters = append(sc.Parameters, SCTPInitParameter(param)) } p.AddLayer(sc) return p.NextDecoder(gopacket.DecodeFunc(decodeWithSCTPChunkTypePrefix)) @@ -486,6 +512,9 @@ func decodeSCTPSack(data []byte, p gopacket.PacketBuilder) error { if err != nil { return err } + if chunk.Length < sctpSackMinLength { + return errors.New("invalid SCTP sack chunk length") + } sc := &SCTPSack{ SCTPChunk: chunk, CumulativeTSNAck: binary.BigEndian.Uint32(data[4:8]), @@ -495,10 +524,9 @@ func decodeSCTPSack(data []byte, p gopacket.PacketBuilder) error { } // We maximize gapAcks and dupTSNs here so we're not allocating tons // of memory based on a user-controlable field. Our maximums are not exact, - // but should give us sane defaults... we'll still hit slice boundaries and - // fail if the user-supplied values are too high (in the for loops below), but - // the amount of memory we'll have allocated because of that should be small - // (< sc.ActualLength) + // but should give us sane defaults... counts too high for the chunk are + // rejected below, and the amount of memory we'll have allocated by then + // should be small (< sc.ActualLength) gapAcks := sc.SCTPChunk.ActualLength / 2 dupTSNs := (sc.SCTPChunk.ActualLength - gapAcks*2) / 4 if gapAcks > int(sc.NumGapACKs) { @@ -509,7 +537,13 @@ func decodeSCTPSack(data []byte, p gopacket.PacketBuilder) error { } sc.GapACKs = make([]uint16, 0, gapAcks) sc.DuplicateTSNs = make([]uint32, 0, dupTSNs) - bytesRemaining := data[16:] + bytesRemaining := data[sctpSackMinLength:sc.Length] + + // Counts are attacker-controlled; reject them if the chunk can't hold + // the entries they announce. + if 2*int(sc.NumGapACKs)+4*int(sc.NumDuplicateTSNs) > len(bytesRemaining) { + return errors.New("SCTP sack counts exceed chunk length") + } for i := 0; i < int(sc.NumGapACKs); i++ { sc.GapACKs = append(sc.GapACKs, binary.BigEndian.Uint16(bytesRemaining[:2])) bytesRemaining = bytesRemaining[2:] @@ -575,9 +609,12 @@ func decodeSCTPHeartbeat(data []byte, p gopacket.PacketBuilder) error { } paramData := data[4:sc.Length] for len(paramData) > 0 { - p := SCTPHeartbeatParameter(decodeSCTPParameter(paramData)) - paramData = paramData[p.ActualLength:] - sc.Parameters = append(sc.Parameters, p) + param, err := decodeSCTPParameter(paramData) + if err != nil { + return err + } + paramData = nextSCTPParameter(paramData, param) + sc.Parameters = append(sc.Parameters, SCTPHeartbeatParameter(param)) } p.AddLayer(sc) return p.NextDecoder(gopacket.DecodeFunc(decodeWithSCTPChunkTypePrefix)) @@ -631,9 +668,12 @@ func decodeSCTPError(data []byte, p gopacket.PacketBuilder) error { } paramData := data[4:sc.Length] for len(paramData) > 0 { - p := SCTPErrorParameter(decodeSCTPParameter(paramData)) - paramData = paramData[p.ActualLength:] - sc.Parameters = append(sc.Parameters, p) + param, err := decodeSCTPParameter(paramData) + if err != nil { + return err + } + paramData = nextSCTPParameter(paramData, param) + sc.Parameters = append(sc.Parameters, SCTPErrorParameter(param)) } p.AddLayer(sc) return p.NextDecoder(gopacket.DecodeFunc(decodeWithSCTPChunkTypePrefix)) @@ -672,6 +712,9 @@ func decodeSCTPShutdown(data []byte, p gopacket.PacketBuilder) error { if err != nil { return err } + if chunk.Length < sctpShutdownMinLength { + return errors.New("invalid SCTP shutdown chunk length") + } sc := &SCTPShutdown{ SCTPChunk: chunk, CumulativeTSNAck: binary.BigEndian.Uint32(data[4:8]), diff --git a/vendor/github.com/mattn/go-runewidth/runewidth.go b/vendor/github.com/mattn/go-runewidth/runewidth.go index af03e996e9..c2e0946556 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth.go @@ -54,10 +54,24 @@ var ( strictWidthLUT [2][0x110000]byte strictWidthLUTLimit atomic.Int32 strictWidthLUTOnce sync.Once + + // joinerBits is the joiner table as a bitmap over + // [joinerBase, 0x10000), the range where the per-rune test has to be + // cheap for the fast paths in StringWidth and Wrap to pay off. It is + // 7.6 KB and init fills it in a few microseconds. Runes above it stay + // on the interval search: they are rare in the text these fast paths + // are for, and the emoji that are common there leave the fast path at + // their first joiner anyway. + joinerBits [(0x10000 - joinerBase) / 8]byte ) +// joinerBase is the lowest rune in the joiner table. CR is the only rune +// below it that can form a multi-rune cluster, by pairing with LF. +const joinerBase = 0x300 + func init() { initStrictWidthLUTLow() + fillJoinerBits() strictWidthLUTLimit.Store(0x300) handleEnv() } @@ -446,6 +460,60 @@ func (c *Condition) CreateLUT() { c.lutStrictEmojiNeutral = c.StrictEmojiNeutral } +// isASCII reports whether s has no byte above 0x7F, in which case every +// grapheme cluster in s is a single byte apart from CRLF. +func isASCII(s string) bool { + for i := 0; i < len(s); i++ { + if s[i] >= 0x80 { + return false + } + } + return true +} + +// fillJoinerBits paints joinerBits from the joiner table. +func fillJoinerBits() { + for _, iv := range joiner { + if iv.first >= 0x10000 { + break // the table is sorted, the rest is astral + } + lo, hi := int(iv.first)-joinerBase, int(iv.last)-joinerBase + if hi >= len(joinerBits)*8 { + hi = len(joinerBits)*8 - 1 + } + for lo <= hi { + if lo&7 == 0 && lo+7 <= hi { + joinerBits[lo>>3] = 0xFF + lo += 8 + continue + } + joinerBits[lo>>3] |= 1 << uint(lo&7) + lo++ + } + } + // A byte that is not valid UTF-8 decodes to U+FFFD, and the segmenter + // can gather a run of such bytes into one cluster, which a rune loop + // has no way to see. Marking U+FFFD keeps those strings on the + // segmenter, and the only string it holds back needlessly is one that + // really contains U+FFFD. + i := int(utf8.RuneError) - joinerBase + joinerBits[i>>3] |= 1 << uint(i&7) +} + +// isJoiner reports whether r can join with a neighbour into a multi-rune +// grapheme cluster. A string of runes for which it reports false has one +// rune per cluster, so measuring it needs no grapheme segmentation. +func isJoiner(r rune) bool { + if r < joinerBase { + return r == '\r' + } + if r < 0x10000 { + i := r - joinerBase + return joinerBits[i>>3]&(1<<(uint(i)&7)) != 0 + } + return inTable(r, joiner) +} + // graphemeWidth returns the width of a single grapheme cluster: the sum of // the widths of its runes, capped at 2 cells. The cap keeps multi-rune // sequences that render as a single glyph (ZWJ emoji, flags, Hangul jamo) @@ -489,6 +557,13 @@ func (c *Condition) StringWidth(s string) (width int) { return graphemes: + // Runes first: until one of them can join a cluster, each cluster is a + // single rune and segmenting the string would only find that out the + // expensive way. + if w, ok := c.runeWidthSum(s); ok { + width = w + return + } width = 0 g := graphemes.FromString(s) for g.Next() { @@ -497,12 +572,29 @@ graphemes: return } +// runeWidthSum adds up the widths of the runes in s, and reports false +// without a total once it meets a rune that can join a cluster, which is +// where per-rune widths stop being the whole story. +func (c *Condition) runeWidthSum(s string) (int, bool) { + width := 0 + for _, r := range s { + if isJoiner(r) { + return 0, false + } + width += c.RuneWidth(r) + } + return width, true +} + // Truncate return string truncated with w cells func (c *Condition) Truncate(s string, w int, tail string) string { if c.StringWidth(s) <= w { return s } w -= c.StringWidth(tail) + if pos, ok := c.truncateRunes(s, w); ok { + return s[:pos] + tail + } var width int pos := len(s) g := graphemes.FromString(s) @@ -517,12 +609,45 @@ func (c *Condition) Truncate(s string, w int, tail string) string { return s[:pos] + tail } +// truncateRunes is the loop in Truncate with every rune taken for a whole +// cluster, which holds until a rune can join one. It reports false there +// and leaves the string to the segmenter. +func (c *Condition) truncateRunes(s string, w int) (int, bool) { + width := 0 + for i, r := range s { + if isJoiner(r) { + return 0, false + } + cw := c.RuneWidth(r) + if width+cw > w { + return i, true + } + width += cw + } + return len(s), true +} + +// endsCluster reports whether the byte at i, which follows a rune that +// cannot join a cluster, also starts one. Cutting there is only safe when +// the rune that follows does not reach back. +func endsCluster(s string, i int) bool { + if i >= len(s) { + return true + } + r, _ := utf8.DecodeRuneInString(s[i:]) + return !isJoiner(r) +} + // TruncateLeft cuts w cells from the beginning of the `s`. func (c *Condition) TruncateLeft(s string, w int, prefix string) string { if c.StringWidth(s) <= w { return prefix } + if pos, pad, ok := c.truncateLeftRunes(s, w); ok { + return prefix + strings.Repeat(" ", pad) + s[pos:] + } + var width int pos := len(s) @@ -547,6 +672,32 @@ func (c *Condition) TruncateLeft(s string, w int, prefix string) string { return prefix + s[pos:] } +// truncateLeftRunes is the loop in TruncateLeft with every rune taken for a +// whole cluster, returning the cut and the padding that replaces the cell +// the cut lands inside. It reports false at the first rune that can join a +// cluster. +func (c *Condition) truncateLeftRunes(s string, w int) (pos, pad int, ok bool) { + width := 0 + for i, r := range s { + if isJoiner(r) { + return 0, 0, false + } + cw := c.RuneWidth(r) + if width+cw > w { + if width >= w { + return i, 0, true + } + end := i + utf8.RuneLen(r) + if !endsCluster(s, end) { + return 0, 0, false + } + return end, width + cw - w, true + } + width += cw + } + return len(s), 0, true +} + // TruncatePrefix cuts the beginning of `s` so the result fits in w cells, with prefix prepended func (c *Condition) TruncatePrefix(s string, w int, prefix string) string { if c.StringWidth(prefix) >= w { @@ -558,6 +709,9 @@ func (c *Condition) TruncatePrefix(s string, w int, prefix string) string { return s } w -= c.StringWidth(prefix) + if pos, ok := c.truncatePrefixRunes(s, sw, w); ok { + return prefix + s[pos:] + } var width int var pos int g := graphemes.FromString(s) @@ -573,27 +727,109 @@ func (c *Condition) TruncatePrefix(s string, w int, prefix string) string { return prefix + s[pos:] } -// Wrap return string wrapped with w cells -func (c *Condition) Wrap(s string, w int) string { +// truncatePrefixRunes is the loop in TruncatePrefix with every rune taken +// for a whole cluster, reporting false at the first rune that can join one. +func (c *Condition) truncatePrefixRunes(s string, sw, w int) (int, bool) { + width := 0 + for i, r := range s { + if isJoiner(r) { + return 0, false + } + cw := c.RuneWidth(r) + if sw-(width+cw) <= w { + end := i + utf8.RuneLen(r) + if !endsCluster(s, end) { + return 0, false + } + return end, true + } + width += cw + } + return 0, true +} + +// wrapRunes wraps s treating every rune as its own grapheme cluster, and +// reports false without a result once it meets a rune that can join one. +func (c *Condition) wrapRunes(s string, w int) (string, bool) { width := 0 var out strings.Builder - // max keeps the capacity hint from dividing by zero when w is 0; a - // non-positive width breaks before every rune, as it always has. out.Grow(len(s) + len(s)/max(w, 1) + 1) for _, r := range s { + if isJoiner(r) { + return "", false + } cw := c.RuneWidth(r) if r == '\n' { out.WriteRune(r) width = 0 continue - } else if width+cw > w { + } + if width+cw > w { out.WriteByte('\n') width = 0 - out.WriteRune(r) + } + out.WriteRune(r) + width += cw + } + return out.String(), true +} + +// Wrap return string wrapped with w cells +func (c *Condition) Wrap(s string, w int) string { + // ASCII fast path: no grapheme clustering needed for pure ASCII + if isASCII(s) { + width := 0 + var out strings.Builder + // max keeps the capacity hint from dividing by zero when w is 0; + // a non-positive width breaks before every cluster, as it always + // has. + out.Grow(len(s) + len(s)/max(w, 1) + 1) + for i := 0; i < len(s); i++ { + b := s[i] + if b == '\n' { + out.WriteByte(b) + width = 0 + continue + } + // Same rule as the StringWidth fast path: no ASCII byte is + // wide or ambiguous, so the flags in c cannot change this. + cw := 0 + if b >= 0x20 && b != 0x7F { + cw = 1 + } + if width+cw > w { + out.WriteByte('\n') + width = 0 + } + out.WriteByte(b) width += cw + } + return out.String() + } + // Runes first, as in StringWidth. Reaching a rune that can join a + // cluster throws the wrapped text away and starts over on the + // segmenter, which is the uncommon case. + if out, ok := c.wrapRunes(s, w); ok { + return out + } + width := 0 + var out strings.Builder + out.Grow(len(s) + len(s)/max(w, 1) + 1) + g := graphemes.FromString(s) + for g.Next() { + cluster := g.Value() + // LF and CRLF are each a single cluster + if strings.HasSuffix(cluster, "\n") { + out.WriteString(cluster) + width = 0 continue } - out.WriteRune(r) + cw := c.graphemeWidth(cluster) + if width+cw > w { + out.WriteByte('\n') + width = 0 + } + out.WriteString(cluster) width += cw } return out.String() diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_table.go b/vendor/github.com/mattn/go-runewidth/runewidth_table.go index 62488d97da..be9618dd36 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth_table.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth_table.go @@ -590,3 +590,120 @@ var emoji = table{ {0x1F947, 0x1F9FF}, {0x1FA58, 0x1FA5F}, {0x1FA6E, 0x1FAFF}, {0x1FC00, 0x1FFFD}, } + +var joiner = table{ + {0x0300, 0x036F}, {0x0483, 0x0489}, {0x0591, 0x05BD}, + {0x05BF, 0x05BF}, {0x05C1, 0x05C2}, {0x05C4, 0x05C5}, + {0x05C7, 0x05C7}, {0x0600, 0x0605}, {0x0610, 0x061A}, + {0x064B, 0x065F}, {0x0670, 0x0670}, {0x06D6, 0x06DD}, + {0x06DF, 0x06E4}, {0x06E7, 0x06E8}, {0x06EA, 0x06ED}, + {0x070F, 0x070F}, {0x0711, 0x0711}, {0x0730, 0x074A}, + {0x07A6, 0x07B0}, {0x07EB, 0x07F3}, {0x07FD, 0x07FD}, + {0x0816, 0x0819}, {0x081B, 0x0823}, {0x0825, 0x0827}, + {0x0829, 0x082D}, {0x0859, 0x085B}, {0x0890, 0x0891}, + {0x0897, 0x089F}, {0x08CA, 0x0903}, {0x093A, 0x093C}, + {0x093E, 0x094F}, {0x0951, 0x0957}, {0x0962, 0x0963}, + {0x0981, 0x0983}, {0x09BC, 0x09BC}, {0x09BE, 0x09C4}, + {0x09C7, 0x09C8}, {0x09CB, 0x09CD}, {0x09D7, 0x09D7}, + {0x09E2, 0x09E3}, {0x09FE, 0x09FE}, {0x0A01, 0x0A03}, + {0x0A3C, 0x0A3C}, {0x0A3E, 0x0A42}, {0x0A47, 0x0A48}, + {0x0A4B, 0x0A4D}, {0x0A51, 0x0A51}, {0x0A70, 0x0A71}, + {0x0A75, 0x0A75}, {0x0A81, 0x0A83}, {0x0ABC, 0x0ABC}, + {0x0ABE, 0x0AC5}, {0x0AC7, 0x0AC9}, {0x0ACB, 0x0ACD}, + {0x0AE2, 0x0AE3}, {0x0AFA, 0x0AFF}, {0x0B01, 0x0B03}, + {0x0B3C, 0x0B3C}, {0x0B3E, 0x0B44}, {0x0B47, 0x0B48}, + {0x0B4B, 0x0B4D}, {0x0B55, 0x0B57}, {0x0B62, 0x0B63}, + {0x0B82, 0x0B82}, {0x0BBE, 0x0BC2}, {0x0BC6, 0x0BC8}, + {0x0BCA, 0x0BCD}, {0x0BD7, 0x0BD7}, {0x0C00, 0x0C04}, + {0x0C3C, 0x0C3C}, {0x0C3E, 0x0C44}, {0x0C46, 0x0C48}, + {0x0C4A, 0x0C4D}, {0x0C55, 0x0C56}, {0x0C62, 0x0C63}, + {0x0C81, 0x0C83}, {0x0CBC, 0x0CBC}, {0x0CBE, 0x0CC4}, + {0x0CC6, 0x0CC8}, {0x0CCA, 0x0CCD}, {0x0CD5, 0x0CD6}, + {0x0CE2, 0x0CE3}, {0x0CF3, 0x0CF3}, {0x0D00, 0x0D03}, + {0x0D3B, 0x0D3C}, {0x0D3E, 0x0D44}, {0x0D46, 0x0D48}, + {0x0D4A, 0x0D4E}, {0x0D57, 0x0D57}, {0x0D62, 0x0D63}, + {0x0D81, 0x0D83}, {0x0DCA, 0x0DCA}, {0x0DCF, 0x0DD4}, + {0x0DD6, 0x0DD6}, {0x0DD8, 0x0DDF}, {0x0DF2, 0x0DF3}, + {0x0E31, 0x0E31}, {0x0E33, 0x0E3A}, {0x0E47, 0x0E4E}, + {0x0EB1, 0x0EB1}, {0x0EB3, 0x0EBC}, {0x0EC8, 0x0ECE}, + {0x0F18, 0x0F19}, {0x0F35, 0x0F35}, {0x0F37, 0x0F37}, + {0x0F39, 0x0F39}, {0x0F3E, 0x0F3F}, {0x0F71, 0x0F84}, + {0x0F86, 0x0F87}, {0x0F8D, 0x0F97}, {0x0F99, 0x0FBC}, + {0x0FC6, 0x0FC6}, {0x102D, 0x1037}, {0x1039, 0x103E}, + {0x1056, 0x1059}, {0x105E, 0x1060}, {0x1071, 0x1074}, + {0x1082, 0x1082}, {0x1084, 0x1086}, {0x108D, 0x108D}, + {0x109D, 0x109D}, {0x1100, 0x11FF}, {0x135D, 0x135F}, + {0x1712, 0x1715}, {0x1732, 0x1734}, {0x1752, 0x1753}, + {0x1772, 0x1773}, {0x17B4, 0x17D3}, {0x17DD, 0x17DD}, + {0x180B, 0x180D}, {0x180F, 0x180F}, {0x1885, 0x1886}, + {0x18A9, 0x18A9}, {0x1920, 0x192B}, {0x1930, 0x193B}, + {0x1A17, 0x1A1B}, {0x1A55, 0x1A5E}, {0x1A60, 0x1A60}, + {0x1A62, 0x1A62}, {0x1A65, 0x1A7C}, {0x1A7F, 0x1A7F}, + {0x1AB0, 0x1ADD}, {0x1AE0, 0x1AEB}, {0x1B00, 0x1B04}, + {0x1B34, 0x1B44}, {0x1B6B, 0x1B73}, {0x1B80, 0x1B82}, + {0x1BA1, 0x1BAD}, {0x1BE6, 0x1BF3}, {0x1C24, 0x1C37}, + {0x1CD0, 0x1CD2}, {0x1CD4, 0x1CE8}, {0x1CED, 0x1CED}, + {0x1CF4, 0x1CF4}, {0x1CF7, 0x1CF9}, {0x1DC0, 0x1DFF}, + {0x200C, 0x200D}, {0x20D0, 0x20F0}, {0x2CEF, 0x2CF1}, + {0x2D7F, 0x2D7F}, {0x2DE0, 0x2DFF}, {0x302A, 0x302F}, + {0x3099, 0x309A}, {0xA66F, 0xA672}, {0xA674, 0xA67D}, + {0xA69E, 0xA69F}, {0xA6F0, 0xA6F1}, {0xA802, 0xA802}, + {0xA806, 0xA806}, {0xA80B, 0xA80B}, {0xA823, 0xA827}, + {0xA82C, 0xA82C}, {0xA880, 0xA881}, {0xA8B4, 0xA8C5}, + {0xA8E0, 0xA8F1}, {0xA8FF, 0xA8FF}, {0xA926, 0xA92D}, + {0xA947, 0xA953}, {0xA960, 0xA97C}, {0xA980, 0xA983}, + {0xA9B3, 0xA9C0}, {0xA9E5, 0xA9E5}, {0xAA29, 0xAA36}, + {0xAA43, 0xAA43}, {0xAA4C, 0xAA4D}, {0xAA7C, 0xAA7C}, + {0xAAB0, 0xAAB0}, {0xAAB2, 0xAAB4}, {0xAAB7, 0xAAB8}, + {0xAABE, 0xAABF}, {0xAAC1, 0xAAC1}, {0xAAEB, 0xAAEF}, + {0xAAF5, 0xAAF6}, {0xABE3, 0xABEA}, {0xABEC, 0xABED}, + {0xAC00, 0xD7A3}, {0xD7B0, 0xD7C6}, {0xD7CB, 0xD7FB}, + {0xFB1E, 0xFB1E}, {0xFE00, 0xFE0F}, {0xFE20, 0xFE2F}, + {0xFF9E, 0xFF9F}, {0x101FD, 0x101FD}, {0x102E0, 0x102E0}, + {0x10376, 0x1037A}, {0x10A01, 0x10A03}, {0x10A05, 0x10A06}, + {0x10A0C, 0x10A0F}, {0x10A38, 0x10A3A}, {0x10A3F, 0x10A3F}, + {0x10AE5, 0x10AE6}, {0x10D24, 0x10D27}, {0x10D69, 0x10D6D}, + {0x10EAB, 0x10EAC}, {0x10EFA, 0x10EFF}, {0x10F46, 0x10F50}, + {0x10F82, 0x10F85}, {0x11000, 0x11002}, {0x11038, 0x11046}, + {0x11070, 0x11070}, {0x11073, 0x11074}, {0x1107F, 0x11082}, + {0x110B0, 0x110BA}, {0x110BD, 0x110BD}, {0x110C2, 0x110C2}, + {0x110CD, 0x110CD}, {0x11100, 0x11102}, {0x11127, 0x11134}, + {0x11145, 0x11146}, {0x11173, 0x11173}, {0x11180, 0x11182}, + {0x111B3, 0x111C0}, {0x111C2, 0x111C3}, {0x111C9, 0x111CC}, + {0x111CE, 0x111CF}, {0x1122C, 0x11237}, {0x1123E, 0x1123E}, + {0x11241, 0x11241}, {0x112DF, 0x112EA}, {0x11300, 0x11303}, + {0x1133B, 0x1133C}, {0x1133E, 0x11344}, {0x11347, 0x11348}, + {0x1134B, 0x1134D}, {0x11357, 0x11357}, {0x11362, 0x11363}, + {0x11366, 0x1136C}, {0x11370, 0x11374}, {0x113B8, 0x113C0}, + {0x113C2, 0x113C2}, {0x113C5, 0x113C5}, {0x113C7, 0x113CA}, + {0x113CC, 0x113D2}, {0x113E1, 0x113E2}, {0x11435, 0x11446}, + {0x1145E, 0x1145E}, {0x114B0, 0x114C3}, {0x115AF, 0x115B5}, + {0x115B8, 0x115C0}, {0x115DC, 0x115DD}, {0x11630, 0x11640}, + {0x116AB, 0x116B7}, {0x1171D, 0x1171F}, {0x11722, 0x1172B}, + {0x1182C, 0x1183A}, {0x11930, 0x11935}, {0x11937, 0x11938}, + {0x1193B, 0x11943}, {0x119D1, 0x119D7}, {0x119DA, 0x119E0}, + {0x119E4, 0x119E4}, {0x11A01, 0x11A0A}, {0x11A33, 0x11A3E}, + {0x11A47, 0x11A47}, {0x11A51, 0x11A5B}, {0x11A84, 0x11A99}, + {0x11B60, 0x11B67}, {0x11C2F, 0x11C36}, {0x11C38, 0x11C3F}, + {0x11C92, 0x11CA7}, {0x11CA9, 0x11CB6}, {0x11D31, 0x11D36}, + {0x11D3A, 0x11D3A}, {0x11D3C, 0x11D3D}, {0x11D3F, 0x11D47}, + {0x11D8A, 0x11D8E}, {0x11D90, 0x11D91}, {0x11D93, 0x11D97}, + {0x11EF3, 0x11EF6}, {0x11F00, 0x11F03}, {0x11F34, 0x11F3A}, + {0x11F3E, 0x11F42}, {0x11F5A, 0x11F5A}, {0x13440, 0x13440}, + {0x13447, 0x13455}, {0x1611E, 0x1612F}, {0x16AF0, 0x16AF4}, + {0x16B30, 0x16B36}, {0x16D63, 0x16D63}, {0x16D67, 0x16D6A}, + {0x16F4F, 0x16F4F}, {0x16F51, 0x16F87}, {0x16F8F, 0x16F92}, + {0x16FE4, 0x16FE4}, {0x16FF0, 0x16FF1}, {0x1BC9D, 0x1BC9E}, + {0x1CF00, 0x1CF2D}, {0x1CF30, 0x1CF46}, {0x1D165, 0x1D169}, + {0x1D16D, 0x1D172}, {0x1D17B, 0x1D182}, {0x1D185, 0x1D18B}, + {0x1D1AA, 0x1D1AD}, {0x1D242, 0x1D244}, {0x1DA00, 0x1DA36}, + {0x1DA3B, 0x1DA6C}, {0x1DA75, 0x1DA75}, {0x1DA84, 0x1DA84}, + {0x1DA9B, 0x1DA9F}, {0x1DAA1, 0x1DAAF}, {0x1E000, 0x1E006}, + {0x1E008, 0x1E018}, {0x1E01B, 0x1E021}, {0x1E023, 0x1E024}, + {0x1E026, 0x1E02A}, {0x1E08F, 0x1E08F}, {0x1E130, 0x1E136}, + {0x1E2AE, 0x1E2AE}, {0x1E2EC, 0x1E2EF}, {0x1E4EC, 0x1E4EF}, + {0x1E5EE, 0x1E5EF}, {0x1E6E3, 0x1E6E3}, {0x1E6E6, 0x1E6E6}, + {0x1E6EE, 0x1E6EF}, {0x1E6F5, 0x1E6F5}, {0x1E8D0, 0x1E8D6}, + {0x1E944, 0x1E94A}, {0x1F1E6, 0x1F1FF}, {0x1F3FB, 0x1F3FF}, + {0xE0020, 0xE007F}, {0xE0100, 0xE01EF}, +} diff --git a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/CLAUDE.md b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/CLAUDE.md new file mode 100644 index 0000000000..4594230e21 --- /dev/null +++ b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/CLAUDE.md @@ -0,0 +1,99 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## What this is + +`counterfeiter` is a CLI (module `github.com/maxbrunsfeld/counterfeiter/v6`) that generates Go test doubles ("fakes") for interfaces, function types, and whole packages. It is typically invoked via `//go:generate` directives. Requires Go modules; CI runs on `stable` and `oldstable` Go on Linux and Windows. + +## Commands + +Full CI pipeline (vet → regenerate fakes → verify clean git tree → tests): + +```shell +./scripts/ci.sh # Linux/macOS +.\scripts\ci.ps1 # Windows +``` + +Individual steps: + +```shell +go vet ./... +go generate ./... # regenerate all fakes under fixtures/ (directives use `go run`, so no install needed) +./scripts/checkclean.sh # fail if regenerated fakes differ from committed ones +./scripts/cleanfakes.sh # delete every */*fakes/fake*.go (then `go generate ./...` to rebuild) +go test -race . ./fixtures/... # packages that exercise fakes or the generator concurrently +go test ./arguments/ ./command/ ./generator/ ./integration/ +``` + +Run a single package's tests or a single spec. Tests use `sclevine/spec` + `gomega`; spec names are nested, so match with a regex on the top-level test function and the spec path: + +```shell +go test ./generator/ -run TestGenerator +go test ./integration/ -run 'TestIntegration/round_trip_as_module/working_with_a_module' +go test ./arguments/ -run TestParsingArguments -v +go test ./command/ -run TestRunner +go test -run TestFakes . # generated_fakes_test.go at repo root +go test -race -run TestConcurrency . # concurrency_test.go at repo root; only meaningful with -race +go test -bench . -benchmem . # benchmark_test.go at repo root +``` + +Debug env vars: `COUNTERFEITER_DEBUG=1` enables log output; `COUNTERFEITER_DISABLECACHE=1` bypasses the package-load cache; `COUNTERFEITER_PROFILE=1` writes `counterfeiter.profile`; `COUNTERFEITER_NO_GENERATE_WARNING=1` silences the "use -generate" warning. In tests, `log.SetOutput(io.Discard)` is set in the top-level test functions — comment it out to see generator logs. + +## Architecture + +Pipeline for one run (`main.go` is intentionally thin and should stay that way): + +1. **`command.Detect`** (`command/runner.go`) turns the process into a list of `Invocation`s. In normal mode that is the single CLI invocation (it reads `GOFILE`/`GOLINE` from `go generate`). In `-generate` mode it scans every `.go` file in the cwd package for lines starting with `//counterfeiter:generate ` and builds one invocation per line. This is why `-generate` is much faster than many `//go:generate` lines: one process, one package load. +2. **`arguments.New`** (`arguments/parser.go`) parses each invocation's flags and positional args into `ParsedArguments`: source package dir, package path, interface name, fake name (`Fake` + exported interface name), output path (default `/fakes/fake_.go`), destination package name, and modes (`-p` package mode, `-` print to stdout, `-q`, `-header`). A `-header` on the top-level `-generate` line is inherited by directives that lack one (handled in `main.go`). +3. **`generator.NewFake`** (`generator/fake.go`) loads packages with `golang.org/x/tools/go/packages` (`loader.go`), finds the target `types.TypeName` (`findPackage`), and populates the `Fake` struct: `Methods` (from `interface_loader.go` / `package_loader.go`) or a single `Function` (`function_loader.go`), `Params`/`Returns` (`param.go`, `return.go`), and `Imports`. +4. **`Fake.Generate`** executes one of three `text/template`s — `interface_template.go`, `function_template.go`, `package_template.go` — then runs `goimports` (`imports.Process`) on the output. `main.go` runs `go/format` again and writes the file. + +Key supporting pieces: + +- **`generator.Imports`** (`import.go`) dedupes imports by package path and guarantees unique aliases (appends `a`, `b`, … on collision). `addImportsFor` in `loader.go` walks `types.Type` recursively to collect every package a fake needs; add a case there when a new `types.Type` kind shows up (it logs `!!! WARNING: Missing case`). +- **Generics**: `findPackage` / `getGenericTypeData` (`loader.go`) extract type params/constraints into `GenericTypeParameters*` strings used by the template. The compile-time assertion for a generic fake is emitted inside a blank generic func (`func _[T C]() { var _ pkg.I[T] = new(FakeI[T]) }`) so any constraint kind works. A target that is itself a constraint interface (unions or `~T`) is rejected up front because it cannot be implemented. +- **Package loading** (`loadPackages` in `loader.go`): the target package is the root of a single `packages.Load` call with `NeedName | NeedFiles | NeedImports | NeedTypes | NeedSyntax`, deliberately without `NeedDeps` or `NeedTypesInfo`. go/packages then type-checks only the target package from source and reads everything it imports from export data via `go list -export` (built through the normal go build cache), instead of type-checking the whole dependency graph on every run. `NeedSyntax` is what forces the root itself to come from source: export data omits unexported types that nothing exported refers to, which would break faking an unexported interface. When the target does not compile, `go list -export` attaches the compiler transcript as an unpositioned `ListError`, which `loadPackages` skips (`isBuildTranscript`) in favor of the positioned type errors. Nothing in the generator reads `TypesInfo`; do not add it back. Of the target package's own errors only `ParseError` is fatal; the rest (unresolved imports, type errors in other files) are kept in `Fake.loadErrors` and generation proceeds. It fails later, quoting them, only if the target's signatures mention an unresolved type (`hasInvalidType`, which does not look inside named types because they print by name) or the interface embeds one (`hasInvalidEmbed`, since the type checker silently drops such an embed from the method set). +- **Same-package fakes**: `main.go` passes the output directory via `generator.WithDestinationDir`. When it equals the target package's directory (`packages.Package.Dir`, symlinks resolved), `findPackage` sets `inTargetPackage`: the target package is not imported, its names print unqualified (the `types.Qualifier` returns `""` for packages absent from `Imports`), and the assertion is emitted even for unexported targets. A stale same-package fake never blocks regeneration because its type errors are tolerated like any other (see package loading). Extend `NewFake` only through `...Option`; its existing parameters are public API. +- **`Cacher`** (`cache.go`): `Cache` memoizes `packages.Load` results per package path across invocations in a `-generate` run; `FakeCache` is the no-op used by tests and `COUNTERFEITER_DISABLECACHE`. +- **`ctx.go`** holds `getBuildContext`, which returns `build.Default` with `build.Context.Dir` set to the working directory. + +## Testing conventions + +- `fixtures/` is a large corpus of interfaces exercising edge cases (aliases, dot imports, variadics, embedded interfaces, generics, hyphenated packages, package mode, vendored-style external packages, etc.). Each has `//go:generate` or `//counterfeiter:generate` directives; the generated fakes live in sibling `*fakes/` dirs and **are committed**. CI fails if `go generate ./...` produces a diff, so after changing templates or the generator, run `go generate ./...` and commit the regenerated fakes. +- `generated_fakes_test.go` (repo root) uses the committed fixture fakes as a behavioral test of the fake API (`Stub`, `CallCount`, `ArgsForCall`, `Returns`, `ReturnsOnCall`, `Invocations`). +- `concurrency_test.go` (repo root) drives `generator.NewFake` / `Generate` and `CachedFileReader` from several goroutines through shared caches. It only proves anything under `-race`, which is why it lives in the root package: CI runs `-race` there and on `fixtures/...` only, since `generator`, `integration`, `arguments`, and `command` are single-threaded and the race detector triples their run time. Anything concurrent added to the tool needs coverage here, not in its own package. +- `generator/generator_internals_test.go` unit-tests `NewFake`/`Generate` against fixtures directly. +- `integration/roundtrip_test.go` copies fixtures into a temp module, generates fakes, and runs `go build` on the result; some cases compare byte-for-byte against `integration/testdata/expected_*.txt`. Set `writeToTestData = true` in that file to dump actual output to `integration/testdata/output/` (gitignored) when debugging a mismatch. +- `.golangci.yaml` skips `fixtures/` from linting. + +## Package layout + +Keep the existing layout: `main.go` at the module root and the three subpackages `arguments`, `command`, and `generator`. `main.go` must stay at the root because users invoke the tool by module path (`go run github.com/maxbrunsfeld/counterfeiter/v6`, `go get -tool ...`); do not move it under `cmd/`. Do not restructure packages toward a different layout (for example Ben Johnson's Standard Package Layout, which the maintainer likes in general but has chosen not to apply here). Put new code in whichever of the three existing packages owns that pipeline stage. + +## Development workflow: red → green → refactor + +Every fix or feature follows strict TDD: + +1. **Red** — write a spec (`sclevine/spec` + `gomega`, matching the surrounding test file) that reproduces the issue and fails. For generator behavior this usually means adding a fixture interface under `fixtures/` plus an assertion in `generator/generator_internals_test.go` or `integration/roundtrip_test.go`. Run it and confirm it fails for the expected reason. +2. **Green** — write the simplest code that makes the spec pass. Nothing more. +3. **Refactor** — with the spec passing, look for duplication or simplification opportunities in the code just touched, keeping the suite green. Then regenerate fakes (`go generate ./...`) and run `./scripts/ci.sh`. + +Do not skip step 1, even for "obvious" one-line fixes. + +## Commits and pull requests + +Every commit carries a DCO sign-off from the person making it: always `git commit -s`. + +Write commit messages and PR descriptions in plain, first-person prose, the way the maintainer does (see `git log --author=Fitzgerald` and PRs #123, #124, #125): + +- Subject: short, lowercase, imperative ("allow fakes to be generated into the interface's own package"). No conventional-commit prefixes. +- Body only when the diff does not explain itself: what was wrong, what changes for the user. A few sentences, not headings or bullet inventories of files and functions. +- `Fixes #n` on its own line at the end when it closes an issue. +- PR body: describe the problem and the outcome for users, not the commit list. No commit hashes, no narrating the process (do not mention TDD, red/green, or how carefully it was tested; just say what is covered). Mention issues that are fixed or related at the end. +- Squash follow-up tweaks into the commit they belong to before pushing. +- No AI attribution or co-author lines. + +## Contribution constraints (from README) + +Keep `main.go` simple, avoid adding CLI options, avoid adding internal complexity, and keep unit coverage high. diff --git a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/README.md b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/README.md index dd36898987..0b6546f80f 100644 --- a/vendor/github.com/maxbrunsfeld/counterfeiter/v6/README.md +++ b/vendor/github.com/maxbrunsfeld/counterfeiter/v6/README.md @@ -1,67 +1,54 @@ -# `counterfeiter` [![GitHub Actions](https://github.com/maxbrunsfeld/counterfeiter/actions/workflows/go.yml/badge.svg)](https://github.com/maxbrunsfeld/counterfeiter/actions/workflows/go.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/maxbrunsfeld/counterfeiter/v6)](https://goreportcard.com/report/github.com/maxbrunsfeld/counterfeiter/v6) [![GoDoc](https://godoc.org/github.com/maxbrunsfeld/counterfeiter/v6?status.svg)](https://godoc.org/github.com/maxbrunsfeld/counterfeiter/v6) +# `counterfeiter` [![GitHub Actions](https://github.com/maxbrunsfeld/counterfeiter/actions/workflows/go.yml/badge.svg)](https://github.com/maxbrunsfeld/counterfeiter/actions/workflows/go.yml) [![Go Reference](https://pkg.go.dev/badge/github.com/maxbrunsfeld/counterfeiter/v6.svg)](https://pkg.go.dev/github.com/maxbrunsfeld/counterfeiter/v6) -When writing unit-tests for an object, it is often useful to have fake implementations -of the object's collaborators. In go, such fake implementations cannot be generated -automatically at runtime, and writing them by hand can be quite arduous. +Go code declares what it needs from its dependencies as interfaces, usually small ones +defined by the package that uses them. Testing that code means supplying fake +implementations of those interfaces. Go has no way to build one at runtime, so they are +written by hand or generated. -`counterfeiter` allows you to simply generate test doubles for a given interface. +`counterfeiter` generates test doubles for a given interface. Given this: -### Supported Versions Of `go` - -`counterfeiter` follows the [support policy of `go` itself](https://golang.org/doc/devel/release.html#policy): - -> Each major Go release is supported until there are two newer major releases. For example, Go 1.5 was supported until the Go 1.7 release, and Go 1.6 was supported until the Go 1.8 release. We fix critical problems, including [critical security problems](https://golang.org/security), in supported releases as needed by issuing minor revisions (for example, Go 1.6.1, Go 1.6.2, and so on). - -If you are having problems with `counterfeiter` and are not using a supported version of go, please update to use a supported version of go before opening an issue. - -### Using `counterfeiter` +```go +package foo -⚠️ Please use [`go modules`](https://blog.golang.org/using-go-modules) when working with counterfeiter. +//go:generate go tool counterfeiter -generate -Typically, `counterfeiter` is used in `go generate` directives. It can be frustrating when you change your interface declaration and suddenly all of your generated code is suddenly out-of-date. The best practice here is to use the [`go generate` command](https://blog.golang.org/generate) to make it easier to keep your test doubles up to date. +//counterfeiter:generate . MySpecialInterface +type MySpecialInterface interface { + DoThings(string, uint64) (int, error) +} +``` -⚠️ If you are working with go 1.23 or earlier, please refer to an [older version of this README](https://github.com/maxbrunsfeld/counterfeiter/blob/e39cbe6aaa94a0b6718cf3d413cd5319c3a1f6fa/README.md#using-counterfeiter), as the instructions below assume go 1.24 (which added `go tool` support) and later. +`go generate` writes `foofakes/fake_my_special_interface.go`, and your tests can do this: -#### Step 1 - Add `counterfeiter` as a tool dependency +```go +fake := &foofakes.FakeMySpecialInterface{} +fake.DoThingsReturns(3, nil) -Establish a tool dependency on counterfeiter by running the following command: +num, err := fake.DoThings("stuff", 5) -```shell -go get -tool github.com/maxbrunsfeld/counterfeiter/v6 +Expect(num).To(Equal(3)) +Expect(fake.DoThingsCallCount()).To(Equal(1)) +str, _ := fake.DoThingsArgsForCall(0) +Expect(str).To(Equal("stuff")) ``` -#### Step 2a - Add `go:generate` Directives - -You can add directives right next to your interface definitions (or not), in any `.go` file in your module. +## Getting Started -```shell -$ cat myinterface.go -``` +`counterfeiter` is run by [`go generate`](https://go.dev/blog/generate), so fakes are regenerated alongside the code they fake. The steps below assume go 1.24 or later, which added `go tool`; for older versions of go, refer to an [older version of this README](https://github.com/maxbrunsfeld/counterfeiter/blob/e39cbe6aaa94a0b6718cf3d413cd5319c3a1f6fa/README.md#using-counterfeiter). -```go -package foo - -//go:generate go tool counterfeiter . MySpecialInterface +### Step 1 - Add `counterfeiter` as a tool dependency -type MySpecialInterface interface { - DoThings(string, uint64) (int, error) -} -``` +Establish a tool dependency on counterfeiter by running the following command: ```shell -$ go generate ./... -Writing `FakeMySpecialInterface` to `foofakes/fake_my_special_interface.go`... Done +go get -tool github.com/maxbrunsfeld/counterfeiter/v6 ``` -#### Step 2b - Add `counterfeiter:generate` Directives +### Step 2 - Add directives -If you plan to have many directives in a single package, consider using this -option, as it will speed things up considerably. You can add directives right -next to your interface definitions (or not), in any `.go` file in your module. +Add one `go:generate` directive per package that runs `counterfeiter -generate`, and one `counterfeiter:generate` directive per interface you want a fake for. You can add them right next to your interface definitions (or not), in any `.go` file in the package. -```shell -$ cat myinterface.go -``` +In `myinterface.go`: ```go package foo @@ -82,71 +69,174 @@ type MyOtherInterface interface { } ``` +A `counterfeiter:generate` directive takes the same arguments as the command line: the directory of the package that declares the interface (`.` for the package the directive is in) and the name of the interface, plus any of the flags described below. + +If a package only has an interface or two, you can skip `-generate` and the `counterfeiter:generate` directives, and run `counterfeiter` directly from one `go:generate` line per interface instead: + +```go +//go:generate go tool counterfeiter . MySpecialInterface +``` + +`-generate` is much faster once there are several directives in a package, because it loads the package once and writes every fake from one process, where each `go:generate` line starts a new one. + +### Step 3 - Run `go generate` + +You can run `go generate` in the directory with your directive, or in the root of your module (to ensure you generate for all packages in your module): + ```shell $ go generate ./... Writing `FakeMySpecialInterface` to `foofakes/fake_my_special_interface.go`... Done Writing `FakeMyOtherInterface` to `foofakes/fake_my_other_interface.go`... Done ``` -#### Step 3 - Run `go generate` +## Defaults -You can run `go generate` in the directory with your directive, or in the root of your module (to ensure you generate for all packages in your module): +`MySpecialInterface` above is declared in package `foo`, so `//counterfeiter:generate . MySpecialInterface` produces: + +| | default | change it with | +|---|---|---| +| fake type | `FakeMySpecialInterface` (`Fake` + the interface name) | `-fake-name`, `-fake-name-template` | +| file | `fake_my_special_interface.go` (the fake's name in snake case) | `-o .go` | +| directory | `foofakes/` (`fakes`, beside the package that declares the interface) | `-o ` | +| package | `foofakes` (`fakes`), or whatever package already lives in the output directory | `-o`, `-test`, or a file declaring the package | + +Every fake ends with a compile-time assertion that it satisfies the interface, so when the interface changes, the stale fake stops compiling until you run `go generate` again. + +## Common Setups + +The examples below are `counterfeiter:generate` directives, and assume the package has the `//go:generate go tool counterfeiter -generate` line from Step 2. A package needs only one of those, no matter how many directives it has. + +### Shared settings for every directive in a package + +Flags given alongside `-generate` on the `//go:generate` line are the defaults for every `//counterfeiter:generate` directive in the package: `-o`, `-header`, `-q`, `-test` and `-fake-name-template`. A directive's own flags take precedence. So if you would rather keep all of a package's fakes in a `fake` package, named after their interfaces, you can write that once: + +```go +//go:generate go tool counterfeiter -generate -o fake -fake-name-template '{{.TargetName}}' + +//counterfeiter:generate . MyRepository +//counterfeiter:generate . MyPresenter +``` ```shell $ go generate ./... +Writing `MyRepository` to `fake/my_repository.go`... Done +Writing `MyPresenter` to `fake/my_presenter.go`... Done ``` -#### Invoking `counterfeiter` from the shell +### Interfaces from other packages, the standard library or third-party modules -You can use the following command to invoke `counterfeiter` from within a go module: +You can fake any interface your module can import. A third-party module has to be a dependency first (`go get` it, so it appears in your `go.mod`), since `counterfeiter` loads the interface from the module cache the same way the compiler would. Name the interface as `.`, or give the directory of the package and the interface name: -```shell -$ go tool counterfeiter +```go +//counterfeiter:generate io.WriteCloser +//counterfeiter:generate github.com/redis/go-redis/v9.Pipeliner +//counterfeiter:generate ../otherpackage OtherInterface +``` -USAGE - counterfeiter - [-generate>] [-o ] [-p] [--fake-name ] - [-header ] - [] [-] +The two forms differ in where the fake goes. With `.`, it goes into the fakes package of the directory the directive is in, so in package `foo` the first line writes `foofakes/fake_write_closer.go`. With a directory and an interface name, it goes into the fakes package beside that directory, so the third line writes `../otherpackage/otherpackagefakes/fake_other_interface.go`. Use `-o` to put it somewhere else. + +### Fakes for tests inside the interface's own package + +By default the fake lives in a sibling `fakes` package. Tests in `` itself cannot import it, because `fakes` imports `` and that would be an import cycle. To use a fake in those tests, point `-o` at the interface's own directory: + +```go +//counterfeiter:generate -o . . MySpecialInterface ``` -#### Installing `counterfeiter` to `$GOPATH/bin` +When the output directory is the directory of the package that declares the interface, `counterfeiter` generates the fake as a member of that package: it does not import the package, refers to its types unqualified, and can fake unexported interfaces too, in which case the fake is unexported as well (`gadget` gets `fakeGadget`) unless `-fake-name` names it. `-o` may also name a file in that directory, for example `-o fake_my_special_interface_test.go` to keep the fake out of the non-test build. -This is unnecessary if you're using the approach described above, but does allow you to invoke `counterfeiter` in your shell _outside_ of a module: +### Fakes for tests in `_test` -```shell -$ go install github.com/maxbrunsfeld/counterfeiter/v6 -$ ~/go/bin/counterfeiter +Go lets a directory hold a second package for tests, `_test`, which imports `` and sees only its exported API. If your tests are in it, `-test` generates the fake into that external test package instead, as a `_test.go` file in the current directory, next to the tests that use it: -USAGE - counterfeiter - [-generate>] [-o ] [-p] [--fake-name ] - [-header ] - [] [-] +```go +//counterfeiter:generate -test . MySpecialInterface +//counterfeiter:generate -test ../otherpackage OtherInterface +//counterfeiter:generate -test io.WriteCloser ``` -### Generating Test Doubles +In package `foo`, all three of these write a `_test.go` file into the current directory, in package `foo_test`: `fake_my_special_interface_test.go`, `fake_other_interface_test.go` and `fake_write_closer_test.go`. With `-test` the fake goes into the package the directive is in, not the package that declares the interface, so faking `OtherInterface` writes nothing into `../otherpackage`. The fakes are only compiled for tests, and the tests use them unqualified (`&FakeMySpecialInterface{}`). The interface's package is imported as usual, so the interface must be exported. With `-o ` the fake goes into the external test package of that directory instead. -Given a path to a package and an interface name, you can generate a test double. +### A fakes package whose name is not its directory name + +If the output directory already contains Go files, the fake joins that package. If it is empty, the fake's package is named after the directory. So to name the package differently from its directory, say `impl_fakes` in `fakes/`, add a file declaring that package first: + +```go +// fakes/doc.go +package impl_fakes +``` + +```go +//counterfeiter:generate -o fakes . MyInterface +``` + +### Naming fakes + +`-fake-name` names one fake. `-fake-name-template` is a Go `text/template` in which `{{.TargetName}}` is the name of the interface being faked (first letter upper-cased); it applies wherever `-fake-name` is not given, and can be set once for the package on the `-generate` line. The file name follows the fake's name. + +```go +//counterfeiter:generate -fake-name Repo . MyRepository +//counterfeiter:generate -fake-name-template '{{.TargetName}}Double' . MyPresenter +``` ```shell -$ cat path/to/foo/file.go +$ go generate ./... +Writing `Repo` to `foofakes/repo.go`... Done +Writing `MyPresenterDouble` to `foofakes/my_presenter_double.go`... Done ``` +### A header on every fake + +`-header` prepends the contents of a file to every generated fake, for a licence header for example. Set it once on the `-generate` line, or per directive. + ```go -package foo +//go:generate go tool counterfeiter -generate -header ../LICENSE.header +``` -type MySpecialInterface interface { - DoThings(string, uint64) (int, error) -} +### Faking a function type + +Function types can be faked as well. The fake is a struct whose `Spy` method has the function's signature, so `fake.Spy` goes wherever the function is expected. `Returns`, `CallCount`, `ArgsForCall` and the rest work as for a method, without a method name in front. + +```go +//counterfeiter:generate . RequestHandler +type RequestHandler func(*http.Request) error +``` + +```go +fake := &foofakes.FakeRequestHandler{} +fake.Returns(nil) + +server := NewServer(fake.Spy) +``` + +### Faking a whole package + +Package mode, `-p`, is for code that calls package-level functions directly, `os.Hostname()` say, and has no interface to fake. It writes a file with an interface whose methods are the package's exported functions, and a shim struct that forwards each method to the package. The file carries a `counterfeiter:generate` directive of its own, so the next `go generate` produces a fake of that interface. + +```go +//counterfeiter:generate -p os ``` ```shell -$ go tool counterfeiter path/to/foo MySpecialInterface -Wrote `FakeMySpecialInterface` to `path/to/foo/foofakes/fake_my_special_interface.go` +$ go generate ./... +Writing `Os` to `osshim/os.go`... Done +$ go generate ./... +Writing `FakeOs` to `osshimfakes/fake_os.go`... Done +``` + +Your code takes the `osshim.Os` interface, production code passes `&osshim.OsShim{}`, tests pass the fake. + +### Printing to stdout, quieter output + +A trailing `-` prints the fake to standard output instead of writing a file: + +```shell +$ go tool counterfeiter . MySpecialInterface - ``` -### Using Test Doubles In Your Tests +`-q` drops the `Writing ...` lines, which is useful in a `-generate` line for a package with many fakes. + +## Using Test Doubles In Your Tests Instantiate fakes: @@ -156,6 +246,44 @@ import "my-repo/path/to/foo/foofakes" var fake = &foofakes.FakeMySpecialInterface{} ``` +For each method `` of the interface, the fake has: + +| | | +|---|---| +| `Returns`, `ReturnsOnCall` | stub what it returns | +| `Calls`, `Stub` | replace it with a function | +| `CallCount`, `ArgsForCall` | inspect the calls it received | + +You can stub return values: + +```go +fake.DoThingsReturns(3, errors.New("the-error")) + +num, err := fake.DoThings("stuff", 5) +Expect(num).To(Equal(3)) +Expect(err).To(Equal(errors.New("the-error"))) +``` + +or stub them for one call at a time, counting from zero; calls without an entry fall back to `Returns`: + +```go +fake.DoThingsReturnsOnCall(0, 1, nil) +fake.DoThingsReturnsOnCall(1, 0, errors.New("the-error")) +``` + +When the result depends on the arguments, give the fake a function instead. It takes precedence over `Returns` and `ReturnsOnCall`, and calling either of those clears it again: + +```go +fake.DoThingsCalls(func(s string, n uint64) (int, error) { + if s == "stuff" { + return 3, nil + } + return 0, errors.New("unexpected") +}) +``` + +`DoThingsCalls` stores the function in the exported `DoThingsStub` field while holding the fake's lock, so it is safe even if other goroutines are already calling the fake. Setting the field directly is only useful in a struct literal, `&foofakes.FakeMySpecialInterface{DoThingsStub: ...}`. Without a stub or stubbed return values, the fake returns zero values. + Fakes record the arguments they were called with: ```go @@ -168,40 +296,196 @@ Expect(str).To(Equal("stuff")) Expect(num).To(Equal(uint64(5))) ``` -You can stub their return values: +Slice and array arguments are recorded as copies, so a caller that reuses its buffer does not change what the fake recorded; a stub function still receives the original. `fake.Invocations()` returns every recorded call of every method, keyed by method name. Fakes are safe to use from several goroutines at once. -```go -fake.DoThingsReturns(3, errors.New("the-error")) +For more examples of using the `counterfeiter` API, look at [some of the provided examples](generated_fakes_test.go). -num, err := fake.DoThings("stuff", 5) -Expect(num).To(Equal(3)) -Expect(err).To(Equal(errors.New("the-error"))) +## Command reference + +`go tool counterfeiter -help` prints the following. Outside a module, `go install github.com/maxbrunsfeld/counterfeiter/v6@latest` puts a `counterfeiter` binary in `$GOPATH/bin` that takes the same arguments. + +```text +USAGE + counterfeiter + [-generate] [-o ] [-p] [-fake-name ] + [-fake-name-template