summaryrefslogtreecommitdiff
path: root/swiftclient/multithreading.py
diff options
context:
space:
mode:
authorClay Gerrard <clay.gerrard@gmail.com>2014-10-24 01:02:53 -0700
committerpaul luse <paul.e.luse@intel.com>2014-12-17 05:53:56 -0700
commitfbe558885f29e2c545e3260927a625b1027995ec (patch)
treeb62ac1f265ade36710f70bdcc92c33347e364df7 /swiftclient/multithreading.py
parentd59af8cc8b3f5ddf846046dd11029b84db4828ea (diff)
downloadpython-swiftclient-fbe558885f29e2c545e3260927a625b1027995ec.tar.gz
Make preauth params work
If you specify a token and storage url when creating a Connection, regardless of the auth api version the first request will be made directly to swift. You can either provide a preauthurl and preauthtoken or fall back to os_options' object_storage_url and auth_token keys (exposed as --os-storage-url and --os-auth-token on the command line or OS_STORAGE_URL and OS_AUTH_TOKEN in the environment). If a _retry wrapped request on a Connection fails because of invalid authentication (401) the Connection's cached token and url will be invalidated. If the Connection's retries attribute is > 0 the subsequent attempt will call get_auth to refresh the token, but the pre-configured storage_url will always be re-used. This is consistent with current auth v2 behavior and less surprising for auth v1. The pre-existing, but previously undocumented behavior/interface of get_auth would override the storage_url returned by the auth service if the 'os_storage_url' option was provided in the os_options dict. To ensure that this behavior is consistent across auth v1 and v2 from the command line and when using the Connection class as a library - the preauthurl is stashed in the os_options dict when provided. Improved Connection.get_capabilities storage_url handling to better support the consistent behavior of a preauthurl/object_storage_url on the connection regardless of auth version. Fixed up some test infrastructure to enable setting up and testing multiple requests/responses. Change-Id: I6950fb73f3e28fdddb62760cae9320e2f4336776
Diffstat (limited to 'swiftclient/multithreading.py')
0 files changed, 0 insertions, 0 deletions