Skip to content
Snippets Groups Projects
Commit 7d17bc88 authored by renovate_bot's avatar renovate_bot Committed by Fabian Seidl
Browse files

[renovate] Update module github.com/bufbuild/protovalidate-go to v0.8.2


See merge request !1131

Co-authored-by: default avatarFabian Seidl <fabian.seidl@h-da.de>
Co-authored-by: default avatarRenovate Bot <renovate@danet.fbi.h-da.de>
parent 9839c9bf
Branches
No related tags found
6 merge requests!1196[renovate] Update module golang.org/x/net to v0.32.0,!1195UI: implement add device functionality,!1166Ui containerlab integration,!1161Ui refactor style,!1160UI containerlab integration,!1131[renovate] Update module github.com/bufbuild/protovalidate-go to v0.8.2
Pipeline #249272 passed
This commit is part of merge request !1161. Comments created here will be created in the context of that merge request.
......@@ -89,7 +89,13 @@ func TestAuth_Login(t *testing.T) {
wantErr: true,
validationErrors: []*validate.Violation{
{
FieldPath: stringToPointer("username"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("username"),
},
},
},
ConstraintId: stringToPointer("required"),
Message: stringToPointer("value is required"),
}},
......@@ -160,7 +166,13 @@ func TestAuth_Logout(t *testing.T) {
wantErr: true,
validationErrors: []*validate.Violation{
{
FieldPath: stringToPointer("username"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("username"),
},
},
},
ConstraintId: stringToPointer("required"),
Message: stringToPointer("value is required"),
}},
......
......@@ -84,10 +84,20 @@ func TestRole_CreateRoles(t *testing.T) {
wantErr: true,
validationErrors: []*validate.Violation{
{
FieldPath: stringToPointer("roles[0].name"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("roles"),
},
{
FieldName: stringToPointer("name"),
},
},
},
ConstraintId: stringToPointer("string.min_len"),
Message: stringToPointer("value length must be at least 3 characters"),
}},
},
},
},
{
name: "role with too short description should fail",
......@@ -105,7 +115,16 @@ func TestRole_CreateRoles(t *testing.T) {
want: &apb.CreateRolesResponse{},
wantErr: true,
validationErrors: []*validate.Violation{{
FieldPath: stringToPointer("roles[0].description"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("roles"),
},
{
FieldName: stringToPointer("description"),
},
},
},
ConstraintId: stringToPointer("string.min_len"),
Message: stringToPointer("value length must be at least 3 characters"),
}},
......@@ -181,7 +200,13 @@ func TestRole_GetRole(t *testing.T) {
wantErr: true,
validationErrors: []*validate.Violation{
{
FieldPath: stringToPointer("role_name"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("role_name"),
},
},
},
ConstraintId: stringToPointer("required"),
Message: stringToPointer("value is required"),
},
......@@ -355,7 +380,16 @@ func TestRole_UpdateRoles(t *testing.T) {
wantErr: true,
validationErrors: []*validate.Violation{
{
FieldPath: stringToPointer("roles[0].name"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("roles"),
},
{
FieldName: stringToPointer("name"),
},
},
},
ConstraintId: stringToPointer("string.min_len"),
Message: stringToPointer("value length must be at least 3 characters"),
},
......@@ -379,7 +413,16 @@ func TestRole_UpdateRoles(t *testing.T) {
wantErr: true,
validationErrors: []*validate.Violation{
{
FieldPath: stringToPointer("roles[0].description"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("roles"),
},
{
FieldName: stringToPointer("description"),
},
},
},
ConstraintId: stringToPointer("string.min_len"),
Message: stringToPointer("value length must be at least 3 characters"),
},
......@@ -456,12 +499,24 @@ func TestRole_DeletePermissionsForRole(t *testing.T) {
wantErr: true,
validationErrors: []*validate.Violation{
{
FieldPath: stringToPointer("role_name"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("role_name"),
},
},
},
ConstraintId: stringToPointer("required"),
Message: stringToPointer("value is required"),
},
{
FieldPath: stringToPointer("permissions_to_delete"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("permissions_to_delete"),
},
},
},
ConstraintId: stringToPointer("required"),
Message: stringToPointer("value is required"),
},
......
......@@ -285,27 +285,72 @@ func TestTopology_AddLink(t *testing.T) {
wantErr: true,
validationErrors: []*validate.Violation{
{
FieldPath: stringToPointer("link.name"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("link"),
},
{
FieldName: stringToPointer("name"),
},
},
},
ConstraintId: stringToPointer("string.min_len"),
Message: stringToPointer("value length must be at least 1 characters"),
},
{
FieldPath: stringToPointer("link.sourceNode"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("link"),
},
{
FieldName: stringToPointer("sourceNode"),
},
},
},
ConstraintId: stringToPointer("required"),
Message: stringToPointer("value is required"),
},
{
FieldPath: stringToPointer("link.targetNode"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("link"),
},
{
FieldName: stringToPointer("targetNode"),
},
},
},
ConstraintId: stringToPointer("required"),
Message: stringToPointer("value is required"),
},
{
FieldPath: stringToPointer("link.sourcePort"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("link"),
},
{
FieldName: stringToPointer("sourcePort"),
},
},
},
ConstraintId: stringToPointer("required"),
Message: stringToPointer("value is required"),
},
{
FieldPath: stringToPointer("link.targetPort"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("link"),
},
{
FieldName: stringToPointer("targetPort"),
},
},
},
ConstraintId: stringToPointer("required"),
Message: stringToPointer("value is required"),
},
......@@ -461,7 +506,13 @@ func TestTopology_DeleteLink(t *testing.T) {
wantErr: true,
validationErrors: []*validate.Violation{
{
FieldPath: stringToPointer("id"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("id"),
},
},
},
ConstraintId: stringToPointer("required"),
Message: stringToPointer("value is required"),
}},
......
......@@ -90,7 +90,16 @@ func TestUser_CreateUsers(t *testing.T) {
wantErr: true,
validationErrors: []*validate.Violation{
{
FieldPath: stringToPointer("user[0].password"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("user"),
},
{
FieldName: stringToPointer("password"),
},
},
},
ConstraintId: stringToPointer("string.min_len"),
Message: stringToPointer("value length must be at least 5 characters"),
}},
......@@ -116,7 +125,16 @@ func TestUser_CreateUsers(t *testing.T) {
wantErr: true,
validationErrors: []*validate.Violation{
{
FieldPath: stringToPointer("user[0].name"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("user"),
},
{
FieldName: stringToPointer("name"),
},
},
},
ConstraintId: stringToPointer("string.min_len"),
Message: stringToPointer("value length must be at least 3 characters"),
}},
......@@ -190,7 +208,13 @@ func TestUser_GetUser(t *testing.T) {
wantErr: true,
validationErrors: []*validate.Violation{
{
FieldPath: stringToPointer("name"),
Field: &validate.FieldPath{
Elements: []*validate.FieldPathElement{
{
FieldName: stringToPointer("name"),
},
},
},
ConstraintId: stringToPointer("required"),
Message: stringToPointer("value is required"),
}},
......
......@@ -23,7 +23,8 @@ func isEqualFieldPaths(violationFieldPath, errFieldPath *validate.FieldPath) boo
}
for i, elem := range violationFieldPath.GetElements() {
if elem != errFieldPath.GetElements()[i] {
errElem := errFieldPath.GetElements()[i]
if *elem.FieldName != *errElem.FieldName {
return false
}
}
......
......@@ -87,7 +87,7 @@ require (
require (
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.2-20241127180247-a33202765966.1
github.com/bufbuild/protovalidate-go v0.7.3
github.com/bufbuild/protovalidate-go v0.8.2
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-plugin v1.4.10
github.com/lesismal/nbio v1.5.12
......@@ -103,7 +103,7 @@ require (
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/containerd/console v1.0.3 // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/google/cel-go v0.22.0 // indirect
github.com/google/cel-go v0.22.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
......
......@@ -79,6 +79,8 @@ github.com/bufbuild/protovalidate-go v0.7.2 h1:UuvKyZHl5p7u3ztEjtRtqtDxOjRKX5VUO
github.com/bufbuild/protovalidate-go v0.7.2/go.mod h1:PHV5pFuWlRzdDW02/cmVyNzdiQ+RNNwo7idGxdzS7o4=
github.com/bufbuild/protovalidate-go v0.7.3 h1:kKnoSueygR3xxppvuBpm9SEwIsP359MMRfMBGmRByPg=
github.com/bufbuild/protovalidate-go v0.7.3/go.mod h1:CFv34wMqiBzAHdQ4q/tWYi9ILFYKuaC3/4zh6eqdUck=
github.com/bufbuild/protovalidate-go v0.8.2 h1:sgzXHkHYP6HnAsL2Rd3I1JxkYUyEQUv9awU1PduMxbM=
github.com/bufbuild/protovalidate-go v0.8.2/go.mod h1:K6w8iPNAXBoIivVueSELbUeUl+MmeTQfCDSug85pn3M=
github.com/c-bata/go-prompt v0.2.6 h1:POP+nrHE+DfLYx370bedwNhsqmpCUynWPxuHi0C5vZI=
github.com/c-bata/go-prompt v0.2.6/go.mod h1:/LMAke8wD2FsNu9EXNdHxNLbd9MedkPnCdfpU9wwHfY=
github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
......@@ -156,6 +158,8 @@ github.com/google/cel-go v0.21.0 h1:cl6uW/gxN+Hy50tNYvI691+sXxioCnstFzLp2WO4GCI=
github.com/google/cel-go v0.21.0/go.mod h1:rHUlWCcBKgyEk+eV03RPdZUekPp6YcJwV0FxuUksYxc=
github.com/google/cel-go v0.22.0 h1:b3FJZxpiv1vTMo2/5RDUqAHPxkT8mmMfJIrq1llbf7g=
github.com/google/cel-go v0.22.0/go.mod h1:BuznPXXfQDpXKWQ9sPW3TzlAJN5zzFe+i9tIs0yC4s8=
github.com/google/cel-go v0.22.1 h1:AfVXx3chM2qwoSbM7Da8g8hX8OVSkBFwX+rz2+PcK40=
github.com/google/cel-go v0.22.1/go.mod h1:BuznPXXfQDpXKWQ9sPW3TzlAJN5zzFe+i9tIs0yC4s8=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment