{"action":"created","issue":{"url":"https://api.github.com/repos/LocativeHQ/cloud-app/issues/31","repository_url":"https://api.github.com/repos/LocativeHQ/cloud-app","labels_url":"https://api.github.com/repos/LocativeHQ/cloud-app/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/LocativeHQ/cloud-app/issues/31/comments","events_url":"https://api.github.com/repos/LocativeHQ/cloud-app/issues/31/events","html_url":"https://github.com/LocativeHQ/cloud-app/issues/31","id":138969917,"number":31,"title":"Global webhook url for push events","user":{"login":"francisdb","id":161305,"avatar_url":"https://avatars.githubusercontent.com/u/161305?v=3","gravatar_id":"","url":"https://api.github.com/users/francisdb","html_url":"https://github.com/francisdb","followers_url":"https://api.github.com/users/francisdb/followers","following_url":"https://api.github.com/users/francisdb/following{/other_user}","gists_url":"https://api.github.com/users/francisdb/gists{/gist_id}","starred_url":"https://api.github.com/users/francisdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francisdb/subscriptions","organizations_url":"https://api.github.com/users/francisdb/orgs","repos_url":"https://api.github.com/users/francisdb/repos","events_url":"https://api.github.com/users/francisdb/events{/privacy}","received_events_url":"https://api.github.com/users/francisdb/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/LocativeHQ/cloud-app/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"kimar","id":126418,"avatar_url":"https://avatars.githubusercontent.com/u/126418?v=3","gravatar_id":"","url":"https://api.github.com/users/kimar","html_url":"https://github.com/kimar","followers_url":"https://api.github.com/users/kimar/followers","following_url":"https://api.github.com/users/kimar/following{/other_user}","gists_url":"https://api.github.com/users/kimar/gists{/gist_id}","starred_url":"https://api.github.com/users/kimar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kimar/subscriptions","organizations_url":"https://api.github.com/users/kimar/orgs","repos_url":"https://api.github.com/users/kimar/repos","events_url":"https://api.github.com/users/kimar/events{/privacy}","received_events_url":"https://api.github.com/users/kimar/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-03-07T12:45:05Z","updated_at":"2016-04-08T09:16:42Z","closed_at":null,"body":"For apps integrating locative, currently there are 2 options to get push events for your users.\r\n\r\n - You set up a mqtt connection per user\r\n - You set up a socket.io connection per user\r\n\r\nFor each of these you need the username and password of the user, which you in fact don't want to store for security reasons. (that's the whole purpose of using OAUth)\r\nThe managing of these subscriptions per user can be tedious and does not scale\r\n\r\nI suggest a third one, configuring a single callback url on app level that is triggered for all the users linked to the app. This involves some kind of 'Automatic subscription' when a new user is linked to the app.\r\nThis app-global `webhook url` is set up when creating the OAuth app.\r\n\r\neg:\r\nhttps://dev.netatmo.com/doc/webhooks\r\n\r\nImplementation could look like this:\r\n\r\n* server receives fencelog from locative app\r\n* server checks if user has oauth apps connected\r\n* for each of the apps check if there is a global callback url set up\r\n* if set do a post to the callback url with as body the fencelog (make sure there is a way to validate that the request is actually coming from locative, see netatmo example)\r\n\r\n@kimar what do you think about this?\r\n"},"comment":{"url":"https://api.github.com/repos/LocativeHQ/cloud-app/issues/comments/207342878","html_url":"https://github.com/LocativeHQ/cloud-app/issues/31#issuecomment-207342878","issue_url":"https://api.github.com/repos/LocativeHQ/cloud-app/issues/31","id":207342878,"user":{"login":"francisdb","id":161305,"avatar_url":"https://avatars.githubusercontent.com/u/161305?v=3","gravatar_id":"","url":"https://api.github.com/users/francisdb","html_url":"https://github.com/francisdb","followers_url":"https://api.github.com/users/francisdb/followers","following_url":"https://api.github.com/users/francisdb/following{/other_user}","gists_url":"https://api.github.com/users/francisdb/gists{/gist_id}","starred_url":"https://api.github.com/users/francisdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/francisdb/subscriptions","organizations_url":"https://api.github.com/users/francisdb/orgs","repos_url":"https://api.github.com/users/francisdb/repos","events_url":"https://api.github.com/users/francisdb/events{/privacy}","received_events_url":"https://api.github.com/users/francisdb/received_events","type":"User","site_admin":false},"created_at":"2016-04-08T09:16:42Z","updated_at":"2016-04-08T09:16:42Z","body":"@kimar I'm going to assign one of our interns on this"}}