我正在使用此库:https://hawkrest.readthedocs.io/en/latest/
在我的settings.py
中:
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'hawkrest.HawkAuthentication',
),
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
),
}
HAWK_CREDENTIALS = {
'script-user': {
'id': 'script-user',
'key': 'aabbcc',
'algorithm': 'sha256'
},
}
在控制台输出中:
access denied: MisComputedContentHash: Our hash b'l0mKQ9ZG6Df44jdvH1FthWGvtKN93umZdmQCqd7YcgI=' (sha256) did not match theirs