Skip to content

Commit

Permalink
deprecate v4.SignHTTPRequestMiddleware (#2375)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucix-aws authored Nov 20, 2023
1 parent 0be05fa commit 03c6858
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .changelog/4c5565e33b374494884429e00bc1dc6b.json
Original file line number Diff line number Diff line change
@@ -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": [
"."
]
}
26 changes: 21 additions & 5 deletions aws/signer/v4/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
) {
Expand Down

0 comments on commit 03c6858

Please sign in to comment.