aws-s3 icon indicating copy to clipboard operation
aws-s3 copied to clipboard

Expires time is calculated twice when using expires_in and can cause signature authentication problems

Open loe opened this issue 14 years ago • 0 comments

@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.

loe avatar Feb 01 '12 00:02 loe