diff options
| author | Niall Sheridan <nsheridan@gmail.com> | 2017-04-10 21:18:42 +0100 | 
|---|---|---|
| committer | Niall Sheridan <nsheridan@gmail.com> | 2017-04-10 21:38:33 +0100 | 
| commit | 30802e07b2d84fbc213b490d3402707dffe60096 (patch) | |
| tree | 934aecb8f3582325dfd1aa6652193adac87d00db /vendor/github.com/google/go-github/github/messages.go | |
| parent | da7638dc112c4c106e8929601b642d2ca4596cba (diff) | |
update dependencies
Diffstat (limited to 'vendor/github.com/google/go-github/github/messages.go')
| -rw-r--r-- | vendor/github.com/google/go-github/github/messages.go | 13 | 
1 files changed, 8 insertions, 5 deletions
diff --git a/vendor/github.com/google/go-github/github/messages.go b/vendor/github.com/google/go-github/github/messages.go index 5f67ba5..a7ec65f 100644 --- a/vendor/github.com/google/go-github/github/messages.go +++ b/vendor/github.com/google/go-github/github/messages.go @@ -4,7 +4,7 @@  // license that can be found in the LICENSE file.  // This file provides functions for validating payloads from GitHub Webhooks. -// GitHub docs: https://developer.github.com/webhooks/securing/#validating-payloads-from-github +// GitHub API docs: https://developer.github.com/webhooks/securing/#validating-payloads-from-github  package github @@ -31,7 +31,7 @@ const (  	sha512Prefix = "sha512"  	// signatureHeader is the GitHub header key used to pass the HMAC hexdigest.  	signatureHeader = "X-Hub-Signature" -	// eventTypeHeader is the Github header key used to pass the event type. +	// eventTypeHeader is the GitHub header key used to pass the event type.  	eventTypeHeader = "X-Github-Event"  ) @@ -56,6 +56,9 @@ var (  		"organization":                          "OrganizationEvent",  		"page_build":                            "PageBuildEvent",  		"ping":                                  "PingEvent", +		"project":                               "ProjectEvent", +		"project_card":                          "ProjectCardEvent", +		"project_column":                        "ProjectColumnEvent",  		"public":                                "PublicEvent",  		"pull_request_review":                   "PullRequestReviewEvent",  		"pull_request_review_comment":           "PullRequestReviewCommentEvent", @@ -143,7 +146,7 @@ func ValidatePayload(r *http.Request, secretKey []byte) (payload []byte, err err  // payload is the JSON payload sent by GitHub Webhooks.  // secretKey is the GitHub Webhook secret message.  // -// GitHub docs: https://developer.github.com/webhooks/securing/#validating-payloads-from-github +// GitHub API docs: https://developer.github.com/webhooks/securing/#validating-payloads-from-github  func validateSignature(signature string, payload, secretKey []byte) error {  	messageMAC, hashFunc, err := messageMAC(signature)  	if err != nil { @@ -162,7 +165,7 @@ func WebHookType(r *http.Request) string {  // ParseWebHook parses the event payload. For recognized event types, a  // value of the corresponding struct type will be returned (as returned -// by Event.Payload()). An error will be returned for unrecognized event +// by Event.ParsePayload()). An error will be returned for unrecognized event  // types.  //  // Example usage: @@ -191,5 +194,5 @@ func ParseWebHook(messageType string, payload []byte) (interface{}, error) {  		Type:       &eventType,  		RawPayload: (*json.RawMessage)(&payload),  	} -	return event.Payload(), nil +	return event.ParsePayload()  }  | 
