chilts / awssum

(deprecated: use aws-sdk) Node.js modules for talking to lots of Web Service APIs.
Other
462 stars 57 forks source link

Versioning support in S3 #139

Closed techtribe closed 11 years ago

techtribe commented 11 years ago

Enable the use of versioning on files / buckets in S3 with Delete/Put/Get actions.

Bucket Versioning

I have an IAM user ready and Awssum supports it, but have to look into issue with TokenCodeInvalidError.

techtribe commented 11 years ago

@chilts could you help out and have a look why the signature gets broken when I add the following to s3.ListObjects.args

Versions : {
   name     : 'versions',
   required : false,
   type     : 'resource',
},

I investigated the support of versioning with S3 and while trying I got the following error.

SignatureDoesNotMatch : The request signature we calculated does not match the signature you provided. Check your key and signing method

When looking at the docs the above code adjustment is the only one necessary to show versions.

You don't have to enable versioning on a bucket to get this error. With or without versioning support on your bucket, it still breaks. So, could you look into the signing part, while ?logging / ?acl (like ?versions) have the same issue.

I also looked into the S3-endpoint-version but could not identify if that is a problem...or has it anything to do with aws-signature-v4?

Thanks and if I can help out (checking/testing examples/etc), let me know! :+1:

techtribe commented 11 years ago

Enabling versioning support on a S3 bucket works :+1: as is the retrieving of a specific version, but to get a list of all versions of an object ("file") I get stuck discovering the cause.

techtribe commented 11 years ago

140 fixes this, it didn't had anything to do with the signature, only with the (un)required way of setting variables

chilts commented 11 years ago

Hi Joey,

Sorry I haven't been able to look at this sooner though I'll just have to have a skim through it now and a proper look in a day or two (it's crazy here at the moment).

Firstly, resources are usually something the operation defines rather than the user provides. I'm not sure if that's relevant here but just thought I'd mention it.

I'll need to take a closer look tomorrow but happy if you leave this and Issue#140 for the moment whilst I go take a closer look. :)

Cheers, Andy

techtribe commented 11 years ago

I will and just only look into #140 while it prevents having issues like this issue. ;)