mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-06 04:09:40 -06:00
chore(deps): bump github.com/go-playground/validator/v10
Bumps [github.com/go-playground/validator/v10](https://github.com/go-playground/validator) from 10.22.1 to 10.23.0. - [Release notes](https://github.com/go-playground/validator/releases) - [Commits](https://github.com/go-playground/validator/compare/v10.22.1...v10.23.0) --- updated-dependencies: - dependency-name: github.com/go-playground/validator/v10 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
2
vendor/github.com/go-playground/validator/v10/README.md
generated
vendored
2
vendor/github.com/go-playground/validator/v10/README.md
generated
vendored
@@ -1,7 +1,7 @@
|
||||
Package validator
|
||||
=================
|
||||
<img align="right" src="logo.png">[](https://gitter.im/go-playground/validator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||

|
||||

|
||||
[](https://travis-ci.org/go-playground/validator)
|
||||
[](https://coveralls.io/github/go-playground/validator?branch=master)
|
||||
[](https://goreportcard.com/report/github.com/go-playground/validator)
|
||||
|
||||
26
vendor/github.com/go-playground/validator/v10/baked_in.go
generated
vendored
26
vendor/github.com/go-playground/validator/v10/baked_in.go
generated
vendored
@@ -205,6 +205,7 @@ var (
|
||||
"fqdn": isFQDN,
|
||||
"unique": isUnique,
|
||||
"oneof": isOneOf,
|
||||
"oneofci": isOneOfCI,
|
||||
"html": isHTML,
|
||||
"html_encoded": isHTMLEncoded,
|
||||
"url_encoded": isURLEncoded,
|
||||
@@ -213,6 +214,7 @@ var (
|
||||
"json": isJSON,
|
||||
"jwt": isJWT,
|
||||
"hostname_port": isHostnamePort,
|
||||
"port": isPort,
|
||||
"lowercase": isLowercase,
|
||||
"uppercase": isUppercase,
|
||||
"datetime": isDatetime,
|
||||
@@ -299,6 +301,23 @@ func isOneOf(fl FieldLevel) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// isOneOfCI is the validation function for validating if the current field's value is one of the provided string values (case insensitive).
|
||||
func isOneOfCI(fl FieldLevel) bool {
|
||||
vals := parseOneOfParam2(fl.Param())
|
||||
field := fl.Field()
|
||||
|
||||
if field.Kind() != reflect.String {
|
||||
panic(fmt.Sprintf("Bad field type %T", field.Interface()))
|
||||
}
|
||||
v := field.String()
|
||||
for _, val := range vals {
|
||||
if strings.EqualFold(val, v) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// isUnique is the validation function for validating if each array|slice|map value is unique
|
||||
func isUnique(fl FieldLevel) bool {
|
||||
field := fl.Field()
|
||||
@@ -2711,6 +2730,13 @@ func isHostnamePort(fl FieldLevel) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// IsPort validates if the current field's value represents a valid port
|
||||
func isPort(fl FieldLevel) bool {
|
||||
val := fl.Field().Uint()
|
||||
|
||||
return val >= 1 && val <= 65535
|
||||
}
|
||||
|
||||
// isLowercase is the validation function for validating if the current field's value is a lowercase string.
|
||||
func isLowercase(fl FieldLevel) bool {
|
||||
field := fl.Field()
|
||||
|
||||
9
vendor/github.com/go-playground/validator/v10/doc.go
generated
vendored
9
vendor/github.com/go-playground/validator/v10/doc.go
generated
vendored
@@ -489,12 +489,19 @@ For strings, ints, and uints, oneof will ensure that the value
|
||||
is one of the values in the parameter. The parameter should be
|
||||
a list of values separated by whitespace. Values may be
|
||||
strings or numbers. To match strings with spaces in them, include
|
||||
the target string between single quotes.
|
||||
the target string between single quotes. Kind of like an 'enum'.
|
||||
|
||||
Usage: oneof=red green
|
||||
oneof='red green' 'blue yellow'
|
||||
oneof=5 7 9
|
||||
|
||||
# One Of Case Insensitive
|
||||
|
||||
Works the same as oneof but is case insensitive and therefore only accepts strings.
|
||||
|
||||
Usage: oneofci=red green
|
||||
oneofci='red green' 'blue yellow'
|
||||
|
||||
# Greater Than
|
||||
|
||||
For numbers, this will ensure that the value is greater than the
|
||||
|
||||
2
vendor/github.com/go-playground/validator/v10/regexes.go
generated
vendored
2
vendor/github.com/go-playground/validator/v10/regexes.go
generated
vendored
@@ -73,7 +73,7 @@ const (
|
||||
cveRegexString = `^CVE-(1999|2\d{3})-(0[^0]\d{2}|0\d[^0]\d{1}|0\d{2}[^0]|[1-9]{1}\d{3,})$` // CVE Format Id https://cve.mitre.org/cve/identifiers/syntaxchange.html
|
||||
mongodbIdRegexString = "^[a-f\\d]{24}$"
|
||||
mongodbConnStringRegexString = "^mongodb(\\+srv)?:\\/\\/(([a-zA-Z\\d]+):([a-zA-Z\\d$:\\/?#\\[\\]@]+)@)?(([a-z\\d.-]+)(:[\\d]+)?)((,(([a-z\\d.-]+)(:(\\d+))?))*)?(\\/[a-zA-Z-_]{1,64})?(\\?(([a-zA-Z]+)=([a-zA-Z\\d]+))(&(([a-zA-Z\\d]+)=([a-zA-Z\\d]+))?)*)?$"
|
||||
cronRegexString = `(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\d+(ns|us|µs|ms|s|m|h))+)|((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})`
|
||||
cronRegexString = `(@(annually|yearly|monthly|weekly|daily|hourly|reboot))|(@every (\d+(ns|us|µs|ms|s|m|h))+)|((((\d+,)+\d+|((\*|\d+)(\/|-)\d+)|\d+|\*) ?){5,7})`
|
||||
spicedbIDRegexString = `^(([a-zA-Z0-9/_|\-=+]{1,})|\*)$`
|
||||
spicedbPermissionRegexString = "^([a-z][a-z0-9_]{1,62}[a-z0-9])?$"
|
||||
spicedbTypeRegexString = "^([a-z][a-z0-9_]{1,61}[a-z0-9]/)?[a-z][a-z0-9_]{1,62}[a-z0-9]$"
|
||||
|
||||
Reference in New Issue
Block a user