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 at docs.ionosphere.io.
Currently only SigV4 and SigV4S3 (the S3 variant of SigV4) are 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
>>> v = awssig.AWSSigV4S3Verifier(
... request_method="POST",
... uri_path="/a//b/../c",
... 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=6b8af5a1e94a59c511e47267ab0cbfa1783dc42861ab7f09e0dba62680da8b28")],
... "x-amz-content-sha256": ["UNSIGNED-PAYLOAD"],
... },
... body=b"Hello world",
... 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
Metadata
Release files for awssig 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| awssig-0.5.0.tar.gz | 13.4 kB | Without provenance | Details for awssig-0.5.0.tar.gz |
Release files / awssig-0.5.0.tar.gz
| Download URL | awssig-0.5.0.tar.gz |
|---|---|
| Size | 13.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee7fa6c7d8b98f4bdee25779810ac8d6ab71ebb3023cb35b999d5ed1763533ff
|
|
BLAKE2b-256 checksum How to use checksums |
75e3e91a6ff81b6547eae21cc38ca070c24b7b9b04fdbaefcd70832e5f8778df
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.5
|
Security for awssig 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.