Jason DEBORD Limoges, France http://nobrandapp.com/
On Wed, Aug 19, 2009 at 2:53 PM, Matthew Weier O'Phinney <matt...@zend.com>wrote: > -- J DeBord <jasdeb...@gmail.com> wrote > (on Wednesday, 19 August 2009, 02:25 PM +0200): > > A view helper that allows easy creation of Amazon Web Services S3 Query > String > > Authentication urls. > > > > In short, query string authentication allows creation of URLS that can > access > > private S3 objects which would otherwise require authentication. The > created > > URLS have an expiration time. One use for this is to only allow links to > your > > images stored on S3 to be available to viewers of your website. > (technically > > speaking to anyone having the created unexpired link) > > > > Usage in a view script: <img src="<?= > $this->S3link('mybucket/myobject.jpg', > > 30); ?>" alt="" /> > > > > The above would generate something similar to: > > > > <img src="http://s3.amazonaws.com/mybucket/myobject.jpg?AWSAccessKeyId= > > 44CF9590006BF252F707&Expires=1250687683&Signature= > > vjbyAxhzyZaNvGa%2ByT45YEenS4%3D" alt="" /> > > > > This would provide a working link to the otherwise private "myobject.jpg" > > object inside of the "mybucket" bucket. The link would be valid for 30 > seconds. > > After 30 seconds the object would no longer be accessible using this url. > > This looks like a great helper! I'd like to see a sane default of > 60-120s on the expiration (to give people a chance to read the page and > follow the links), but otherwise, seems like a natural fit. Please *do* > create the proposal! :) Matthew and all, I've created the proposal here: http://framework.zend.com/wiki/display/ZFPROP/Zend_View_Helper_S3Link+-+Jason+DeBord Of course I'd love to receive some feedback / questions / advice etc. So if you have a minute, take a look. One immediate concern I have is how to supply the AWS public and private keys to the view helper. Entering them as arguments is not a good idea. I currently store my keys in a Zend_Config object which is used as a resource of Zend_Application. Then I access them in the view helper's constructor. This seems to create some dependencies that I'd like to avoid. Is there a way to "bootstrap" a view helper. Maybe set up some static variables for each of the public keys? Thanks again for your tilme. > > > I have been using this view helper for some time now. I am very > interested in > > creating a proposal, refactoring my code to meet ZF standards, and > eventually > > having this view helper included in the Zend Framework. > > > -- > Matthew Weier O'Phinney > Project Lead | matt...@zend.com > Zend Framework | http://framework.zend.com/ >