Skip to content

Commit 324e4c4

Browse files
Found new managed modules references (#216)
New managed modules references found. Please review. Co-authored-by: unmultimedio <unmultimedio@users.noreply.github.com>
1 parent ba7d62b commit 324e4c4

10 files changed

+3949
-5
lines changed

modules/sync/bufbuild/protovalidate-testing/state.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@
8383
{
8484
"name": "v0.2.7",
8585
"digest": "0930dab7a8079b07f848db40af6970cad7a2d23db77a9ac7a2aa7616d346f9950f284791d0a05ca87a0f40456235eea3f7fffff1d71d1cb4ffd695ff6d8d387b"
86+
},
87+
{
88+
"name": "v0.2.8",
89+
"digest": "0930dab7a8079b07f848db40af6970cad7a2d23db77a9ac7a2aa7616d346f9950f284791d0a05ca87a0f40456235eea3f7fffff1d71d1cb4ffd695ff6d8d387b"
8690
}
8791
]
8892
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// Copyright 2023 Buf Technologies, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package buf.validate.priv;
18+
19+
import "google/protobuf/descriptor.proto";
20+
21+
option go_package = "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate/priv";
22+
option java_multiple_files = true;
23+
option java_outer_classname = "PrivateProto";
24+
option java_package = "build.buf.validate.priv";
25+
26+
extend google.protobuf.FieldOptions {
27+
// Do not use. Internal to protovalidate library
28+
optional FieldConstraints field = 1160;
29+
}
30+
31+
// Do not use. Internal to protovalidate library
32+
message FieldConstraints {
33+
repeated Constraint cel = 1;
34+
}
35+
36+
// Do not use. Internal to protovalidate library
37+
message Constraint {
38+
string id = 1;
39+
string message = 2;
40+
string expression = 3;
41+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
shake256:8f88503768991dcc77b5a39a4a8d3374c99f4f0f69fb9e58a383fa238b20645190dc4570817b8ab9bbd83e90d063d151048137ef8c6bdb51ea797f7c6f41cfba LICENSE
2+
shake256:b8ec4cbd3f0ff7194a4c6564eecfecc967ce2a93caeb5a09f402efb172371655b358d7bcb6fd7d6a01c1c2f71f705c3f21a55f159c779ea246f99e385a7f4bbb buf.yaml
3+
shake256:393e36ad07273f113d09d44b5b98be3c425b673102630848d446077346f45507bd37917d47adec2f3e27fc889d13541964e0dbb538559507de697e5d1d240e1f buf/validate/expression.proto
4+
shake256:14a0eada735b3de7cbd4a2062d738914efb8ee7c0c1294b653fe41cd0803e833d72d3c8cbe1b4c168ad660bbc9c3dd6a2aa8bcdbb7e2fe179aece6ec8aa8d9fa buf/validate/priv/private.proto
5+
shake256:c12bbd54c868cc4c994d369821628a576d07da1c5e826436e2d724e7ab0cabfbe792af2077f8109952dcf115fde6a03ab9f039a93d1480d44cc7f94be2e74d8e buf/validate/validate.proto
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
// Copyright 2023 Buf Technologies, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
syntax = "proto3";
16+
17+
package buf.validate;
18+
19+
option go_package = "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate";
20+
option java_multiple_files = true;
21+
option java_outer_classname = "ExpressionProto";
22+
option java_package = "build.buf.validate";
23+
24+
// `Constraint` represents a validation rule written in the Common Expression
25+
// Language (CEL) syntax. Each Constraint includes a unique identifier, an
26+
// optional error message, and the CEL expression to evaluate. For more
27+
// information on CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
28+
//
29+
// ```proto
30+
// message Foo {
31+
// option (buf.validate.message).cel = {
32+
// id: "foo.bar"
33+
// message: "bar must be greater than 0"
34+
// expression: "this.bar > 0"
35+
// };
36+
// int32 bar = 1;
37+
// }
38+
// ```
39+
message Constraint {
40+
// `id` is a string that serves as a machine-readable name for this Constraint.
41+
// It should be unique within its scope, which could be either a message or a field.
42+
string id = 1;
43+
44+
// `message` is an optional field that provides a human-readable error message
45+
// for this Constraint when the CEL expression evaluates to false. If a
46+
// non-empty message is provided, any strings resulting from the CEL
47+
// expression evaluation are ignored.
48+
string message = 2;
49+
50+
// `expression` is the actual CEL expression that will be evaluated for
51+
// validation. This string must resolve to either a boolean or a string
52+
// value. If the expression evaluates to false or a non-empty string, the
53+
// validation is considered failed, and the message is rejected.
54+
string expression = 3;
55+
}
56+
57+
// `Violations` is a collection of `Violation` messages. This message type is returned by
58+
// protovalidate when a proto message fails to meet the requirements set by the `Constraint` validation rules.
59+
// Each individual violation is represented by a `Violation` message.
60+
message Violations {
61+
// `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected.
62+
repeated Violation violations = 1;
63+
}
64+
65+
// `Violation` represents a single instance where a validation rule, expressed
66+
// as a `Constraint`, was not met. It provides information about the field that
67+
// caused the violation, the specific constraint that wasn't fulfilled, and a
68+
// human-readable error message.
69+
//
70+
// ```json
71+
// {
72+
// "fieldPath": "bar",
73+
// "constraintId": "foo.bar",
74+
// "message": "bar must be greater than 0"
75+
// }
76+
// ```
77+
message Violation {
78+
// `field_path` is a machine-readable identifier that points to the specific field that failed the validation.
79+
// This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.
80+
string field_path = 1;
81+
82+
// `constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
83+
// This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated.
84+
string constraint_id = 2;
85+
86+
// `message` is a human-readable error message that describes the nature of the violation.
87+
// This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation.
88+
string message = 3;
89+
90+
// `for_key` indicates whether the violation was caused by a map key, rather than a value.
91+
bool for_key = 4;
92+
}

0 commit comments

Comments
 (0)