* [Feature] Added DevContainer Public Key Login, and deprecated SSH Password login * [Improvement] Anti-spam * GET /api/devstar_ssh/key_pair/new_temp: SSH Keypair Gen * fix HTTP 500 error while deleting Repo * updated DevContainer WorkDIR * updated warn msg
21 lines
765 B
Go
21 lines
765 B
Go
package forms
|
|
|
|
import (
|
|
"code.gitea.io/gitea/modules/web/middleware"
|
|
"code.gitea.io/gitea/services/context"
|
|
"gitea.com/go-chi/binding"
|
|
"net/http"
|
|
)
|
|
|
|
// CreateRepoDevcontainerForm 用户使用 API 创建仓库 DevContainer POST 表单数据绑定与校验规则
|
|
type CreateRepoDevcontainerForm struct {
|
|
RepoId string `json:"repoId" binding:"Required;MinSize(1);MaxSize(19);PositiveBase10IntegerNumberRule"`
|
|
SSHPublicKeyList []string `json:"sshPublicKeyList"`
|
|
}
|
|
|
|
// Validate 用户使用 API 创建仓库 DevContainer POST 表单数据校验器
|
|
func (f *CreateRepoDevcontainerForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
|
|
ctx := context.GetValidateContext(req)
|
|
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
|
|
}
|