{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-plug/plug/issues/698","repository_url":"https://api.github.com/repos/elixir-plug/plug","labels_url":"https://api.github.com/repos/elixir-plug/plug/issues/698/labels{/name}","comments_url":"https://api.github.com/repos/elixir-plug/plug/issues/698/comments","events_url":"https://api.github.com/repos/elixir-plug/plug/issues/698/events","html_url":"https://github.com/elixir-plug/plug/pull/698","id":316448921,"number":698,"title":"(WIP) Add a custom body reader option to Parsers","user":{"login":"ryanwinchester","id":2897340,"avatar_url":"https://avatars3.githubusercontent.com/u/2897340?v=4","gravatar_id":"","url":"https://api.github.com/users/ryanwinchester","html_url":"https://github.com/ryanwinchester","followers_url":"https://api.github.com/users/ryanwinchester/followers","following_url":"https://api.github.com/users/ryanwinchester/following{/other_user}","gists_url":"https://api.github.com/users/ryanwinchester/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanwinchester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanwinchester/subscriptions","organizations_url":"https://api.github.com/users/ryanwinchester/orgs","repos_url":"https://api.github.com/users/ryanwinchester/repos","events_url":"https://api.github.com/users/ryanwinchester/events{/privacy}","received_events_url":"https://api.github.com/users/ryanwinchester/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-04-21T01:08:00Z","updated_at":"2018-04-21T11:55:36Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/elixir-plug/plug/pulls/698","html_url":"https://github.com/elixir-plug/plug/pull/698","diff_url":"https://github.com/elixir-plug/plug/pull/698.diff","patch_url":"https://github.com/elixir-plug/plug/pull/698.patch"},"body":"Submitting a possible solution as discussed in #691, for further discussion.\r\n\r\nSince the body can only be read once, this becomes an issue for anybody who needs the raw body for whatever reason in their application.\r\n\r\nThis is a common problem and recurring theme that people run into when they need to verify their requests with HTTP Signature Verification. (See [IETF HTTP Signature Verification Draft](https://tools.ietf.org/html/draft-cavage-http-signatures-03)).\r\n\r\nThis issue effects anybody who uses webhooks to integrate with third-party services like [GitHub](https://developer.github.com/webhooks/securing/), [Stripe](https://stripe.com/docs/webhooks/signatures), [Dropbox](https://www.dropbox.com/developers/reference/webhooks), [Samsung SmartThings](https://smartthings.developer.samsung.com/develop/guides/smartapps/webhook-apps.html#HTTP-signature-verification), and many many more.\r\n\r\nBy passing in an optional read_body function, the developer can now hook in signature verifications to be used on the raw body before it is discarded.\r\n\r\nI'm opening this PR in the hopes of pushing progress on this issue. I am 100% open to completely changing the implementation, and also I will not feel snubbed if somebody opens a better PR."},"comment":{"url":"https://api.github.com/repos/elixir-plug/plug/issues/comments/383289430","html_url":"https://github.com/elixir-plug/plug/pull/698#issuecomment-383289430","issue_url":"https://api.github.com/repos/elixir-plug/plug/issues/698","id":383289430,"user":{"login":"ryanwinchester","id":2897340,"avatar_url":"https://avatars3.githubusercontent.com/u/2897340?v=4","gravatar_id":"","url":"https://api.github.com/users/ryanwinchester","html_url":"https://github.com/ryanwinchester","followers_url":"https://api.github.com/users/ryanwinchester/followers","following_url":"https://api.github.com/users/ryanwinchester/following{/other_user}","gists_url":"https://api.github.com/users/ryanwinchester/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanwinchester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanwinchester/subscriptions","organizations_url":"https://api.github.com/users/ryanwinchester/orgs","repos_url":"https://api.github.com/users/ryanwinchester/repos","events_url":"https://api.github.com/users/ryanwinchester/events{/privacy}","received_events_url":"https://api.github.com/users/ryanwinchester/received_events","type":"User","site_admin":false},"created_at":"2018-04-21T11:55:36Z","updated_at":"2018-04-21T11:55:36Z","author_association":"NONE","body":"Cool, updated. 😊\r\n\r\nMy concern now is `apply(mod, fun, [conn | args])` vs  maybe changing that to something like `apply(mod, fun, [conn | args] ++ opts)`\r\n\r\nSince we used to (and still do in the default case) pass the remaining `opts` to `Plug.Conn.read_body`, but now if we override it, it's only the args specifically supplied in the `:body_reader` MFA.\r\n\r\nDoes that matter?"}}
{"actor":{"display_login":"ryanwinchester"}}