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 = authenticate_hawk_header(
lookup_credentials, seen_nonce,
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f3d9d56f0376cdb078bf56b4a998c4617b6275e3c0263ddcce4363c865dca30 |
|
MD5 | 2777d3bc5063fcfc7aa4d0ef6925dfd0 |
|
BLAKE2b-256 | 7be9e68ef4e6e59287b994616aae05f346b1b8c341c7e0223858c876ca2b85b3 |
Close
Hashes for hawk_server_asyncio-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 752db20723193b178eeeb8c23cbe1cb7de6837ed8944650672b812dcaef29739 |
|
MD5 | 86c74a1c7b11ba483c85e0d1b46e0b32 |
|
BLAKE2b-256 | 07f20d236df1e065aada1f23cc042f862e8563109866469cbdb9a7b8be1cd606 |