feat(hook): add support for authorization_header in webhooks (#633)
fixes #632 Co-authored-by: Jörg Markert <venc0r@live.com> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/633 Reviewed-by: John Olheiser <john+gitea@jolheiser.com> Co-authored-by: venc0r <venc0r@noreply.gitea.com> Co-committed-by: venc0r <venc0r@noreply.gitea.com>
This commit is contained in:
parent
0141b499c9
commit
d5e174e5b5
1 changed files with 11 additions and 9 deletions
|
@ -95,11 +95,12 @@ func (c *Client) GetRepoHook(user, repo string, id int64) (*Hook, *Response, err
|
||||||
|
|
||||||
// CreateHookOption options when create a hook
|
// CreateHookOption options when create a hook
|
||||||
type CreateHookOption struct {
|
type CreateHookOption struct {
|
||||||
Type HookType `json:"type"`
|
Type HookType `json:"type"`
|
||||||
Config map[string]string `json:"config"`
|
Config map[string]string `json:"config"`
|
||||||
Events []string `json:"events"`
|
Events []string `json:"events"`
|
||||||
BranchFilter string `json:"branch_filter"`
|
BranchFilter string `json:"branch_filter"`
|
||||||
Active bool `json:"active"`
|
Active bool `json:"active"`
|
||||||
|
AuthorizationHeader string `json:"authorization_header"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate the CreateHookOption struct
|
// Validate the CreateHookOption struct
|
||||||
|
@ -143,10 +144,11 @@ func (c *Client) CreateRepoHook(user, repo string, opt CreateHookOption) (*Hook,
|
||||||
|
|
||||||
// EditHookOption options when modify one hook
|
// EditHookOption options when modify one hook
|
||||||
type EditHookOption struct {
|
type EditHookOption struct {
|
||||||
Config map[string]string `json:"config"`
|
Config map[string]string `json:"config"`
|
||||||
Events []string `json:"events"`
|
Events []string `json:"events"`
|
||||||
BranchFilter string `json:"branch_filter"`
|
BranchFilter string `json:"branch_filter"`
|
||||||
Active *bool `json:"active"`
|
Active *bool `json:"active"`
|
||||||
|
AuthorizationHeader string `json:"authorization_header"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EditOrgHook modify one hook of an organization, with hook id and options
|
// EditOrgHook modify one hook of an organization, with hook id and options
|
||||||
|
|
Loading…
Reference in a new issue