-
Notifications
You must be signed in to change notification settings - Fork 662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"SignatureDoesNotMatch" error with PresignGetObject #2531
Comments
@dchoma-sy -- Your
You can upgrade all of your sdk v2 dependencies by running
This behavior does not occur against the latest set of released modules. I will provide my reproduction go.mod and sample program in a subsequent comment. There was a set of recent changes that introduced compatibility issues with modules across releases. We are tracking long-term correction of this behavior in #2507. In general, updating all of your modules via the above command will ensure you do not hit this compatibility edge. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
go.mod:
main.go: package main
import (
"context"
"fmt"
"log"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/s3"
)
func main() {
cfg, err := config.LoadDefaultConfig(context.Background())
if err != nil {
log.Fatal(err)
}
svc := s3.NewFromConfig(cfg)
presign := s3.NewPresignClient(svc)
req, err := presign.PresignGetObject(context.Background(), &s3.GetObjectInput{
Bucket: aws.String("..."),
Key: aws.String("..."),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(req.URL)
} |
Thanks @lucix-aws! Much appreciated help. 😄 |
Describe the bug
After upgrading
aws-sdk-go-v2
beyond v1.24.0, thePresignGetObject
op adds toX-Amz-SignedHeaders
which seems to always produce "SignatureDoesNotMatch" errors.Expected Behavior
URL retrieves object.
Current Behavior
SignatureDoesNotMatch
The request signature we calculated does not match the signature you provided. Check your key and signing method.
Reproduction Steps
go get github.com/aws/[email protected]
Any version between v1.24.1 -> v1.25.2 exhibits the new behavior.
Possible Solution
Seems like it's introduced here...
Reverting
if err := stack.Finalize.Add(&MetricsHeader{}, smithymiddle.After); err != nil {
fixes the issue for me.Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
github.com/aws/aws-sdk-go-v2 v1.24.1
github.com/aws/aws-sdk-go-v2/config v1.25.8
github.com/aws/aws-sdk-go-v2/credentials v1.16.6
github.com/aws/aws-sdk-go-v2/service/s3 v1.46.0
Compiler and Version used
go version go1.21.3 darwin/arm64
Operating System and version
MacOS 13.6.3 (22G436)
The text was updated successfully, but these errors were encountered: