{"action":"created","comment":{"url":"https://api.github.com/repos/Pylons/pyramid/pulls/comments/91269523","pull_request_review_id":11776896,"id":91269523,"diff_hunk":"@@ -218,9 +227,14 @@ def register():\n         intr['header'] = header\n         intr['safe_methods'] = as_sorted_tuple(safe_methods)\n         intr['callback'] = callback\n+\n+        from pyramid.csrf import csrf_token_template_global\n+        from pyramid.events import BeforeRender","path":"pyramid/config/security.py","position":49,"original_position":49,"commit_id":"e4f33995a722837b400944b34768d2d364d7d5a1","original_commit_id":"e4f33995a722837b400944b34768d2d364d7d5a1","user":{"login":"jcerjak","id":191024,"avatar_url":"https://avatars.githubusercontent.com/u/191024?v=3","gravatar_id":"","url":"https://api.github.com/users/jcerjak","html_url":"https://github.com/jcerjak","followers_url":"https://api.github.com/users/jcerjak/followers","following_url":"https://api.github.com/users/jcerjak/following{/other_user}","gists_url":"https://api.github.com/users/jcerjak/gists{/gist_id}","starred_url":"https://api.github.com/users/jcerjak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcerjak/subscriptions","organizations_url":"https://api.github.com/users/jcerjak/orgs","repos_url":"https://api.github.com/users/jcerjak/repos","events_url":"https://api.github.com/users/jcerjak/events{/privacy}","received_events_url":"https://api.github.com/users/jcerjak/received_events","type":"User","site_admin":false},"body":"Could we move these imports to the top?","created_at":"2016-12-07T10:56:00Z","updated_at":"2016-12-07T10:56:00Z","html_url":"https://github.com/Pylons/pyramid/pull/2854#discussion_r91269523","pull_request_url":"https://api.github.com/repos/Pylons/pyramid/pulls/2854","_links":{"self":{"href":"https://api.github.com/repos/Pylons/pyramid/pulls/comments/91269523"},"html":{"href":"https://github.com/Pylons/pyramid/pull/2854#discussion_r91269523"},"pull_request":{"href":"https://api.github.com/repos/Pylons/pyramid/pulls/2854"}}},"pull_request":{"url":"https://api.github.com/repos/Pylons/pyramid/pulls/2854","id":96893136,"html_url":"https://github.com/Pylons/pyramid/pull/2854","diff_url":"https://github.com/Pylons/pyramid/pull/2854.diff","patch_url":"https://github.com/Pylons/pyramid/pull/2854.patch","issue_url":"https://api.github.com/repos/Pylons/pyramid/issues/2854","number":2854,"state":"open","locked":false,"title":"Decouple CSRF protection from the session machinery","user":{"login":"MatthewWilkes","id":98908,"avatar_url":"https://avatars.githubusercontent.com/u/98908?v=3","gravatar_id":"","url":"https://api.github.com/users/MatthewWilkes","html_url":"https://github.com/MatthewWilkes","followers_url":"https://api.github.com/users/MatthewWilkes/followers","following_url":"https://api.github.com/users/MatthewWilkes/following{/other_user}","gists_url":"https://api.github.com/users/MatthewWilkes/gists{/gist_id}","starred_url":"https://api.github.com/users/MatthewWilkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatthewWilkes/subscriptions","organizations_url":"https://api.github.com/users/MatthewWilkes/orgs","repos_url":"https://api.github.com/users/MatthewWilkes/repos","events_url":"https://api.github.com/users/MatthewWilkes/events{/privacy}","received_events_url":"https://api.github.com/users/MatthewWilkes/received_events","type":"User","site_admin":false},"body":"In #1573 @dstufft makes a number of feature requests about the CSRF implementation of Pyramid, most of which were added in 1.7.\r\n\r\nThis patch attempts to move the CSRF generation logic out of the session, so new CSRF implementations that do not depend on sessions can be added. It currently does not add any such implementations, the only one shipped is the default which falls back to an implementation of CSRF on the session.\r\n\r\nIt also introduces new utility functions for `get_csrf_token(request)` and `new_csrf_token(request)` in Python, as well as a `get_csrf_token()` in the template global scope, and repoints documentation to use these rather than explicitly calling the session machinery.\r\n\r\nThis was written at the DragonSprint by me and @jcerjak, a new contributor to Pyramid.","created_at":"2016-12-07T10:09:50Z","updated_at":"2016-12-07T10:56:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd228dd135d7904b165a257fadb2b7c1eb2621b3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Pylons/pyramid/pulls/2854/commits","review_comments_url":"https://api.github.com/repos/Pylons/pyramid/pulls/2854/comments","review_comment_url":"https://api.github.com/repos/Pylons/pyramid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Pylons/pyramid/issues/2854/comments","statuses_url":"https://api.github.com/repos/Pylons/pyramid/statuses/e4f33995a722837b400944b34768d2d364d7d5a1","head":{"label":"MatthewWilkes:csrf_session_decouple","ref":"csrf_session_decouple","sha":"e4f33995a722837b400944b34768d2d364d7d5a1","user":{"login":"MatthewWilkes","id":98908,"avatar_url":"https://avatars.githubusercontent.com/u/98908?v=3","gravatar_id":"","url":"https://api.github.com/users/MatthewWilkes","html_url":"https://github.com/MatthewWilkes","followers_url":"https://api.github.com/users/MatthewWilkes/followers","following_url":"https://api.github.com/users/MatthewWilkes/following{/other_user}","gists_url":"https://api.github.com/users/MatthewWilkes/gists{/gist_id}","starred_url":"https://api.github.com/users/MatthewWilkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatthewWilkes/subscriptions","organizations_url":"https://api.github.com/users/MatthewWilkes/orgs","repos_url":"https://api.github.com/users/MatthewWilkes/repos","events_url":"https://api.github.com/users/MatthewWilkes/events{/privacy}","received_events_url":"https://api.github.com/users/MatthewWilkes/received_events","type":"User","site_admin":false},"repo":{"id":12321059,"name":"pyramid","full_name":"MatthewWilkes/pyramid","owner":{"login":"MatthewWilkes","id":98908,"avatar_url":"https://avatars.githubusercontent.com/u/98908?v=3","gravatar_id":"","url":"https://api.github.com/users/MatthewWilkes","html_url":"https://github.com/MatthewWilkes","followers_url":"https://api.github.com/users/MatthewWilkes/followers","following_url":"https://api.github.com/users/MatthewWilkes/following{/other_user}","gists_url":"https://api.github.com/users/MatthewWilkes/gists{/gist_id}","starred_url":"https://api.github.com/users/MatthewWilkes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatthewWilkes/subscriptions","organizations_url":"https://api.github.com/users/MatthewWilkes/orgs","repos_url":"https://api.github.com/users/MatthewWilkes/repos","events_url":"https://api.github.com/users/MatthewWilkes/events{/privacy}","received_events_url":"https://api.github.com/users/MatthewWilkes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/MatthewWilkes/pyramid","description":"Pyramid web framework","fork":true,"url":"https://api.github.com/repos/MatthewWilkes/pyramid","forks_url":"https://api.github.com/repos/MatthewWilkes/pyramid/forks","keys_url":"https://api.github.com/repos/MatthewWilkes/pyramid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MatthewWilkes/pyramid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MatthewWilkes/pyramid/teams","hooks_url":"https://api.github.com/repos/MatthewWilkes/pyramid/hooks","issue_events_url":"https://api.github.com/repos/MatthewWilkes/pyramid/issues/events{/number}","events_url":"https://api.github.com/repos/MatthewWilkes/pyramid/events","assignees_url":"https://api.github.com/repos/MatthewWilkes/pyramid/assignees{/user}","branches_url":"https://api.github.com/repos/MatthewWilkes/pyramid/branches{/branch}","tags_url":"https://api.github.com/repos/MatthewWilkes/pyramid/tags","blobs_url":"https://api.github.com/repos/MatthewWilkes/pyramid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MatthewWilkes/pyramid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MatthewWilkes/pyramid/git/refs{/sha}","trees_url":"https://api.github.com/repos/MatthewWilkes/pyramid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MatthewWilkes/pyramid/statuses/{sha}","languages_url":"https://api.github.com/repos/MatthewWilkes/pyramid/languages","stargazers_url":"https://api.github.com/repos/MatthewWilkes/pyramid/stargazers","contributors_url":"https://api.github.com/repos/MatthewWilkes/pyramid/contributors","subscribers_url":"https://api.github.com/repos/MatthewWilkes/pyramid/subscribers","subscription_url":"https://api.github.com/repos/MatthewWilkes/pyramid/subscription","commits_url":"https://api.github.com/repos/MatthewWilkes/pyramid/commits{/sha}","git_commits_url":"https://api.github.com/repos/MatthewWilkes/pyramid/git/commits{/sha}","comments_url":"https://api.github.com/repos/MatthewWilkes/pyramid/comments{/number}","issue_comment_url":"https://api.github.com/repos/MatthewWilkes/pyramid/issues/comments{/number}","contents_url":"https://api.github.com/repos/MatthewWilkes/pyramid/contents/{+path}","compare_url":"https://api.github.com/repos/MatthewWilkes/pyramid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MatthewWilkes/pyramid/merges","archive_url":"https://api.github.com/repos/MatthewWilkes/pyramid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MatthewWilkes/pyramid/downloads","issues_url":"https://api.github.com/repos/MatthewWilkes/pyramid/issues{/number}","pulls_url":"https://api.github.com/repos/MatthewWilkes/pyramid/pulls{/number}","milestones_url":"https://api.github.com/repos/MatthewWilkes/pyramid/milestones{/number}","notifications_url":"https://api.github.com/repos/MatthewWilkes/pyramid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MatthewWilkes/pyramid/labels{/name}","releases_url":"https://api.github.com/repos/MatthewWilkes/pyramid/releases{/id}","deployments_url":"https://api.github.com/repos/MatthewWilkes/pyramid/deployments","created_at":"2013-08-23T11:09:54Z","updated_at":"2016-12-05T09:03:27Z","pushed_at":"2016-12-07T10:27:45Z","git_url":"git://github.com/MatthewWilkes/pyramid.git","ssh_url":"git@github.com:MatthewWilkes/pyramid.git","clone_url":"https://github.com/MatthewWilkes/pyramid.git","svn_url":"https://github.com/MatthewWilkes/pyramid","homepage":"http://pylonsproject.org","size":19095,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Pylons:master","ref":"master","sha":"8bc0f9a68c4f19533ccdf4486656f2a106a81827","user":{"login":"Pylons","id":452227,"avatar_url":"https://avatars.githubusercontent.com/u/452227?v=3","gravatar_id":"","url":"https://api.github.com/users/Pylons","html_url":"https://github.com/Pylons","followers_url":"https://api.github.com/users/Pylons/followers","following_url":"https://api.github.com/users/Pylons/following{/other_user}","gists_url":"https://api.github.com/users/Pylons/gists{/gist_id}","starred_url":"https://api.github.com/users/Pylons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pylons/subscriptions","organizations_url":"https://api.github.com/users/Pylons/orgs","repos_url":"https://api.github.com/users/Pylons/repos","events_url":"https://api.github.com/users/Pylons/events{/privacy}","received_events_url":"https://api.github.com/users/Pylons/received_events","type":"Organization","site_admin":false},"repo":{"id":1020639,"name":"pyramid","full_name":"Pylons/pyramid","owner":{"login":"Pylons","id":452227,"avatar_url":"https://avatars.githubusercontent.com/u/452227?v=3","gravatar_id":"","url":"https://api.github.com/users/Pylons","html_url":"https://github.com/Pylons","followers_url":"https://api.github.com/users/Pylons/followers","following_url":"https://api.github.com/users/Pylons/following{/other_user}","gists_url":"https://api.github.com/users/Pylons/gists{/gist_id}","starred_url":"https://api.github.com/users/Pylons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pylons/subscriptions","organizations_url":"https://api.github.com/users/Pylons/orgs","repos_url":"https://api.github.com/users/Pylons/repos","events_url":"https://api.github.com/users/Pylons/events{/privacy}","received_events_url":"https://api.github.com/users/Pylons/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Pylons/pyramid","description":"Pyramid web framework","fork":false,"url":"https://api.github.com/repos/Pylons/pyramid","forks_url":"https://api.github.com/repos/Pylons/pyramid/forks","keys_url":"https://api.github.com/repos/Pylons/pyramid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Pylons/pyramid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Pylons/pyramid/teams","hooks_url":"https://api.github.com/repos/Pylons/pyramid/hooks","issue_events_url":"https://api.github.com/repos/Pylons/pyramid/issues/events{/number}","events_url":"https://api.github.com/repos/Pylons/pyramid/events","assignees_url":"https://api.github.com/repos/Pylons/pyramid/assignees{/user}","branches_url":"https://api.github.com/repos/Pylons/pyramid/branches{/branch}","tags_url":"https://api.github.com/repos/Pylons/pyramid/tags","blobs_url":"https://api.github.com/repos/Pylons/pyramid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Pylons/pyramid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Pylons/pyramid/git/refs{/sha}","trees_url":"https://api.github.com/repos/Pylons/pyramid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Pylons/pyramid/statuses/{sha}","languages_url":"https://api.github.com/repos/Pylons/pyramid/languages","stargazers_url":"https://api.github.com/repos/Pylons/pyramid/stargazers","contributors_url":"https://api.github.com/repos/Pylons/pyramid/contributors","subscribers_url":"https://api.github.com/repos/Pylons/pyramid/subscribers","subscription_url":"https://api.github.com/repos/Pylons/pyramid/subscription","commits_url":"https://api.github.com/repos/Pylons/pyramid/commits{/sha}","git_commits_url":"https://api.github.com/repos/Pylons/pyramid/git/commits{/sha}","comments_url":"https://api.github.com/repos/Pylons/pyramid/comments{/number}","issue_comment_url":"https://api.github.com/repos/Pylons/pyramid/issues/comments{/number}","contents_url":"https://api.github.com/repos/Pylons/pyramid/contents/{+path}","compare_url":"https://api.github.com/repos/Pylons/pyramid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Pylons/pyramid/merges","archive_url":"https://api.github.com/repos/Pylons/pyramid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Pylons/pyramid/downloads","issues_url":"https://api.github.com/repos/Pylons/pyramid/issues{/number}","pulls_url":"https://api.github.com/repos/Pylons/pyramid/pulls{/number}","milestones_url":"https://api.github.com/repos/Pylons/pyramid/milestones{/number}","notifications_url":"https://api.github.com/repos/Pylons/pyramid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Pylons/pyramid/labels{/name}","releases_url":"https://api.github.com/repos/Pylons/pyramid/releases{/id}","deployments_url":"https://api.github.com/repos/Pylons/pyramid/deployments","created_at":"2010-10-24T22:00:35Z","updated_at":"2016-12-07T01:59:28Z","pushed_at":"2016-12-07T10:27:45Z","git_url":"git://github.com/Pylons/pyramid.git","ssh_url":"git@github.com:Pylons/pyramid.git","clone_url":"https://github.com/Pylons/pyramid.git","svn_url":"https://github.com/Pylons/pyramid","homepage":"https://trypyramid.com/","size":29621,"stargazers_count":2178,"watchers_count":2178,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":709,"mirror_url":null,"open_issues_count":110,"forks":709,"open_issues":110,"watchers":2178,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Pylons/pyramid/pulls/2854"},"html":{"href":"https://github.com/Pylons/pyramid/pull/2854"},"issue":{"href":"https://api.github.com/repos/Pylons/pyramid/issues/2854"},"comments":{"href":"https://api.github.com/repos/Pylons/pyramid/issues/2854/comments"},"review_comments":{"href":"https://api.github.com/repos/Pylons/pyramid/pulls/2854/comments"},"review_comment":{"href":"https://api.github.com/repos/Pylons/pyramid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Pylons/pyramid/pulls/2854/commits"},"statuses":{"href":"https://api.github.com/repos/Pylons/pyramid/statuses/e4f33995a722837b400944b34768d2d364d7d5a1"}}}}
{"actor":{"display_login":"jcerjak"}}