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.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a4aadcba81ed6f810109dac5c7bf8687479b8eb95ad42724a30792ac01640c7 |
|
MD5 | 9e72cd1ab40b117a0396337b5424c724 |
|
BLAKE2b-256 | d49b9791b84bc42ea3d67ea1eb643d15ccc46b2a613389967dc1ca2eca381632 |
Close
Hashes for hawk_server_asyncio-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7d5e2e57cc6d0cfa7cb1948882c7ca5a80d7a92fdd47a73a9a9741e7409b90c |
|
MD5 | 5c6c34eb707988809e38ba638b2aa4ce |
|
BLAKE2b-256 | 0274753f3765ac73db8632bb1b6676dc473f35977602c6e65aa3ed92fe6044d7 |