aws-s3
aws-s3 copied to clipboard
Expires time is calculated twice when using expires_in and can cause signature authentication problems
@bmo figured this out, I'm just the messenger.
The build method in QueryString calls #expires, and so does #encoded_canonical.
# Keep in alphabetical order
def build
"AWSAccessKeyId=#{access_key_id}&Expires=#{expires}&Signature=#{encoded_canonical}"
end
If these calls lie on separate sides of a second tick the signature will be wrong. The solution is to memoize the first call so encoded_canonical uses the same value.