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 canonicalizes HTTP request components according to AWS Signature Version 4 specifications. The utility should properly format URI paths and query strings for use in AWS request signing.
Your implementation should handle:
Canonical Path Generation: Convert URI paths to their canonical form following AWS specifications
/Canonical Query String Generation: Process query parameters into canonical form
"", the canonical path should be "/" @test"/search/documents", the canonical path should preserve it as "/search/documents" @test"/files/my document.pdf", special characters should be properly encoded @test"", the canonical query string should be "" @test"search=test", it should be preserved as "search=test" @test"zebra=last&apple=first&banana=middle", they should be sorted alphabetically by key: "apple=first&banana=middle&zebra=last" @test@generates
def get_canonical_path(path: str) -> str:
"""
Convert a URI path to its canonical form for AWS request signing.
Args:
path: The URI path to canonicalize
Returns:
The canonical path string
"""
pass
def get_canonical_querystring(query: str) -> str:
"""
Convert a query string to its canonical form for AWS request signing.
Query parameters should be sorted alphabetically by key.
Args:
query: The query string to canonicalize
Returns:
The canonical query string
"""
passProvides canonical request formatting utilities for AWS request signing.
@satisfied-by