Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Code changes to implement proposed solution to GitHub issue #10
GitHub issue: #10 See issue report and docstrings for detailed discussion of new functionality. Package changes: * Added StrictAWS4Auth and PassiveAWS4Auth classes * Added exceptions module with new exceptions: RequestsAWS4AuthException, DateMismatchError, NoSecretKeyError, DateFormatError * Now only tested on Pythons 2.7 and 3.3 and up, to match Requests supported versions (dropped support for Python 3.2) AWS4Auth changes: * Added regenerate_signing_key() method, to allow regeneration of current signing key with parameter overrides * Added methods for checking and extracting dates from requests: get_request_date(), parse_date(), handle_date_mismatch() * __call__() now checks for a date header in the request and attempts to automatically regenerate the signing key with the request date if request date differs from the signing key date * Can now supply a date to the constructor * Changed default included sig headers to include 'date' header if present * Docstring improvements AWS4SigningKey changes: * Added new store_secret_key instantiation parameter which allows control of whether the secret key is stored in the instance * Deprecated the amz_date property in favour of just 'date' * Spelling typo fix in AWS4AuthSigningKey module docstring. Thanks to jhgorrell Test changes: * Many new tests for the above functionality * Added tests for generating canonical path, including test for fix added in 0.7 for percent encoding of paths * Added tests for generating canonical querystrings
- Loading branch information