{"action":"created","comment":{"url":"https://api.github.com/repos/ably/docs/pulls/comments/73296735","id":73296735,"diff_hunk":"@@ -147,18 +147,21 @@ h3(#rest-auth). Auth\n ** @(RSA9f)@ Capability JSON text can be provided that specifies the rights of the token in terms of the channel(s) authorised and the permitted operations on each\n ** @(RSA9g)@ A valid HMAC is created using the key secret  to sign the @TokenRequest@ so that it can be used by any client to request a token without having or exchanging any secrets\n ** @(RSA9i)@ Adheres to all requirements in @RSA8@ relating to @TokenParams@\n-* @(RSA10)@ @Auth#authorise@ function:\n-** @(RSA10a)@ Instructs the library to create a token if needed and uses Token Auth for all future requests\n-** @(RSA10j)@ Method signature is @authorise(TokenParams, AuthOptions)@. @TokenParams@ and @AuthOptions@ are optional. When the arguments are present, even if empty, the @TokenParams@ and @AuthOptions@ supersede any previously client library configured @TokenParams@ and @AuthOptions@. For example, if a client is initialised with @TokenParams#ttl@ configured with a custom value, and a @TokenParams@ object is passed in as an argument to @#authorise@ with a @null@ value for @ttl@, then the @ttl@ used for every subsequent authorisation will be @null@. See \"@RSA10d@\":#RSA10d for an exception\n+* @(RSA10)@ @Auth#authorize@ function:\n+** @(RSA10a)@ Instructs the library to create a token immediately and ensures Token Auth is used for all future requests. See \"RTC8\":#RTC8 for re-authentication behaviour when called for a realtime client\n+** @(RSA10j)@ Method signature is @authorize(TokenParams, AuthOptions)@. @TokenParams@ and @AuthOptions@ are optional. When the arguments are present, even if empty, the @TokenParams@ and @AuthOptions@ supersede any previously client library configured @TokenParams@ and @AuthOptions@. For example, if a client is initialised with @TokenParams#ttl@ configured with a custom value, and a @TokenParams@ object is passed in as an argument to @#authorize@ with a @null@ value for @ttl@, then the @ttl@ used for every subsequent authorisation will be @null@","path":"content/client-lib-development-guide/features.textile","position":28,"original_position":28,"commit_id":"04fd63fd8ebd3cc5ad3fdac16aecd5778bf00350","original_commit_id":"04fd63fd8ebd3cc5ad3fdac16aecd5778bf00350","user":{"login":"mattheworiordan","id":43789,"avatar_url":"https://avatars.githubusercontent.com/u/43789?v=3","gravatar_id":"","url":"https://api.github.com/users/mattheworiordan","html_url":"https://github.com/mattheworiordan","followers_url":"https://api.github.com/users/mattheworiordan/followers","following_url":"https://api.github.com/users/mattheworiordan/following{/other_user}","gists_url":"https://api.github.com/users/mattheworiordan/gists{/gist_id}","starred_url":"https://api.github.com/users/mattheworiordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattheworiordan/subscriptions","organizations_url":"https://api.github.com/users/mattheworiordan/orgs","repos_url":"https://api.github.com/users/mattheworiordan/repos","events_url":"https://api.github.com/users/mattheworiordan/events{/privacy}","received_events_url":"https://api.github.com/users/mattheworiordan/received_events","type":"User","site_admin":false},"body":"Sure, I can amend so it makes sense for typed & non-typed langs","created_at":"2016-08-03T08:09:52Z","updated_at":"2016-08-03T08:09:52Z","html_url":"https://github.com/ably/docs/pull/132#discussion_r73296735","pull_request_url":"https://api.github.com/repos/ably/docs/pulls/132","_links":{"self":{"href":"https://api.github.com/repos/ably/docs/pulls/comments/73296735"},"html":{"href":"https://github.com/ably/docs/pull/132#discussion_r73296735"},"pull_request":{"href":"https://api.github.com/repos/ably/docs/pulls/132"}}},"pull_request":{"url":"https://api.github.com/repos/ably/docs/pulls/132","id":78696402,"html_url":"https://github.com/ably/docs/pull/132","diff_url":"https://github.com/ably/docs/pull/132.diff","patch_url":"https://github.com/ably/docs/pull/132.patch","issue_url":"https://api.github.com/repos/ably/docs/issues/132","number":132,"state":"open","locked":false,"title":"Auth protocol message","user":{"login":"mattheworiordan","id":43789,"avatar_url":"https://avatars.githubusercontent.com/u/43789?v=3","gravatar_id":"","url":"https://api.github.com/users/mattheworiordan","html_url":"https://github.com/mattheworiordan","followers_url":"https://api.github.com/users/mattheworiordan/followers","following_url":"https://api.github.com/users/mattheworiordan/following{/other_user}","gists_url":"https://api.github.com/users/mattheworiordan/gists{/gist_id}","starred_url":"https://api.github.com/users/mattheworiordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattheworiordan/subscriptions","organizations_url":"https://api.github.com/users/mattheworiordan/orgs","repos_url":"https://api.github.com/users/mattheworiordan/repos","events_url":"https://api.github.com/users/mattheworiordan/events{/privacy}","received_events_url":"https://api.github.com/users/mattheworiordan/received_events","type":"User","site_admin":false},"body":"This PR addresses the requirement to allow token authentication upgrades/downgrades/renewal without closing the connection.  The realtime system can now send an `AUTH` `ProtocolMessage` a sensible time before the token expires forcing the client to immediately commence re-auth.\r\n\r\n@SimonWoolf @paddybyers @tcard please review.\r\n\r\nNote:\r\n* I believe we should consider exposing a means to invalidate existing tokens based on a token identifier or even a `clientId` thus forcing all clients to immediately reauth.\r\n* We may also want to allow upgrades from anonymous to identified as that is a very common use case","created_at":"2016-07-25T14:58:41Z","updated_at":"2016-08-03T08:09:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1ea5fa2da927e650c52700579849040d64655daf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ably/docs/pulls/132/commits","review_comments_url":"https://api.github.com/repos/ably/docs/pulls/132/comments","review_comment_url":"https://api.github.com/repos/ably/docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ably/docs/issues/132/comments","statuses_url":"https://api.github.com/repos/ably/docs/statuses/04fd63fd8ebd3cc5ad3fdac16aecd5778bf00350","head":{"label":"ably:auth-protocol-message","ref":"auth-protocol-message","sha":"04fd63fd8ebd3cc5ad3fdac16aecd5778bf00350","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":7221949,"name":"docs","full_name":"ably/docs","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/docs","description":"Ably API documentation ","fork":false,"url":"https://api.github.com/repos/ably/docs","forks_url":"https://api.github.com/repos/ably/docs/forks","keys_url":"https://api.github.com/repos/ably/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ably/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ably/docs/teams","hooks_url":"https://api.github.com/repos/ably/docs/hooks","issue_events_url":"https://api.github.com/repos/ably/docs/issues/events{/number}","events_url":"https://api.github.com/repos/ably/docs/events","assignees_url":"https://api.github.com/repos/ably/docs/assignees{/user}","branches_url":"https://api.github.com/repos/ably/docs/branches{/branch}","tags_url":"https://api.github.com/repos/ably/docs/tags","blobs_url":"https://api.github.com/repos/ably/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ably/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ably/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ably/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ably/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/ably/docs/languages","stargazers_url":"https://api.github.com/repos/ably/docs/stargazers","contributors_url":"https://api.github.com/repos/ably/docs/contributors","subscribers_url":"https://api.github.com/repos/ably/docs/subscribers","subscription_url":"https://api.github.com/repos/ably/docs/subscription","commits_url":"https://api.github.com/repos/ably/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ably/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ably/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ably/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ably/docs/contents/{+path}","compare_url":"https://api.github.com/repos/ably/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ably/docs/merges","archive_url":"https://api.github.com/repos/ably/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ably/docs/downloads","issues_url":"https://api.github.com/repos/ably/docs/issues{/number}","pulls_url":"https://api.github.com/repos/ably/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/ably/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/ably/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ably/docs/labels{/name}","releases_url":"https://api.github.com/repos/ably/docs/releases{/id}","deployments_url":"https://api.github.com/repos/ably/docs/deployments","created_at":"2012-12-18T10:59:49Z","updated_at":"2016-01-13T09:44:51Z","pushed_at":"2016-08-02T16:24:21Z","git_url":"git://github.com/ably/docs.git","ssh_url":"git@github.com:ably/docs.git","clone_url":"https://github.com/ably/docs.git","svn_url":"https://github.com/ably/docs","homepage":null,"size":4721,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":22,"forks":8,"open_issues":22,"watchers":1,"default_branch":"source"}},"base":{"label":"ably:source","ref":"source","sha":"1e9ecd367fb093120f85e21ab274dd9688170572","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":7221949,"name":"docs","full_name":"ably/docs","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/docs","description":"Ably API documentation ","fork":false,"url":"https://api.github.com/repos/ably/docs","forks_url":"https://api.github.com/repos/ably/docs/forks","keys_url":"https://api.github.com/repos/ably/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ably/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ably/docs/teams","hooks_url":"https://api.github.com/repos/ably/docs/hooks","issue_events_url":"https://api.github.com/repos/ably/docs/issues/events{/number}","events_url":"https://api.github.com/repos/ably/docs/events","assignees_url":"https://api.github.com/repos/ably/docs/assignees{/user}","branches_url":"https://api.github.com/repos/ably/docs/branches{/branch}","tags_url":"https://api.github.com/repos/ably/docs/tags","blobs_url":"https://api.github.com/repos/ably/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ably/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ably/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ably/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ably/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/ably/docs/languages","stargazers_url":"https://api.github.com/repos/ably/docs/stargazers","contributors_url":"https://api.github.com/repos/ably/docs/contributors","subscribers_url":"https://api.github.com/repos/ably/docs/subscribers","subscription_url":"https://api.github.com/repos/ably/docs/subscription","commits_url":"https://api.github.com/repos/ably/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ably/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ably/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ably/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ably/docs/contents/{+path}","compare_url":"https://api.github.com/repos/ably/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ably/docs/merges","archive_url":"https://api.github.com/repos/ably/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ably/docs/downloads","issues_url":"https://api.github.com/repos/ably/docs/issues{/number}","pulls_url":"https://api.github.com/repos/ably/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/ably/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/ably/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ably/docs/labels{/name}","releases_url":"https://api.github.com/repos/ably/docs/releases{/id}","deployments_url":"https://api.github.com/repos/ably/docs/deployments","created_at":"2012-12-18T10:59:49Z","updated_at":"2016-01-13T09:44:51Z","pushed_at":"2016-08-02T16:24:21Z","git_url":"git://github.com/ably/docs.git","ssh_url":"git@github.com:ably/docs.git","clone_url":"https://github.com/ably/docs.git","svn_url":"https://github.com/ably/docs","homepage":null,"size":4721,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":22,"forks":8,"open_issues":22,"watchers":1,"default_branch":"source"}},"_links":{"self":{"href":"https://api.github.com/repos/ably/docs/pulls/132"},"html":{"href":"https://github.com/ably/docs/pull/132"},"issue":{"href":"https://api.github.com/repos/ably/docs/issues/132"},"comments":{"href":"https://api.github.com/repos/ably/docs/issues/132/comments"},"review_comments":{"href":"https://api.github.com/repos/ably/docs/pulls/132/comments"},"review_comment":{"href":"https://api.github.com/repos/ably/docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ably/docs/pulls/132/commits"},"statuses":{"href":"https://api.github.com/repos/ably/docs/statuses/04fd63fd8ebd3cc5ad3fdac16aecd5778bf00350"}}}}
{"actor":{"display_login":"mattheworiordan"}}