Utility function to perform the server-side of Hawk authentication
Project description
hawk-server
Utility function to perform the server-side of Hawk authentication, with no dependencies other than the Python standard library.
Installation
pip install hawk-server
Usage
from hawkserver import authenticate_hawk_header
def lookup_credentials(id):
# Return {'id': 'some-id', 'key': 'some-secret'} matching credentials,
# or None if credentials can't be found
def seen_nonce(nonce, id):
# Store nonce, return True if nonce previously seen
error_message, credentials = authenticate_hawk_header(
lookup_credentials, seen_nonce, max_skew,
header, method, host, port, path, content_type, content,
)
if error_message is not None:
# Return error or raise exception as needed
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hawk-server-0.0.12.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for hawk_server-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4add4af0021e64ecb64524b264855f6de815d4acbc0aac9b9419f6a08dabe112 |
|
MD5 | cce7d64098d1d8773d730ab985f59040 |
|
BLAKE2b-256 | 86e94b0cfd214eb4ddb64a7f8e8db9ff8cf0c05abd9eea74f5fc2ded5c625b93 |