You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the envoyproxy protos, a large number is used in the duration validation rule,
// [#next-free-field: 8]messageDownstreamTlsContext {
// ...// If specified, ``session_timeout`` will change the maximum lifetime (in seconds) of the TLS session.// Currently this value is used as a hint for the `TLS session ticket lifetime (for TLSv1.2) <https://tools.ietf.org/html/rfc5077#section-5.6>`_.// Only seconds can be specified (fractional seconds are ignored).google.protobuf.Durationsession_timeout=6 [(validate.rules).duration = {
lt {seconds: 4294967296}
gte {}
}];
}
Such use cases are also shown in the examples in the README.md in this repo.
But since the user-defined thresholds are possibly out of the bound of int32, i.e. the seconds field is int64 aka long in Java.
messageDuration {
// Signed seconds of the span of time. Must be from -315,576,000,000// to +315,576,000,000 inclusive. Note: these bounds are computed from:// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 yearsint64seconds=1;
// Signed fractions of a second at nanosecond resolution of the span// of time. Durations less than one second are represented with a 0// `seconds` field and a positive or negative `nanos` field. For durations// of one second or more, a non-zero value for the `nanos` field must be// of the same sign as the `seconds` field. Must be from -999,999,999// to +999,999,999 inclusive.int32nanos=2;
}
Compiling the proto file above will just cause exceptions, (with pgv 0.9.1)
The generated codes look like,
privatefinalcom.google.protobuf.DurationSESSION_TIMEOUT__LT = io.envoyproxy.pgv.TimestampValidation.toDuration(4294967296,0); // should be 4294967296Lprivatefinalcom.google.protobuf.DurationSESSION_TIMEOUT__GTE = io.envoyproxy.pgv.TimestampValidation.toDuration(0,0);
I will submit a PR to resolve this issue.
The text was updated successfully, but these errors were encountered:
In the envoyproxy protos, a large number is used in the duration validation rule,
Such use cases are also shown in the examples in the
README.md
in this repo.But since the user-defined thresholds are possibly out of the bound of
int32
, i.e. theseconds
field isint64
akalong
in Java.Compiling the proto file above will just cause exceptions, (with
pgv 0.9.1
)The generated codes look like,
I will submit a PR to resolve this issue.
The text was updated successfully, but these errors were encountered: