diff options
author | Rémy Boulanouar <rboulanouar@gmail.com> | 2017-05-29 09:17:15 +0200 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-05-29 02:17:15 -0500 |
commit | e0c6ab2d44d17b72a7ea6f8b4c829c42baeaae3b (patch) | |
tree | 44e906f5ac3a322832e5d9a55ea59bf613d36b24 /modules/auth | |
parent | e67ece26f0b97437200998b9b153b4c3a87a65aa (diff) | |
download | gitea-e0c6ab2d44d17b72a7ea6f8b4c829c42baeaae3b.tar.gz gitea-e0c6ab2d44d17b72a7ea6f8b4c829c42baeaae3b.zip |
Add Gitea Webhook (#1755)
* Replace Gogs by Gitea
* Fix missing changes
* Create Gitea webhook and put Gogs webhook apart.
Diffstat (limited to 'modules/auth')
-rw-r--r-- | modules/auth/repo_form.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index c56e76c871..58dcf468ef 100644 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -1,4 +1,5 @@ // Copyright 2014 The Gogs Authors. All rights reserved. +// Copyright 2017 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. @@ -154,6 +155,19 @@ func (f *NewWebhookForm) Validate(ctx *macaron.Context, errs binding.Errors) bin return validate(errs, ctx.Data, f, ctx.Locale) } +// NewGogshookForm form for creating gogs hook +type NewGogshookForm struct { + PayloadURL string `binding:"Required;ValidUrl"` + ContentType int `binding:"Required"` + Secret string + WebhookForm +} + +// Validate validates the fields +func (f *NewGogshookForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { + return validate(errs, ctx.Data, f, ctx.Locale) +} + // NewSlackHookForm form for creating slack hook type NewSlackHookForm struct { PayloadURL string `binding:"Required;ValidUrl"` |