boto/botocore — pull request #21 by jamesls (2013-02-05 20:24:26+00:00)
Title: Update auth handlers to use requests 1.1.0

The hooks that the auth handlers were using are no longer available in
requests >= 1.0. The new way to do this is with custom auth handlers.

So originally I used the auth metchanism built into request 1.0 (the auth
param to the request.(get|post|etc.) method). However, I ran into a
problem, which is that the auth plugins operate on a PreparedRequest,
which already have the query string/post body params urlencoded. In order
to do signature calculations, I had to re-parse the query string and/or
post body params into a dict, update the dict accordingly, then
re-urlencode the params. Not ideal.

So then I started with using Request/PreparedRequest objects directly, but
then I ran into another issue, namely that I needed access to the
urlencoded post body for sigv4 (i.e the "payload" for the sha256).

So what I've done for now is to use our own AWSRequest class which
subclasses requests.models.Request.

This will allow us the flexibility to add whatever hooks/extension points
we want to the request/response going forward, and we
*should* be able to isolate ourselves from any changes that happen in the
request.models module (not sure how stable of an API this is).