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%
Build a utility that makes authenticated HTTP requests to AWS services with proper payload handling. The utility should handle different types of request bodies and ensure they are correctly signed using AWS Signature Version 4.
Your implementation should provide a function that:
The function should accept AWS credentials, endpoint information, HTTP method, and optional body data, then return the HTTP response.
@generates
def make_authenticated_request(method, url, aws_access_key, aws_secret_key,
aws_region, aws_service, body=None):
"""
Makes an authenticated HTTP request to an AWS service.
Parameters:
- method (str): HTTP method ('GET' or 'POST')
- url (str): Full AWS service endpoint URL
- aws_access_key (str): AWS access key ID
- aws_secret_key (str): AWS secret access key
- aws_region (str): AWS region (e.g., 'us-east-1')
- aws_service (str): AWS service name (e.g., 'es')
- body (str, bytes, or None): Request body content
Returns:
requests.Response: HTTP response object
"""
passProvides AWS signature version 4 authentication and payload handling capabilities.
@satisfied-by