Skip to content

Commit 0d8f50a

Browse files
authored
Temporarily revert updates to the documentation in validate.proto (#327)
1 parent df9ad5c commit 0d8f50a

File tree

2 files changed

+91
-184
lines changed

2 files changed

+91
-184
lines changed

Diff for: proto/protovalidate/buf/validate/validate.proto

+46-92
Original file line numberDiff line numberDiff line change
@@ -3276,16 +3276,10 @@ message StringRules {
32763276
}];
32773277

32783278
// `WellKnown` rules provide advanced constraints against common string
3279-
// patterns.
3279+
// patterns
32803280
oneof well_known {
3281-
// `email` specifies that the field value must be a valid email address, for
3282-
// example "[email protected]".
3283-
//
3284-
// Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address).
3285-
// Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322),
3286-
// which allows many unexpected forms of email addresses and will easily match
3287-
// a typographical error.
3288-
//
3281+
// `email` specifies that the field value must be a valid email address
3282+
// (addr-spec only) as defined by [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1).
32893283
// If the field value isn't a valid email address, an error message will be generated.
32903284
//
32913285
// ```proto
@@ -3307,18 +3301,10 @@ message StringRules {
33073301
}
33083302
];
33093303

3310-
// `hostname` specifies that the field value must be a valid hostname, for
3311-
// example "foo.example.com".
3312-
//
3313-
// A valid hostname follows the rules below:
3314-
// - The name consists of one or more labels, separated by a dot (".").
3315-
// - Each label can be 1 to 63 alphanumeric characters.
3316-
// - A label can contain hyphens ("-"), but must not start or end with a hyphen.
3317-
// - The right-most label must not be digits only.
3318-
// - The name can have a trailing dot—for example, "foo.example.com.".
3319-
// - The name can be 253 characters at most, excluding the optional trailing dot.
3320-
//
3321-
// If the field value isn't a valid hostname, an error message will be generated.
3304+
// `hostname` specifies that the field value must be a valid
3305+
// hostname as defined by [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034#section-3.5). This constraint doesn't support
3306+
// internationalized domain names (IDNs). If the field value isn't a
3307+
// valid hostname, an error message will be generated.
33223308
//
33233309
// ```proto
33243310
// message MyString {
@@ -3339,15 +3325,8 @@ message StringRules {
33393325
}
33403326
];
33413327

3342-
// `ip` specifies that the field value must be a valid IP (v4 or v6) address.
3343-
//
3344-
// IPv4 addresses are expected in the dotted decimal format—for example, "192.168.5.21".
3345-
// IPv6 addresses are expected in their text representation—for example, "::1",
3346-
// or "2001:0DB8:ABCD:0012::0".
3347-
//
3348-
// Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).
3349-
// Zone identifiers for IPv6 addresses (for example, "fe80::a%en1") are supported.
3350-
//
3328+
// `ip` specifies that the field value must be a valid IP
3329+
// (v4 or v6) address, without surrounding square brackets for IPv6 addresses.
33513330
// If the field value isn't a valid IP address, an error message will be
33523331
// generated.
33533332
//
@@ -3370,9 +3349,9 @@ message StringRules {
33703349
}
33713350
];
33723351

3373-
// `ipv4` specifies that the field value must be a valid IPv4 address—for
3374-
// example "192.168.5.21". If the field value isn't a valid IPv4 address, an
3375-
// error message will be generated.
3352+
// `ipv4` specifies that the field value must be a valid IPv4
3353+
// address. If the field value isn't a valid IPv4 address, an error message
3354+
// will be generated.
33763355
//
33773356
// ```proto
33783357
// message MyString {
@@ -3393,9 +3372,9 @@ message StringRules {
33933372
}
33943373
];
33953374

3396-
// `ipv6` specifies that the field value must be a valid IPv6 address—for
3397-
// example "::1", or "d7a:115c:a1e0:ab12:4843:cd96:626b:430b". If the field
3398-
// value is not a valid IPv6 address, an error message will be generated.
3375+
// `ipv6` specifies that the field value must be a valid
3376+
// IPv6 address, without surrounding square brackets. If the field value is
3377+
// not a valid IPv6 address, an error message will be generated.
33993378
//
34003379
// ```proto
34013380
// message MyString {
@@ -3416,11 +3395,8 @@ message StringRules {
34163395
}
34173396
];
34183397

3419-
// `uri` specifies that the field value must be a valid URI, for example
3420-
// "https://example.com/foo/bar?baz=quux#frag".
3421-
//
3422-
// URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).
3423-
// Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).
3398+
// `uri` specifies that the field value must be a valid URI as defined by
3399+
// [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-3).
34243400
//
34253401
// If the field value isn't a valid URI, an error message will be generated.
34263402
//
@@ -3443,13 +3419,11 @@ message StringRules {
34433419
}
34443420
];
34453421

3446-
// `uri_ref` specifies that the field value must be a valid URI Reference—either
3447-
// a URI such as "https://example.com/foo/bar?baz=quux#frag", or a Relative
3448-
// Reference such as "./foo/bar?query".
3422+
// `uri_ref` specifies that the field value must be a valid URI Reference as
3423+
// defined by [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986#section-4.1).
34493424
//
3450-
// URI, URI Reference, and Relative Reference are defined in the internet
3451-
// standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone
3452-
// Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).
3425+
// A URI Reference is either a [URI](https://datatracker.ietf.org/doc/html/rfc3986#section-3),
3426+
// or a [Relative Reference](https://datatracker.ietf.org/doc/html/rfc3986#section-4.2).
34533427
//
34543428
// If the field value isn't a valid URI Reference, an error message will be
34553429
// generated.
@@ -3467,9 +3441,10 @@ message StringRules {
34673441
}];
34683442

34693443
// `address` specifies that the field value must be either a valid hostname
3470-
// (for example, "example.com"), or a valid IP (v4 or v6) address (for example,
3471-
// "192.168.0.1", or "::1"). If the field value isn't a valid hostname or IP,
3472-
// an error message will be generated.
3444+
// as defined by [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034#section-3.5)
3445+
// (which doesn't support internationalized domain names or IDNs) or a valid
3446+
// IP (v4 or v6). If the field value isn't a valid hostname or IP, an error
3447+
// message will be generated.
34733448
//
34743449
// ```proto
34753450
// message MyString {
@@ -3537,10 +3512,10 @@ message StringRules {
35373512
}
35383513
];
35393514

3540-
// `ip_with_prefixlen` specifies that the field value must be a valid IP
3541-
// (v4 or v6) address with prefix length—for example, "192.168.5.21/16" or
3542-
// "2001:0DB8:ABCD:0012::F1/64". If the field value isn't a valid IP with
3543-
// prefix length, an error message will be generated.
3515+
// `ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6)
3516+
// address with prefix length. If the field value isn't a valid IP with prefix
3517+
// length, an error message will be generated.
3518+
//
35443519
//
35453520
// ```proto
35463521
// message MyString {
@@ -3562,9 +3537,9 @@ message StringRules {
35623537
];
35633538

35643539
// `ipv4_with_prefixlen` specifies that the field value must be a valid
3565-
// IPv4 address with prefix length—for example, "192.168.5.21/16". If the
3566-
// field value isn't a valid IPv4 address with prefix length, an error
3567-
// message will be generated.
3540+
// IPv4 address with prefix.
3541+
// If the field value isn't a valid IPv4 address with prefix length,
3542+
// an error message will be generated.
35683543
//
35693544
// ```proto
35703545
// message MyString {
@@ -3586,7 +3561,7 @@ message StringRules {
35863561
];
35873562

35883563
// `ipv6_with_prefixlen` specifies that the field value must be a valid
3589-
// IPv6 address with prefix length—for example, "2001:0DB8:ABCD:0012::F1/64".
3564+
// IPv6 address with prefix length.
35903565
// If the field value is not a valid IPv6 address with prefix length,
35913566
// an error message will be generated.
35923567
//
@@ -3609,15 +3584,10 @@ message StringRules {
36093584
}
36103585
];
36113586

3612-
// `ip_prefix` specifies that the field value must be a valid IP (v4 or v6)
3613-
// prefix—for example, "192.168.0.0/16" or "2001:0DB8:ABCD:0012::0/64".
3614-
//
3615-
// The prefix must have all zeros for the unmasked bits. For example,
3616-
// "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the
3617-
// prefix, and the remaining 64 bits must be zero.
3618-
//
3587+
// `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix.
36193588
// If the field value isn't a valid IP prefix, an error message will be
3620-
// generated.
3589+
// generated. The prefix must have all zeros for the masked bits of the prefix (e.g.,
3590+
// `127.0.0.0/16`, not `127.0.0.1/16`).
36213591
//
36223592
// ```proto
36233593
// message MyString {
@@ -3639,14 +3609,9 @@ message StringRules {
36393609
];
36403610

36413611
// `ipv4_prefix` specifies that the field value must be a valid IPv4
3642-
// prefix, for example "192.168.0.0/16".
3643-
//
3644-
// The prefix must have all zeros for the unmasked bits. For example,
3645-
// "192.168.0.0/16" designates the left-most 16 bits for the prefix,
3646-
// and the remaining 16 bits must be zero.
3647-
//
3648-
// If the field value isn't a valid IPv4 prefix, an error message
3649-
// will be generated.
3612+
// prefix. If the field value isn't a valid IPv4 prefix, an error message
3613+
// will be generated. The prefix must have all zeros for the masked bits of
3614+
// the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`).
36503615
//
36513616
// ```proto
36523617
// message MyString {
@@ -3667,15 +3632,10 @@ message StringRules {
36673632
}
36683633
];
36693634

3670-
// `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for
3671-
// example, "2001:0DB8:ABCD:0012::0/64".
3672-
//
3673-
// The prefix must have all zeros for the unmasked bits. For example,
3674-
// "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the
3675-
// prefix, and the remaining 64 bits must be zero.
3676-
//
3635+
// `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix.
36773636
// If the field value is not a valid IPv6 prefix, an error message will be
3678-
// generated.
3637+
// generated. The prefix must have all zeros for the masked bits of the prefix
3638+
// (e.g., `2001:db8::/48`, not `2001:db8::1/48`).
36793639
//
36803640
// ```proto
36813641
// message MyString {
@@ -3696,16 +3656,10 @@ message StringRules {
36963656
}
36973657
];
36983658

3699-
// `host_and_port` specifies that the field value must be valid host/port
3700-
// pair—for example, "example.com:8080".
3701-
//
3702-
// The host can be one of:
3703-
//- An IPv4 address in dotted decimal format—for example, "192.168.5.21".
3704-
//- An IPv6 address enclosed in square brackets—for example, "[2001:0DB8:ABCD:0012::F1]".
3705-
//- A hostname—for example, "example.com".
3706-
//
3707-
// The port is separated by a colon. It must be non-empty, with a decimal number
3708-
// in the range of 0-65535, inclusive.
3659+
// `host_and_port` specifies the field value must be a valid host and port
3660+
// pair. The host must be a valid hostname or IP address while the port
3661+
// must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
3662+
// with square brackets (e.g., `[::1]:1234`).
37093663
bool host_and_port = 32 [
37103664
(predefined).cel = {
37113665
id: "string.host_and_port"

0 commit comments

Comments
 (0)