Skip to main content

AWS signature verification routines

Project description

This library provides signature verification for requests made to an AWS service. Typically, this is used to provide mock interfaces for AWS services or to rewrite AWS requests through a proxy host.

The current source tree can be found on GitHub.

Documentation is available on pythonhosted.

Currently only SigV4 is supported.

Example Usage

>>> import awssig
>>> access_key = "AKIDEXAMPLE"
>>> secret_key = "wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY"
>>> key_mapping = { access_key: secret_key }
>>> v = awssig.AWSSigV4Verifier(
...     request_method="GET",
...     uri_path="/",
...     query_string="a=foo&b=foo",
...     headers={
...         "Date": "Mon, 09 Sep 2011 23:36:00 GMT",
...         "Host": "host.foo.com",
...         "Authorization": (
...             "AWS4-HMAC-SHA256 "
...             "Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, "
...             "SignedHeaders=date;host, "
...             "Signature=0dc122f3b28b831ab48ba65cb47300de53fbe91b577fe113edac383730254a3b"),
...    },
...    body=b"",
...    region="us-east-1",
...    service="host",
...    key_mapping=key_mapping,
...    timestamp_mismatch=None)
>>> try:
...     v.verify()
...     print("ok")
... except awssig.InvalidSignatureError as e:
...     print("error: %s" % e)
ok

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

awssig-0.2.2.tar.gz (7.3 kB view details)

Uploaded Source

File details

Details for the file awssig-0.2.2.tar.gz.

File metadata

  • Download URL: awssig-0.2.2.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for awssig-0.2.2.tar.gz
Algorithm Hash digest
SHA256 445b03945096bf9ca238b3fb8b88b7106c355538014b5a77183e3fe2f8793aea
MD5 1ca6323ff1ec3a4d89ed9fd329b3e5f7
BLAKE2b-256 98b9da7fe795d9bd13a67b34c5149380a7f6d1bc517168c0b44c24c0d92e4604

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