{"action":"created","issue":{"url":"https://api.github.com/repos/closeio/socketshark/issues/26","repository_url":"https://api.github.com/repos/closeio/socketshark","labels_url":"https://api.github.com/repos/closeio/socketshark/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/closeio/socketshark/issues/26/comments","events_url":"https://api.github.com/repos/closeio/socketshark/issues/26/events","html_url":"https://github.com/closeio/socketshark/pull/26","id":340789878,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxMTE5MzUw","number":26,"title":"Authorizer fields","user":{"login":"thomasst","id":68381,"node_id":"MDQ6VXNlcjY4Mzgx","avatar_url":"https://avatars1.githubusercontent.com/u/68381?v=4","gravatar_id":"","url":"https://api.github.com/users/thomasst","html_url":"https://github.com/thomasst","followers_url":"https://api.github.com/users/thomasst/followers","following_url":"https://api.github.com/users/thomasst/following{/other_user}","gists_url":"https://api.github.com/users/thomasst/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasst/subscriptions","organizations_url":"https://api.github.com/users/thomasst/orgs","repos_url":"https://api.github.com/users/thomasst/repos","events_url":"https://api.github.com/users/thomasst/events{/privacy}","received_events_url":"https://api.github.com/users/thomasst/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"thomasst","id":68381,"node_id":"MDQ6VXNlcjY4Mzgx","avatar_url":"https://avatars1.githubusercontent.com/u/68381?v=4","gravatar_id":"","url":"https://api.github.com/users/thomasst","html_url":"https://github.com/thomasst","followers_url":"https://api.github.com/users/thomasst/followers","following_url":"https://api.github.com/users/thomasst/following{/other_user}","gists_url":"https://api.github.com/users/thomasst/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasst/subscriptions","organizations_url":"https://api.github.com/users/thomasst/orgs","repos_url":"https://api.github.com/users/thomasst/repos","events_url":"https://api.github.com/users/thomasst/events{/privacy}","received_events_url":"https://api.github.com/users/thomasst/received_events","type":"User","site_admin":false},"assignees":[{"login":"thomasst","id":68381,"node_id":"MDQ6VXNlcjY4Mzgx","avatar_url":"https://avatars1.githubusercontent.com/u/68381?v=4","gravatar_id":"","url":"https://api.github.com/users/thomasst","html_url":"https://github.com/thomasst","followers_url":"https://api.github.com/users/thomasst/followers","following_url":"https://api.github.com/users/thomasst/following{/other_user}","gists_url":"https://api.github.com/users/thomasst/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasst/subscriptions","organizations_url":"https://api.github.com/users/thomasst/orgs","repos_url":"https://api.github.com/users/thomasst/repos","events_url":"https://api.github.com/users/thomasst/events{/privacy}","received_events_url":"https://api.github.com/users/thomasst/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-07-12T20:39:44Z","updated_at":"2018-07-13T14:00:28Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/closeio/socketshark/pulls/26","html_url":"https://github.com/closeio/socketshark/pull/26","diff_url":"https://github.com/closeio/socketshark/pull/26.diff","patch_url":"https://github.com/closeio/socketshark/pull/26.patch"},"body":"This allows the authorizer to return fields  (e.g. a list of permissions / capabilities / plan type) that are passed to subsequent subscription callbacks.\r\n\r\nQuestions:\r\n- What should happen when periodic authorization is enabled and the fields change during an active subscription? Should we 1) do nothing (current behavior), 2) have a new specific callback that gets invoked (if defined), 3) re-invoke the `on_subscribe` callback (possibly with a flag that we're resubscribing, or, 4) force an unsubscribe (so the client can re-subscribe).\r\n- Is it necessary to pass authorizer fields to all subsequent subscription callbacks, or is it enough to just pass them to e.g. `before_subscribe` and `on_subscribe`?"},"comment":{"url":"https://api.github.com/repos/closeio/socketshark/issues/comments/404842056","html_url":"https://github.com/closeio/socketshark/pull/26#issuecomment-404842056","issue_url":"https://api.github.com/repos/closeio/socketshark/issues/26","id":404842056,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDg0MjA1Ng==","user":{"login":"thomasst","id":68381,"node_id":"MDQ6VXNlcjY4Mzgx","avatar_url":"https://avatars1.githubusercontent.com/u/68381?v=4","gravatar_id":"","url":"https://api.github.com/users/thomasst","html_url":"https://github.com/thomasst","followers_url":"https://api.github.com/users/thomasst/followers","following_url":"https://api.github.com/users/thomasst/following{/other_user}","gists_url":"https://api.github.com/users/thomasst/gists{/gist_id}","starred_url":"https://api.github.com/users/thomasst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thomasst/subscriptions","organizations_url":"https://api.github.com/users/thomasst/orgs","repos_url":"https://api.github.com/users/thomasst/repos","events_url":"https://api.github.com/users/thomasst/events{/privacy}","received_events_url":"https://api.github.com/users/thomasst/received_events","type":"User","site_admin":false},"created_at":"2018-07-13T14:00:28Z","updated_at":"2018-07-13T14:00:28Z","author_association":"MEMBER","body":"But, assuming we go with this option:\r\n- With periodic authorization you won't get an immediate notification once the authorizer fields change, i.e. the backend has to wait for the next message from the client. Let's say the client subscribes to updates of an object (but the service should only send updates if certain authorizer fields are set), then the server would keep sending updates potentially forever even if periodic authorization is enabled.\r\n- There is no single callback you can use to validate authorizer fields, you have to validate them in all the message callbacks."}}
{"actor":{"display_login":"thomasst"}}