def generate_jwt(self, data_dict):
"""Generate a JSON web token for this BTS.
IMPORTANT: This is subject to replay attacks if there's not a nonce in
the JWT. It's the callers responsibility to include this in the data
dict if replay attacks are a concern (a random, unique msgid would
suffice).
"""
serializer = itsdangerous.JSONWebSignatureSerializer(self.secret)
return serializer.dumps(data_dict)
models.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录