{"action":"created","comment":{"url":"https://api.github.com/repos/pypa/warehouse/pulls/comments/55473903","id":55473903,"diff_hunk":"@@ -32,13 +31,15 @@ def content_security_policy_tween(request):\n \n \n def csp_factory(_, request):\n-    return copy.deepcopy(request.registry.settings.get(\"csp\", {}))\n+    return collections.defaultdict(\n+        list, request.registry.settings.get(\"csp\", {})\n+    )\n \n \n def includeme(config):\n     config.register_service_factory(csp_factory, name=\"csp\")\n     # Enable a Content Security Policy\n-    config.add_settings({\n+    config.add_settings(collections.defaultdict(list, {","path":"warehouse/csp.py","position":20,"original_position":20,"commit_id":"fdecc3189e49a3e99879d1b5bffc0c03e4bfe054","original_commit_id":"fdecc3189e49a3e99879d1b5bffc0c03e4bfe054","user":{"login":"demianbrecht","id":1422155,"avatar_url":"https://avatars.githubusercontent.com/u/1422155?v=3","gravatar_id":"","url":"https://api.github.com/users/demianbrecht","html_url":"https://github.com/demianbrecht","followers_url":"https://api.github.com/users/demianbrecht/followers","following_url":"https://api.github.com/users/demianbrecht/following{/other_user}","gists_url":"https://api.github.com/users/demianbrecht/gists{/gist_id}","starred_url":"https://api.github.com/users/demianbrecht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demianbrecht/subscriptions","organizations_url":"https://api.github.com/users/demianbrecht/orgs","repos_url":"https://api.github.com/users/demianbrecht/repos","events_url":"https://api.github.com/users/demianbrecht/events{/privacy}","received_events_url":"https://api.github.com/users/demianbrecht/received_events","type":"User","site_admin":false},"body":"I take that back. the `defaultdict` doesn't hold when applied to `request.registry.settings` because of the `update`. So no, this doesn't have to be a `defaultdict` (will change it), but I'll need to update the factory function.","created_at":"2016-03-09T05:37:28Z","updated_at":"2016-03-09T05:37:28Z","html_url":"https://github.com/pypa/warehouse/pull/1012#discussion_r55473903","pull_request_url":"https://api.github.com/repos/pypa/warehouse/pulls/1012","_links":{"self":{"href":"https://api.github.com/repos/pypa/warehouse/pulls/comments/55473903"},"html":{"href":"https://github.com/pypa/warehouse/pull/1012#discussion_r55473903"},"pull_request":{"href":"https://api.github.com/repos/pypa/warehouse/pulls/1012"}}},"pull_request":{"url":"https://api.github.com/repos/pypa/warehouse/pulls/1012","id":61837881,"html_url":"https://github.com/pypa/warehouse/pull/1012","diff_url":"https://github.com/pypa/warehouse/pull/1012.diff","patch_url":"https://github.com/pypa/warehouse/pull/1012.patch","issue_url":"https://api.github.com/repos/pypa/warehouse/issues/1012","number":1012,"state":"open","locked":false,"title":"Add user registration functionality","user":{"login":"demianbrecht","id":1422155,"avatar_url":"https://avatars.githubusercontent.com/u/1422155?v=3","gravatar_id":"","url":"https://api.github.com/users/demianbrecht","html_url":"https://github.com/demianbrecht","followers_url":"https://api.github.com/users/demianbrecht/followers","following_url":"https://api.github.com/users/demianbrecht/following{/other_user}","gists_url":"https://api.github.com/users/demianbrecht/gists{/gist_id}","starred_url":"https://api.github.com/users/demianbrecht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demianbrecht/subscriptions","organizations_url":"https://api.github.com/users/demianbrecht/orgs","repos_url":"https://api.github.com/users/demianbrecht/repos","events_url":"https://api.github.com/users/demianbrecht/events{/privacy}","received_events_url":"https://api.github.com/users/demianbrecht/received_events","type":"User","site_admin":false},"body":"New items:\r\n- Recaptcha service (conditionally functional, dependent on env vars)\r\n- forms.RegistrationForm\r\n- Reusable recaptcha template\r\n\r\nAlso added the responses lib as a dependency for mocking recaptcha tests\r\n\r\nFeatures:\r\n- [x] reCaptcha service\r\n- [x] Reusable reCapatcha template\r\n- [x] ``forms.RegistrationForm``\r\n- [x] ``views.register``\r\n\r\nReview items:\r\n- [x] Address SSL verification issue\r\n- [x] Expose reCaptcha keys through make targets and docker-compose\r\n- [ ] Move from base ``requests.post`` to using a module-scope session in recaptcha.py\r\n- [ ] Handle timeouts & other lower level socket errors in recaptcha.py\r\n- [ ] Security review on session handling in registration handler","created_at":"2016-03-06T09:04:51Z","updated_at":"2016-03-09T05:37:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a84d0aea89c3da6215992a8fde700d91e4c84b0c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pypa/warehouse/pulls/1012/commits","review_comments_url":"https://api.github.com/repos/pypa/warehouse/pulls/1012/comments","review_comment_url":"https://api.github.com/repos/pypa/warehouse/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pypa/warehouse/issues/1012/comments","statuses_url":"https://api.github.com/repos/pypa/warehouse/statuses/fdecc3189e49a3e99879d1b5bffc0c03e4bfe054","head":{"label":"demianbrecht:user-registration","ref":"user-registration","sha":"fdecc3189e49a3e99879d1b5bffc0c03e4bfe054","user":{"login":"demianbrecht","id":1422155,"avatar_url":"https://avatars.githubusercontent.com/u/1422155?v=3","gravatar_id":"","url":"https://api.github.com/users/demianbrecht","html_url":"https://github.com/demianbrecht","followers_url":"https://api.github.com/users/demianbrecht/followers","following_url":"https://api.github.com/users/demianbrecht/following{/other_user}","gists_url":"https://api.github.com/users/demianbrecht/gists{/gist_id}","starred_url":"https://api.github.com/users/demianbrecht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demianbrecht/subscriptions","organizations_url":"https://api.github.com/users/demianbrecht/orgs","repos_url":"https://api.github.com/users/demianbrecht/repos","events_url":"https://api.github.com/users/demianbrecht/events{/privacy}","received_events_url":"https://api.github.com/users/demianbrecht/received_events","type":"User","site_admin":false},"repo":{"id":50686212,"name":"warehouse","full_name":"demianbrecht/warehouse","owner":{"login":"demianbrecht","id":1422155,"avatar_url":"https://avatars.githubusercontent.com/u/1422155?v=3","gravatar_id":"","url":"https://api.github.com/users/demianbrecht","html_url":"https://github.com/demianbrecht","followers_url":"https://api.github.com/users/demianbrecht/followers","following_url":"https://api.github.com/users/demianbrecht/following{/other_user}","gists_url":"https://api.github.com/users/demianbrecht/gists{/gist_id}","starred_url":"https://api.github.com/users/demianbrecht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demianbrecht/subscriptions","organizations_url":"https://api.github.com/users/demianbrecht/orgs","repos_url":"https://api.github.com/users/demianbrecht/repos","events_url":"https://api.github.com/users/demianbrecht/events{/privacy}","received_events_url":"https://api.github.com/users/demianbrecht/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/demianbrecht/warehouse","description":"Next Generation Python Package Repository","fork":true,"url":"https://api.github.com/repos/demianbrecht/warehouse","forks_url":"https://api.github.com/repos/demianbrecht/warehouse/forks","keys_url":"https://api.github.com/repos/demianbrecht/warehouse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/demianbrecht/warehouse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/demianbrecht/warehouse/teams","hooks_url":"https://api.github.com/repos/demianbrecht/warehouse/hooks","issue_events_url":"https://api.github.com/repos/demianbrecht/warehouse/issues/events{/number}","events_url":"https://api.github.com/repos/demianbrecht/warehouse/events","assignees_url":"https://api.github.com/repos/demianbrecht/warehouse/assignees{/user}","branches_url":"https://api.github.com/repos/demianbrecht/warehouse/branches{/branch}","tags_url":"https://api.github.com/repos/demianbrecht/warehouse/tags","blobs_url":"https://api.github.com/repos/demianbrecht/warehouse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/demianbrecht/warehouse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/demianbrecht/warehouse/git/refs{/sha}","trees_url":"https://api.github.com/repos/demianbrecht/warehouse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/demianbrecht/warehouse/statuses/{sha}","languages_url":"https://api.github.com/repos/demianbrecht/warehouse/languages","stargazers_url":"https://api.github.com/repos/demianbrecht/warehouse/stargazers","contributors_url":"https://api.github.com/repos/demianbrecht/warehouse/contributors","subscribers_url":"https://api.github.com/repos/demianbrecht/warehouse/subscribers","subscription_url":"https://api.github.com/repos/demianbrecht/warehouse/subscription","commits_url":"https://api.github.com/repos/demianbrecht/warehouse/commits{/sha}","git_commits_url":"https://api.github.com/repos/demianbrecht/warehouse/git/commits{/sha}","comments_url":"https://api.github.com/repos/demianbrecht/warehouse/comments{/number}","issue_comment_url":"https://api.github.com/repos/demianbrecht/warehouse/issues/comments{/number}","contents_url":"https://api.github.com/repos/demianbrecht/warehouse/contents/{+path}","compare_url":"https://api.github.com/repos/demianbrecht/warehouse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/demianbrecht/warehouse/merges","archive_url":"https://api.github.com/repos/demianbrecht/warehouse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/demianbrecht/warehouse/downloads","issues_url":"https://api.github.com/repos/demianbrecht/warehouse/issues{/number}","pulls_url":"https://api.github.com/repos/demianbrecht/warehouse/pulls{/number}","milestones_url":"https://api.github.com/repos/demianbrecht/warehouse/milestones{/number}","notifications_url":"https://api.github.com/repos/demianbrecht/warehouse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/demianbrecht/warehouse/labels{/name}","releases_url":"https://api.github.com/repos/demianbrecht/warehouse/releases{/id}","deployments_url":"https://api.github.com/repos/demianbrecht/warehouse/deployments","created_at":"2016-01-29T19:32:15Z","updated_at":"2016-01-29T19:32:16Z","pushed_at":"2016-03-08T06:54:31Z","git_url":"git://github.com/demianbrecht/warehouse.git","ssh_url":"git@github.com:demianbrecht/warehouse.git","clone_url":"https://github.com/demianbrecht/warehouse.git","svn_url":"https://github.com/demianbrecht/warehouse","homepage":"https://warehouse.readthedocs.org/","size":17059,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pypa:master","ref":"master","sha":"bd0d3ea964164510d6470c887abbd5a63fe59318","user":{"login":"pypa","id":647025,"avatar_url":"https://avatars.githubusercontent.com/u/647025?v=3","gravatar_id":"","url":"https://api.github.com/users/pypa","html_url":"https://github.com/pypa","followers_url":"https://api.github.com/users/pypa/followers","following_url":"https://api.github.com/users/pypa/following{/other_user}","gists_url":"https://api.github.com/users/pypa/gists{/gist_id}","starred_url":"https://api.github.com/users/pypa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypa/subscriptions","organizations_url":"https://api.github.com/users/pypa/orgs","repos_url":"https://api.github.com/users/pypa/repos","events_url":"https://api.github.com/users/pypa/events{/privacy}","received_events_url":"https://api.github.com/users/pypa/received_events","type":"Organization","site_admin":false},"repo":{"id":9120498,"name":"warehouse","full_name":"pypa/warehouse","owner":{"login":"pypa","id":647025,"avatar_url":"https://avatars.githubusercontent.com/u/647025?v=3","gravatar_id":"","url":"https://api.github.com/users/pypa","html_url":"https://github.com/pypa","followers_url":"https://api.github.com/users/pypa/followers","following_url":"https://api.github.com/users/pypa/following{/other_user}","gists_url":"https://api.github.com/users/pypa/gists{/gist_id}","starred_url":"https://api.github.com/users/pypa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypa/subscriptions","organizations_url":"https://api.github.com/users/pypa/orgs","repos_url":"https://api.github.com/users/pypa/repos","events_url":"https://api.github.com/users/pypa/events{/privacy}","received_events_url":"https://api.github.com/users/pypa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pypa/warehouse","description":"Next Generation Python Package Repository","fork":false,"url":"https://api.github.com/repos/pypa/warehouse","forks_url":"https://api.github.com/repos/pypa/warehouse/forks","keys_url":"https://api.github.com/repos/pypa/warehouse/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pypa/warehouse/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pypa/warehouse/teams","hooks_url":"https://api.github.com/repos/pypa/warehouse/hooks","issue_events_url":"https://api.github.com/repos/pypa/warehouse/issues/events{/number}","events_url":"https://api.github.com/repos/pypa/warehouse/events","assignees_url":"https://api.github.com/repos/pypa/warehouse/assignees{/user}","branches_url":"https://api.github.com/repos/pypa/warehouse/branches{/branch}","tags_url":"https://api.github.com/repos/pypa/warehouse/tags","blobs_url":"https://api.github.com/repos/pypa/warehouse/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pypa/warehouse/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pypa/warehouse/git/refs{/sha}","trees_url":"https://api.github.com/repos/pypa/warehouse/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pypa/warehouse/statuses/{sha}","languages_url":"https://api.github.com/repos/pypa/warehouse/languages","stargazers_url":"https://api.github.com/repos/pypa/warehouse/stargazers","contributors_url":"https://api.github.com/repos/pypa/warehouse/contributors","subscribers_url":"https://api.github.com/repos/pypa/warehouse/subscribers","subscription_url":"https://api.github.com/repos/pypa/warehouse/subscription","commits_url":"https://api.github.com/repos/pypa/warehouse/commits{/sha}","git_commits_url":"https://api.github.com/repos/pypa/warehouse/git/commits{/sha}","comments_url":"https://api.github.com/repos/pypa/warehouse/comments{/number}","issue_comment_url":"https://api.github.com/repos/pypa/warehouse/issues/comments{/number}","contents_url":"https://api.github.com/repos/pypa/warehouse/contents/{+path}","compare_url":"https://api.github.com/repos/pypa/warehouse/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pypa/warehouse/merges","archive_url":"https://api.github.com/repos/pypa/warehouse/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pypa/warehouse/downloads","issues_url":"https://api.github.com/repos/pypa/warehouse/issues{/number}","pulls_url":"https://api.github.com/repos/pypa/warehouse/pulls{/number}","milestones_url":"https://api.github.com/repos/pypa/warehouse/milestones{/number}","notifications_url":"https://api.github.com/repos/pypa/warehouse/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pypa/warehouse/labels{/name}","releases_url":"https://api.github.com/repos/pypa/warehouse/releases{/id}","deployments_url":"https://api.github.com/repos/pypa/warehouse/deployments","created_at":"2013-03-30T19:03:53Z","updated_at":"2016-03-09T05:37:01Z","pushed_at":"2016-03-08T06:54:32Z","git_url":"git://github.com/pypa/warehouse.git","ssh_url":"git@github.com:pypa/warehouse.git","clone_url":"https://github.com/pypa/warehouse.git","svn_url":"https://github.com/pypa/warehouse","homepage":"https://warehouse.readthedocs.org/","size":18934,"stargazers_count":488,"watchers_count":488,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":101,"mirror_url":null,"open_issues_count":118,"forks":101,"open_issues":118,"watchers":488,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pypa/warehouse/pulls/1012"},"html":{"href":"https://github.com/pypa/warehouse/pull/1012"},"issue":{"href":"https://api.github.com/repos/pypa/warehouse/issues/1012"},"comments":{"href":"https://api.github.com/repos/pypa/warehouse/issues/1012/comments"},"review_comments":{"href":"https://api.github.com/repos/pypa/warehouse/pulls/1012/comments"},"review_comment":{"href":"https://api.github.com/repos/pypa/warehouse/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pypa/warehouse/pulls/1012/commits"},"statuses":{"href":"https://api.github.com/repos/pypa/warehouse/statuses/fdecc3189e49a3e99879d1b5bffc0c03e4bfe054"}}}}