foodforus: move api_key to end of signature

master
mutantmonkey 2013-05-22 10:30:42 -04:00
parent bc9d6f3453
commit db3b6ba2d0
1 changed files with 2 additions and 1 deletions

View File

@ -14,11 +14,12 @@ API_URL = 'http://foodfor.vtluug.org'
def _sign_vote(api_key, args): def _sign_vote(api_key, args):
data = "ffu0" + api_key data = "ffu1"
for k, v in sorted(args.items()): for k, v in sorted(args.items()):
if k == 'sig': if k == 'sig':
continue continue
data += '{0}{1}'.format(k, v) data += '{0}{1}'.format(k, v)
data += api_key
h = hashlib.sha256() h = hashlib.sha256()
h.update(data.encode('utf-8')) h.update(data.encode('utf-8'))
return h.hexdigest() return h.hexdigest()