octokit/octokit.rb — pull request #333 by elskwid (2013-11-05 04:34:23+00:00)
Title: Add secret support to PubSubHubbub subscribe

This pull request adds support for the shared secret when performing a PubSubHubbub subscribe action by adding `secret` to both the `PubSubHubbub#subscribe` and `PubSubHubbub#subscribe_service_hook` methods.

The secret gets sent to the API as `hub.secret` and is described in the [PubSubHubbub documentation](http://developer.github.com/v3/repos/hooks/#pubsubhubbub) as:

> A shared secret key that generates a SHA1 HMAC of the outgoing body content. You can verify a push came from GitHub by comparing the raw request body with the contents of the X-Hub-Signature header. You can see our Ruby implementation, or the PubSubHubbub documentation for more details.

*Questions*

* How do you feel about the optional parameter in `#subscribe_service_hook`? The parameter is list getting a little long (4) but it seemed like it might be okay given that `service_arguments` is almost always used when using this method.
* Should there be tests for the optional nature of the `secret` param? I didn't want to copy entire expectations as that doesn't seem the style in Octokit. If you have something you'd like to see tested, please let me know.
* Do the cassettes look okay? As mentioned in #327, I removed the existing cassettes, used a URL I have access to, and run the spec suite.