AWS signature version 4 signing process for the python requests module
84
Build a utility that canonicalizes AWS request URIs for use in AWS Signature Version 4 authentication. The tool should handle both URI path and query string canonicalization according to AWS specifications.
Properly formats URI paths with URL encoding.
Formats query strings by sorting parameters alphabetically. Assumes parameters are already URL-encoded.
@generates
def canonicalize_path(path: str) -> str:
"""
Canonicalizes a URI path according to AWS Signature Version 4 specifications.
Args:
path: The URI path to canonicalize
Returns:
The canonicalized path with proper URL encoding
"""
pass
def canonicalize_query_string(query: str) -> str:
"""
Canonicalizes a query string according to AWS Signature Version 4 specifications.
Assumes query parameters are already URL-encoded.
Args:
query: The query string to canonicalize (pre-encoded)
Returns:
The canonicalized query string with parameters sorted by name
"""
passProvides AWS signature version 4 signing process for the python requests module.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-aws-requests-authdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10