Skip to main content

Utility function to perform the server-side of Hawk authentication for asyncio HTTP servers

Project description

hawk-server-asyncio CircleCI Test Coverage

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hawk-server-asyncio-0.0.13.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

hawk_server_asyncio-0.0.13-py3-none-any.whl (3.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page