mirror of
https://gitea.com/gitea/gitea-mirror.git
synced 2026-03-20 11:50:27 +00:00
Add validation constraints for repository creation fields (#36671)
Adds validation constraints to repository creation inputs, enforcing max-length limits for labels/license/readme and enum validation for trust model and object format. Updates both the API option struct and the web form struct to keep validation consistent.
This commit is contained in:
@@ -27,9 +27,9 @@ type CreateRepoForm struct {
|
||||
DefaultBranch string `binding:"GitRefName;MaxSize(100)"`
|
||||
AutoInit bool
|
||||
Gitignores string
|
||||
IssueLabels string
|
||||
License string
|
||||
Readme string
|
||||
IssueLabels string `binding:"MaxSize(255)"`
|
||||
License string `binding:"MaxSize(100)"`
|
||||
Readme string `binding:"MaxSize(255)"`
|
||||
Template bool
|
||||
|
||||
RepoTemplate int64
|
||||
@@ -41,7 +41,7 @@ type CreateRepoForm struct {
|
||||
Labels bool
|
||||
ProtectedBranch bool
|
||||
|
||||
ForkSingleBranch string
|
||||
ForkSingleBranch string `binding:"MaxSize(255)"`
|
||||
ObjectFormatName string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user