Commit 0e25775d authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Jérome Perrin

py2/py3: hmac.new() requires digestmod argument from Python 3.8.

parent a6281e66
import hashlib
import hmac import hmac
from Products.ERP5Type.Cache import DEFAULT_CACHE_SCOPE from Products.ERP5Type.Cache import DEFAULT_CACHE_SCOPE
CACHE_FACTORY_NAME = 'bearer_token_cache_factory' CACHE_FACTORY_NAME = 'bearer_token_cache_factory'
def getHMAC(self, key, body): def getHMAC(self, key, body):
digest = hmac.new(key, body) digest = hmac.new(key, body, digestmod=hashlib.md5)
return digest.hexdigest() return digest.hexdigest()
def _getCacheFactory(self, cache_factory_name): def _getCacheFactory(self, cache_factory_name):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment