Utility function to perform the server-side of Hawk authentication for asyncio HTTP servers
Project description
hawk-server-asyncio
Utility function to perform the server-side of Hawk authentication for asyncio servers, with no dependencies other than the Python standard library.
Installation
pip install hawk-server-asyncio
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, id):
# Store nonce, return True if nonce previously seen
error_message, credentials = await 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
Built Distribution
Close
Hashes for hawk-server-asyncio-0.0.13.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | eee7cb551599ab1d130637a7c951f784c8a825b021f8ef8e1349b4e13d50fcf9 |
|
MD5 | 8207cb959818cbd68f48df6968ff1cbe |
|
BLAKE2b-256 | a894998b1553f2e2060f646e2e666b6be8b80599def98b556335b305878d1e5a |
Close
Hashes for hawk_server_asyncio-0.0.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9fb62e41ef9b503359009cc02bd760381fd5cde56fc7fe9b4132768871c36dd0 |
|
MD5 | 648577f2c5e1fa2774186ddea4ae7a2a |
|
BLAKE2b-256 | 682422a6d0f0c61a88f4f5e3107f0f2db5b79c8bd063c035cc6c8a449f0bb4b6 |