I use Amazon web service api from within my Google app engine application. Amazon have said that they will only accept signed requests from Aug 15, 2009. While they have given simple instructions for signing, I am not so knowledgeable of Python libraries for SHA256. The app engine documentation says it supports pycrypto but I was just wondering (read being lazy) if anyone has already done this. Any code snippets you could share? Any issues I might be missing here?
相关问题
- java.lang.NullPointerException at java.io.PrintWri
- __call__() missing 1 required positional argument:
- Upload file to Google Cloud Storage using AngularJ
- Where is the best place to put one-time and every-
- facebook “could not retrieve data from URL”
相关文章
- Is there a size limit for HTTP response headers on
- appcfg.py command not found
- Google app engine datastore string encoding proble
- Angular route not working when used with Google Ap
- Doctrine not finding data on Google App Engine?
- Using OkHttp client via OKClient on Google App Eng
- Google appEngine: 404 when accessing /_ah/api [dup
-
Google App Engine Error:
INVALID_ARGUMENT
See http://sowacs.appspot.com/AWS/Downloads/#python for a GAE Python signing service webapp. Uses native Python libraries.
Pycrypto will work fine - it's supported on App Engine, though the public ciphers are implemented in Python rather than C. You also ought to be able to use one of the existing AWS libraries, now that urlfetch/httplib are supported on App Engine.
I have an app that uploads images to S3, and I've implemented the request signing myself, but mostly because I wrote it before urlfetch/httplib were available. It works just fine, however.
I use this one using pycrypto to generate a custom policy:
This allows me to use one key for multiple items, something like:
Don't forget to enable pycrypto by adding this lines to the app.yaml
Here is an example of a REST request based on lower level (then boto) libraries. Solution was taken from http://cloudcarpenters.com/blog/amazon_products_api_request_signing.
All you need is valid entries for AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
Got this to work based on code sample at http://jjinux.blogspot.com/2009/06/python-amazon-product-advertising-api.html Here is a minor improved version that lets you merge a dict of call specific params with the basic params before making the call.
Sample usage:
I wrote another simple example that uses only the core python 3 libraries (not boto) and uses version 2 of the AWS signature protocol:
http://xocoatl.blogspot.com/2011/03/signing-ec2-api-request-in-python.html
I know it won't work in GAE, but might be useful for anyone just looking for AWS authentication examples like I was.