{"action":"created","comment":{"url":"https://api.github.com/repos/wallabag/wallabag/pulls/comments/24395070","id":24395070,"diff_hunk":"@@ -35,20 +39,35 @@ public function authenticate(TokenInterface $token)\n \n     protected function validateDigest($digest, $nonce, $created, $secret)\n     {\n-        // Expire le timestamp après 5 minutes\n+        // Check created time is not in the future\n+        if (strtotime($created) > time()) {\n+            throw new AuthenticationException(\"Back to the future...\");\n+        }\n+\n+        // Expire timestamp after 5 minutes\n         if (time() - strtotime($created) > 300) {\n-            return false;\n+            throw new AuthenticationException(\"Too late for this timestamp... Watch your watch.\");\n         }\n \n-        // Valide que le nonce est unique dans les 5 minutes\n+        // Validate nonce is unique within 5 minutes\n         if (file_exists($this->cacheDir.'/'.$nonce) && file_get_contents($this->cacheDir.'/'.$nonce) + 300 > time()) {\n             throw new NonceExpiredException('Previously used nonce detected');\n         }\n+\n+        // If cache directory does not exist we create it\n+        if (!is_dir($this->cacheDir)) {","path":"src/Wallabag/CoreBundle/Security/Authentication/Provider/WsseProvider.php","position":34,"original_position":34,"commit_id":"c5e8ba25bb0d6d59b3275480f406b5ce3fa83b75","original_commit_id":"2a94b1d1b74b4e776e76a522621b67b45d115fe7","user":{"login":"j0k3r","id":62333,"avatar_url":"https://avatars.githubusercontent.com/u/62333?v=3","gravatar_id":"","url":"https://api.github.com/users/j0k3r","html_url":"https://github.com/j0k3r","followers_url":"https://api.github.com/users/j0k3r/followers","following_url":"https://api.github.com/users/j0k3r/following{/other_user}","gists_url":"https://api.github.com/users/j0k3r/gists{/gist_id}","starred_url":"https://api.github.com/users/j0k3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j0k3r/subscriptions","organizations_url":"https://api.github.com/users/j0k3r/orgs","repos_url":"https://api.github.com/users/j0k3r/repos","events_url":"https://api.github.com/users/j0k3r/events{/privacy}","received_events_url":"https://api.github.com/users/j0k3r/received_events","type":"User","site_admin":false},"body":"Well 777 isn't really a problem.\r\nMaybe you can move this code inside the constructor.","created_at":"2015-02-10T08:11:56Z","updated_at":"2015-02-10T08:11:56Z","html_url":"https://github.com/wallabag/wallabag/pull/1068#discussion_r24395070","pull_request_url":"https://api.github.com/repos/wallabag/wallabag/pulls/1068","_links":{"self":{"href":"https://api.github.com/repos/wallabag/wallabag/pulls/comments/24395070"},"html":{"href":"https://github.com/wallabag/wallabag/pull/1068#discussion_r24395070"},"pull_request":{"href":"https://api.github.com/repos/wallabag/wallabag/pulls/1068"}}},"pull_request":{"url":"https://api.github.com/repos/wallabag/wallabag/pulls/1068","id":28956660,"html_url":"https://github.com/wallabag/wallabag/pull/1068","diff_url":"https://github.com/wallabag/wallabag/pull/1068.diff","patch_url":"https://github.com/wallabag/wallabag/pull/1068.patch","issue_url":"https://api.github.com/repos/wallabag/wallabag/issues/1068","number":1068,"state":"open","locked":false,"title":"V2 api authentication","user":{"login":"nicosomb","id":121870,"avatar_url":"https://avatars.githubusercontent.com/u/121870?v=3","gravatar_id":"","url":"https://api.github.com/users/nicosomb","html_url":"https://github.com/nicosomb","followers_url":"https://api.github.com/users/nicosomb/followers","following_url":"https://api.github.com/users/nicosomb/following{/other_user}","gists_url":"https://api.github.com/users/nicosomb/gists{/gist_id}","starred_url":"https://api.github.com/users/nicosomb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicosomb/subscriptions","organizations_url":"https://api.github.com/users/nicosomb/orgs","repos_url":"https://api.github.com/users/nicosomb/repos","events_url":"https://api.github.com/users/nicosomb/events{/privacy}","received_events_url":"https://api.github.com/users/nicosomb/received_events","type":"User","site_admin":false},"body":"Authentication for API, based on WSSE http://obtao.com/blog/2013/06/configure-wsse-on-symfony-with-fosrestbundle/\r\nAbout salt: http://stackoverflow.com/questions/213380/the-necessity-of-hiding-the-salt-for-a-hash\r\nFor generating correct headers: http://www.teria.com/~koseki/tools/wssegen/\r\nFor testing API, install Rest console plugin for Chrome or Firefox.\r\n","created_at":"2015-02-09T21:09:22Z","updated_at":"2015-02-10T08:11:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5ce32d05543c38a27072fc026c25d26613777be6","assignee":{"login":"j0k3r","id":62333,"avatar_url":"https://avatars.githubusercontent.com/u/62333?v=3","gravatar_id":"","url":"https://api.github.com/users/j0k3r","html_url":"https://github.com/j0k3r","followers_url":"https://api.github.com/users/j0k3r/followers","following_url":"https://api.github.com/users/j0k3r/following{/other_user}","gists_url":"https://api.github.com/users/j0k3r/gists{/gist_id}","starred_url":"https://api.github.com/users/j0k3r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j0k3r/subscriptions","organizations_url":"https://api.github.com/users/j0k3r/orgs","repos_url":"https://api.github.com/users/j0k3r/repos","events_url":"https://api.github.com/users/j0k3r/events{/privacy}","received_events_url":"https://api.github.com/users/j0k3r/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/wallabag/wallabag/milestones/6","labels_url":"https://api.github.com/repos/wallabag/wallabag/milestones/6/labels","id":402907,"number":6,"title":"2.0","description":"","creator":{"login":"nicosomb","id":121870,"avatar_url":"https://avatars.githubusercontent.com/u/121870?v=3","gravatar_id":"","url":"https://api.github.com/users/nicosomb","html_url":"https://github.com/nicosomb","followers_url":"https://api.github.com/users/nicosomb/followers","following_url":"https://api.github.com/users/nicosomb/following{/other_user}","gists_url":"https://api.github.com/users/nicosomb/gists{/gist_id}","starred_url":"https://api.github.com/users/nicosomb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicosomb/subscriptions","organizations_url":"https://api.github.com/users/nicosomb/orgs","repos_url":"https://api.github.com/users/nicosomb/repos","events_url":"https://api.github.com/users/nicosomb/events{/privacy}","received_events_url":"https://api.github.com/users/nicosomb/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":53,"state":"open","created_at":"2013-08-15T19:39:25Z","updated_at":"2015-02-10T00:18:56Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/wallabag/wallabag/pulls/1068/commits","review_comments_url":"https://api.github.com/repos/wallabag/wallabag/pulls/1068/comments","review_comment_url":"https://api.github.com/repos/wallabag/wallabag/pulls/comments/{number}","comments_url":"https://api.github.com/repos/wallabag/wallabag/issues/1068/comments","statuses_url":"https://api.github.com/repos/wallabag/wallabag/statuses/c5e8ba25bb0d6d59b3275480f406b5ce3fa83b75","head":{"label":"wallabag:v2-api-authentication","ref":"v2-api-authentication","sha":"c5e8ba25bb0d6d59b3275480f406b5ce3fa83b75","user":{"login":"wallabag","id":4143872,"avatar_url":"https://avatars.githubusercontent.com/u/4143872?v=3","gravatar_id":"","url":"https://api.github.com/users/wallabag","html_url":"https://github.com/wallabag","followers_url":"https://api.github.com/users/wallabag/followers","following_url":"https://api.github.com/users/wallabag/following{/other_user}","gists_url":"https://api.github.com/users/wallabag/gists{/gist_id}","starred_url":"https://api.github.com/users/wallabag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallabag/subscriptions","organizations_url":"https://api.github.com/users/wallabag/orgs","repos_url":"https://api.github.com/users/wallabag/repos","events_url":"https://api.github.com/users/wallabag/events{/privacy}","received_events_url":"https://api.github.com/users/wallabag/received_events","type":"Organization","site_admin":false},"repo":{"id":9193949,"name":"wallabag","full_name":"wallabag/wallabag","owner":{"login":"wallabag","id":4143872,"avatar_url":"https://avatars.githubusercontent.com/u/4143872?v=3","gravatar_id":"","url":"https://api.github.com/users/wallabag","html_url":"https://github.com/wallabag","followers_url":"https://api.github.com/users/wallabag/followers","following_url":"https://api.github.com/users/wallabag/following{/other_user}","gists_url":"https://api.github.com/users/wallabag/gists{/gist_id}","starred_url":"https://api.github.com/users/wallabag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallabag/subscriptions","organizations_url":"https://api.github.com/users/wallabag/orgs","repos_url":"https://api.github.com/users/wallabag/repos","events_url":"https://api.github.com/users/wallabag/events{/privacy}","received_events_url":"https://api.github.com/users/wallabag/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wallabag/wallabag","description":"open source self hostable read-it-later web app. Download the latest stable version: https://www.wallabag.org/pages/download-wallabag.html","fork":false,"url":"https://api.github.com/repos/wallabag/wallabag","forks_url":"https://api.github.com/repos/wallabag/wallabag/forks","keys_url":"https://api.github.com/repos/wallabag/wallabag/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wallabag/wallabag/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wallabag/wallabag/teams","hooks_url":"https://api.github.com/repos/wallabag/wallabag/hooks","issue_events_url":"https://api.github.com/repos/wallabag/wallabag/issues/events{/number}","events_url":"https://api.github.com/repos/wallabag/wallabag/events","assignees_url":"https://api.github.com/repos/wallabag/wallabag/assignees{/user}","branches_url":"https://api.github.com/repos/wallabag/wallabag/branches{/branch}","tags_url":"https://api.github.com/repos/wallabag/wallabag/tags","blobs_url":"https://api.github.com/repos/wallabag/wallabag/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wallabag/wallabag/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wallabag/wallabag/git/refs{/sha}","trees_url":"https://api.github.com/repos/wallabag/wallabag/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wallabag/wallabag/statuses/{sha}","languages_url":"https://api.github.com/repos/wallabag/wallabag/languages","stargazers_url":"https://api.github.com/repos/wallabag/wallabag/stargazers","contributors_url":"https://api.github.com/repos/wallabag/wallabag/contributors","subscribers_url":"https://api.github.com/repos/wallabag/wallabag/subscribers","subscription_url":"https://api.github.com/repos/wallabag/wallabag/subscription","commits_url":"https://api.github.com/repos/wallabag/wallabag/commits{/sha}","git_commits_url":"https://api.github.com/repos/wallabag/wallabag/git/commits{/sha}","comments_url":"https://api.github.com/repos/wallabag/wallabag/comments{/number}","issue_comment_url":"https://api.github.com/repos/wallabag/wallabag/issues/comments/{number}","contents_url":"https://api.github.com/repos/wallabag/wallabag/contents/{+path}","compare_url":"https://api.github.com/repos/wallabag/wallabag/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wallabag/wallabag/merges","archive_url":"https://api.github.com/repos/wallabag/wallabag/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wallabag/wallabag/downloads","issues_url":"https://api.github.com/repos/wallabag/wallabag/issues{/number}","pulls_url":"https://api.github.com/repos/wallabag/wallabag/pulls{/number}","milestones_url":"https://api.github.com/repos/wallabag/wallabag/milestones{/number}","notifications_url":"https://api.github.com/repos/wallabag/wallabag/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wallabag/wallabag/labels{/name}","releases_url":"https://api.github.com/repos/wallabag/wallabag/releases{/id}","created_at":"2013-04-03T12:21:14Z","updated_at":"2015-02-09T15:14:01Z","pushed_at":"2015-02-10T07:35:48Z","git_url":"git://github.com/wallabag/wallabag.git","ssh_url":"git@github.com:wallabag/wallabag.git","clone_url":"https://github.com/wallabag/wallabag.git","svn_url":"https://github.com/wallabag/wallabag","homepage":"https://www.wallabag.org","size":37923,"stargazers_count":1033,"watchers_count":1033,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":182,"mirror_url":null,"open_issues_count":167,"forks":182,"open_issues":167,"watchers":1033,"default_branch":"master"}},"base":{"label":"wallabag:v2","ref":"v2","sha":"cbce162b407024882d8c37a7e3298c85175d2651","user":{"login":"wallabag","id":4143872,"avatar_url":"https://avatars.githubusercontent.com/u/4143872?v=3","gravatar_id":"","url":"https://api.github.com/users/wallabag","html_url":"https://github.com/wallabag","followers_url":"https://api.github.com/users/wallabag/followers","following_url":"https://api.github.com/users/wallabag/following{/other_user}","gists_url":"https://api.github.com/users/wallabag/gists{/gist_id}","starred_url":"https://api.github.com/users/wallabag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallabag/subscriptions","organizations_url":"https://api.github.com/users/wallabag/orgs","repos_url":"https://api.github.com/users/wallabag/repos","events_url":"https://api.github.com/users/wallabag/events{/privacy}","received_events_url":"https://api.github.com/users/wallabag/received_events","type":"Organization","site_admin":false},"repo":{"id":9193949,"name":"wallabag","full_name":"wallabag/wallabag","owner":{"login":"wallabag","id":4143872,"avatar_url":"https://avatars.githubusercontent.com/u/4143872?v=3","gravatar_id":"","url":"https://api.github.com/users/wallabag","html_url":"https://github.com/wallabag","followers_url":"https://api.github.com/users/wallabag/followers","following_url":"https://api.github.com/users/wallabag/following{/other_user}","gists_url":"https://api.github.com/users/wallabag/gists{/gist_id}","starred_url":"https://api.github.com/users/wallabag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallabag/subscriptions","organizations_url":"https://api.github.com/users/wallabag/orgs","repos_url":"https://api.github.com/users/wallabag/repos","events_url":"https://api.github.com/users/wallabag/events{/privacy}","received_events_url":"https://api.github.com/users/wallabag/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wallabag/wallabag","description":"open source self hostable read-it-later web app. Download the latest stable version: https://www.wallabag.org/pages/download-wallabag.html","fork":false,"url":"https://api.github.com/repos/wallabag/wallabag","forks_url":"https://api.github.com/repos/wallabag/wallabag/forks","keys_url":"https://api.github.com/repos/wallabag/wallabag/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wallabag/wallabag/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wallabag/wallabag/teams","hooks_url":"https://api.github.com/repos/wallabag/wallabag/hooks","issue_events_url":"https://api.github.com/repos/wallabag/wallabag/issues/events{/number}","events_url":"https://api.github.com/repos/wallabag/wallabag/events","assignees_url":"https://api.github.com/repos/wallabag/wallabag/assignees{/user}","branches_url":"https://api.github.com/repos/wallabag/wallabag/branches{/branch}","tags_url":"https://api.github.com/repos/wallabag/wallabag/tags","blobs_url":"https://api.github.com/repos/wallabag/wallabag/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wallabag/wallabag/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wallabag/wallabag/git/refs{/sha}","trees_url":"https://api.github.com/repos/wallabag/wallabag/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wallabag/wallabag/statuses/{sha}","languages_url":"https://api.github.com/repos/wallabag/wallabag/languages","stargazers_url":"https://api.github.com/repos/wallabag/wallabag/stargazers","contributors_url":"https://api.github.com/repos/wallabag/wallabag/contributors","subscribers_url":"https://api.github.com/repos/wallabag/wallabag/subscribers","subscription_url":"https://api.github.com/repos/wallabag/wallabag/subscription","commits_url":"https://api.github.com/repos/wallabag/wallabag/commits{/sha}","git_commits_url":"https://api.github.com/repos/wallabag/wallabag/git/commits{/sha}","comments_url":"https://api.github.com/repos/wallabag/wallabag/comments{/number}","issue_comment_url":"https://api.github.com/repos/wallabag/wallabag/issues/comments/{number}","contents_url":"https://api.github.com/repos/wallabag/wallabag/contents/{+path}","compare_url":"https://api.github.com/repos/wallabag/wallabag/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wallabag/wallabag/merges","archive_url":"https://api.github.com/repos/wallabag/wallabag/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wallabag/wallabag/downloads","issues_url":"https://api.github.com/repos/wallabag/wallabag/issues{/number}","pulls_url":"https://api.github.com/repos/wallabag/wallabag/pulls{/number}","milestones_url":"https://api.github.com/repos/wallabag/wallabag/milestones{/number}","notifications_url":"https://api.github.com/repos/wallabag/wallabag/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wallabag/wallabag/labels{/name}","releases_url":"https://api.github.com/repos/wallabag/wallabag/releases{/id}","created_at":"2013-04-03T12:21:14Z","updated_at":"2015-02-09T15:14:01Z","pushed_at":"2015-02-10T07:35:48Z","git_url":"git://github.com/wallabag/wallabag.git","ssh_url":"git@github.com:wallabag/wallabag.git","clone_url":"https://github.com/wallabag/wallabag.git","svn_url":"https://github.com/wallabag/wallabag","homepage":"https://www.wallabag.org","size":37923,"stargazers_count":1033,"watchers_count":1033,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":182,"mirror_url":null,"open_issues_count":167,"forks":182,"open_issues":167,"watchers":1033,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wallabag/wallabag/pulls/1068"},"html":{"href":"https://github.com/wallabag/wallabag/pull/1068"},"issue":{"href":"https://api.github.com/repos/wallabag/wallabag/issues/1068"},"comments":{"href":"https://api.github.com/repos/wallabag/wallabag/issues/1068/comments"},"review_comments":{"href":"https://api.github.com/repos/wallabag/wallabag/pulls/1068/comments"},"review_comment":{"href":"https://api.github.com/repos/wallabag/wallabag/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/wallabag/wallabag/pulls/1068/commits"},"statuses":{"href":"https://api.github.com/repos/wallabag/wallabag/statuses/c5e8ba25bb0d6d59b3275480f406b5ce3fa83b75"}}}}