test working
This commit is contained in:
+7
-7
@@ -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
File diff suppressed because it is too large
Load Diff
+3
-3
@@ -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"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user