🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

hawk-server-asyncio

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hawk-server-asyncio

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

0.0.13
PyPI
Maintainers
1

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

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts