Skip to main content

Utility function to perform the server-side of Hawk authentication

Project description

hawk-server CircleCI Test Coverage

Utility function to perform the server-side of Hawk authentication, with no dependencies other than the Python standard library.

Installation

pip install hawk-server

Usage

from hawkserver import authenticate_hawk_header

def lookup_credentials(id):
    # Return {'id': 'some-id', 'key': 'some-secret'} matching credentials,
    # or None if credentials can't be found

def seen_nonce(nonce, id):
    # Store nonce, return True if nonce previously seen

error_message, credentials = 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-0.0.12.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hawk_server-0.0.12-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file hawk-server-0.0.12.tar.gz.

File metadata

  • Download URL: hawk-server-0.0.12.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for hawk-server-0.0.12.tar.gz
Algorithm Hash digest
SHA256 9737819865c46a343e8fff1ec3571e4945359fa4d2e1c248c73ff8dc9f923831
MD5 ec5d46d00d6e353062b4d00e07841fff
BLAKE2b-256 6624783c5a565f65f33c025c5b7ab1122b5186a03e66ee159cddd05734af7860

See more details on using hashes here.

File details

Details for the file hawk_server-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: hawk_server-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for hawk_server-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 4add4af0021e64ecb64524b264855f6de815d4acbc0aac9b9419f6a08dabe112
MD5 cce7d64098d1d8773d730ab985f59040
BLAKE2b-256 86e94b0cfd214eb4ddb64a7f8e8db9ff8cf0c05abd9eea74f5fc2ded5c625b93

See more details on using hashes here.

Supported by

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