Correction to cloud-bridge-register and S3RestServlet to use parameter Action in POST

This commit is contained in:
JohnZ 2012-05-08 17:54:53 +01:00
parent 56f4dec1e2
commit 2242ec0ca3
2 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ def get_signature(key, url, query):
hmac.new(key, '\n'.join(['GET', netloc, path, query]), sha).digest()))
def get_url(url, api_key, secret_key, action, query):
amzn_string = 'AWSAccessKeyId=' + api_key + '&CloudAction=' + action + '&SignatureMethod=HmacSHA1'
amzn_string = 'AWSAccessKeyId=' + api_key + '&Action=' + action + '&SignatureMethod=HmacSHA1'
amzn_string += '&SignatureVersion=2&Timestamp='+ datetime.now().isoformat()[:19] +'Z&Version=2010-11-15'
query = amzn_string + '&' + query
url = url + '?' + query + '&Signature=' + get_signature(secret_key, url, query)

View File

@ -110,12 +110,12 @@ public class S3RestServlet extends HttpServlet {
logRequest(request);
// Our extensions to the S3 REST API for simple management actions
// are conveyed with Request parameter CloudAction.
// are conveyed with Request parameter "Action".
// The present extensions are either to set up the user credentials
// (see the cloud-bridge-register script for more detail) or
// to report our version of this capability.
// -> unauthenticated calls, should still be done over HTTPS
String cloudAction = request.getParameter( "CloudAction" );
String cloudAction = request.getParameter( "Action" );
if (null != cloudAction)
{
if (cloudAction.equalsIgnoreCase( "SetUserKeys" )) {