{"action":"created","comment":{"url":"https://api.github.com/repos/ably/ably-go/pulls/comments/27974973","id":27974973,"diff_hunk":"@@ -35,29 +50,31 @@ type tokenResponse struct {\n }\n \n type TokenRequest struct {\n-\tID         string `json:\"id\"`\n-\tTTL        int    `json:\"ttl\"`\n-\tCapability string `json:\"capability\"`\n-\tClientID   string `json:\"client_id\"`\n-\tTimestamp  int64  `json:\"timestamp\"`\n-\tNonce      string `json:\"nonce\"`\n-\tMac        string `json:\"mac\"`\n+\tID         string     `json:\"id\"`\n+\tTTL        int        `json:\"ttl\"`\n+\tCapability Capability `json:\"capability\"`\n+\tClientID   string     `json:\"client_id\"`\n+\tTimestamp  int64      `json:\"timestamp\"`\n+\tNonce      string     `json:\"nonce\"`\n+\tMac        string     `json:\"mac\"`\n }\n \n-func (t *TokenRequest) Sign(secret string) {\n-\tparams := []string{\n-\t\tt.ID,\n-\t\tstrconv.Itoa(t.TTL),\n-\t\tt.Capability,\n-\t\tt.ClientID,\n-\t\tstrconv.Itoa(int(t.Timestamp)),\n-\t\tt.Nonce,\n-\t}\n-\ts := strings.Join(params, \"\\n\") + \"\\n\"\n+var nl = []byte{'\\n'}","path":"rest/auth.go","position":79,"original_position":79,"commit_id":"fef39a78f5ace4d89e01b48c9b7fd5bcf46ca489","original_commit_id":"fef39a78f5ace4d89e01b48c9b7fd5bcf46ca489","user":{"login":"kouno","id":209665,"avatar_url":"https://avatars.githubusercontent.com/u/209665?v=3","gravatar_id":"","url":"https://api.github.com/users/kouno","html_url":"https://github.com/kouno","followers_url":"https://api.github.com/users/kouno/followers","following_url":"https://api.github.com/users/kouno/following{/other_user}","gists_url":"https://api.github.com/users/kouno/gists{/gist_id}","starred_url":"https://api.github.com/users/kouno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kouno/subscriptions","organizations_url":"https://api.github.com/users/kouno/orgs","repos_url":"https://api.github.com/users/kouno/repos","events_url":"https://api.github.com/users/kouno/events{/privacy}","received_events_url":"https://api.github.com/users/kouno/received_events","type":"User","site_admin":false},"body":"Shouldn't this be within the `Sign` function anyway?","created_at":"2015-04-08T14:33:42Z","updated_at":"2015-04-08T14:33:42Z","html_url":"https://github.com/ably/ably-go/pull/6#discussion_r27974973","pull_request_url":"https://api.github.com/repos/ably/ably-go/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/ably/ably-go/pulls/comments/27974973"},"html":{"href":"https://github.com/ably/ably-go/pull/6#discussion_r27974973"},"pull_request":{"href":"https://api.github.com/repos/ably/ably-go/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/ably/ably-go/pulls/6","id":32865238,"html_url":"https://github.com/ably/ably-go/pull/6","diff_url":"https://github.com/ably/ably-go/pull/6.diff","patch_url":"https://github.com/ably/ably-go/pull/6.patch","issue_url":"https://api.github.com/repos/ably/ably-go/issues/6","number":6,"state":"open","locked":false,"title":"Fix capability","user":{"login":"rjeczalik","id":1162017,"avatar_url":"https://avatars.githubusercontent.com/u/1162017?v=3","gravatar_id":"","url":"https://api.github.com/users/rjeczalik","html_url":"https://github.com/rjeczalik","followers_url":"https://api.github.com/users/rjeczalik/followers","following_url":"https://api.github.com/users/rjeczalik/following{/other_user}","gists_url":"https://api.github.com/users/rjeczalik/gists{/gist_id}","starred_url":"https://api.github.com/users/rjeczalik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjeczalik/subscriptions","organizations_url":"https://api.github.com/users/rjeczalik/orgs","repos_url":"https://api.github.com/users/rjeczalik/repos","events_url":"https://api.github.com/users/rjeczalik/events{/privacy}","received_events_url":"https://api.github.com/users/rjeczalik/received_events","type":"User","site_admin":false},"body":"Fix for broken Capability marshalling/unmarshalling on master.","created_at":"2015-04-08T14:27:37Z","updated_at":"2015-04-08T14:33:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc062e3a21d566768d5aa1a2a4454053fd726752","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ably/ably-go/pulls/6/commits","review_comments_url":"https://api.github.com/repos/ably/ably-go/pulls/6/comments","review_comment_url":"https://api.github.com/repos/ably/ably-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ably/ably-go/issues/6/comments","statuses_url":"https://api.github.com/repos/ably/ably-go/statuses/fef39a78f5ace4d89e01b48c9b7fd5bcf46ca489","head":{"label":"rjeczalik:fix-capability","ref":"fix-capability","sha":"fef39a78f5ace4d89e01b48c9b7fd5bcf46ca489","user":{"login":"rjeczalik","id":1162017,"avatar_url":"https://avatars.githubusercontent.com/u/1162017?v=3","gravatar_id":"","url":"https://api.github.com/users/rjeczalik","html_url":"https://github.com/rjeczalik","followers_url":"https://api.github.com/users/rjeczalik/followers","following_url":"https://api.github.com/users/rjeczalik/following{/other_user}","gists_url":"https://api.github.com/users/rjeczalik/gists{/gist_id}","starred_url":"https://api.github.com/users/rjeczalik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjeczalik/subscriptions","organizations_url":"https://api.github.com/users/rjeczalik/orgs","repos_url":"https://api.github.com/users/rjeczalik/repos","events_url":"https://api.github.com/users/rjeczalik/events{/privacy}","received_events_url":"https://api.github.com/users/rjeczalik/received_events","type":"User","site_admin":false},"repo":{"id":33247084,"name":"ably-go","full_name":"rjeczalik/ably-go","owner":{"login":"rjeczalik","id":1162017,"avatar_url":"https://avatars.githubusercontent.com/u/1162017?v=3","gravatar_id":"","url":"https://api.github.com/users/rjeczalik","html_url":"https://github.com/rjeczalik","followers_url":"https://api.github.com/users/rjeczalik/followers","following_url":"https://api.github.com/users/rjeczalik/following{/other_user}","gists_url":"https://api.github.com/users/rjeczalik/gists{/gist_id}","starred_url":"https://api.github.com/users/rjeczalik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjeczalik/subscriptions","organizations_url":"https://api.github.com/users/rjeczalik/orgs","repos_url":"https://api.github.com/users/rjeczalik/repos","events_url":"https://api.github.com/users/rjeczalik/events{/privacy}","received_events_url":"https://api.github.com/users/rjeczalik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rjeczalik/ably-go","description":"Go client for Ably real-time messaging service","fork":true,"url":"https://api.github.com/repos/rjeczalik/ably-go","forks_url":"https://api.github.com/repos/rjeczalik/ably-go/forks","keys_url":"https://api.github.com/repos/rjeczalik/ably-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rjeczalik/ably-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rjeczalik/ably-go/teams","hooks_url":"https://api.github.com/repos/rjeczalik/ably-go/hooks","issue_events_url":"https://api.github.com/repos/rjeczalik/ably-go/issues/events{/number}","events_url":"https://api.github.com/repos/rjeczalik/ably-go/events","assignees_url":"https://api.github.com/repos/rjeczalik/ably-go/assignees{/user}","branches_url":"https://api.github.com/repos/rjeczalik/ably-go/branches{/branch}","tags_url":"https://api.github.com/repos/rjeczalik/ably-go/tags","blobs_url":"https://api.github.com/repos/rjeczalik/ably-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rjeczalik/ably-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rjeczalik/ably-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/rjeczalik/ably-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rjeczalik/ably-go/statuses/{sha}","languages_url":"https://api.github.com/repos/rjeczalik/ably-go/languages","stargazers_url":"https://api.github.com/repos/rjeczalik/ably-go/stargazers","contributors_url":"https://api.github.com/repos/rjeczalik/ably-go/contributors","subscribers_url":"https://api.github.com/repos/rjeczalik/ably-go/subscribers","subscription_url":"https://api.github.com/repos/rjeczalik/ably-go/subscription","commits_url":"https://api.github.com/repos/rjeczalik/ably-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/rjeczalik/ably-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/rjeczalik/ably-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/rjeczalik/ably-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/rjeczalik/ably-go/contents/{+path}","compare_url":"https://api.github.com/repos/rjeczalik/ably-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rjeczalik/ably-go/merges","archive_url":"https://api.github.com/repos/rjeczalik/ably-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rjeczalik/ably-go/downloads","issues_url":"https://api.github.com/repos/rjeczalik/ably-go/issues{/number}","pulls_url":"https://api.github.com/repos/rjeczalik/ably-go/pulls{/number}","milestones_url":"https://api.github.com/repos/rjeczalik/ably-go/milestones{/number}","notifications_url":"https://api.github.com/repos/rjeczalik/ably-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rjeczalik/ably-go/labels{/name}","releases_url":"https://api.github.com/repos/rjeczalik/ably-go/releases{/id}","created_at":"2015-04-01T12:48:55Z","updated_at":"2015-04-01T12:48:56Z","pushed_at":"2015-04-08T14:25:35Z","git_url":"git://github.com/rjeczalik/ably-go.git","ssh_url":"git@github.com:rjeczalik/ably-go.git","clone_url":"https://github.com/rjeczalik/ably-go.git","svn_url":"https://github.com/rjeczalik/ably-go","homepage":null,"size":776,"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":"ably:master","ref":"master","sha":"81a7aeb39082001791c96252db709b2003e59d70","user":{"login":"ably","id":1859245,"avatar_url":"https://avatars.githubusercontent.com/u/1859245?v=3","gravatar_id":"","url":"https://api.github.com/users/ably","html_url":"https://github.com/ably","followers_url":"https://api.github.com/users/ably/followers","following_url":"https://api.github.com/users/ably/following{/other_user}","gists_url":"https://api.github.com/users/ably/gists{/gist_id}","starred_url":"https://api.github.com/users/ably/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ably/subscriptions","organizations_url":"https://api.github.com/users/ably/orgs","repos_url":"https://api.github.com/users/ably/repos","events_url":"https://api.github.com/users/ably/events{/privacy}","received_events_url":"https://api.github.com/users/ably/received_events","type":"Organization","site_admin":false},"repo":{"id":27377399,"name":"ably-go","full_name":"ably/ably-go","owner":{"login":"ably","id":1859245,"avatar_url":"https://avatars.githubusercontent.com/u/1859245?v=3","gravatar_id":"","url":"https://api.github.com/users/ably","html_url":"https://github.com/ably","followers_url":"https://api.github.com/users/ably/followers","following_url":"https://api.github.com/users/ably/following{/other_user}","gists_url":"https://api.github.com/users/ably/gists{/gist_id}","starred_url":"https://api.github.com/users/ably/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ably/subscriptions","organizations_url":"https://api.github.com/users/ably/orgs","repos_url":"https://api.github.com/users/ably/repos","events_url":"https://api.github.com/users/ably/events{/privacy}","received_events_url":"https://api.github.com/users/ably/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ably/ably-go","description":"Go client for Ably real-time messaging service","fork":false,"url":"https://api.github.com/repos/ably/ably-go","forks_url":"https://api.github.com/repos/ably/ably-go/forks","keys_url":"https://api.github.com/repos/ably/ably-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ably/ably-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ably/ably-go/teams","hooks_url":"https://api.github.com/repos/ably/ably-go/hooks","issue_events_url":"https://api.github.com/repos/ably/ably-go/issues/events{/number}","events_url":"https://api.github.com/repos/ably/ably-go/events","assignees_url":"https://api.github.com/repos/ably/ably-go/assignees{/user}","branches_url":"https://api.github.com/repos/ably/ably-go/branches{/branch}","tags_url":"https://api.github.com/repos/ably/ably-go/tags","blobs_url":"https://api.github.com/repos/ably/ably-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ably/ably-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ably/ably-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/ably/ably-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ably/ably-go/statuses/{sha}","languages_url":"https://api.github.com/repos/ably/ably-go/languages","stargazers_url":"https://api.github.com/repos/ably/ably-go/stargazers","contributors_url":"https://api.github.com/repos/ably/ably-go/contributors","subscribers_url":"https://api.github.com/repos/ably/ably-go/subscribers","subscription_url":"https://api.github.com/repos/ably/ably-go/subscription","commits_url":"https://api.github.com/repos/ably/ably-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/ably/ably-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/ably/ably-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/ably/ably-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/ably/ably-go/contents/{+path}","compare_url":"https://api.github.com/repos/ably/ably-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ably/ably-go/merges","archive_url":"https://api.github.com/repos/ably/ably-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ably/ably-go/downloads","issues_url":"https://api.github.com/repos/ably/ably-go/issues{/number}","pulls_url":"https://api.github.com/repos/ably/ably-go/pulls{/number}","milestones_url":"https://api.github.com/repos/ably/ably-go/milestones{/number}","notifications_url":"https://api.github.com/repos/ably/ably-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ably/ably-go/labels{/name}","releases_url":"https://api.github.com/repos/ably/ably-go/releases{/id}","created_at":"2014-12-01T11:57:59Z","updated_at":"2015-03-16T16:00:16Z","pushed_at":"2015-04-08T14:30:05Z","git_url":"git://github.com/ably/ably-go.git","ssh_url":"git@github.com:ably/ably-go.git","clone_url":"https://github.com/ably/ably-go.git","svn_url":"https://github.com/ably/ably-go","homepage":null,"size":759,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ably/ably-go/pulls/6"},"html":{"href":"https://github.com/ably/ably-go/pull/6"},"issue":{"href":"https://api.github.com/repos/ably/ably-go/issues/6"},"comments":{"href":"https://api.github.com/repos/ably/ably-go/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/ably/ably-go/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/ably/ably-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ably/ably-go/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/ably/ably-go/statuses/fef39a78f5ace4d89e01b48c9b7fd5bcf46ca489"}}}}