summaryrefslogtreecommitdiff
path: root/boto/auth.py
diff options
context:
space:
mode:
authorDaniel Lindsley <daniel@toastdriven.com>2013-12-13 15:27:10 -0800
committerDaniel Lindsley <daniel@toastdriven.com>2013-12-13 15:27:10 -0800
commit09ca3fc929cc1961a22542f82f23a6dacd685770 (patch)
treeafc04e5f8994ea39dacabf6014093c8e60ad3143 /boto/auth.py
parentd18eac82d6f543c948c380348f69d09acbf7cada (diff)
downloadboto-09ca3fc929cc1961a22542f82f23a6dacd685770.tar.gz
Added conditional use of SigV4 to EC2.
Diffstat (limited to 'boto/auth.py')
-rw-r--r--boto/auth.py11
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