boto/botocore — pull request #142 by jamesls (2013-09-30 19:44:58+00:00)
Title: Protect auth signing with a lock 

The parts that manipulate the .auth_path aren't thread safe.
While we can possibly make this more granular, the entire
`before-auth` and `add_auth` calls are protected with a lock.
All of the existing auth signing code is CPU bound, so this
won't negatively impact performance.

This came about when sharing `endpoint` objects across threads,
as part of the fix for: https://github.com/aws/aws-cli/issues/381

Integration test shows the issue, you'll get signing errors without
this fix because it's using the wrong `auth_path`:

```
======================================================================
FAIL: test_thread_safe_auth (tests.integration.test_s3.TestS3Objects)
----------------------------------------------------------------------
Traceback (most recent call last):
File "botocore/tests/integration/test_s3.py", line 267, in test_thread_safe_auth
"Unexpectedly caught exceptions: %s" % self.caught_exceptions)
AssertionError: Unexpectedly caught exceptions: [AssertionError('403 != 200',), AssertionError('403 != 200',), AssertionError('403 != 200',), AssertionError('403 != 200',), AssertionError('403 != 200',), AssertionError('403 != 200',)]
...

SignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your key and signing method.50 55 54 0a 0a 0a 4d 6f 6e 31 39 3a 33 34 3a 35 38 20 47 4d 54 0a 2f 62 6f 74 6f 63 6f 72 65 74 65 73 74 31 33 38 30 35 36 39 36 39 37 2d 31 31 35 2f 66 6f 6f 359ADB7B3662B090EDABCDBErju4IzInYEQEaqy8MtecR4wpeOZq31b0zlHfCQ5J8ossnMNnW+Ztz4w6A/ABCDefg=PUT
```