English 中文(简体)
Pure Javascript app + Amazon S3?
原标题:

I m looking to confirm or refute the following:

For what I have read so far it is not possible to write a web application with only javascript -- no server side logic -- served from Amazon S3 that also store data only to S3 if you need to have multiple clients with private data per client.

The issue I see is the Authorization header required for every Ajax call that would force me to put the signature (and my AWS id) right there in the page source for everybody to see.

Is that correct or I misunderstood the docs?

Are there workarounds?

最佳回答

In short, you are correct.

If your AWS key ends-up in any way on the client-side, you are in trouble.


A possible solution is, of course, to have the user specify their AWS key for storing their data.

问题回答

I m working on a project that will do something similar to this, mine will have the users use their own S3 which I will store in HTML5 localStorage. It s a bit tricky, but I ve got the basics working.

It involves making an Javascript program that replicates itself into S3, gets itself from S3 and then transfers credentials and control into the S3 loaded version.

I m using the excellent SJCL to do signature generation and jQuery s ajax functionality for the parts I can.

My work simply initializes the S3 side application and does a test PUT/GET sequence to S3. I also rewrote a JQuery postMessage plugin (which StackOverflow won t let me post for lack of rep) for communicating between my frames.

In my case, I m trying to fit the entire application into a single HTML file so that I don t have to do as much initial transfer into S3, but perhaps there are other ways to work this out.

iBeans offers a way around this without having to write any server side code. There s an S3 iBean (a developer is working on it to be released in the next few days - watch the mulesoft blog for an announcement) and you can access it right from your javascript. The iBean itself runs on a server so you wouldn t need to store your keys in the javascript.





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签