{"action":"created","issue":{"url":"https://api.github.com/repos/Shopify/shopify_app/issues/177","labels_url":"https://api.github.com/repos/Shopify/shopify_app/issues/177/labels{/name}","comments_url":"https://api.github.com/repos/Shopify/shopify_app/issues/177/comments","events_url":"https://api.github.com/repos/Shopify/shopify_app/issues/177/events","html_url":"https://github.com/Shopify/shopify_app/pull/177","id":114877777,"number":177,"title":"add a webhooks manager to the framework","user":{"login":"kevinhughes27","id":1965489,"avatar_url":"https://avatars.githubusercontent.com/u/1965489?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinhughes27","html_url":"https://github.com/kevinhughes27","followers_url":"https://api.github.com/users/kevinhughes27/followers","following_url":"https://api.github.com/users/kevinhughes27/following{/other_user}","gists_url":"https://api.github.com/users/kevinhughes27/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinhughes27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinhughes27/subscriptions","organizations_url":"https://api.github.com/users/kevinhughes27/orgs","repos_url":"https://api.github.com/users/kevinhughes27/repos","events_url":"https://api.github.com/users/kevinhughes27/events{/privacy}","received_events_url":"https://api.github.com/users/kevinhughes27/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Shopify/shopify_app/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-03T18:18:49Z","updated_at":"2015-11-03T20:09:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Shopify/shopify_app/pulls/177","html_url":"https://github.com/Shopify/shopify_app/pull/177","diff_url":"https://github.com/Shopify/shopify_app/pull/177.diff","patch_url":"https://github.com/Shopify/shopify_app/pull/177.patch"},"body":"This PR brings in the WebhooksManager that has made its way into most of our apps that require webhooks. It allows developers to say which webhooks their app needs in the ShopifyApp initializer and then the framework takes care of the rest. In the callback method when the shop is being installed or logged in we queue the webhooks manager to make sure all the required hooks are in place. This does require ActiveJob to be configured for the app to work properly since we wouldn't want to block waiting to talk to shopify again after the callback.\r\n\r\n* This is totally optional and won't have any affect on existing apps unless they opt in and use this class\r\n* If an app is using a background queue directly they can still use this. for example Sidekiq can live happily next to ActiveJob.\r\n\r\nfor review:\r\n@t6d @christhomson "},"comment":{"url":"https://api.github.com/repos/Shopify/shopify_app/issues/comments/153472794","html_url":"https://github.com/Shopify/shopify_app/pull/177#issuecomment-153472794","issue_url":"https://api.github.com/repos/Shopify/shopify_app/issues/177","id":153472794,"user":{"login":"kevinhughes27","id":1965489,"avatar_url":"https://avatars.githubusercontent.com/u/1965489?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinhughes27","html_url":"https://github.com/kevinhughes27","followers_url":"https://api.github.com/users/kevinhughes27/followers","following_url":"https://api.github.com/users/kevinhughes27/following{/other_user}","gists_url":"https://api.github.com/users/kevinhughes27/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinhughes27/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinhughes27/subscriptions","organizations_url":"https://api.github.com/users/kevinhughes27/orgs","repos_url":"https://api.github.com/users/kevinhughes27/repos","events_url":"https://api.github.com/users/kevinhughes27/events{/privacy}","received_events_url":"https://api.github.com/users/kevinhughes27/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T20:09:01Z","updated_at":"2015-11-03T20:09:01Z","body":"I added another module to this PR - a WebhooksController module that does a couple of things - it disables the `verify_authenticity_token` filter and adds a before action to verify the shopify webhook. It also adds a shop_domain helper method that grabs this info from the header\r\n\r\nI was originally waiting to add this because I wanted to looked into updating the SessionStorage mixin to use the shopify_domain rather than just any uid but then I realized that this wasn't neccessary for the webhooks controller mixin. This is because I don't actually want to add a `with_shopify_session` type method to a webhook receiving controller since this would encouage responding to webhooks inline (a bad idea when dealing with Shopify) rather than queueing something to process them and responding :ok: immediately.\r\n\r\ncan I get another look at this!"}}