Skip to content

Commit

Permalink
Code changes to implement proposed solution to GitHub issue #10
Browse files Browse the repository at this point in the history
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
Sam Washington committed Dec 22, 2015
1 parent 80b016e commit 3e25e67
Show file tree
Hide file tree
Showing 6 changed files with 914 additions and 110 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Install via pip:
requests-aws4auth requires the `Requests`_ library by Kenneth Reitz.

requests-aws4auth is tested on Python 2.7 and 3.2 and up.
requests-aws4auth is tested on Python 2.7 and 3.3 and up.

Basic usage
-----------
Expand Down
6 changes: 4 additions & 2 deletions requests_aws4auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
requests-aws4auth requires the Requests_ library by Kenneth Reitz.
requests-aws4auth is tested on Python 2.7 and 3.2 and up.
requests-aws4auth is tested on Python 2.7 and 3.3 and up.
Basic usage
-----------
Expand Down Expand Up @@ -143,9 +143,11 @@
# http://opensource.org/licenses/MIT


from .aws4auth import AWS4Auth
from .aws4auth import AWS4Auth, StrictAWS4Auth, PassiveAWS4Auth
from .aws4signingkey import AWS4SigningKey
from .exceptions import RequestsAws4AuthException, DateMismatchError, NoSecretKeyError
del aws4auth
del aws4signingkey
del exceptions

__version__ = '0.7'
Loading

0 comments on commit 3e25e67

Please sign in to comment.