From 03c6858107f8c4c85637c18e1b643e33ca4575c0 Mon Sep 17 00:00:00 2001 From: Luc Talatinian <102624213+lucix-aws@users.noreply.github.com> Date: Mon, 20 Nov 2023 10:30:12 -0500 Subject: [PATCH] deprecate v4.SignHTTPRequestMiddleware (#2375) --- .../4c5565e33b374494884429e00bc1dc6b.json | 8 ++++++ aws/signer/v4/middleware.go | 26 +++++++++++++++---- 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 .changelog/4c5565e33b374494884429e00bc1dc6b.json diff --git a/.changelog/4c5565e33b374494884429e00bc1dc6b.json b/.changelog/4c5565e33b374494884429e00bc1dc6b.json new file mode 100644 index 00000000000..28167496ca8 --- /dev/null +++ b/.changelog/4c5565e33b374494884429e00bc1dc6b.json @@ -0,0 +1,8 @@ +{ + "id": "4c5565e3-3b37-4494-8844-29e00bc1dc6b", + "type": "bugfix", + "description": "Mark v4.SignHTTPRequestMiddleware as deprecated, this middleware is no longer used by the SDK.", + "modules": [ + "." + ] +} \ No newline at end of file diff --git a/aws/signer/v4/middleware.go b/aws/signer/v4/middleware.go index 4b19444b048..f682fb5dce0 100644 --- a/aws/signer/v4/middleware.go +++ b/aws/signer/v4/middleware.go @@ -237,21 +237,32 @@ func (m *contentSHA256Header) HandleFinalize( return next.HandleFinalize(ctx, in) } -// SignHTTPRequestMiddlewareOptions is the configuration options for the SignHTTPRequestMiddleware middleware. +// SignHTTPRequestMiddlewareOptions is the configuration options for +// [SignHTTPRequestMiddleware]. +// +// Deprecated: [SignHTTPRequestMiddleware] is deprecated. type SignHTTPRequestMiddlewareOptions struct { CredentialsProvider aws.CredentialsProvider Signer HTTPSigner LogSigning bool } -// SignHTTPRequestMiddleware is a `FinalizeMiddleware` implementation for SigV4 HTTP Signing +// SignHTTPRequestMiddleware is a `FinalizeMiddleware` implementation for SigV4 +// HTTP Signing. +// +// Deprecated: AWS service clients no longer use this middleware. Signing as an +// SDK operation is now performed through an internal per-service middleware +// which opaquely selects and uses the signer from the resolved auth scheme. type SignHTTPRequestMiddleware struct { credentialsProvider aws.CredentialsProvider signer HTTPSigner logSigning bool } -// NewSignHTTPRequestMiddleware constructs a SignHTTPRequestMiddleware using the given Signer for signing requests +// NewSignHTTPRequestMiddleware constructs a [SignHTTPRequestMiddleware] using +// the given [Signer] for signing requests. +// +// Deprecated: SignHTTPRequestMiddleware is deprecated. func NewSignHTTPRequestMiddleware(options SignHTTPRequestMiddlewareOptions) *SignHTTPRequestMiddleware { return &SignHTTPRequestMiddleware{ credentialsProvider: options.CredentialsProvider, @@ -260,12 +271,17 @@ func NewSignHTTPRequestMiddleware(options SignHTTPRequestMiddlewareOptions) *Sig } } -// ID is the SignHTTPRequestMiddleware identifier +// ID is the SignHTTPRequestMiddleware identifier. +// +// Deprecated: SignHTTPRequestMiddleware is deprecated. func (s *SignHTTPRequestMiddleware) ID() string { return "Signing" } -// HandleFinalize will take the provided input and sign the request using the SigV4 authentication scheme +// HandleFinalize will take the provided input and sign the request using the +// SigV4 authentication scheme. +// +// Deprecated: SignHTTPRequestMiddleware is deprecated. func (s *SignHTTPRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( out middleware.FinalizeOutput, metadata middleware.Metadata, err error, ) {