boto/boto — pull request #1134 by jamesls (2012-11-26 18:31:41+00:00)
Title: Switch SQS to Signature Version 4

There were a few structural changes needed to support this
change.

To keep compatilibity with python < 2.7.3, we use the
queue.amazonaws.com endpoint because < 2.7.3 we can't
validate the subjectAltName of the SSL certs.

However, for sigv4, the service name needs to be 'sqs' and not
'queue'. Ideally, the service name and region name are derived
from the endpoint, but we can't use the sqs.us-east-1.amazonaws.com
because this is the subjectAltName of the SSL cert.

This fix offers two mechanisms:

* The auth_service_name/auth_region_name properties on the connection
class, which allows you to set these values:

```
sqs = connect_sqs()
sqs.auth_service_name = 'sqs'
sqs.auth_region_name = 'us-east-1'
```

* An `AuthServiceName`class attribute that will be used to set the
`auth_service_name` value when the connection class is initialized.

This allows us to use 'sqs' for the credential scope required for
signature version 4, and allows us to use the queue.*.com endpoints
to ensure proper SSL cert validation for older pythons.

Also, the auth_region_name is automatically set to
self.region.name when the SQS client is initialized. This allows
SQS to work properly with sigv4 in non us-east-1 regions.

Unittests pass, SQS integration tests pass.

@garnaat, thoughts?