{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/comments/34507669","id":34507669,"diff_hunk":"@@ -145,7 +145,11 @@ def upload(self, stream, path, conflict='replace', **kwargs):\n \n         resp = yield from self.make_request(\n             'PUT',\n-            self.bucket.new_key(path.path).generate_url(settings.TEMP_URL_SECS, 'PUT'),\n+            self.bucket.new_key(path.name).generate_url(\n+                settings.TEMP_URL_SECS,\n+                'PUT',\n+                encrypt_key=self.settings.get('encrypt_uploads', False)\n+            ),\n             data=stream,\n             headers={'Content-Length': str(stream.size)},","path":"waterbutler/providers/s3/provider.py","position":11,"original_position":11,"commit_id":"221bbe5e9d8032f3b0541b9d4205c50812d092ee","original_commit_id":"221bbe5e9d8032f3b0541b9d4205c50812d092ee","user":{"login":"chrisseto","id":5532905,"avatar_url":"https://avatars.githubusercontent.com/u/5532905?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisseto","html_url":"https://github.com/chrisseto","followers_url":"https://api.github.com/users/chrisseto/followers","following_url":"https://api.github.com/users/chrisseto/following{/other_user}","gists_url":"https://api.github.com/users/chrisseto/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisseto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisseto/subscriptions","organizations_url":"https://api.github.com/users/chrisseto/orgs","repos_url":"https://api.github.com/users/chrisseto/repos","events_url":"https://api.github.com/users/chrisseto/events{/privacy}","received_events_url":"https://api.github.com/users/chrisseto/received_events","type":"User","site_admin":false},"body":"Don't you need to provide the actual header? Or can it be embedded in the url?","created_at":"2015-07-13T20:29:19Z","updated_at":"2015-07-13T20:29:19Z","html_url":"https://github.com/CenterForOpenScience/waterbutler/pull/60#discussion_r34507669","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/60","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/comments/34507669"},"html":{"href":"https://github.com/CenterForOpenScience/waterbutler/pull/60#discussion_r34507669"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/60","id":39844861,"html_url":"https://github.com/CenterForOpenScience/waterbutler/pull/60","diff_url":"https://github.com/CenterForOpenScience/waterbutler/pull/60.diff","patch_url":"https://github.com/CenterForOpenScience/waterbutler/pull/60.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/60","number":60,"state":"open","locked":false,"title":"[feature] Allow new S3 keys to be encrypted","user":{"login":"HarryRybacki","id":2614670,"avatar_url":"https://avatars.githubusercontent.com/u/2614670?v=3","gravatar_id":"","url":"https://api.github.com/users/HarryRybacki","html_url":"https://github.com/HarryRybacki","followers_url":"https://api.github.com/users/HarryRybacki/followers","following_url":"https://api.github.com/users/HarryRybacki/following{/other_user}","gists_url":"https://api.github.com/users/HarryRybacki/gists{/gist_id}","starred_url":"https://api.github.com/users/HarryRybacki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HarryRybacki/subscriptions","organizations_url":"https://api.github.com/users/HarryRybacki/orgs","repos_url":"https://api.github.com/users/HarryRybacki/repos","events_url":"https://api.github.com/users/HarryRybacki/events{/privacy}","received_events_url":"https://api.github.com/users/HarryRybacki/received_events","type":"User","site_admin":false},"body":"## Purpose:\r\nAllow users to encrypt (at rest) new keys uploaded to S3.\r\n\r\n## Changes:\r\n- Pulls encrypt_uploads bool from settings and modifies PUT header accordingly\r\n\r\n## Side Effects:\r\nFiles will optionally be encrypted on Amazon's cloud servers.\r\n\r\n## Notes:\r\n- Depends on [osf.io sister PR](https://github.com/CenterForOpenScience/osf.io/pull/3533).\r\n- boto's ability to tell if a key is encrypted (on the server) is [currently broken](https://github.com/boto/boto/issues/3269). I am looking into the bug as well as a way to check whether a key is encrypted (on the server) via the rest API.\r\n  - Not an immediate issue now as everything is handled on the AWS side of things.","created_at":"2015-07-13T19:05:44Z","updated_at":"2015-07-13T20:29:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9481000c9d1e83239d5c8cc34aea1802188f4d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/60/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/60/comments","review_comment_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/60/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/statuses/221bbe5e9d8032f3b0541b9d4205c50812d092ee","head":{"label":"HarryRybacki:feature/handle_s3_key_encryption_for_uploads","ref":"feature/handle_s3_key_encryption_for_uploads","sha":"221bbe5e9d8032f3b0541b9d4205c50812d092ee","user":{"login":"HarryRybacki","id":2614670,"avatar_url":"https://avatars.githubusercontent.com/u/2614670?v=3","gravatar_id":"","url":"https://api.github.com/users/HarryRybacki","html_url":"https://github.com/HarryRybacki","followers_url":"https://api.github.com/users/HarryRybacki/followers","following_url":"https://api.github.com/users/HarryRybacki/following{/other_user}","gists_url":"https://api.github.com/users/HarryRybacki/gists{/gist_id}","starred_url":"https://api.github.com/users/HarryRybacki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HarryRybacki/subscriptions","organizations_url":"https://api.github.com/users/HarryRybacki/orgs","repos_url":"https://api.github.com/users/HarryRybacki/repos","events_url":"https://api.github.com/users/HarryRybacki/events{/privacy}","received_events_url":"https://api.github.com/users/HarryRybacki/received_events","type":"User","site_admin":false},"repo":{"id":38755812,"name":"waterbutler","full_name":"HarryRybacki/waterbutler","owner":{"login":"HarryRybacki","id":2614670,"avatar_url":"https://avatars.githubusercontent.com/u/2614670?v=3","gravatar_id":"","url":"https://api.github.com/users/HarryRybacki","html_url":"https://github.com/HarryRybacki","followers_url":"https://api.github.com/users/HarryRybacki/followers","following_url":"https://api.github.com/users/HarryRybacki/following{/other_user}","gists_url":"https://api.github.com/users/HarryRybacki/gists{/gist_id}","starred_url":"https://api.github.com/users/HarryRybacki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HarryRybacki/subscriptions","organizations_url":"https://api.github.com/users/HarryRybacki/orgs","repos_url":"https://api.github.com/users/HarryRybacki/repos","events_url":"https://api.github.com/users/HarryRybacki/events{/privacy}","received_events_url":"https://api.github.com/users/HarryRybacki/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HarryRybacki/waterbutler","description":"","fork":true,"url":"https://api.github.com/repos/HarryRybacki/waterbutler","forks_url":"https://api.github.com/repos/HarryRybacki/waterbutler/forks","keys_url":"https://api.github.com/repos/HarryRybacki/waterbutler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HarryRybacki/waterbutler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HarryRybacki/waterbutler/teams","hooks_url":"https://api.github.com/repos/HarryRybacki/waterbutler/hooks","issue_events_url":"https://api.github.com/repos/HarryRybacki/waterbutler/issues/events{/number}","events_url":"https://api.github.com/repos/HarryRybacki/waterbutler/events","assignees_url":"https://api.github.com/repos/HarryRybacki/waterbutler/assignees{/user}","branches_url":"https://api.github.com/repos/HarryRybacki/waterbutler/branches{/branch}","tags_url":"https://api.github.com/repos/HarryRybacki/waterbutler/tags","blobs_url":"https://api.github.com/repos/HarryRybacki/waterbutler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HarryRybacki/waterbutler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HarryRybacki/waterbutler/git/refs{/sha}","trees_url":"https://api.github.com/repos/HarryRybacki/waterbutler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HarryRybacki/waterbutler/statuses/{sha}","languages_url":"https://api.github.com/repos/HarryRybacki/waterbutler/languages","stargazers_url":"https://api.github.com/repos/HarryRybacki/waterbutler/stargazers","contributors_url":"https://api.github.com/repos/HarryRybacki/waterbutler/contributors","subscribers_url":"https://api.github.com/repos/HarryRybacki/waterbutler/subscribers","subscription_url":"https://api.github.com/repos/HarryRybacki/waterbutler/subscription","commits_url":"https://api.github.com/repos/HarryRybacki/waterbutler/commits{/sha}","git_commits_url":"https://api.github.com/repos/HarryRybacki/waterbutler/git/commits{/sha}","comments_url":"https://api.github.com/repos/HarryRybacki/waterbutler/comments{/number}","issue_comment_url":"https://api.github.com/repos/HarryRybacki/waterbutler/issues/comments{/number}","contents_url":"https://api.github.com/repos/HarryRybacki/waterbutler/contents/{+path}","compare_url":"https://api.github.com/repos/HarryRybacki/waterbutler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HarryRybacki/waterbutler/merges","archive_url":"https://api.github.com/repos/HarryRybacki/waterbutler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HarryRybacki/waterbutler/downloads","issues_url":"https://api.github.com/repos/HarryRybacki/waterbutler/issues{/number}","pulls_url":"https://api.github.com/repos/HarryRybacki/waterbutler/pulls{/number}","milestones_url":"https://api.github.com/repos/HarryRybacki/waterbutler/milestones{/number}","notifications_url":"https://api.github.com/repos/HarryRybacki/waterbutler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HarryRybacki/waterbutler/labels{/name}","releases_url":"https://api.github.com/repos/HarryRybacki/waterbutler/releases{/id}","created_at":"2015-07-08T13:30:16Z","updated_at":"2015-07-08T13:30:17Z","pushed_at":"2015-07-10T19:34:00Z","git_url":"git://github.com/HarryRybacki/waterbutler.git","ssh_url":"git@github.com:HarryRybacki/waterbutler.git","clone_url":"https://github.com/HarryRybacki/waterbutler.git","svn_url":"https://github.com/HarryRybacki/waterbutler","homepage":"http://waterbutler.io","size":3173,"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":"bdfd06863032a208f58ad3c8518161db49b5171c","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":"","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":"2015-05-22T00:07:10Z","pushed_at":"2015-07-13T20:28:15Z","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":3173,"stargazers_count":9,"watchers_count":9,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":10,"forks":25,"open_issues":10,"watchers":9,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/60"},"html":{"href":"https://github.com/CenterForOpenScience/waterbutler/pull/60"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/60"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/statuses/221bbe5e9d8032f3b0541b9d4205c50812d092ee"}}}}