mirror of
https://github.com/acepanel/panel.git
synced 2026-02-06 13:37:13 +08:00
feat(证书管理): 支持自动续签
This commit is contained in:
@@ -6,10 +6,11 @@ import (
|
||||
)
|
||||
|
||||
type CertAdd struct {
|
||||
Type string `form:"type" json:"type"`
|
||||
Domains []string `form:"domains" json:"domains"`
|
||||
UserID uint `form:"user_id" json:"user_id"`
|
||||
DNSID *uint `form:"dns_id" json:"dns_id"`
|
||||
Type string `form:"type" json:"type"`
|
||||
Domains []string `form:"domains" json:"domains"`
|
||||
AutoRenew bool `form:"auto_renew" json:"auto_renew"`
|
||||
UserID uint `form:"user_id" json:"user_id"`
|
||||
DNSID *uint `form:"dns_id" json:"dns_id"`
|
||||
}
|
||||
|
||||
func (r *CertAdd) Authorize(ctx http.Context) error {
|
||||
@@ -18,20 +19,23 @@ func (r *CertAdd) Authorize(ctx http.Context) error {
|
||||
|
||||
func (r *CertAdd) Rules(ctx http.Context) map[string]string {
|
||||
return map[string]string{
|
||||
"type": "required|in:P256,P384,2048,4096",
|
||||
"domains": "required|array",
|
||||
"user_id": "required|exists:cert_users,id",
|
||||
"type": "required|in:P256,P384,2048,4096",
|
||||
"domains": "required|array",
|
||||
"auto_renew": "required|bool",
|
||||
"user_id": "required|exists:cert_users,id",
|
||||
}
|
||||
}
|
||||
|
||||
func (r *CertAdd) Messages(ctx http.Context) map[string]string {
|
||||
return map[string]string{
|
||||
"type.required": "类型不能为空",
|
||||
"type.in": "类型必须为 P256, P384, 2048, 4096 中的一个",
|
||||
"domains.required": "域名不能为空",
|
||||
"domains.slice": "域名必须为数组",
|
||||
"user_id.required": "ACME 用户 ID 不能为空",
|
||||
"user_id.exists": "ACME 用户 ID 不存在",
|
||||
"type.required": "类型不能为空",
|
||||
"type.in": "类型必须为 P256, P384, 2048, 4096 中的一个",
|
||||
"domains.required": "域名不能为空",
|
||||
"domains.array": "域名必须为数组",
|
||||
"auto_renew.required": "自动续签不能为空",
|
||||
"auto_renew.bool": "自动续签必须为布尔值",
|
||||
"user_id.required": "ACME 用户 ID 不能为空",
|
||||
"user_id.exists": "ACME 用户 ID 不存在",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user