This program can generat a API Auth Token
follow bce auth rule
from PythonBceAPIAuth.bceauth import SignTokenGenerator
# build object
token_obj = SignTokenGenerator(
'AK', # access key id
'SK', # secret access key
'POST', # method
'/v2/document', # uri
{'source':'bos'}, # get params
'doc.bj.baidubce.com' # endpoint
)
# get token
print(token_obj.Token)
- urllib
- datetime
- hashlib
- hmac
- time