This is an automated email from the ASF dual-hosted git repository.
paul_a pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-documentation.git
The following commit(s) were added to refs/heads/master by this push:
new 1ef74ee Fix the string to sign (#29)
1ef74ee is described below
commit 1ef74eebc28e7ff852518cfcb132cda1415b13bf
Author: Kai Takahashi <[email protected]>
AuthorDate: Sun Apr 21 04:23:03 2019 +0900
Fix the string to sign (#29)
urllib.quote_plus() encodes characters into upper case hex string, so we
need to call lower() at last.
---
source/developersguide/dev.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/source/developersguide/dev.rst b/source/developersguide/dev.rst
index 6aaef57..9aa69ad 100644
--- a/source/developersguide/dev.rst
+++ b/source/developersguide/dev.rst
@@ -255,7 +255,7 @@ encoding:
.. parsed-literal::
- >>>
sig_str='&'.join(['='.join([k.lower(),urllib.quote_plus(request[k].lower().replace('+','%20'))])for
k in sorted(request.iterkeys())])
+ >>>
sig_str='&'.join(['='.join([k.lower(),urllib.quote_plus(request[k]).lower().replace('+','%20')])for
k in sorted(request.iterkeys())])
>>> sig_str
'apikey=plgwjfzk4gys3momtvmjuvg-x-jlwlnfauj9gabbbf9edm-kaymmailqzzq1elzlyq_u38zcm0bewzgudp66mg&command=listusers&response=json'
>>> sig=hmac.new(secretkey,sig_str,hashlib.sha1)
>>> sig