lowered the max field id and name length limit to 100
This commit is contained in:
parent
0af8f3cc66
commit
db57572a54
|
@ -12,7 +12,7 @@
|
||||||
- Added default max limits for the expressions count and length of the search filter and sort params.
|
- Added default max limits for the expressions count and length of the search filter and sort params.
|
||||||
_This is just an extra measure mostly for the case when the filter and sort parameters are resolved outside of the request context since the request size limits won't apply._
|
_This is just an extra measure mostly for the case when the filter and sort parameters are resolved outside of the request context since the request size limits won't apply._
|
||||||
|
|
||||||
- Other minor changes (better error in case of duplicated rate limit rule, fixed typos, updated Go deps, etc.).
|
- Other minor changes (better error in case of duplicated rate limit rule, fixed typos, changed field id and name length validator to max 100, updated Go deps, etc.).
|
||||||
|
|
||||||
|
|
||||||
## v0.23.0-rc12
|
## v0.23.0-rc12
|
||||||
|
|
|
@ -191,7 +191,7 @@ func DefaultFieldIdValidationRule(value any) error {
|
||||||
|
|
||||||
rules := []validation.Rule{
|
rules := []validation.Rule{
|
||||||
validation.Required,
|
validation.Required,
|
||||||
validation.Length(1, 255),
|
validation.Length(1, 100),
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, r := range rules {
|
for _, r := range rules {
|
||||||
|
@ -217,7 +217,7 @@ func DefaultFieldNameValidationRule(value any) error {
|
||||||
|
|
||||||
rules := []validation.Rule{
|
rules := []validation.Rule{
|
||||||
validation.Required,
|
validation.Required,
|
||||||
validation.Length(1, 255),
|
validation.Length(1, 100),
|
||||||
validation.Match(fieldNameRegex),
|
validation.Match(fieldNameRegex),
|
||||||
validation.NotIn(excludeNames...),
|
validation.NotIn(excludeNames...),
|
||||||
validation.By(checkForVia),
|
validation.By(checkForVia),
|
||||||
|
|
|
@ -91,7 +91,7 @@ func testDefaultFieldIdValidation(t *testing.T, fieldType string) {
|
||||||
"invalid length",
|
"invalid length",
|
||||||
func() core.Field {
|
func() core.Field {
|
||||||
f := core.Fields[fieldType]()
|
f := core.Fields[fieldType]()
|
||||||
f.SetId(strings.Repeat("a", 256))
|
f.SetId(strings.Repeat("a", 101))
|
||||||
return f
|
return f
|
||||||
},
|
},
|
||||||
true,
|
true,
|
||||||
|
@ -100,7 +100,7 @@ func testDefaultFieldIdValidation(t *testing.T, fieldType string) {
|
||||||
"valid length",
|
"valid length",
|
||||||
func() core.Field {
|
func() core.Field {
|
||||||
f := core.Fields[fieldType]()
|
f := core.Fields[fieldType]()
|
||||||
f.SetId(strings.Repeat("a", 255))
|
f.SetId(strings.Repeat("a", 100))
|
||||||
return f
|
return f
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
|
@ -142,7 +142,7 @@ func testDefaultFieldNameValidation(t *testing.T, fieldType string) {
|
||||||
"invalid length",
|
"invalid length",
|
||||||
func() core.Field {
|
func() core.Field {
|
||||||
f := core.Fields[fieldType]()
|
f := core.Fields[fieldType]()
|
||||||
f.SetName(strings.Repeat("a", 256))
|
f.SetName(strings.Repeat("a", 101))
|
||||||
return f
|
return f
|
||||||
},
|
},
|
||||||
true,
|
true,
|
||||||
|
@ -151,7 +151,7 @@ func testDefaultFieldNameValidation(t *testing.T, fieldType string) {
|
||||||
"valid length",
|
"valid length",
|
||||||
func() core.Field {
|
func() core.Field {
|
||||||
f := core.Fields[fieldType]()
|
f := core.Fields[fieldType]()
|
||||||
f.SetName(strings.Repeat("a", 255))
|
f.SetName(strings.Repeat("a", 100))
|
||||||
return f
|
return f
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
|
|
Loading…
Reference in New Issue