aboutsummaryrefslogtreecommitdiffstats
path: root/services/forms
diff options
context:
space:
mode:
authorDr. Tobias Quathamer <toddy15@users.noreply.github.com>2022-01-23 14:46:30 +0100
committerGitHub <noreply@github.com>2022-01-23 21:46:30 +0800
commit3349fd8f7901d9a04769dff71d86fb67374e9395 (patch)
treedc0fecab704696b3106761e9feb41b8670f03fd4 /services/forms
parent87141b908d4a03ce27af3ce042dc417da925b84f (diff)
downloadgitea-3349fd8f7901d9a04769dff71d86fb67374e9395.tar.gz
gitea-3349fd8f7901d9a04769dff71d86fb67374e9395.zip
Add packagist webhook (#18224)
Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'services/forms')
-rw-r--r--services/forms/repo_form.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/services/forms/repo_form.go b/services/forms/repo_form.go
index 19b5a37664..e6bd088da4 100644
--- a/services/forms/repo_form.go
+++ b/services/forms/repo_form.go
@@ -396,6 +396,20 @@ func (f *NewWechatWorkHookForm) Validate(req *http.Request, errs binding.Errors)
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
}
+// NewPackagistHookForm form for creating packagist hook
+type NewPackagistHookForm struct {
+ Username string `binding:"Required"`
+ APIToken string `binding:"Required"`
+ PackageURL string `binding:"Required;ValidUrl"`
+ WebhookForm
+}
+
+// Validate validates the fields
+func (f *NewPackagistHookForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
+ ctx := context.GetContext(req)
+ return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
+}
+
// .___
// | | ______ ________ __ ____
// | |/ ___// ___/ | \_/ __ \