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, max_skew,
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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39f2dd487fa0f1dc21ad43e40a8f979bf7a718d82ad703916d030ce86d3acce6 |
|
MD5 | 1a5f87d44c3f50d0d276cff1a8e6d4fb |
|
BLAKE2b-256 | c100a06d1a0a1826fd847e27f66e7270e78e63f790f21c1db9ff342e863f1406 |
Close
Hashes for hawk_server_asyncio-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fb6d45e4f17366e351341e7d94bbba29040a9041a2fc04f95bed8f3158a359d |
|
MD5 | 41dabaca69d6e5d8ffecd67e7850cb94 |
|
BLAKE2b-256 | a93cfbe90dc6dcff4818917834a6b36da98a19aa0013ec462a5280b21820c192 |