{"action":"created","comment":{"url":"https://api.github.com/repos/decred/dcrstakepool/pulls/comments/92695462","pull_request_review_id":13215992,"id":92695462,"diff_hunk":"@@ -179,7 +186,8 @@ func WriteAPIResponse(resp *APIResponse, code int, w http.ResponseWriter) {\n // http.HanderFunc.\n func APIInvalidHandler(w http.ResponseWriter, _ *http.Request) {\n \tresp := &APIResponse{Status: \"error\",\n-\t\tMessage: \"invalid API version\",\n+\t\tCode:    codes.InvalidArgument,","path":"system/core.go","position":75,"original_position":75,"commit_id":"f69f16b0facf688e77a9bf84d7c6cbb534517906","original_commit_id":"f69f16b0facf688e77a9bf84d7c6cbb534517906","user":{"login":"jolan","id":927740,"avatar_url":"https://avatars.githubusercontent.com/u/927740?v=3","gravatar_id":"","url":"https://api.github.com/users/jolan","html_url":"https://github.com/jolan","followers_url":"https://api.github.com/users/jolan/followers","following_url":"https://api.github.com/users/jolan/following{/other_user}","gists_url":"https://api.github.com/users/jolan/gists{/gist_id}","starred_url":"https://api.github.com/users/jolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jolan/subscriptions","organizations_url":"https://api.github.com/users/jolan/orgs","repos_url":"https://api.github.com/users/jolan/repos","events_url":"https://api.github.com/users/jolan/events{/privacy}","received_events_url":"https://api.github.com/users/jolan/received_events","type":"User","site_admin":false},"body":"Well that's a catch all right now for invalid version OR invalid command so I think InvalidArgument makes more sense.","created_at":"2016-12-15T20:39:57Z","updated_at":"2016-12-15T20:39:57Z","html_url":"https://github.com/decred/dcrstakepool/pull/76#discussion_r92695462","pull_request_url":"https://api.github.com/repos/decred/dcrstakepool/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/decred/dcrstakepool/pulls/comments/92695462"},"html":{"href":"https://github.com/decred/dcrstakepool/pull/76#discussion_r92695462"},"pull_request":{"href":"https://api.github.com/repos/decred/dcrstakepool/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/decred/dcrstakepool/pulls/76","id":97989162,"html_url":"https://github.com/decred/dcrstakepool/pull/76","diff_url":"https://github.com/decred/dcrstakepool/pull/76.diff","patch_url":"https://github.com/decred/dcrstakepool/pull/76.patch","issue_url":"https://api.github.com/repos/decred/dcrstakepool/issues/76","number":76,"state":"open","locked":false,"title":"add API Tokens, change API version to v1 and bump to 1.0.0","user":{"login":"jolan","id":927740,"avatar_url":"https://avatars.githubusercontent.com/u/927740?v=3","gravatar_id":"","url":"https://api.github.com/users/jolan","html_url":"https://github.com/jolan","followers_url":"https://api.github.com/users/jolan/followers","following_url":"https://api.github.com/users/jolan/following{/other_user}","gists_url":"https://api.github.com/users/jolan/gists{/gist_id}","starred_url":"https://api.github.com/users/jolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jolan/subscriptions","organizations_url":"https://api.github.com/users/jolan/orgs","repos_url":"https://api.github.com/users/jolan/repos","events_url":"https://api.github.com/users/jolan/events{/privacy}","received_events_url":"https://api.github.com/users/jolan/received_events","type":"User","site_admin":false},"body":"This addresses everything mentioned in #75.\r\n\r\n- [x] JSON messages need to be updated to not use strings for literally all fields.\r\n\r\n- [x] There has been discussion about redirecting users to the pool's web page in order to sign up for the service, since then it can be protected with a captcha.\r\n\r\n- [x] Consider using a sessionless API key instead of logging in to the service.\r\n\r\n- [x] Add error codes to report specific error conditions.\r\n\r\n@chappjc mentioned requiring TLS but since TLS termination can be handled by nginx, I'm not sure how that would work.  Also @jrick mentioned keeping CSRF but that requires sessions or a 'get csrf token' API call.  Not sure it is worth the effort.\r\n\r\nAnyway, this PR works well for me. Just needs more testing and some review and close out the discussion items mentioned above.\r\n\r\nCloses #75.","created_at":"2016-12-14T16:40:19Z","updated_at":"2016-12-15T20:39:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd504bb12b5a9ff7f911ac57e2707168549bb9c2","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/decred/dcrstakepool/pulls/76/commits","review_comments_url":"https://api.github.com/repos/decred/dcrstakepool/pulls/76/comments","review_comment_url":"https://api.github.com/repos/decred/dcrstakepool/pulls/comments{/number}","comments_url":"https://api.github.com/repos/decred/dcrstakepool/issues/76/comments","statuses_url":"https://api.github.com/repos/decred/dcrstakepool/statuses/f69f16b0facf688e77a9bf84d7c6cbb534517906","head":{"label":"jolan:jolan_apiv1","ref":"jolan_apiv1","sha":"f69f16b0facf688e77a9bf84d7c6cbb534517906","user":{"login":"jolan","id":927740,"avatar_url":"https://avatars.githubusercontent.com/u/927740?v=3","gravatar_id":"","url":"https://api.github.com/users/jolan","html_url":"https://github.com/jolan","followers_url":"https://api.github.com/users/jolan/followers","following_url":"https://api.github.com/users/jolan/following{/other_user}","gists_url":"https://api.github.com/users/jolan/gists{/gist_id}","starred_url":"https://api.github.com/users/jolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jolan/subscriptions","organizations_url":"https://api.github.com/users/jolan/orgs","repos_url":"https://api.github.com/users/jolan/repos","events_url":"https://api.github.com/users/jolan/events{/privacy}","received_events_url":"https://api.github.com/users/jolan/received_events","type":"User","site_admin":false},"repo":{"id":73411678,"name":"dcrstakepool","full_name":"jolan/dcrstakepool","owner":{"login":"jolan","id":927740,"avatar_url":"https://avatars.githubusercontent.com/u/927740?v=3","gravatar_id":"","url":"https://api.github.com/users/jolan","html_url":"https://github.com/jolan","followers_url":"https://api.github.com/users/jolan/followers","following_url":"https://api.github.com/users/jolan/following{/other_user}","gists_url":"https://api.github.com/users/jolan/gists{/gist_id}","starred_url":"https://api.github.com/users/jolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jolan/subscriptions","organizations_url":"https://api.github.com/users/jolan/orgs","repos_url":"https://api.github.com/users/jolan/repos","events_url":"https://api.github.com/users/jolan/events{/privacy}","received_events_url":"https://api.github.com/users/jolan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jolan/dcrstakepool","description":"Stake Pool for Decred","fork":true,"url":"https://api.github.com/repos/jolan/dcrstakepool","forks_url":"https://api.github.com/repos/jolan/dcrstakepool/forks","keys_url":"https://api.github.com/repos/jolan/dcrstakepool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jolan/dcrstakepool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jolan/dcrstakepool/teams","hooks_url":"https://api.github.com/repos/jolan/dcrstakepool/hooks","issue_events_url":"https://api.github.com/repos/jolan/dcrstakepool/issues/events{/number}","events_url":"https://api.github.com/repos/jolan/dcrstakepool/events","assignees_url":"https://api.github.com/repos/jolan/dcrstakepool/assignees{/user}","branches_url":"https://api.github.com/repos/jolan/dcrstakepool/branches{/branch}","tags_url":"https://api.github.com/repos/jolan/dcrstakepool/tags","blobs_url":"https://api.github.com/repos/jolan/dcrstakepool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jolan/dcrstakepool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jolan/dcrstakepool/git/refs{/sha}","trees_url":"https://api.github.com/repos/jolan/dcrstakepool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jolan/dcrstakepool/statuses/{sha}","languages_url":"https://api.github.com/repos/jolan/dcrstakepool/languages","stargazers_url":"https://api.github.com/repos/jolan/dcrstakepool/stargazers","contributors_url":"https://api.github.com/repos/jolan/dcrstakepool/contributors","subscribers_url":"https://api.github.com/repos/jolan/dcrstakepool/subscribers","subscription_url":"https://api.github.com/repos/jolan/dcrstakepool/subscription","commits_url":"https://api.github.com/repos/jolan/dcrstakepool/commits{/sha}","git_commits_url":"https://api.github.com/repos/jolan/dcrstakepool/git/commits{/sha}","comments_url":"https://api.github.com/repos/jolan/dcrstakepool/comments{/number}","issue_comment_url":"https://api.github.com/repos/jolan/dcrstakepool/issues/comments{/number}","contents_url":"https://api.github.com/repos/jolan/dcrstakepool/contents/{+path}","compare_url":"https://api.github.com/repos/jolan/dcrstakepool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jolan/dcrstakepool/merges","archive_url":"https://api.github.com/repos/jolan/dcrstakepool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jolan/dcrstakepool/downloads","issues_url":"https://api.github.com/repos/jolan/dcrstakepool/issues{/number}","pulls_url":"https://api.github.com/repos/jolan/dcrstakepool/pulls{/number}","milestones_url":"https://api.github.com/repos/jolan/dcrstakepool/milestones{/number}","notifications_url":"https://api.github.com/repos/jolan/dcrstakepool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jolan/dcrstakepool/labels{/name}","releases_url":"https://api.github.com/repos/jolan/dcrstakepool/releases{/id}","deployments_url":"https://api.github.com/repos/jolan/dcrstakepool/deployments","created_at":"2016-11-10T18:54:40Z","updated_at":"2016-11-10T18:54:42Z","pushed_at":"2016-12-15T16:51:38Z","git_url":"git://github.com/jolan/dcrstakepool.git","ssh_url":"git@github.com:jolan/dcrstakepool.git","clone_url":"https://github.com/jolan/dcrstakepool.git","svn_url":"https://github.com/jolan/dcrstakepool","homepage":"","size":712,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"decred:master","ref":"master","sha":"68e16526448858e8b284c024867d6e570e9dc8fa","user":{"login":"decred","id":16297194,"avatar_url":"https://avatars.githubusercontent.com/u/16297194?v=3","gravatar_id":"","url":"https://api.github.com/users/decred","html_url":"https://github.com/decred","followers_url":"https://api.github.com/users/decred/followers","following_url":"https://api.github.com/users/decred/following{/other_user}","gists_url":"https://api.github.com/users/decred/gists{/gist_id}","starred_url":"https://api.github.com/users/decred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decred/subscriptions","organizations_url":"https://api.github.com/users/decred/orgs","repos_url":"https://api.github.com/users/decred/repos","events_url":"https://api.github.com/users/decred/events{/privacy}","received_events_url":"https://api.github.com/users/decred/received_events","type":"Organization","site_admin":false},"repo":{"id":54925829,"name":"dcrstakepool","full_name":"decred/dcrstakepool","owner":{"login":"decred","id":16297194,"avatar_url":"https://avatars.githubusercontent.com/u/16297194?v=3","gravatar_id":"","url":"https://api.github.com/users/decred","html_url":"https://github.com/decred","followers_url":"https://api.github.com/users/decred/followers","following_url":"https://api.github.com/users/decred/following{/other_user}","gists_url":"https://api.github.com/users/decred/gists{/gist_id}","starred_url":"https://api.github.com/users/decred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decred/subscriptions","organizations_url":"https://api.github.com/users/decred/orgs","repos_url":"https://api.github.com/users/decred/repos","events_url":"https://api.github.com/users/decred/events{/privacy}","received_events_url":"https://api.github.com/users/decred/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/decred/dcrstakepool","description":"Stake Pool for Decred","fork":false,"url":"https://api.github.com/repos/decred/dcrstakepool","forks_url":"https://api.github.com/repos/decred/dcrstakepool/forks","keys_url":"https://api.github.com/repos/decred/dcrstakepool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/decred/dcrstakepool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/decred/dcrstakepool/teams","hooks_url":"https://api.github.com/repos/decred/dcrstakepool/hooks","issue_events_url":"https://api.github.com/repos/decred/dcrstakepool/issues/events{/number}","events_url":"https://api.github.com/repos/decred/dcrstakepool/events","assignees_url":"https://api.github.com/repos/decred/dcrstakepool/assignees{/user}","branches_url":"https://api.github.com/repos/decred/dcrstakepool/branches{/branch}","tags_url":"https://api.github.com/repos/decred/dcrstakepool/tags","blobs_url":"https://api.github.com/repos/decred/dcrstakepool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/decred/dcrstakepool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/decred/dcrstakepool/git/refs{/sha}","trees_url":"https://api.github.com/repos/decred/dcrstakepool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/decred/dcrstakepool/statuses/{sha}","languages_url":"https://api.github.com/repos/decred/dcrstakepool/languages","stargazers_url":"https://api.github.com/repos/decred/dcrstakepool/stargazers","contributors_url":"https://api.github.com/repos/decred/dcrstakepool/contributors","subscribers_url":"https://api.github.com/repos/decred/dcrstakepool/subscribers","subscription_url":"https://api.github.com/repos/decred/dcrstakepool/subscription","commits_url":"https://api.github.com/repos/decred/dcrstakepool/commits{/sha}","git_commits_url":"https://api.github.com/repos/decred/dcrstakepool/git/commits{/sha}","comments_url":"https://api.github.com/repos/decred/dcrstakepool/comments{/number}","issue_comment_url":"https://api.github.com/repos/decred/dcrstakepool/issues/comments{/number}","contents_url":"https://api.github.com/repos/decred/dcrstakepool/contents/{+path}","compare_url":"https://api.github.com/repos/decred/dcrstakepool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/decred/dcrstakepool/merges","archive_url":"https://api.github.com/repos/decred/dcrstakepool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/decred/dcrstakepool/downloads","issues_url":"https://api.github.com/repos/decred/dcrstakepool/issues{/number}","pulls_url":"https://api.github.com/repos/decred/dcrstakepool/pulls{/number}","milestones_url":"https://api.github.com/repos/decred/dcrstakepool/milestones{/number}","notifications_url":"https://api.github.com/repos/decred/dcrstakepool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/decred/dcrstakepool/labels{/name}","releases_url":"https://api.github.com/repos/decred/dcrstakepool/releases{/id}","deployments_url":"https://api.github.com/repos/decred/dcrstakepool/deployments","created_at":"2016-03-28T21:44:13Z","updated_at":"2016-11-17T15:12:38Z","pushed_at":"2016-12-15T16:51:38Z","git_url":"git://github.com/decred/dcrstakepool.git","ssh_url":"git@github.com:decred/dcrstakepool.git","clone_url":"https://github.com/decred/dcrstakepool.git","svn_url":"https://github.com/decred/dcrstakepool","homepage":"","size":811,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":12,"forks":6,"open_issues":12,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/decred/dcrstakepool/pulls/76"},"html":{"href":"https://github.com/decred/dcrstakepool/pull/76"},"issue":{"href":"https://api.github.com/repos/decred/dcrstakepool/issues/76"},"comments":{"href":"https://api.github.com/repos/decred/dcrstakepool/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/decred/dcrstakepool/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/decred/dcrstakepool/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/decred/dcrstakepool/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/decred/dcrstakepool/statuses/f69f16b0facf688e77a9bf84d7c6cbb534517906"}}}}
{"actor":{"display_login":"jolan"}}