Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix s3 fips endpoint #265

Merged
merged 2 commits into from
Mar 28, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix fips-us-gov-west-1 s3 logic
The s3.json model had "fips-gov-west-1" when the
region needed to be "fips-us-gov-west-1".  Interestingly
enough, botocore did *not* given an error when this happened.
This should be fixed...
  • Loading branch information
jamesls committed Mar 27, 2014
commit 2b58065190e0803759219428306fcb5f4f7b1415
2 changes: 1 addition & 1 deletion botocore/data/aws/s3/2006-03-01.json
Original file line number Diff line number Diff line change
Expand Up @@ -5298,7 +5298,7 @@
"us-west-1": "https://s3-us-west-1.amazonaws.com/",
"eu-west-1": "https://s3-eu-west-1.amazonaws.com/",
"us-gov-west-1": "https://s3-us-gov-west-1.amazonaws.com/",
"fips-gov-west-1": "https://s3-fips-us-gov-west-1.amazonaws.com/",
"fips-us-gov-west-1": "https://s3-fips-us-gov-west-1.amazonaws.com/",
"cn-north-1": "https://s3.cn-north-1.amazonaws.com.cn"
},
"protocols": [
Expand Down
2 changes: 1 addition & 1 deletion botocore/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
LABEL_RE = re.compile('[a-z0-9][a-z0-9\-]*[a-z0-9]')
RESTRICTED_REGIONS = [
'us-gov-west-1',
'fips-gov-west-1',
'fips-us-gov-west-1',
]


Expand Down
2 changes: 1 addition & 1 deletion services/s3.extra.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"us-west-1": "https://s3-us-west-1.amazonaws.com/",
"eu-west-1": "https://s3-eu-west-1.amazonaws.com/",
"us-gov-west-1": "https://s3-us-gov-west-1.amazonaws.com/",
"fips-gov-west-1": "https://s3-fips-us-gov-west-1.amazonaws.com/",
"fips-us-gov-west-1": "https://s3-fips-us-gov-west-1.amazonaws.com/",
"cn-north-1": "https://s3.cn-north-1.amazonaws.com.cn"
},
"protocols": [
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/test_s3_addressing.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ def test_list_objects_in_restricted_regions(self):
self.assertEqual(prepared_request.url,
'https://s3-us-gov-west-1.amazonaws.com/safename')

def test_list_objects_in_fips(self):
self.endpoint = self.s3.get_endpoint('fips-us-gov-west-1')
op = self.s3.get_operation('ListObjects')
params = op.build_parameters(bucket='safename')
prepared_request = self.get_prepared_request(op, params)
# Note how we keep the region specific endpoint here.
self.assertEqual(
prepared_request.url,
'https://s3-fips-us-gov-west-1.amazonaws.com/safename')

def test_list_objects_non_dns_name_non_classic(self):
self.endpoint = self.s3.get_endpoint('us-west-2')
op = self.s3.get_operation('ListObjects')
Expand Down