-
Notifications
You must be signed in to change notification settings - Fork 114
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
[BUG] Invalid Sigv4 on requests without a body using AWS SDK v1 #492
Comments
I don't see any region specified, maybe you're just missing that? Can you try running my working sample in https://github.com/dblock/opensearch-go-client-demo, does it work or cause the same error? |
opensearch-go-client-demo uses AWS SDK V2. The code with AWS SDK v2 works perfectly. I was trying to get the code work for AWS SDK v1.
|
I can confirm that it doesn't work for requests without a body (works for PUT, POST, etc., but not GET or DELETE). Made a v1 version in https://github.com/dblock/opensearch-go-client-demo/tree/aws-sdk-v1/aws-sdk-v1 and I get an invalid signature for those as well. It's probably something we broke in the signer in the way empty body is handled, or something that changed on the server. Maybe you can help debug/fix? |
Fix in #496. Looks like this was introduced in efe6d62 when serverless support was added, I bet the empty body signature is required, but not checked in serverless on GET/DELETE, cc: @harrisonhjones. I tested with AWS SDK v1 with https://github.com/dblock/opensearch-go-client-demo/tree/aws-sdk-v1 against both managed and serverless by adding |
Thank you @dblock , I was trying to understand the code and it was taking time.
|
@rblcoder My PR got merged, can you try the version from HEAD? We can cut a release if it works well for you. |
@dblock tested on the version from HEAD, works perfectly now. |
Sorry for the bug on my end folks. Thanks for fixing it! |
No stress! Looks like AOSS was not enforcing the header check (I suppose it makes sense because SSL is required), so this took a while to get noticed. |
What is the bug?
Getting Error: status: [403 Forbidden] exit status 1 when connecting to OpenSearch using AWS SDK v1
How can one reproduce the bug?
The following code gives Error: status: [403 Forbidden]
exit status 1
What is the expected behavior?
Connection should be successful
What is your host/environment?
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
Do you have any screenshots?
Do you have any additional context?
I am able to connect using AWS SDK v1 with the same credentials.
The text was updated successfully, but these errors were encountered: