{"action":"opened","number":111,"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/111","id":55908729,"html_url":"https://github.com/CenterForOpenScience/waterbutler/pull/111","diff_url":"https://github.com/CenterForOpenScience/waterbutler/pull/111.diff","patch_url":"https://github.com/CenterForOpenScience/waterbutler/pull/111.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/111","number":111,"state":"open","locked":false,"title":"[CR] s3: support periods in bucketnames for all regions","user":{"login":"felliott","id":86835,"avatar_url":"https://avatars.githubusercontent.com/u/86835?v=3","gravatar_id":"","url":"https://api.github.com/users/felliott","html_url":"https://github.com/felliott","followers_url":"https://api.github.com/users/felliott/followers","following_url":"https://api.github.com/users/felliott/following{/other_user}","gists_url":"https://api.github.com/users/felliott/gists{/gist_id}","starred_url":"https://api.github.com/users/felliott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felliott/subscriptions","organizations_url":"https://api.github.com/users/felliott/orgs","repos_url":"https://api.github.com/users/felliott/repos","events_url":"https://api.github.com/users/felliott/events{/privacy}","received_events_url":"https://api.github.com/users/felliott/received_events","type":"User","site_admin":false},"body":"A bogus error message in the OSF S3 addon revealed some shenanigans\r\nin how we handle bucket names outside the US (N. Virginia) region.\r\nAmazon permits bucket names that follow subdomain-naming conventions\r\n(labels separated by periods).  WB had been accessing buckets using\r\nthe subdomain calling format, which would access a bucket named 'foo'\r\nat `https://foo.s3.amazonaws.com/`.  However, wildcard nested\r\nsubdomain certificates are deprecated, and Pythons newer than 2.7.9\r\nwill throw a certificate checking error if you try to access them.\r\nIOW a bucket named 'foo' will still work, but a bucket named 'foo.bar'\r\nwill try to connect to `https://foo.bar.s3.amazonaws.com/` and\r\nwill fail validation.\r\n\r\n`boto`, the library WB uses to communicate with S3, supports another\r\ncalling format that avoids this issue, the `OrdinaryCallingFormat`.\r\nUnder OCF, a call to a bucket named `foo.bar` is directed to\r\n`https://s3.amazonaws.com/foo.bar/`, and so the certificate will pass\r\nvalidation.  The catch is that buckets in regions outside US\r\n(N. Virginia) require the request to be sent to a region-specific URL.\r\nThe OSF doesn't currently track the bucket's region, so WB has to\r\nlook it up via the S3 API.  Once we have the region, we can update the\r\nhost, and all S3 actions should succeed.\r\n\r\nFixes: [#OSF-5509]\r\n\r\nReferences:\r\n----\r\n\r\n* [S3 naming conventions](http://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html#bucketnamingrules)\r\n* [S3 bucket region lookup](http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html)","created_at":"2016-01-13T15:07:18Z","updated_at":"2016-01-13T15:07:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38a2c312c80457af6c233f5c584bd1969d1292ef","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/111/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/111/comments","review_comment_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/111/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/statuses/372e22c657a7ced53e0875fea01ba366a6c40f01","head":{"label":"felliott:feature/s3-robust-bucket-names","ref":"feature/s3-robust-bucket-names","sha":"372e22c657a7ced53e0875fea01ba366a6c40f01","user":{"login":"felliott","id":86835,"avatar_url":"https://avatars.githubusercontent.com/u/86835?v=3","gravatar_id":"","url":"https://api.github.com/users/felliott","html_url":"https://github.com/felliott","followers_url":"https://api.github.com/users/felliott/followers","following_url":"https://api.github.com/users/felliott/following{/other_user}","gists_url":"https://api.github.com/users/felliott/gists{/gist_id}","starred_url":"https://api.github.com/users/felliott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felliott/subscriptions","organizations_url":"https://api.github.com/users/felliott/orgs","repos_url":"https://api.github.com/users/felliott/repos","events_url":"https://api.github.com/users/felliott/events{/privacy}","received_events_url":"https://api.github.com/users/felliott/received_events","type":"User","site_admin":false},"repo":{"id":43513200,"name":"waterbutler","full_name":"felliott/waterbutler","owner":{"login":"felliott","id":86835,"avatar_url":"https://avatars.githubusercontent.com/u/86835?v=3","gravatar_id":"","url":"https://api.github.com/users/felliott","html_url":"https://github.com/felliott","followers_url":"https://api.github.com/users/felliott/followers","following_url":"https://api.github.com/users/felliott/following{/other_user}","gists_url":"https://api.github.com/users/felliott/gists{/gist_id}","starred_url":"https://api.github.com/users/felliott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felliott/subscriptions","organizations_url":"https://api.github.com/users/felliott/orgs","repos_url":"https://api.github.com/users/felliott/repos","events_url":"https://api.github.com/users/felliott/events{/privacy}","received_events_url":"https://api.github.com/users/felliott/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/felliott/waterbutler","description":"","fork":true,"url":"https://api.github.com/repos/felliott/waterbutler","forks_url":"https://api.github.com/repos/felliott/waterbutler/forks","keys_url":"https://api.github.com/repos/felliott/waterbutler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/felliott/waterbutler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/felliott/waterbutler/teams","hooks_url":"https://api.github.com/repos/felliott/waterbutler/hooks","issue_events_url":"https://api.github.com/repos/felliott/waterbutler/issues/events{/number}","events_url":"https://api.github.com/repos/felliott/waterbutler/events","assignees_url":"https://api.github.com/repos/felliott/waterbutler/assignees{/user}","branches_url":"https://api.github.com/repos/felliott/waterbutler/branches{/branch}","tags_url":"https://api.github.com/repos/felliott/waterbutler/tags","blobs_url":"https://api.github.com/repos/felliott/waterbutler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/felliott/waterbutler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/felliott/waterbutler/git/refs{/sha}","trees_url":"https://api.github.com/repos/felliott/waterbutler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/felliott/waterbutler/statuses/{sha}","languages_url":"https://api.github.com/repos/felliott/waterbutler/languages","stargazers_url":"https://api.github.com/repos/felliott/waterbutler/stargazers","contributors_url":"https://api.github.com/repos/felliott/waterbutler/contributors","subscribers_url":"https://api.github.com/repos/felliott/waterbutler/subscribers","subscription_url":"https://api.github.com/repos/felliott/waterbutler/subscription","commits_url":"https://api.github.com/repos/felliott/waterbutler/commits{/sha}","git_commits_url":"https://api.github.com/repos/felliott/waterbutler/git/commits{/sha}","comments_url":"https://api.github.com/repos/felliott/waterbutler/comments{/number}","issue_comment_url":"https://api.github.com/repos/felliott/waterbutler/issues/comments{/number}","contents_url":"https://api.github.com/repos/felliott/waterbutler/contents/{+path}","compare_url":"https://api.github.com/repos/felliott/waterbutler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/felliott/waterbutler/merges","archive_url":"https://api.github.com/repos/felliott/waterbutler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/felliott/waterbutler/downloads","issues_url":"https://api.github.com/repos/felliott/waterbutler/issues{/number}","pulls_url":"https://api.github.com/repos/felliott/waterbutler/pulls{/number}","milestones_url":"https://api.github.com/repos/felliott/waterbutler/milestones{/number}","notifications_url":"https://api.github.com/repos/felliott/waterbutler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/felliott/waterbutler/labels{/name}","releases_url":"https://api.github.com/repos/felliott/waterbutler/releases{/id}","created_at":"2015-10-01T18:24:31Z","updated_at":"2015-10-01T18:24:32Z","pushed_at":"2016-01-13T15:03:09Z","git_url":"git://github.com/felliott/waterbutler.git","ssh_url":"git@github.com:felliott/waterbutler.git","clone_url":"https://github.com/felliott/waterbutler.git","svn_url":"https://github.com/felliott/waterbutler","homepage":"http://waterbutler.io","size":1855,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"CenterForOpenScience:develop","ref":"develop","sha":"4c1c53ff740ba7406592792e969ec9675a317002","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"repo":{"id":27130042,"name":"waterbutler","full_name":"CenterForOpenScience/waterbutler","owner":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CenterForOpenScience/waterbutler","description":"WaterButler is a Python web application for interacting with various file storage services via a single RESTful API, developed at The Center for Open Science.","fork":false,"url":"https://api.github.com/repos/CenterForOpenScience/waterbutler","forks_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/forks","keys_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/teams","hooks_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/hooks","issue_events_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/events{/number}","events_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/events","assignees_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/assignees{/user}","branches_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/branches{/branch}","tags_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/tags","blobs_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/git/refs{/sha}","trees_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/statuses/{sha}","languages_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/languages","stargazers_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/stargazers","contributors_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/contributors","subscribers_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/subscribers","subscription_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/subscription","commits_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/commits{/sha}","git_commits_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/git/commits{/sha}","comments_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/comments{/number}","issue_comment_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/comments{/number}","contents_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/contents/{+path}","compare_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/merges","archive_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/downloads","issues_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues{/number}","pulls_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls{/number}","milestones_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/milestones{/number}","notifications_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/labels{/name}","releases_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/releases{/id}","created_at":"2014-11-25T14:42:31Z","updated_at":"2016-01-13T14:47:44Z","pushed_at":"2016-01-13T15:07:18Z","git_url":"git://github.com/CenterForOpenScience/waterbutler.git","ssh_url":"git@github.com:CenterForOpenScience/waterbutler.git","clone_url":"https://github.com/CenterForOpenScience/waterbutler.git","svn_url":"https://github.com/CenterForOpenScience/waterbutler","homepage":"http://waterbutler.io","size":2271,"stargazers_count":14,"watchers_count":14,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":36,"mirror_url":null,"open_issues_count":14,"forks":36,"open_issues":14,"watchers":14,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/111"},"html":{"href":"https://github.com/CenterForOpenScience/waterbutler/pull/111"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/111"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/statuses/372e22c657a7ced53e0875fea01ba366a6c40f01"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":121,"deletions":11,"changed_files":2}}