From 3f5bb9f709afddbb7ec29de9b782153e04f32f06 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 08:05:27 -0700 Subject: [PATCH] build(deps): bump github.com/aws/smithy-go in /ecr-login (#630) Bumps [github.com/aws/smithy-go](https://github.com/aws/smithy-go) from 1.14.2 to 1.15.0. - [Release notes](https://github.com/aws/smithy-go/releases) - [Changelog](https://github.com/aws/smithy-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/smithy-go/compare/v1.14.2...v1.15.0) --- updated-dependencies: - dependency-name: github.com/aws/smithy-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- ecr-login/go.mod | 2 +- ecr-login/go.sum | 3 +- .../github.com/aws/smithy-go/CHANGELOG.md | 6 ++ .../vendor/github.com/aws/smithy-go/README.md | 15 ++++ .../aws/smithy-go/go_module_metadata.go | 2 +- .../http/middleware_header_comment.go | 81 +++++++++++++++++++ ecr-login/vendor/modules.txt | 2 +- 7 files changed, 107 insertions(+), 4 deletions(-) create mode 100644 ecr-login/vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go diff --git a/ecr-login/go.mod b/ecr-login/go.mod index ee4e5d20..83f722cc 100644 --- a/ecr-login/go.mod +++ b/ecr-login/go.mod @@ -8,7 +8,7 @@ require ( github.com/aws/aws-sdk-go-v2/credentials v1.13.41 github.com/aws/aws-sdk-go-v2/service/ecr v1.20.0 github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.18.0 - github.com/aws/smithy-go v1.14.2 + github.com/aws/smithy-go v1.15.0 github.com/docker/docker-credential-helpers v0.8.0 github.com/mitchellh/go-homedir v1.1.0 github.com/sirupsen/logrus v1.9.3 diff --git a/ecr-login/go.sum b/ecr-login/go.sum index 6bb6a850..877831db 100644 --- a/ecr-login/go.sum +++ b/ecr-login/go.sum @@ -24,8 +24,9 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.1 h1:8lKOidPkmSmfUtiTgtdXWgaK github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.1/go.mod h1:yygr8ACQRY2PrEcy3xsUI357stq2AxnFM6DIsR9lij4= github.com/aws/aws-sdk-go-v2/service/sts v1.23.0 h1:pyvfUqkNLMipdKNAtu7OVbRxUrR2BMaKccIPpk/Hkak= github.com/aws/aws-sdk-go-v2/service/sts v1.23.0/go.mod h1:VC7JDqsqiwXukYEDjoHh9U0fOJtNWh04FPQz4ct4GGU= -github.com/aws/smithy-go v1.14.2 h1:MJU9hqBGbvWZdApzpvoF2WAIJDbtjK2NDJSiJP7HblQ= github.com/aws/smithy-go v1.14.2/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/smithy-go v1.15.0 h1:PS/durmlzvAFpQHDs4wi4sNNP9ExsqZh6IlfdHXgKK8= +github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/ecr-login/vendor/github.com/aws/smithy-go/CHANGELOG.md b/ecr-login/vendor/github.com/aws/smithy-go/CHANGELOG.md index b9171b88..8a3540e0 100644 --- a/ecr-login/vendor/github.com/aws/smithy-go/CHANGELOG.md +++ b/ecr-login/vendor/github.com/aws/smithy-go/CHANGELOG.md @@ -1,3 +1,9 @@ +# Release (2023-10-06) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.15.0 + * **Feature**: Add `http.WithHeaderComment` middleware. + # Release (2023-08-18) * No change notes available for this release. diff --git a/ecr-login/vendor/github.com/aws/smithy-go/README.md b/ecr-login/vendor/github.com/aws/smithy-go/README.md index a4bb43fb..c374f692 100644 --- a/ecr-login/vendor/github.com/aws/smithy-go/README.md +++ b/ecr-login/vendor/github.com/aws/smithy-go/README.md @@ -6,6 +6,21 @@ **WARNING: All interfaces are subject to change.** +## Can I use this? + +In order to generate a usable smithy client you must provide a [protocol definition](https://github.com/aws/smithy-go/blob/main/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/ProtocolGenerator.java), +such as [AWS restJson1](https://smithy.io/2.0/aws/protocols/aws-restjson1-protocol.html), +in order to generate transport mechanisms and serialization/deserialization +code ("serde") accordingly. + +The code generator does not currently support any protocols out of the box, +therefore the useability of this project on its own is currently limited. +Support for all [AWS protocols](https://smithy.io/2.0/aws/protocols/index.html) +exists in [aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2). We are +tracking the movement of those out of the SDK into smithy-go in +[#458](https://github.com/aws/smithy-go/issues/458), but there's currently no +timeline for doing so. + ## License This project is licensed under the Apache-2.0 License. diff --git a/ecr-login/vendor/github.com/aws/smithy-go/go_module_metadata.go b/ecr-login/vendor/github.com/aws/smithy-go/go_module_metadata.go index 997c3092..6b795a2c 100644 --- a/ecr-login/vendor/github.com/aws/smithy-go/go_module_metadata.go +++ b/ecr-login/vendor/github.com/aws/smithy-go/go_module_metadata.go @@ -3,4 +3,4 @@ package smithy // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.14.2" +const goModuleVersion = "1.15.0" diff --git a/ecr-login/vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go b/ecr-login/vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go new file mode 100644 index 00000000..855c2272 --- /dev/null +++ b/ecr-login/vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go @@ -0,0 +1,81 @@ +package http + +import ( + "context" + "fmt" + "net/http" + + "github.com/aws/smithy-go/middleware" +) + +// WithHeaderComment instruments a middleware stack to append an HTTP field +// comment to the given header as specified in RFC 9110 +// (https://www.rfc-editor.org/rfc/rfc9110#name-comments). +// +// The header is case-insensitive. If the provided header exists when the +// middleware runs, the content will be inserted as-is enclosed in parentheses. +// +// Note that per the HTTP specification, comments are only allowed in fields +// containing "comment" as part of their field value definition, but this API +// will NOT verify whether the provided header is one of them. +// +// WithHeaderComment MAY be applied more than once to a middleware stack and/or +// more than once per header. +func WithHeaderComment(header, content string) func(*middleware.Stack) error { + return func(s *middleware.Stack) error { + m, err := getOrAddHeaderComment(s) + if err != nil { + return fmt.Errorf("get or add header comment: %v", err) + } + + m.values.Add(header, content) + return nil + } +} + +type headerCommentMiddleware struct { + values http.Header // hijack case-insensitive access APIs +} + +func (*headerCommentMiddleware) ID() string { + return "headerComment" +} + +func (m *headerCommentMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( + out middleware.BuildOutput, metadata middleware.Metadata, err error, +) { + r, ok := in.Request.(*Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + for h, contents := range m.values { + for _, c := range contents { + if existing := r.Header.Get(h); existing != "" { + r.Header.Set(h, fmt.Sprintf("%s (%s)", existing, c)) + } + } + } + + return next.HandleBuild(ctx, in) +} + +func getOrAddHeaderComment(s *middleware.Stack) (*headerCommentMiddleware, error) { + id := (*headerCommentMiddleware)(nil).ID() + m, ok := s.Build.Get(id) + if !ok { + m := &headerCommentMiddleware{values: http.Header{}} + if err := s.Build.Add(m, middleware.After); err != nil { + return nil, fmt.Errorf("add build: %v", err) + } + + return m, nil + } + + hc, ok := m.(*headerCommentMiddleware) + if !ok { + return nil, fmt.Errorf("existing middleware w/ id %s is not *headerCommentMiddleware", id) + } + + return hc, nil +} diff --git a/ecr-login/vendor/modules.txt b/ecr-login/vendor/modules.txt index b5f9ead0..4629acdc 100644 --- a/ecr-login/vendor/modules.txt +++ b/ecr-login/vendor/modules.txt @@ -74,7 +74,7 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc/types github.com/aws/aws-sdk-go-v2/service/sts github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sts/types -# github.com/aws/smithy-go v1.14.2 +# github.com/aws/smithy-go v1.15.0 ## explicit; go 1.15 github.com/aws/smithy-go github.com/aws/smithy-go/auth/bearer