aws / aws-sdk-php-zf2

ZF2 module for using the AWS SDK for PHP to interact with AWS services like S3, DynamoDB, SQS, EC2, etc.
http://aws.amazon.com/sdkforphp/
Apache License 2.0
103 stars 63 forks source link

S3 signature #5

Closed bakura10 closed 11 years ago

bakura10 commented 11 years ago

Hi,

I've tried to make CORS for S3 work in my application. This thing needs our server to sign requests. The problem is that SignatureInterface (https://github.com/aws/aws-sdk-php/blob/master/src/Aws/Common/Signature/SignatureInterface.php) is bound to a Guzzle Request Interface, therefore I could not write an adapter for Zend Framework Request object.

The only solution I've found so far is to convert a Zend Request to a Guzzle Request, sign the Guzzle Request.

What is your position on that @jeremeamia ? (I suppose you already had this problem with Symfony 2 bundle).

That kind of cases really want to to have a PSR interface for HTTP (https://github.com/php-fig/fig-standards/pull/72).

jeremeamia commented 11 years ago

The only solution I've found so far is to convert a Zend Request to a Guzzle Request, sign the Guzzle Request.

I'm not sure if that makes sense. Is there a reason you can't create the request with the SDK?

The SDK's S3 Client is capable of creating pre-signed URLs. This might be a good way to create requests for using with CORS.

bakura10 commented 11 years ago

Thanks. I was not aware of this function. You can close :)

jeremeamia commented 11 years ago

OK! Let me know how that works out.