mirror of
https://github.com/acepanel/panel.git
synced 2026-02-05 04:37:17 +08:00
43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
package requests
|
|
|
|
import (
|
|
"github.com/goravel/framework/contracts/http"
|
|
"github.com/goravel/framework/contracts/validation"
|
|
)
|
|
|
|
type UserUpdate struct {
|
|
ID uint `form:"id" json:"id"`
|
|
CA string `form:"ca" json:"ca"`
|
|
Email string `form:"email" json:"email"`
|
|
Kid string `form:"kid" json:"kid"`
|
|
HmacEncoded string `form:"hmac_encoded" json:"hmac_encoded"`
|
|
KeyType string `form:"key_type" json:"key_type"`
|
|
}
|
|
|
|
func (r *UserUpdate) Authorize(ctx http.Context) error {
|
|
return nil
|
|
}
|
|
|
|
func (r *UserUpdate) Rules(ctx http.Context) map[string]string {
|
|
return map[string]string{
|
|
"id": "required|uint|min:1|exists:cert_users,id",
|
|
"ca": "required|in:letsencrypt,zerossl,sslcom,google,buypass",
|
|
"email": "required|email",
|
|
"kid": "required_unless:ca,letsencrypt,buypass",
|
|
"hmac_encoded": "required_unless:ca,letsencrypt,buypass",
|
|
"key_type": "required|in:P256,P384,2048,4096",
|
|
}
|
|
}
|
|
|
|
func (r *UserUpdate) Messages(ctx http.Context) map[string]string {
|
|
return map[string]string{}
|
|
}
|
|
|
|
func (r *UserUpdate) Attributes(ctx http.Context) map[string]string {
|
|
return map[string]string{}
|
|
}
|
|
|
|
func (r *UserUpdate) PrepareForValidation(ctx http.Context, data validation.Data) error {
|
|
return nil
|
|
}
|