httpx-auth-awssigv4

raw JSON →
0.1.4 verified Mon Apr 27 auth: no python

A Python library that provides AWS Signature V4 authentication for HTTPX requests. Current version 0.1.4 supports IAM user credentials and STS temporary credentials. Release cadence is low; no recent updates.

pip install httpx-auth-awssigv4
error ModuleNotFoundError: No module named 'httpx-auth-awssigv4'
cause Using hyphen instead of underscore in import statement.
fix
Use from httpx_auth_awssigv4 import SigV4Auth.
error TypeError: __init__() missing required positional arguments: 'access_key' and 'secret_key'
cause Credentials not provided to SigV4Auth.
fix
Provide access_key, secret_key (and optionally session_token).
gotcha The library requires Python >=3.6.2 but no longer actively maintained; consider using `aws-sigv4` for httpx if updates are needed.
fix Use aws-sigv4 package if newer features required.
gotcha Credentials are passed as parameters; avoid hardcoding. Use environment variables or AWS credential providers.
fix Use os.environ.get() or boto3 session.
gotcha The library does not support automatic credential chain resolution (e.g., from ~/.aws/credentials). You must supply keys explicitly.
fix Provide access_key and secret_key explicitly.

Initialize SigV4Auth with credentials and use it as HTTPX auth.

import os
from httpx import Client
from httpx_auth_awssigv4 import SigV4Auth

auth = SigV4Auth(
    access_key=os.environ.get('AWS_ACCESS_KEY_ID', 'YOUR_ACCESS_KEY'),
    secret_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'YOUR_SECRET_KEY'),
    region='us-east-1',
    service='execute-api'
)

with Client() as client:
    response = client.get('https://example.amazonaws.com', auth=auth)
    print(response.status_code)