Permalink
Browse files

Merge pull request #3461 from kyleknap/ap-northeast-2-sigv4

Autodetect sigv4 for ap-northeast-2
  • Loading branch information...
2 parents 6627d77 + 243575f commit c2a17ce0e99dc66ff24f2943b3ca10eea6c004f0 @kyleknap kyleknap committed Jan 12, 2016
Showing with 17 additions and 3 deletions.
  1. +3 −1 boto/auth.py
  2. +14 −2 tests/unit/auth/test_sigv4.py
View
@@ -55,9 +55,11 @@
# by default.
SIGV4_DETECT = [
'.cn-',
- # In eu-central we support both host styles for S3
+ # In eu-central and ap-northeast-2 we support both host styles for S3
'.eu-central',
'-eu-central',
+ '.ap-northeast-2',
+ '-ap-northeast-2'
]
@@ -530,12 +530,24 @@ def test_sigv4_opt_out(self):
self.assertEqual(fake._required_auth_capability(), ['nope'])
def test_sigv4_non_optional(self):
- # Requires SigV4.
- for region in ['.cn-north', '.eu-central', '-eu-central']:
+ region_groups = ['.cn-north', '.eu-central', '-eu-central']
+ specific_regions = ['.ap-northeast-2', '-ap-northeast-2']
+
+ # Create a connection for a sample region in each of these groups
+ # and ensure sigv4 is used.
+ for region in region_groups:
fake = FakeS3Connection(host='s3' + region + '-1.amazonaws.com')
self.assertEqual(
fake._required_auth_capability(), ['hmac-v4-s3'])
+ # Create a connection from the specific regions and make sure
+ # that these use sigv4.
+ for region in specific_regions:
+ fake = FakeS3Connection(host='s3' + region + '.amazonaws.com')
+ self.assertEqual(
+ fake._required_auth_capability(), ['hmac-v4-s3'])
+
+
def test_sigv4_opt_in_config(self):
# Opt-in via the config.
self.config = {

0 comments on commit c2a17ce

Please sign in to comment.