fix: validate input for default_{merge,update}_style (#7395)
- Add `binding:"In(...)"` to the `default_merge_style` and `default_update_style` fields to only accept recognized merge and update styles. - Resolves https://codeberg.org/forgejo/forgejo/issues/7389 - Added integration test for the API (`binding` works in the exact same way for the API and web routes). Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7395 Reviewed-by: 0ko <0ko@noreply.codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
parent
114cd6d4b6
commit
4b56c05e65
5 changed files with 248 additions and 216 deletions
2
templates/swagger/v1_json.tmpl
generated
2
templates/swagger/v1_json.tmpl
generated
|
@ -23762,7 +23762,7 @@
|
|||
"x-go-name": "DefaultDeleteBranchAfterMerge"
|
||||
},
|
||||
"default_merge_style": {
|
||||
"description": "set to a merge style to be used by this repository: \"merge\", \"rebase\", \"rebase-merge\", \"squash\", or \"fast-forward-only\".",
|
||||
"description": "set to a merge style to be used by this repository: \"merge\", \"rebase\", \"rebase-merge\", \"squash\", \"fast-forward-only\", \"manually-merged\", or \"rebase-update-only\".",
|
||||
"type": "string",
|
||||
"x-go-name": "DefaultMergeStyle"
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue