deps: add go-playground/validator/v10 and update crypto deps

Ultraworked with Sisyphus (https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-05-31 10:54:40 +01:00
co-authored by Sisyphus
parent 0de5128201
commit 8b72c3fbef
3 changed files with 37 additions and 9 deletions
+16
View File
@@ -1,9 +1,25 @@
package validators
import (
"github.com/go-playground/validator/v10"
"reflect"
"regexp"
"strings"
)
var Validate *validator.Validate
func init() {
Validate = validator.New()
Validate.RegisterTagNameFunc(func(fld reflect.StructField) string {
name := strings.SplitN(fld.Tag.Get("json"), ",", 2)[0]
if name == "-" {
return ""
}
return name
})
}
// ID format: 12-character hexadecimal string (from gen_random_bytes(6) encoded as hex)
var validIDRegex = regexp.MustCompile(`^[0-9a-f]{12}$`)