-
Notifications
You must be signed in to change notification settings - Fork 149
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
Implement support for signature v4 #660
Conversation
@kherock is this something you'd be interested in merging? |
* @param {String} region received From the credential header | ||
* @param {String} service received From the credential header | ||
*/ | ||
function calculateSignatureV4(stringToSign, secretKey, date, region, service) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to break out the V2 and V4 methods into 2 different files? That way it reduces the file size of this file, and we can separate out concerns a little bit?
These just needs a couple more tests but otherwise this would be a great addition. I did want to suggest that AWS signing is a problem that has already been solved and it might be a better use of this project's time to offload request signing to another library such as aws4. |
2b334fe
to
338cca8
Compare
Codecov Report
@@ Coverage Diff @@
## main #660 +/- ##
==========================================
+ Coverage 88.80% 89.15% +0.34%
==========================================
Files 20 20
Lines 1349 1374 +25
==========================================
+ Hits 1198 1225 +27
+ Misses 151 149 -2
Continue to review full report at Codecov.
|
Sorry for the super long delay with this, I was happy to see the code here mostly working. Thanks for finding the existing bug in the V2 signing as well! I've switched the default S3 client used in tests to use v4 signing. There were some slight tweaks I needed to make for computing the canonicalized query string to get tests passing. |
Fixes #659