Skip to content

Instantly share code, notes, and snippets.

@jemygraw
Created November 13, 2014 05:42
Show Gist options
  • Save jemygraw/6d6c8ce2184068cc9131 to your computer and use it in GitHub Desktop.
Save jemygraw/6d6c8ce2184068cc9131 to your computer and use it in GitHub Desktop.
Qiniu Cloud Callback Upload Token Check Code
#回调验签代码
__author__ = 'jemy'
from qiniu.auth import digest
import urllib
path = '/~jemy/qiniu-lab-php/demos/service/callback_upload_service.php'
body = 'fname=jemygraw_999.png&etag=FkbO_BZF_49z0j63-2i1C25QGdT3&key=FkbO_BZF_49z0j63-2i1C25QGdT3&exParam1=w&exParam2=h&exParam3=h'
access_key = 'pObK-5uirmOAtYGM705oxIco1m9xlqwONnYyLOoX'
secret_key = 'wXIqwPbClstEew5vibPkUJPv-bJojiVe4aapNmYW'
data = path + '\n' + body
mac = digest.Mac(access_key, secret_key)
signed_data = mac.sign(data)
print(signed_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment