Utility function to perform the server-side of Hawk authentication
Project description
hawk-server-asyncio
Utility function to perform the server-side of Hawk authentication
Installation
pip install hawkserver
Usage
from hawkserver import authenticate_hawk_header
async def lookup_credentials(id):
# Return {'id': 'some-id', 'key': 'some-secret'} matching credentials,
# or None if credentials can't be found
async def seen_nonce(nonce):
# Store nonce, return True if nonce previously seen
is_authenticated, error_message, credentials = await authenticate_hawk_header(
lookup_credentials, seen_nonce,
header, method, host, port, path, content_type, content,
)
if not is_authenticated:
# 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
Built Distribution
Close
Hashes for hawk-server-asyncio-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ccf4607ec41fa0ad8354ac3153b50d12b4102a6ae8f677bd385e06a663d95fb |
|
MD5 | 335cc854416dbc68a569ad79d131238b |
|
BLAKE2b-256 | 2c13cf36da13a30513df30232409ac43790d1a5a0b17bc1037c9d9cca621fca5 |
Close
Hashes for hawk_server_asyncio-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24004f5e7fd9ebd209baec37f1a3a87417463567c77d5c93e6137b5171827495 |
|
MD5 | cec73b7bdf0f73c711c60964034de3d2 |
|
BLAKE2b-256 | e17dd4cc4826cc913d3b41e4ec43f30a885a945e5887d4f47c3ec2810ff027ed |