From a6bf28adf3db55f2464dc1f167e1f8123bb11cf3 Mon Sep 17 00:00:00 2001 From: Corey Donohoe Date: Tue, 11 Mar 2014 15:12:04 -0700 Subject: [PATCH 1/7] document headers we send to payloads --- content/v3/repos/hooks.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/content/v3/repos/hooks.md b/content/v3/repos/hooks.md index a662447946..db5871b40f 100644 --- a/content/v3/repos/hooks.md +++ b/content/v3/repos/hooks.md @@ -33,6 +33,16 @@ or the [PubSubHubbub API](#pubsubhubbub). POST /repos/:owner/:repo/hooks +### Webhook Headers + +GitHub will send along a few HTTP headers to differentiate between event types and payload identifiers. + +Name | Description +-----|-----------| +`HTTP_X_GITHUB_EVENT` | The [event type](#events) that was triggered. +`HTTP_X_GITHUB_DELIVERY` | A [guid][guid] to identify the payload and event being sent. +`HTTP_X_GITHUB_SIGNATURE` | The value of this header is computed as the HMAC hex digest of the body, using the `secret` config option as the key. + ### Parameter Name | Type | Description @@ -197,4 +207,4 @@ Name | Type | Description [hub-signature]: https://github.com/github/github-services/blob/f3bb3dd780feb6318c42b2db064ed6d481b70a1f/lib/service/http_helper.rb#L77 [pshb-secret]: http://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.3.html#authednotify [events-url]: /webhooks/#events -[ping-event-url]: /webhooks/#ping-event \ No newline at end of file +[ping-event-url]: /webhooks/#ping-event From 3f27b2740469953d8b31ce5e3cea5a728e0cb390 Mon Sep 17 00:00:00 2001 From: Corey Donohoe Date: Tue, 11 Mar 2014 16:01:47 -0700 Subject: [PATCH 2/7] link to guids --- content/v3/repos/hooks.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/v3/repos/hooks.md b/content/v3/repos/hooks.md index db5871b40f..b36447e52e 100644 --- a/content/v3/repos/hooks.md +++ b/content/v3/repos/hooks.md @@ -201,6 +201,7 @@ Name | Type | Description ``hub.secret``|`string` | 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][ruby-secret], or [the PubSubHubbub documentation][pshb-secret] for more details. +[guid]: http://en.wikipedia.org/wiki/Globally_unique_identifier [pubsub]: http://code.google.com/p/pubsubhubbub/ [post-receive]: http://help.github.com/post-receive-hooks/ [ruby-secret]: https://github.com/github/github-services/blob/14f4da01ce29bc6a02427a9fbf37b08b141e81d9/lib/services/web.rb#L47-L50 From f4ec3b8c3b0625b4660175d8ffc43afa7b6da020 Mon Sep 17 00:00:00 2001 From: Corey Donohoe Date: Tue, 11 Mar 2014 16:19:22 -0700 Subject: [PATCH 3/7] use the headers we actually send not what rails gives us --- content/v3/repos/hooks.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/v3/repos/hooks.md b/content/v3/repos/hooks.md index b36447e52e..8dc4f981c3 100644 --- a/content/v3/repos/hooks.md +++ b/content/v3/repos/hooks.md @@ -39,9 +39,9 @@ GitHub will send along a few HTTP headers to differentiate between event types a Name | Description -----|-----------| -`HTTP_X_GITHUB_EVENT` | The [event type](#events) that was triggered. -`HTTP_X_GITHUB_DELIVERY` | A [guid][guid] to identify the payload and event being sent. -`HTTP_X_GITHUB_SIGNATURE` | The value of this header is computed as the HMAC hex digest of the body, using the `secret` config option as the key. +`X-GitHub_Event` | The [event type](#events) that was triggered. +`X-GitHub_Delivery` | A [guid][guid] to identify the payload and event being sent. +`X-GitHub_Signature` | The value of this header is computed as the HMAC hex digest of the body, using the `secret` config option as the key. ### Parameter From 988cdfe45571c612a5b447f536e77c63843e2399 Mon Sep 17 00:00:00 2001 From: Corey Donohoe Date: Wed, 12 Mar 2014 12:25:25 -0700 Subject: [PATCH 4/7] stupid underscores --- content/v3/repos/hooks.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/v3/repos/hooks.md b/content/v3/repos/hooks.md index 8dc4f981c3..521a46070b 100644 --- a/content/v3/repos/hooks.md +++ b/content/v3/repos/hooks.md @@ -39,9 +39,9 @@ GitHub will send along a few HTTP headers to differentiate between event types a Name | Description -----|-----------| -`X-GitHub_Event` | The [event type](#events) that was triggered. -`X-GitHub_Delivery` | A [guid][guid] to identify the payload and event being sent. -`X-GitHub_Signature` | The value of this header is computed as the HMAC hex digest of the body, using the `secret` config option as the key. +`X-GitHub-Event` | The [event type](#events) that was triggered. +`X-GitHub-Delivery` | A [guid][guid] to identify the payload and event being sent. +`X-GitHub-Signature` | The value of this header is computed as the HMAC hex digest of the body, using the `secret` config option as the key. ### Parameter From 267b7b44ade1de8295933304d9b01778ce87480c Mon Sep 17 00:00:00 2001 From: Corey Donohoe Date: Wed, 12 Mar 2014 12:26:24 -0700 Subject: [PATCH 5/7] restructure the locations for docs --- content/v3/repos/hooks.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/content/v3/repos/hooks.md b/content/v3/repos/hooks.md index 521a46070b..dae272ed7a 100644 --- a/content/v3/repos/hooks.md +++ b/content/v3/repos/hooks.md @@ -33,16 +33,6 @@ or the [PubSubHubbub API](#pubsubhubbub). POST /repos/:owner/:repo/hooks -### Webhook Headers - -GitHub will send along a few HTTP headers to differentiate between event types and payload identifiers. - -Name | Description ------|-----------| -`X-GitHub-Event` | The [event type](#events) that was triggered. -`X-GitHub-Delivery` | A [guid][guid] to identify the payload and event being sent. -`X-GitHub-Signature` | The value of this header is computed as the HMAC hex digest of the body, using the `secret` config option as the key. - ### Parameter Name | Type | Description @@ -141,6 +131,18 @@ This will trigger a [ping event][ping-event-url] to be sent to the hook. <%= headers 204 %> +## Receiving Webhooks + +### Webhook Headers + +GitHub will send along a few HTTP headers to differentiate between event types and payload identifiers. + +Name | Description +-----|-----------| +`X-GitHub-Event` | The [event type](#events) that was triggered. +`X-GitHub-Delivery` | A [guid][guid] to identify the payload and event being sent. +`X-GitHub-Signature` | The value of this header is computed as the HMAC hex digest of the body, using the `secret` config option as the key. + ## PubSubHubbub GitHub can also serve as a [PubSubHubbub][pubsub] hub for all repositories. From 28db7aed0697717c6adec2c6708293b08b572a7f Mon Sep 17 00:00:00 2001 From: Corey Donohoe Date: Wed, 12 Mar 2014 12:30:16 -0700 Subject: [PATCH 6/7] add some content, still needs something better --- content/v3/repos/hooks.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/v3/repos/hooks.md b/content/v3/repos/hooks.md index dae272ed7a..aaed63e652 100644 --- a/content/v3/repos/hooks.md +++ b/content/v3/repos/hooks.md @@ -133,6 +133,8 @@ This will trigger a [ping event][ping-event-url] to be sent to the hook. ## Receiving Webhooks +In order for GitHub to send webhooks to your service it needs to be accessible from the internet. We highly suggest using SSL to encrypt the payloads we send to your server. + ### Webhook Headers GitHub will send along a few HTTP headers to differentiate between event types and payload identifiers. From 5985fdfb39ed766da69162734bec3161b4b52640 Mon Sep 17 00:00:00 2001 From: Corey Donohoe Date: Wed, 12 Mar 2014 12:46:56 -0700 Subject: [PATCH 7/7] thanks for the suggestions @pengwynn --- content/v3/repos/hooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/v3/repos/hooks.md b/content/v3/repos/hooks.md index aaed63e652..30bffcea51 100644 --- a/content/v3/repos/hooks.md +++ b/content/v3/repos/hooks.md @@ -133,7 +133,7 @@ This will trigger a [ping event][ping-event-url] to be sent to the hook. ## Receiving Webhooks -In order for GitHub to send webhooks to your service it needs to be accessible from the internet. We highly suggest using SSL to encrypt the payloads we send to your server. +In order for GitHub to send Webhook payloads to your service, your server needs to be accessible from the Internet. We also highly suggest using SSL so that we can send encrypted payloads over HTTPS. ### Webhook Headers pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy