Is it possible to replace the default V4 signer with a custom signer? #2428
-
Issue #228 seems to suggest that it should be possible, but I found no documentation on the topic. The Customizing the AWS SDK for Go V2 Client Requests docs also seem to suggest that this should be possible by providing a custom |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi Folks, Want to chime in here with an example of a possible use case: For client security reasons, we need to make API calls through a proxy as the client's network can only communicate over white listed IP addresses, so all API calls need to pass through a proxy (nginx, in this case). As part of this operation, the host header is rewritten. However, as the host header is required when generating the V4 signature, this causes the signature check to fail on the receiving end. One of the potential workarounds is to sign the request using the S3 endpoint in the host field, and not the proxy endpoint url. Seems that a custom signer would resolve the issue. @alberto-miranda - these are great resources that you have found. Any progress on finding more guidance? Thanks. |
Beta Was this translation helpful? Give feedback.
-
If you're just trying to modify the signing behavior in place you don't have to touch the middleware. Options for services that use sigv4 (so basically all of them) have an The authentication resolution workflow and signing can be heavily modified (again, without having to deal with middleware), see https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/auth/. For what you're describing though modification of that field on options should suffice. |
Beta Was this translation helpful? Give feedback.
If you're just trying to modify the signing behavior in place you don't have to touch the middleware. Options for services that use sigv4 (so basically all of them) have an
HTTPSignerV4
field that you can set (example).The authentication resolution workflow and signing can be heavily modified (again, without having to deal with middleware), see https://aws.github.io/aws-sdk-go-v2/docs/configuring-sdk/auth/. For what you're describing though modification of that field on options should suffice.