test working

This commit is contained in:
Dean Karn
2018-07-31 08:46:17 -07:00
parent 1d0289a3ae
commit fe5cf5a911
6 changed files with 4154 additions and 3903 deletions
+7 -7
View File
@@ -11,12 +11,12 @@ import (
// parse errors
var (
ErrEventNotSpecifiedToParse = errors.New("no Event specified to parse")
ErrInvalidHTTPMethod = errors.New("invalid HTTP Method")
ErrMissingGitLabEventHeader = errors.New("missing X-Gitlab-Event Header")
ErrMissingGitLabTokenHeader = errors.New("missing X-Gitlab-Token Header")
ErrEventNotFound = errors.New("event not defined to be parsed")
ErrParsingPayload = errors.New("error parsing payload")
ErrEventNotSpecifiedToParse = errors.New("no Event specified to parse")
ErrInvalidHTTPMethod = errors.New("invalid HTTP Method")
ErrMissingGitLabEventHeader = errors.New("missing X-Gitlab-Event Header")
ErrGitLabTokenVerificationFailed = errors.New("X-Gitlab-Token validation failed")
ErrEventNotFound = errors.New("event not defined to be parsed")
ErrParsingPayload = errors.New("error parsing payload")
// ErrHMACVerificationFailed = errors.New("HMAC verification failed")
)
@@ -111,7 +111,7 @@ func (hook Webhook) Parse(r *http.Request, events ...Event) (interface{}, error)
if len(hook.secret) > 0 {
signature := r.Header.Get("X-Gitlab-Token")
if signature != hook.secret {
return nil, ErrMissingGitLabTokenHeader
return nil, ErrGitLabTokenVerificationFailed
}
}
+1078 -967
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -427,14 +427,14 @@ type LabelChanges struct {
// Label contains all of the GitLab label information
type Label struct {
Id int64 `json:"id"`
ID int64 `json:"id"`
Title string `json:"title"`
Color string `json:"color"`
ProjectId int64 `json:"project_id"`
ProjectID int64 `json:"project_id"`
CreatedAt customTime `json:"created_at"`
UpdatedAt customTime `json:"updated_at"`
Template bool `json:"template"`
Description string `json:"description"`
Type string `json:"type"`
GroupId int64 `json:"group_id"`
GroupID int64 `json:"group_id"`
}