Registry / aws / aws-sdk-signers

aws-sdk-signers

JSON →
library0.3.0pypypiunverified

The aws-sdk-signers library provides standalone HTTP request signers for Amazon Web Services, primarily focusing on SigV4 signing. It's part of the wider smithy-python ecosystem, offering a low-level interface for integrating AWS signature logic into any HTTP client. As a 0.x.x release, it is under active development with an irregular release cadence.

pip install aws-sdk-signers aws-sdk-http botocore
INSTALL
IMPORT
SIG · AWS-SDK-SIGNERS
A
aws-sdk-signers
awspythonv0.3.0
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
build_error
glibc
py 3.103.920 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HTTPSigner
from aws_sdk_signers import HTTPSigner
SigV4Signer
from aws_sdk_signers import SigV4Signer
HttpRequest
from aws_sdk_http import HttpRequest

This example demonstrates how to sign a simple AWS S3 GET request using SigV4. It dynamically resolves AWS credentials and region, constructs an `HttpRequest` object, and then applies the SigV4 signature using `SigV4Signer`. Note that `x-amz-content-sha256` for an empty body is explicitly set, and `botocore` is used for credential resolution.

import os from datetime import datetime, timezone from aws_sdk_signers import SigV4Signer from aws_sdk_http import HttpRequest import botocore.session # 1. Resolve AWS credentials and region (e.g., from environment variables, ~/.aws/credentials) session = botocore.session.get_session() credentials = session.get_credentials() # Use os.environ.get for region, falling back to botocore config or a default region = os.environ.get('AWS_DEFAULT_REGION', session.get_config_variable('region') or 'us-east-1') # Ensure credentials and region are found if not credentials or not credentials.access_key or not region: raise RuntimeError("AWS credentials or region not found. Set AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN (optional) and AWS_DEFAULT_REGION.") # 2. Create an HTTP Request object # For an empty body, x-amz-content-sha256 must be the SHA256 hash of an empty string. request = HttpRequest( method="GET", scheme="https", host="example.s3.amazonaws.com", path="/myobject.txt", headers={ "Host": "example.s3.amazonaws.com", "x-amz-content-sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }, body=b'' ) # 3. Create a SigV4Signer instance signer = SigV4Signer( credentials=credentials, service_id="s3", region=region, ) # 4. Sign the request signing_date = datetime.now(timezone.utc) # Use a timezone-aware datetime for signing signed_request = signer.sign(request, signing_date) print("--- Original Request Headers ---") for k, v in request.headers.items(): print(f"{k}: {v}") print("\n--- Signed Request Headers ---") for k, v in signed_request.headers.items(): print(f"{k}: {v}") print(f"\nSigned Authorization header: {signed_request.headers.get('Authorization')}")
Debug
Known issues
breakingAs a 0.x.x library, the API is subject to frequent and breaking changes without prior notice. Semantic versioning guarantees do not apply, and minor version increments may introduce incompatible changes.
fix
Always pin to exact versions (e.g., `aws-sdk-signers==0.2.0`) and review changes carefully when upgrading.
affects: 0.1.0 - 0.2.0+
gotchaThis library provides signing logic but does not handle AWS credential or region resolution by itself. For typical AWS environments, you'll need to use `botocore` or manually provide `AWSCredentials` and `region`.
fix
Install `botocore` and use `botocore.session.get_session().get_credentials()` and `session.get_config_variable('region')` to obtain credentials and region, or explicitly pass them to the signer.
affects: 0.1.0 - 0.2.0+
gotchaThe signer expects an `HttpRequest` object from `aws-sdk-http` (or a compatible type) and will not work with a plain Python dictionary or other HTTP request objects directly without custom adaptation.
fix
Ensure `aws-sdk-http` is installed and construct your request using `from aws_sdk_http import HttpRequest`.
affects: 0.1.0 - 0.2.0+
Upgrade
Version history
0.3.0latest on PyPI · released May 5, 2026
Audit
Dependencies
botocoreoptionalCommonly used for resolving AWS credentials and regions programmatically.
aws-sdk-httpoptionalProvides the HttpRequest and HttpResponse objects that are typically used with signers.
Agent activity
28 hits · last 30 days
node
26
OpenAI (training)
1
Resources
aws-sdk-signers — pip install aws-sdk-signers · libregistry