diff options
author | Daniel Lindsley <daniel@toastdriven.com> | 2013-12-13 15:27:10 -0800 |
---|---|---|
committer | Daniel Lindsley <daniel@toastdriven.com> | 2013-12-13 15:27:10 -0800 |
commit | 09ca3fc929cc1961a22542f82f23a6dacd685770 (patch) | |
tree | afc04e5f8994ea39dacabf6014093c8e60ad3143 /boto/auth.py | |
parent | d18eac82d6f543c948c380348f69d09acbf7cada (diff) | |
download | boto-09ca3fc929cc1961a22542f82f23a6dacd685770.tar.gz |
Added conditional use of SigV4 to EC2.
Diffstat (limited to 'boto/auth.py')
-rw-r--r-- | boto/auth.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/boto/auth.py b/boto/auth.py index 0d4221d6..c7ee3387 100644 --- a/boto/auth.py +++ b/boto/auth.py @@ -742,3 +742,14 @@ def get_auth_handler(host, config, provider, requested_capability=None): # user could override this with a .boto config that includes user-specific # credentials (for access to user data). return ready_handlers[-1] + + +def detect_potential_sigv4(func): + def _wrapper(self): + if hasattr(self, 'region'): + if getattr(self.region, 'endpoint', ''): + if '.cn-' in self.region.endpoint: + return ['hmac-v4'] + + return func(self) + return _wrapper |