Added authentication to REST requests using secret key
Status: Pre-Alpha
Brought to you by:
bookstack
From August 2009 Amazon will require all REST requests to have a hash appended to url parameters of all REST requests.
More informtation here: http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?RequestAuthenticationArticle.html
Updated ecs.py file
Thanks a lot! I modified ecs.py version 0.3 from Kun Xi (http://kunxi.org/archives/2008/05/pyaws-030-released/) after your changes and it works. Seems that I cannot attach it here :(
Just to add, the occurrences of
for (k,v) in sortedArgv if v
should really be
for (k,v) in sortedArgv if v is not None
because *without* this tweak, values of 0 are omitted from the request, which means that removing an item from a cart by setting its quantity to 0 would fail.
Hope this helps!
Also, the timestamp is not in UTC. Instead the datetime module should be imported. Then in buildRequest there should be
argv['Timestamp'] = datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ")
instead of
argv['Timestamp'] = strftime("%Y-%m-%dT%H:%M:%SZ")