{"action":"created","comment":{"url":"https://api.github.com/repos/google/goacme/pulls/comments/55809317","id":55809317,"diff_hunk":"@@ -0,0 +1,69 @@\n+// Copyright 2015 Google Inc. All Rights Reserved.\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//     http://www.apache.org/licenses/LICENSE-2.0\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+\n+package goacme\n+\n+import (\n+\t\"encoding/json\"\n+\t\"fmt\"\n+\t\"io/ioutil\"\n+\t\"net/http\"\n+\t\"time\"\n+)\n+\n+// ErrorType is used to define a set of errors predefined by the ACME spec.\n+type ErrorType string\n+\n+const (\n+\tErrBadCSR       = \"urn:acme:error:badCSR\"         // The CSR is unacceptable (e.g., due to a short key)","path":"errors.go","position":26,"original_position":26,"commit_id":"aad783a20e19c3002b04bcaa4c265b73eef3ea7f","original_commit_id":"aad783a20e19c3002b04bcaa4c265b73eef3ea7f","user":{"login":"crhym3","id":25405,"avatar_url":"https://avatars.githubusercontent.com/u/25405?v=3","gravatar_id":"","url":"https://api.github.com/users/crhym3","html_url":"https://github.com/crhym3","followers_url":"https://api.github.com/users/crhym3/followers","following_url":"https://api.github.com/users/crhym3/following{/other_user}","gists_url":"https://api.github.com/users/crhym3/gists{/gist_id}","starred_url":"https://api.github.com/users/crhym3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crhym3/subscriptions","organizations_url":"https://api.github.com/users/crhym3/orgs","repos_url":"https://api.github.com/users/crhym3/repos","events_url":"https://api.github.com/users/crhym3/events{/privacy}","received_events_url":"https://api.github.com/users/crhym3/received_events","type":"User","site_admin":false},"body":"OTOH if we agree that, for instance, `urn:acme:error:badNonce` always has `The client sent an unacceptable anti-replay nonce` in `detail` field then I think we can actually declare these predefined errors \"the right way\", with those `detail` strings fixed.","created_at":"2016-03-11T09:48:27Z","updated_at":"2016-03-11T09:48:27Z","html_url":"https://github.com/google/goacme/pull/21#discussion_r55809317","pull_request_url":"https://api.github.com/repos/google/goacme/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/google/goacme/pulls/comments/55809317"},"html":{"href":"https://github.com/google/goacme/pull/21#discussion_r55809317"},"pull_request":{"href":"https://api.github.com/repos/google/goacme/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/google/goacme/pulls/21","id":62417104,"html_url":"https://github.com/google/goacme/pull/21","diff_url":"https://github.com/google/goacme/pull/21.diff","patch_url":"https://github.com/google/goacme/pull/21.patch","issue_url":"https://api.github.com/repos/google/goacme/issues/21","number":21,"state":"open","locked":false,"title":"Predefined ACME error types","user":{"login":"crhym3","id":25405,"avatar_url":"https://avatars.githubusercontent.com/u/25405?v=3","gravatar_id":"","url":"https://api.github.com/users/crhym3","html_url":"https://github.com/crhym3","followers_url":"https://api.github.com/users/crhym3/followers","following_url":"https://api.github.com/users/crhym3/following{/other_user}","gists_url":"https://api.github.com/users/crhym3/gists{/gist_id}","starred_url":"https://api.github.com/users/crhym3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crhym3/subscriptions","organizations_url":"https://api.github.com/users/crhym3/orgs","repos_url":"https://api.github.com/users/crhym3/repos","events_url":"https://api.github.com/users/crhym3/events{/privacy}","received_events_url":"https://api.github.com/users/crhym3/received_events","type":"User","site_admin":false},"body":"A possible solution for #15.\r\n\r\nExample usage:\r\n\r\n    err := client.Register(url, a)\r\n    if err, ok := err.(*Error); ok && err.Type == ErrBadCSR {\r\n      // handle urn:acme:error:badCSR error\r\n    }\r\n\r\n@mbwalas WDYT?","created_at":"2016-03-10T16:33:33Z","updated_at":"2016-03-11T09:48:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f21080707b0954eb1fcdf0cae5a51d8d14a23d0a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/goacme/pulls/21/commits","review_comments_url":"https://api.github.com/repos/google/goacme/pulls/21/comments","review_comment_url":"https://api.github.com/repos/google/goacme/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/goacme/issues/21/comments","statuses_url":"https://api.github.com/repos/google/goacme/statuses/aad783a20e19c3002b04bcaa4c265b73eef3ea7f","head":{"label":"google:errors","ref":"errors","sha":"aad783a20e19c3002b04bcaa4c265b73eef3ea7f","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":46423194,"name":"goacme","full_name":"google/goacme","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/goacme","description":"ACME Go client library and AppEngine module.","fork":false,"url":"https://api.github.com/repos/google/goacme","forks_url":"https://api.github.com/repos/google/goacme/forks","keys_url":"https://api.github.com/repos/google/goacme/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/goacme/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/goacme/teams","hooks_url":"https://api.github.com/repos/google/goacme/hooks","issue_events_url":"https://api.github.com/repos/google/goacme/issues/events{/number}","events_url":"https://api.github.com/repos/google/goacme/events","assignees_url":"https://api.github.com/repos/google/goacme/assignees{/user}","branches_url":"https://api.github.com/repos/google/goacme/branches{/branch}","tags_url":"https://api.github.com/repos/google/goacme/tags","blobs_url":"https://api.github.com/repos/google/goacme/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/goacme/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/goacme/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/goacme/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/goacme/statuses/{sha}","languages_url":"https://api.github.com/repos/google/goacme/languages","stargazers_url":"https://api.github.com/repos/google/goacme/stargazers","contributors_url":"https://api.github.com/repos/google/goacme/contributors","subscribers_url":"https://api.github.com/repos/google/goacme/subscribers","subscription_url":"https://api.github.com/repos/google/goacme/subscription","commits_url":"https://api.github.com/repos/google/goacme/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/goacme/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/goacme/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/goacme/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/goacme/contents/{+path}","compare_url":"https://api.github.com/repos/google/goacme/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/goacme/merges","archive_url":"https://api.github.com/repos/google/goacme/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/goacme/downloads","issues_url":"https://api.github.com/repos/google/goacme/issues{/number}","pulls_url":"https://api.github.com/repos/google/goacme/pulls{/number}","milestones_url":"https://api.github.com/repos/google/goacme/milestones{/number}","notifications_url":"https://api.github.com/repos/google/goacme/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/goacme/labels{/name}","releases_url":"https://api.github.com/repos/google/goacme/releases{/id}","deployments_url":"https://api.github.com/repos/google/goacme/deployments","created_at":"2015-11-18T14:14:40Z","updated_at":"2016-02-29T07:52:11Z","pushed_at":"2016-03-10T16:33:33Z","git_url":"git://github.com/google/goacme.git","ssh_url":"git@github.com:google/goacme.git","clone_url":"https://github.com/google/goacme.git","svn_url":"https://github.com/google/goacme","homepage":"","size":74,"stargazers_count":12,"watchers_count":12,"language":"Go","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":12,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"114453a7fd2e33f4f7887012456ea2eb326ccf84","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":46423194,"name":"goacme","full_name":"google/goacme","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/goacme","description":"ACME Go client library and AppEngine module.","fork":false,"url":"https://api.github.com/repos/google/goacme","forks_url":"https://api.github.com/repos/google/goacme/forks","keys_url":"https://api.github.com/repos/google/goacme/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/goacme/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/goacme/teams","hooks_url":"https://api.github.com/repos/google/goacme/hooks","issue_events_url":"https://api.github.com/repos/google/goacme/issues/events{/number}","events_url":"https://api.github.com/repos/google/goacme/events","assignees_url":"https://api.github.com/repos/google/goacme/assignees{/user}","branches_url":"https://api.github.com/repos/google/goacme/branches{/branch}","tags_url":"https://api.github.com/repos/google/goacme/tags","blobs_url":"https://api.github.com/repos/google/goacme/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/goacme/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/goacme/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/goacme/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/goacme/statuses/{sha}","languages_url":"https://api.github.com/repos/google/goacme/languages","stargazers_url":"https://api.github.com/repos/google/goacme/stargazers","contributors_url":"https://api.github.com/repos/google/goacme/contributors","subscribers_url":"https://api.github.com/repos/google/goacme/subscribers","subscription_url":"https://api.github.com/repos/google/goacme/subscription","commits_url":"https://api.github.com/repos/google/goacme/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/goacme/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/goacme/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/goacme/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/goacme/contents/{+path}","compare_url":"https://api.github.com/repos/google/goacme/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/goacme/merges","archive_url":"https://api.github.com/repos/google/goacme/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/goacme/downloads","issues_url":"https://api.github.com/repos/google/goacme/issues{/number}","pulls_url":"https://api.github.com/repos/google/goacme/pulls{/number}","milestones_url":"https://api.github.com/repos/google/goacme/milestones{/number}","notifications_url":"https://api.github.com/repos/google/goacme/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/goacme/labels{/name}","releases_url":"https://api.github.com/repos/google/goacme/releases{/id}","deployments_url":"https://api.github.com/repos/google/goacme/deployments","created_at":"2015-11-18T14:14:40Z","updated_at":"2016-02-29T07:52:11Z","pushed_at":"2016-03-10T16:33:33Z","git_url":"git://github.com/google/goacme.git","ssh_url":"git@github.com:google/goacme.git","clone_url":"https://github.com/google/goacme.git","svn_url":"https://github.com/google/goacme","homepage":"","size":74,"stargazers_count":12,"watchers_count":12,"language":"Go","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/goacme/pulls/21"},"html":{"href":"https://github.com/google/goacme/pull/21"},"issue":{"href":"https://api.github.com/repos/google/goacme/issues/21"},"comments":{"href":"https://api.github.com/repos/google/goacme/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/google/goacme/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/google/goacme/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/goacme/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/google/goacme/statuses/aad783a20e19c3002b04bcaa4c265b73eef3ea7f"}}}}