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.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 799d344a577e96e7e4ae3112843031bf37ef03351b0371f58a72ad87b6c16b95 |
|
MD5 | 178b6abf9ad61f6dde5a2d717a701dde |
|
BLAKE2b-256 | dc6a8c7eec43ba56f9b7e937274d6dad2df57d175cb59aa11efb9bcef37145c1 |
Close
Hashes for hawk_server_asyncio-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8ff2d938dd3f5ef096de9f4cb12367619410e8309d5f7d5b642f4ec1f3c3452 |
|
MD5 | 874fc6dbeb5b09745f0ee7e96ae87099 |
|
BLAKE2b-256 | c349137c14a51162fe36d5d31104af6b749921d3ff917810988561f6952bbf75 |