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 HTTP servers. Presents a single-function API, 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.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29d085098b654f5f8e91c7f637d37b03f2eb832b204784f2e25bc100f4f175b6 |
|
MD5 | 811bedc3df4adf8d77195d21520f6bb9 |
|
BLAKE2b-256 | abd42e8bcb7a15a5cf0f83760e0df18a99137aac791de87f364d9dd9f41cabe4 |
Close
Hashes for hawk_server_asyncio-0.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4eac4d8ead3d380f893d990d35710d0c0afeb3327412a81889e7d89c2c5f5cba |
|
MD5 | 91700077e79741dca555d47aaf12b849 |
|
BLAKE2b-256 | 8629526eaf10a8f904e842e3bfea7b7e821856a46c2b18cfa3a6fac923673edc |