{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/206247822","pull_request_review_id":141626027,"id":206247822,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNjI0NzgyMg==","diff_hunk":"@@ -47,10 +50,6 @@ public function __construct(TokenStorageInterface $tokenStorage, AccessDecisionM\n      */\n     public function handle(GetResponseEvent $event)\n     {\n-        if (null === $token = $this->tokenStorage->getToken()) {","path":"src/Symfony/Component/Security/Http/Firewall/AccessListener.php","position":29,"original_position":29,"commit_id":"325d8cb0eb7ae3db1735945109afa202fbe32e90","original_commit_id":"9d9fe4958516bc5a09fa90b8086285d5b29043af","user":{"login":"nicolas-grekas","id":243674,"node_id":"MDQ6VXNlcjI0MzY3NA==","avatar_url":"https://avatars3.githubusercontent.com/u/243674?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolas-grekas","html_url":"https://github.com/nicolas-grekas","followers_url":"https://api.github.com/users/nicolas-grekas/followers","following_url":"https://api.github.com/users/nicolas-grekas/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-grekas/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-grekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-grekas/subscriptions","organizations_url":"https://api.github.com/users/nicolas-grekas/orgs","repos_url":"https://api.github.com/users/nicolas-grekas/repos","events_url":"https://api.github.com/users/nicolas-grekas/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-grekas/received_events","type":"User","site_admin":false},"body":"\r\n\r\nOK to me, lets continue here :)\r\n","created_at":"2018-07-30T17:00:17Z","updated_at":"2018-07-30T17:00:17Z","html_url":"https://github.com/symfony/symfony/pull/27121#discussion_r206247822","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/27121","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/206247822"},"html":{"href":"https://github.com/symfony/symfony/pull/27121#discussion_r206247822"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/27121"}},"in_reply_to_id":200814944},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/27121","id":185389468,"node_id":"MDExOlB1bGxSZXF1ZXN0MTg1Mzg5NDY4","html_url":"https://github.com/symfony/symfony/pull/27121","diff_url":"https://github.com/symfony/symfony/pull/27121.diff","patch_url":"https://github.com/symfony/symfony/pull/27121.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/27121","number":27121,"state":"open","locked":false,"title":"[Security] reusing AuthorizationChecker in AccessListener","user":{"login":"oleg-andreyev","id":1244112,"node_id":"MDQ6VXNlcjEyNDQxMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1244112?v=4","gravatar_id":"","url":"https://api.github.com/users/oleg-andreyev","html_url":"https://github.com/oleg-andreyev","followers_url":"https://api.github.com/users/oleg-andreyev/followers","following_url":"https://api.github.com/users/oleg-andreyev/following{/other_user}","gists_url":"https://api.github.com/users/oleg-andreyev/gists{/gist_id}","starred_url":"https://api.github.com/users/oleg-andreyev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleg-andreyev/subscriptions","organizations_url":"https://api.github.com/users/oleg-andreyev/orgs","repos_url":"https://api.github.com/users/oleg-andreyev/repos","events_url":"https://api.github.com/users/oleg-andreyev/events{/privacy}","received_events_url":"https://api.github.com/users/oleg-andreyev/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | master\r\n| Bug fix?      | yes\r\n| New feature?  | no\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| License       | MIT\r\n| Fixed tickets | #21571\r\n\r\nWhile investigating why `AuthenticationEvents::AUTHENTICATION_SUCCESS` is not dispatched, noticed similarity between `AccessListener` and `AuthorizationChecker` and the only real difference is `alwaysAuthenticate` flag.\r\n\r\n**Case 1:**\r\nWhen `UsernamePasswordToken` is serialized it will be serialized with state of `authenticated`,\r\nso when application will load token from session `AccessListener` won't call `authenticate` because `authenticated=true`, even if `alwaysAuthenticate=true`\r\n\r\n**Case 2:**\r\nUser A has roles `foo, bar and admin`, User A is signed-in into application and token is persisted, later another User B with role `admin`, decided to restrict role `admin` for User A, so User A won't lose it's privileges until session is expired or logout, because token is persisted with `roles` and `authenticated=true` and AccessListener does not call `authenticate` even if `alwaysAuthenticate=true`\r\n\r\n**TODO**\r\n- [x] - reuse AuthorizationChecker in AccessListener\r\n- [x] - adjust unit tests\r\n- [ ] - add deprecation notices\r\n- [ ] - update CHANGELOG and UPGRADE*","created_at":"2018-05-02T09:58:54Z","updated_at":"2018-07-30T17:00:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"73e3fb4ae9aa7c6e5619d7a9b9318de179b9a771","assignee":null,"assignees":[],"requested_reviewers":[{"login":"lyrixx","id":408368,"node_id":"MDQ6VXNlcjQwODM2OA==","avatar_url":"https://avatars1.githubusercontent.com/u/408368?v=4","gravatar_id":"","url":"https://api.github.com/users/lyrixx","html_url":"https://github.com/lyrixx","followers_url":"https://api.github.com/users/lyrixx/followers","following_url":"https://api.github.com/users/lyrixx/following{/other_user}","gists_url":"https://api.github.com/users/lyrixx/gists{/gist_id}","starred_url":"https://api.github.com/users/lyrixx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyrixx/subscriptions","organizations_url":"https://api.github.com/users/lyrixx/orgs","repos_url":"https://api.github.com/users/lyrixx/repos","events_url":"https://api.github.com/users/lyrixx/events{/privacy}","received_events_url":"https://api.github.com/users/lyrixx/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":100378,"node_id":"MDU6TGFiZWwxMDAzNzg=","url":"https://api.github.com/repos/symfony/symfony/labels/Feature","name":"Feature","color":"02e10c","default":false},{"id":99600,"node_id":"MDU6TGFiZWw5OTYwMA==","url":"https://api.github.com/repos/symfony/symfony/labels/Security","name":"Security","color":"DDDDDD","default":false},{"id":238909857,"node_id":"MDU6TGFiZWwyMzg5MDk4NTc=","url":"https://api.github.com/repos/symfony/symfony/labels/Status:%20Needs%20Work","name":"Status: Needs Work","color":"fad8c7","default":false}],"milestone":{"url":"https://api.github.com/repos/symfony/symfony/milestones/18","html_url":"https://github.com/symfony/symfony/milestone/18","labels_url":"https://api.github.com/repos/symfony/symfony/milestones/18/labels","id":3234645,"node_id":"MDk6TWlsZXN0b25lMzIzNDY0NQ==","number":18,"title":"next","description":"https://symfony.com/roadmap?version=4.2#checker","creator":{"login":"nicolas-grekas","id":243674,"node_id":"MDQ6VXNlcjI0MzY3NA==","avatar_url":"https://avatars3.githubusercontent.com/u/243674?v=4","gravatar_id":"","url":"https://api.github.com/users/nicolas-grekas","html_url":"https://github.com/nicolas-grekas","followers_url":"https://api.github.com/users/nicolas-grekas/followers","following_url":"https://api.github.com/users/nicolas-grekas/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-grekas/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-grekas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-grekas/subscriptions","organizations_url":"https://api.github.com/users/nicolas-grekas/orgs","repos_url":"https://api.github.com/users/nicolas-grekas/repos","events_url":"https://api.github.com/users/nicolas-grekas/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-grekas/received_events","type":"User","site_admin":false},"open_issues":149,"closed_issues":130,"state":"open","created_at":"2018-04-02T12:03:21Z","updated_at":"2018-07-29T15:55:44Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/27121/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/27121/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/27121/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/325d8cb0eb7ae3db1735945109afa202fbe32e90","head":{"label":"oleg-andreyev:reuse-auth-checker-in-access-listener","ref":"reuse-auth-checker-in-access-listener","sha":"325d8cb0eb7ae3db1735945109afa202fbe32e90","user":{"login":"oleg-andreyev","id":1244112,"node_id":"MDQ6VXNlcjEyNDQxMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1244112?v=4","gravatar_id":"","url":"https://api.github.com/users/oleg-andreyev","html_url":"https://github.com/oleg-andreyev","followers_url":"https://api.github.com/users/oleg-andreyev/followers","following_url":"https://api.github.com/users/oleg-andreyev/following{/other_user}","gists_url":"https://api.github.com/users/oleg-andreyev/gists{/gist_id}","starred_url":"https://api.github.com/users/oleg-andreyev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleg-andreyev/subscriptions","organizations_url":"https://api.github.com/users/oleg-andreyev/orgs","repos_url":"https://api.github.com/users/oleg-andreyev/repos","events_url":"https://api.github.com/users/oleg-andreyev/events{/privacy}","received_events_url":"https://api.github.com/users/oleg-andreyev/received_events","type":"User","site_admin":false},"repo":{"id":12225722,"node_id":"MDEwOlJlcG9zaXRvcnkxMjIyNTcyMg==","name":"symfony","full_name":"oleg-andreyev/symfony","owner":{"login":"oleg-andreyev","id":1244112,"node_id":"MDQ6VXNlcjEyNDQxMTI=","avatar_url":"https://avatars1.githubusercontent.com/u/1244112?v=4","gravatar_id":"","url":"https://api.github.com/users/oleg-andreyev","html_url":"https://github.com/oleg-andreyev","followers_url":"https://api.github.com/users/oleg-andreyev/followers","following_url":"https://api.github.com/users/oleg-andreyev/following{/other_user}","gists_url":"https://api.github.com/users/oleg-andreyev/gists{/gist_id}","starred_url":"https://api.github.com/users/oleg-andreyev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleg-andreyev/subscriptions","organizations_url":"https://api.github.com/users/oleg-andreyev/orgs","repos_url":"https://api.github.com/users/oleg-andreyev/repos","events_url":"https://api.github.com/users/oleg-andreyev/events{/privacy}","received_events_url":"https://api.github.com/users/oleg-andreyev/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oleg-andreyev/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/oleg-andreyev/symfony","forks_url":"https://api.github.com/repos/oleg-andreyev/symfony/forks","keys_url":"https://api.github.com/repos/oleg-andreyev/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oleg-andreyev/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oleg-andreyev/symfony/teams","hooks_url":"https://api.github.com/repos/oleg-andreyev/symfony/hooks","issue_events_url":"https://api.github.com/repos/oleg-andreyev/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/oleg-andreyev/symfony/events","assignees_url":"https://api.github.com/repos/oleg-andreyev/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/oleg-andreyev/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/oleg-andreyev/symfony/tags","blobs_url":"https://api.github.com/repos/oleg-andreyev/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oleg-andreyev/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oleg-andreyev/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/oleg-andreyev/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oleg-andreyev/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/oleg-andreyev/symfony/languages","stargazers_url":"https://api.github.com/repos/oleg-andreyev/symfony/stargazers","contributors_url":"https://api.github.com/repos/oleg-andreyev/symfony/contributors","subscribers_url":"https://api.github.com/repos/oleg-andreyev/symfony/subscribers","subscription_url":"https://api.github.com/repos/oleg-andreyev/symfony/subscription","commits_url":"https://api.github.com/repos/oleg-andreyev/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/oleg-andreyev/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/oleg-andreyev/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/oleg-andreyev/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/oleg-andreyev/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/oleg-andreyev/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oleg-andreyev/symfony/merges","archive_url":"https://api.github.com/repos/oleg-andreyev/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oleg-andreyev/symfony/downloads","issues_url":"https://api.github.com/repos/oleg-andreyev/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/oleg-andreyev/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/oleg-andreyev/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/oleg-andreyev/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oleg-andreyev/symfony/labels{/name}","releases_url":"https://api.github.com/repos/oleg-andreyev/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/oleg-andreyev/symfony/deployments","created_at":"2013-08-19T19:32:58Z","updated_at":"2018-07-13T10:14:18Z","pushed_at":"2018-07-13T10:14:02Z","git_url":"git://github.com/oleg-andreyev/symfony.git","ssh_url":"git@github.com:oleg-andreyev/symfony.git","clone_url":"https://github.com/oleg-andreyev/symfony.git","svn_url":"https://github.com/oleg-andreyev/symfony","homepage":"symfony.com","size":115515,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"symfony:master","ref":"master","sha":"b226859e8a949c0b39071f61ffcc0b4c10e3ba46","user":{"login":"symfony","id":143937,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MzkzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/143937?v=4","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":458058,"node_id":"MDEwOlJlcG9zaXRvcnk0NTgwNTg=","name":"symfony","full_name":"symfony/symfony","owner":{"login":"symfony","id":143937,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MzkzNw==","avatar_url":"https://avatars3.githubusercontent.com/u/143937?v=4","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony","description":"The Symfony PHP framework","fork":false,"url":"https://api.github.com/repos/symfony/symfony","forks_url":"https://api.github.com/repos/symfony/symfony/forks","keys_url":"https://api.github.com/repos/symfony/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony/teams","hooks_url":"https://api.github.com/repos/symfony/symfony/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony/events","assignees_url":"https://api.github.com/repos/symfony/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony/tags","blobs_url":"https://api.github.com/repos/symfony/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony/subscription","commits_url":"https://api.github.com/repos/symfony/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony/merges","archive_url":"https://api.github.com/repos/symfony/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony/downloads","issues_url":"https://api.github.com/repos/symfony/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/symfony/deployments","created_at":"2010-01-04T14:21:21Z","updated_at":"2018-07-30T15:01:11Z","pushed_at":"2018-07-30T10:01:16Z","git_url":"git://github.com/symfony/symfony.git","ssh_url":"git@github.com:symfony/symfony.git","clone_url":"https://github.com/symfony/symfony.git","svn_url":"https://github.com/symfony/symfony","homepage":"https://symfony.com","size":122259,"stargazers_count":18170,"watchers_count":18170,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":6335,"mirror_url":null,"archived":false,"open_issues_count":913,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":6335,"open_issues":913,"watchers":18170,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/27121"},"html":{"href":"https://github.com/symfony/symfony/pull/27121"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/27121"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/27121/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/27121/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/27121/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/325d8cb0eb7ae3db1735945109afa202fbe32e90"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nicolas-grekas"}}