{"action":"closed","issue":{"url":"https://api.github.com/repos/crossbario/crossbar/issues/430","repository_url":"https://api.github.com/repos/crossbario/crossbar","labels_url":"https://api.github.com/repos/crossbario/crossbar/issues/430/labels{/name}","comments_url":"https://api.github.com/repos/crossbario/crossbar/issues/430/comments","events_url":"https://api.github.com/repos/crossbario/crossbar/issues/430/events","html_url":"https://github.com/crossbario/crossbar/issues/430","id":104587846,"number":430,"title":"Dynamic authorizers should get details","user":{"login":"oberstet","id":233340,"avatar_url":"https://avatars0.githubusercontent.com/u/233340?v=3","gravatar_id":"","url":"https://api.github.com/users/oberstet","html_url":"https://github.com/oberstet","followers_url":"https://api.github.com/users/oberstet/followers","following_url":"https://api.github.com/users/oberstet/following{/other_user}","gists_url":"https://api.github.com/users/oberstet/gists{/gist_id}","starred_url":"https://api.github.com/users/oberstet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oberstet/subscriptions","organizations_url":"https://api.github.com/users/oberstet/orgs","repos_url":"https://api.github.com/users/oberstet/repos","events_url":"https://api.github.com/users/oberstet/events{/privacy}","received_events_url":"https://api.github.com/users/oberstet/received_events","type":"User","site_admin":false},"labels":[{"id":83625844,"url":"https://api.github.com/repos/crossbario/crossbar/labels/core","name":"core","color":"009800","default":false},{"id":60805043,"url":"https://api.github.com/repos/crossbario/crossbar/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2015-09-02T22:54:41Z","updated_at":"2017-07-07T20:49:43Z","closed_at":"2017-07-07T20:49:43Z","body":"Say you want everyone who happens to know or guess the number `0634534534` to be allowed to subscribe to `chat.channel.0634534534`, but disallow everyone from doing a prefix-based subscribe on `chat.channel.`.\n\nIn principle, this is a perfect example of why we have dynamic authorizers:\n\n``` python\n@wamp.register('com.example.authorize')\ndef custom_authorize(session, uri, action, options):\n   # your custom authorization logic to determine whether client\n   # session should be allowed to perform action on uri\n   if (action == 'publish' or (action == 'subscribe' and options.get('match', 'exact') == 'exact'))\n        and uri.startswith(u'chat.channel.'):\n      try:\n          int(uri.split('.')[2])\n          return True # allow action\n      except ValueError:\n          return False\n   else:\n      # deny action\n      return False\n```\n\nThere is only 1 catch: the `options` are currently NOT forwarded to the authorizer (the 4th argument is missing).\n\r\n\r\n<bountysource-plugin>\r\n\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26403544-dynamic-authorizers-should-get-details?utm_campaign=plugin&utm_content=tracker%2F462544&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F462544&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"}}
{"actor":{"display_login":"meejah"}}