boto/botocore — pull request #414 by danielgtaylor (2014-12-16 22:49:56+00:00)
Title: Refactor to decouple auth/endpoints and unify events.

Refactor to decouple auth/endpoints and unify events.

This change decouples authentication from the `Endpoint` class and
introduces a new `RequestSigner` class to handle the signing of
requests. It fires the following events:

* `choose-signer.service.operation`: Allow overriding signature version
* `before-sign.service.operation`: Allow mutating request before signing

This also fixes the EC2 encrypted snapshot copying customization to work
with clients, as well as implements the changes needed for boto/boto3#39
(signature version overrides) and boto/boto3#30 (anonymous operations)
for the Botocore client interface.

The previous `before-auth` event is now removed, and all handlers that
previously used an endpoint's `.auth` property are now switched to
use the request signer. This may require changes upstream in the AWS CLI
as it is a potentially breaking change.

Additionally, the event emitter now supports an `emit_until_response`
method that will **stop** processing handlers once the first non-`None`
response has been received.

Tests have been updated/moved/removed accordingly.

cc @jamesls, @kyleknap