{"action":"created","comment":{"url":"https://api.github.com/repos/anchor/oauth2-server/pulls/comments/33646117","id":33646117,"diff_hunk":"@@ -566,12 +566,28 @@ serverPostToken\n     -> m Html\n -- | Revoke a given token\n serverPostToken ref user_id _ (DeleteRequest token_id) = do\n-    success <- liftIO $ storeRevokeToken ref user_id token_id\n-    if success then\n-        let link = safeLink (Proxy :: Proxy AnchorOAuth2API) (Proxy :: Proxy ListTokens) page1\n-        in throwError err302{errHeaders = [(hLocation, B.pack $ show link)]} --Redirect to tokens page\n-    else\n-        throwError err500{errBody = \"Something quite horrible has happened\"}\n+    maybe_tok <- liftIO $ storeReadToken ref (Right token_id)\n+    tok <- case maybe_tok of\n+        Nothing -> throwError err403 { errBody = \"Invalid token_id\" }\n+        Just (_, tok) -> return tok\n+    case tokenDetailsUserID tok of\n+        Nothing -> do","path":"lib/Network/OAuth2/Server/API.hs","position":24,"original_position":24,"commit_id":"16564887014c7460395069d4a69336adc9d32ac6","original_commit_id":"16564887014c7460395069d4a69336adc9d32ac6","user":{"login":"thsutton","id":62708,"avatar_url":"https://avatars.githubusercontent.com/u/62708?v=3","gravatar_id":"","url":"https://api.github.com/users/thsutton","html_url":"https://github.com/thsutton","followers_url":"https://api.github.com/users/thsutton/followers","following_url":"https://api.github.com/users/thsutton/following{/other_user}","gists_url":"https://api.github.com/users/thsutton/gists{/gist_id}","starred_url":"https://api.github.com/users/thsutton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thsutton/subscriptions","organizations_url":"https://api.github.com/users/thsutton/orgs","repos_url":"https://api.github.com/users/thsutton/repos","events_url":"https://api.github.com/users/thsutton/events{/privacy}","received_events_url":"https://api.github.com/users/thsutton/received_events","type":"User","site_admin":false},"body":"We're not letting an admin revoke non-user-y tokens, then?","created_at":"2015-07-01T03:47:53Z","updated_at":"2015-07-01T03:47:53Z","html_url":"https://github.com/anchor/oauth2-server/pull/103#discussion_r33646117","pull_request_url":"https://api.github.com/repos/anchor/oauth2-server/pulls/103","_links":{"self":{"href":"https://api.github.com/repos/anchor/oauth2-server/pulls/comments/33646117"},"html":{"href":"https://github.com/anchor/oauth2-server/pull/103#discussion_r33646117"},"pull_request":{"href":"https://api.github.com/repos/anchor/oauth2-server/pulls/103"}}},"pull_request":{"url":"https://api.github.com/repos/anchor/oauth2-server/pulls/103","id":38944560,"html_url":"https://github.com/anchor/oauth2-server/pull/103","diff_url":"https://github.com/anchor/oauth2-server/pull/103.diff","patch_url":"https://github.com/anchor/oauth2-server/pull/103.patch","issue_url":"https://api.github.com/repos/anchor/oauth2-server/issues/103","number":103,"state":"open","locked":false,"title":"Some more properties for the tokenstore, uncovering brokenness","user":{"login":"christian-marie","id":3360007,"avatar_url":"https://avatars.githubusercontent.com/u/3360007?v=3","gravatar_id":"","url":"https://api.github.com/users/christian-marie","html_url":"https://github.com/christian-marie","followers_url":"https://api.github.com/users/christian-marie/followers","following_url":"https://api.github.com/users/christian-marie/following{/other_user}","gists_url":"https://api.github.com/users/christian-marie/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-marie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-marie/subscriptions","organizations_url":"https://api.github.com/users/christian-marie/orgs","repos_url":"https://api.github.com/users/christian-marie/repos","events_url":"https://api.github.com/users/christian-marie/events{/privacy}","received_events_url":"https://api.github.com/users/christian-marie/received_events","type":"User","site_admin":false},"body":"Brokenness is fixed with the merge.","created_at":"2015-07-01T03:05:10Z","updated_at":"2015-07-01T03:47:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3990debfc65d96b2c75a2ea9337503adb008eb9b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/anchor/oauth2-server/pulls/103/commits","review_comments_url":"https://api.github.com/repos/anchor/oauth2-server/pulls/103/comments","review_comment_url":"https://api.github.com/repos/anchor/oauth2-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/anchor/oauth2-server/issues/103/comments","statuses_url":"https://api.github.com/repos/anchor/oauth2-server/statuses/16564887014c7460395069d4a69336adc9d32ac6","head":{"label":"anchor:pingu/update-store-tests-final","ref":"pingu/update-store-tests-final","sha":"16564887014c7460395069d4a69336adc9d32ac6","user":{"login":"anchor","id":146304,"avatar_url":"https://avatars.githubusercontent.com/u/146304?v=3","gravatar_id":"","url":"https://api.github.com/users/anchor","html_url":"https://github.com/anchor","followers_url":"https://api.github.com/users/anchor/followers","following_url":"https://api.github.com/users/anchor/following{/other_user}","gists_url":"https://api.github.com/users/anchor/gists{/gist_id}","starred_url":"https://api.github.com/users/anchor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anchor/subscriptions","organizations_url":"https://api.github.com/users/anchor/orgs","repos_url":"https://api.github.com/users/anchor/repos","events_url":"https://api.github.com/users/anchor/events{/privacy}","received_events_url":"https://api.github.com/users/anchor/received_events","type":"Organization","site_admin":false},"repo":{"id":28891009,"name":"oauth2-server","full_name":"anchor/oauth2-server","owner":{"login":"anchor","id":146304,"avatar_url":"https://avatars.githubusercontent.com/u/146304?v=3","gravatar_id":"","url":"https://api.github.com/users/anchor","html_url":"https://github.com/anchor","followers_url":"https://api.github.com/users/anchor/followers","following_url":"https://api.github.com/users/anchor/following{/other_user}","gists_url":"https://api.github.com/users/anchor/gists{/gist_id}","starred_url":"https://api.github.com/users/anchor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anchor/subscriptions","organizations_url":"https://api.github.com/users/anchor/orgs","repos_url":"https://api.github.com/users/anchor/repos","events_url":"https://api.github.com/users/anchor/events{/privacy}","received_events_url":"https://api.github.com/users/anchor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/anchor/oauth2-server","description":"Haskell libraries for implementing OAuth2 servers.","fork":false,"url":"https://api.github.com/repos/anchor/oauth2-server","forks_url":"https://api.github.com/repos/anchor/oauth2-server/forks","keys_url":"https://api.github.com/repos/anchor/oauth2-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anchor/oauth2-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anchor/oauth2-server/teams","hooks_url":"https://api.github.com/repos/anchor/oauth2-server/hooks","issue_events_url":"https://api.github.com/repos/anchor/oauth2-server/issues/events{/number}","events_url":"https://api.github.com/repos/anchor/oauth2-server/events","assignees_url":"https://api.github.com/repos/anchor/oauth2-server/assignees{/user}","branches_url":"https://api.github.com/repos/anchor/oauth2-server/branches{/branch}","tags_url":"https://api.github.com/repos/anchor/oauth2-server/tags","blobs_url":"https://api.github.com/repos/anchor/oauth2-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anchor/oauth2-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anchor/oauth2-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/anchor/oauth2-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anchor/oauth2-server/statuses/{sha}","languages_url":"https://api.github.com/repos/anchor/oauth2-server/languages","stargazers_url":"https://api.github.com/repos/anchor/oauth2-server/stargazers","contributors_url":"https://api.github.com/repos/anchor/oauth2-server/contributors","subscribers_url":"https://api.github.com/repos/anchor/oauth2-server/subscribers","subscription_url":"https://api.github.com/repos/anchor/oauth2-server/subscription","commits_url":"https://api.github.com/repos/anchor/oauth2-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/anchor/oauth2-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/anchor/oauth2-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/anchor/oauth2-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/anchor/oauth2-server/contents/{+path}","compare_url":"https://api.github.com/repos/anchor/oauth2-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anchor/oauth2-server/merges","archive_url":"https://api.github.com/repos/anchor/oauth2-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anchor/oauth2-server/downloads","issues_url":"https://api.github.com/repos/anchor/oauth2-server/issues{/number}","pulls_url":"https://api.github.com/repos/anchor/oauth2-server/pulls{/number}","milestones_url":"https://api.github.com/repos/anchor/oauth2-server/milestones{/number}","notifications_url":"https://api.github.com/repos/anchor/oauth2-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anchor/oauth2-server/labels{/name}","releases_url":"https://api.github.com/repos/anchor/oauth2-server/releases{/id}","created_at":"2015-01-07T00:49:31Z","updated_at":"2015-06-17T09:14:26Z","pushed_at":"2015-07-01T03:38:52Z","git_url":"git://github.com/anchor/oauth2-server.git","ssh_url":"git@github.com:anchor/oauth2-server.git","clone_url":"https://github.com/anchor/oauth2-server.git","svn_url":"https://github.com/anchor/oauth2-server","homepage":null,"size":2080,"stargazers_count":4,"watchers_count":4,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":8,"forks":1,"open_issues":8,"watchers":4,"default_branch":"master"}},"base":{"label":"anchor:master","ref":"master","sha":"d5fe7ff82a200dbea2999b26f0a6baca00c29b3c","user":{"login":"anchor","id":146304,"avatar_url":"https://avatars.githubusercontent.com/u/146304?v=3","gravatar_id":"","url":"https://api.github.com/users/anchor","html_url":"https://github.com/anchor","followers_url":"https://api.github.com/users/anchor/followers","following_url":"https://api.github.com/users/anchor/following{/other_user}","gists_url":"https://api.github.com/users/anchor/gists{/gist_id}","starred_url":"https://api.github.com/users/anchor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anchor/subscriptions","organizations_url":"https://api.github.com/users/anchor/orgs","repos_url":"https://api.github.com/users/anchor/repos","events_url":"https://api.github.com/users/anchor/events{/privacy}","received_events_url":"https://api.github.com/users/anchor/received_events","type":"Organization","site_admin":false},"repo":{"id":28891009,"name":"oauth2-server","full_name":"anchor/oauth2-server","owner":{"login":"anchor","id":146304,"avatar_url":"https://avatars.githubusercontent.com/u/146304?v=3","gravatar_id":"","url":"https://api.github.com/users/anchor","html_url":"https://github.com/anchor","followers_url":"https://api.github.com/users/anchor/followers","following_url":"https://api.github.com/users/anchor/following{/other_user}","gists_url":"https://api.github.com/users/anchor/gists{/gist_id}","starred_url":"https://api.github.com/users/anchor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anchor/subscriptions","organizations_url":"https://api.github.com/users/anchor/orgs","repos_url":"https://api.github.com/users/anchor/repos","events_url":"https://api.github.com/users/anchor/events{/privacy}","received_events_url":"https://api.github.com/users/anchor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/anchor/oauth2-server","description":"Haskell libraries for implementing OAuth2 servers.","fork":false,"url":"https://api.github.com/repos/anchor/oauth2-server","forks_url":"https://api.github.com/repos/anchor/oauth2-server/forks","keys_url":"https://api.github.com/repos/anchor/oauth2-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/anchor/oauth2-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/anchor/oauth2-server/teams","hooks_url":"https://api.github.com/repos/anchor/oauth2-server/hooks","issue_events_url":"https://api.github.com/repos/anchor/oauth2-server/issues/events{/number}","events_url":"https://api.github.com/repos/anchor/oauth2-server/events","assignees_url":"https://api.github.com/repos/anchor/oauth2-server/assignees{/user}","branches_url":"https://api.github.com/repos/anchor/oauth2-server/branches{/branch}","tags_url":"https://api.github.com/repos/anchor/oauth2-server/tags","blobs_url":"https://api.github.com/repos/anchor/oauth2-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/anchor/oauth2-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/anchor/oauth2-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/anchor/oauth2-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/anchor/oauth2-server/statuses/{sha}","languages_url":"https://api.github.com/repos/anchor/oauth2-server/languages","stargazers_url":"https://api.github.com/repos/anchor/oauth2-server/stargazers","contributors_url":"https://api.github.com/repos/anchor/oauth2-server/contributors","subscribers_url":"https://api.github.com/repos/anchor/oauth2-server/subscribers","subscription_url":"https://api.github.com/repos/anchor/oauth2-server/subscription","commits_url":"https://api.github.com/repos/anchor/oauth2-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/anchor/oauth2-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/anchor/oauth2-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/anchor/oauth2-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/anchor/oauth2-server/contents/{+path}","compare_url":"https://api.github.com/repos/anchor/oauth2-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/anchor/oauth2-server/merges","archive_url":"https://api.github.com/repos/anchor/oauth2-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/anchor/oauth2-server/downloads","issues_url":"https://api.github.com/repos/anchor/oauth2-server/issues{/number}","pulls_url":"https://api.github.com/repos/anchor/oauth2-server/pulls{/number}","milestones_url":"https://api.github.com/repos/anchor/oauth2-server/milestones{/number}","notifications_url":"https://api.github.com/repos/anchor/oauth2-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/anchor/oauth2-server/labels{/name}","releases_url":"https://api.github.com/repos/anchor/oauth2-server/releases{/id}","created_at":"2015-01-07T00:49:31Z","updated_at":"2015-06-17T09:14:26Z","pushed_at":"2015-07-01T03:38:52Z","git_url":"git://github.com/anchor/oauth2-server.git","ssh_url":"git@github.com:anchor/oauth2-server.git","clone_url":"https://github.com/anchor/oauth2-server.git","svn_url":"https://github.com/anchor/oauth2-server","homepage":null,"size":2080,"stargazers_count":4,"watchers_count":4,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":8,"forks":1,"open_issues":8,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/anchor/oauth2-server/pulls/103"},"html":{"href":"https://github.com/anchor/oauth2-server/pull/103"},"issue":{"href":"https://api.github.com/repos/anchor/oauth2-server/issues/103"},"comments":{"href":"https://api.github.com/repos/anchor/oauth2-server/issues/103/comments"},"review_comments":{"href":"https://api.github.com/repos/anchor/oauth2-server/pulls/103/comments"},"review_comment":{"href":"https://api.github.com/repos/anchor/oauth2-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/anchor/oauth2-server/pulls/103/commits"},"statuses":{"href":"https://api.github.com/repos/anchor/oauth2-server/statuses/16564887014c7460395069d4a69336adc9d32ac6"}}}}