-
Notifications
You must be signed in to change notification settings - Fork 41
Conversation
kat-co
commented
Feb 11, 2015
- S3 constructor now takes a Signer function. This indicates the preferred signing methodology.
- Users can still use the recommended type of signing by using the Signer defined on the region.
Most of this PR is switching the S3 requests over to vanilla http.Request structures. This was done because the new AWS signing operates on these. |
- S3 constructor now takes a Signer function. This indicates the preferred signing methodology. - Users can still use the recommended type of signing by using the Signer defined on the region.
if r.S3BucketEndpoint != "" { | ||
return strings.Replace(r.S3BucketEndpoint, "${bucket}", bucketName, -1) | ||
} | ||
return r.S3Endpoint + "/" + bucketName + "/" |
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.
path.Join here instead?
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.
path.Join scrubs the content and will remove one of the slashes in "http://" in the r.S3Endpoint.
Most of this looks good, however dropping the 2 methods I can't quite get. Also, have you tried running all the s3 tests with -amazon to make sure both the s3test server still works (I'm assuming tests pass, otherwise travis CI would've reported it) and the changes work against live AWS and s3test the same way? |
Sorry, I've seen this is actually targeted to v3-unstable, so changes to the interface is fine at this point. However, I still think URL is worth keeping as a method. I'd like to have another look when you're done with the tests. |
if req.Body != nil { | ||
if b, err := ioutil.ReadAll(req.Body); err != nil { | ||
return "", err | ||
} else { |
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.
I'd pull b, err := ioutil.ReadAll(..) before the if and drop the else clause to reduce the indentation level.
All in all it looks fine, but I'm getting some s3 test failures in both local and live tests. I've sent you a mail with more details. |
LGTM with the patch discussed on IRC: http://pastebin.ubuntu.com/10490009/ which makes s3 live tests to pass reliably. However, a side-effect of that is leaving a bunch of buckets after each live test run - please, add an issue for this as well. When we have time, we'll fix it. |
- Minor formatting issues. - Changed skip message to a comment. Now referencing bug#. - Documentation cleaned up.
Great, I'm merging this. |
Added support for v4 signing to S3.