Skip to content
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

Fix serverless signing with body #367

Closed

Conversation

harshavamsi
Copy link
Collaborator

Signed-off-by: Harsha Vamsi Kalluri harshavamsi096@gmail.com

Description

Proof of concept with SigV4 signing for serverless. This is still a work in progress. I can't seem to understand why this does not work. I compute the body hash and set the x-amz-content-sha256 header and use that to sign the request, but there is a mismatch in the signature.

Issues Resolved

Closes #356

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>
request.headers['X-Amz-Content-Sha256'] = hash(request.body || '', 'hex');
request.extraHeadersToIgnore = {
'content-length': true,
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this the issue? Content-length needed to be included?

https://github.com/opensearch-project/opensearch-js/pull/366/files

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, looks like that PR is not including x-amz-content-sha256 in the signing process. It signs the request first and then computes the hash in the header. Weird, I tried this but it did not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add support for OpenSearch Serverless
2 participants