tessl install tessl/pypi-aws-requests-auth@0.4.0AWS signature version 4 signing process for the python requests module
Agent Success
Agent success rate when using this tile
84%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.11x
Baseline
Agent success rate without this tile
76%
A utility for managing different types of AWS credentials when making authenticated HTTP requests to AWS services.
Build a credential management system that handles both permanent and temporary AWS credentials for authenticating HTTP requests to AWS services. The system should support static access key pairs as well as temporary session-based credentials.
Handles permanent AWS access credentials for service authentication.
Handles AWS Security Token Service (STS) temporary credentials with session tokens.
Supports credential configuration for different AWS services.
@generates
def create_static_auth(aws_access_key: str, aws_secret_key: str,
aws_host: str, aws_region: str, aws_service: str):
"""
Creates an authentication handler for AWS requests using static credentials.
Args:
aws_access_key: AWS access key ID
aws_secret_key: AWS secret access key
aws_host: AWS service host (e.g., 'es.us-west-2.amazonaws.com')
aws_region: AWS region (e.g., 'us-west-2')
aws_service: AWS service name (e.g., 'es', 'execute-api', 'lambda')
Returns:
An authentication handler compatible with the requests library
"""
pass
def create_temporary_auth(aws_access_key: str, aws_secret_key: str,
aws_token: str, aws_host: str, aws_region: str,
aws_service: str):
"""
Creates an authentication handler for AWS requests using temporary credentials.
Args:
aws_access_key: Temporary AWS access key ID
aws_secret_key: Temporary AWS secret access key
aws_token: AWS session token from STS
aws_host: AWS service host
aws_region: AWS region
aws_service: AWS service name
Returns:
An authentication handler compatible with the requests library
"""
passProvides AWS Signature Version 4 authentication for HTTP requests.
HTTP library for making requests to AWS services.