From ef109423c9b4061293ed2a43143f5f19329ca463 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Mon, 16 Dec 2019 13:33:03 -0500 Subject: [PATCH 01/25] add HTTP header well known type and C++ UUID Signed-off-by: Asra Ali --- README.md | 6 ++++ .../io/envoyproxy/pgv/StringValidation.java | 26 +++++++++++++++++ .../envoyproxy/pgv/StringValidationTest.java | 29 +++++++++++++++++++ rule_comparison.md | 8 +++-- templates/cc/file.go | 3 ++ templates/cc/string.go | 23 +++++++++++---- templates/goshared/known.go | 25 ++++++++++++++++ templates/goshared/msg.go | 4 +++ templates/goshared/register.go | 4 ++- templates/goshared/string.go | 9 +++++- templates/java/string.go | 6 ++++ templates/shared/well_known.go | 16 ++++++++-- tests/harness/cases/strings.proto | 2 ++ tests/harness/executor/cases.go | 17 +++++++++++ validate/validate.h | 20 +++++++++++++ validate/validate.proto | 8 +++++ validate/validator.py | 22 +++++++++++++- 17 files changed, 214 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index aff0b2014..d389b1397 100644 --- a/README.md +++ b/README.md @@ -398,6 +398,12 @@ Check the [constraint rule comparison matrix](rule_comparison.md) for language-s // x must be a valid UUID (via RFC 4122) string x = 1 [(validate.rules).string.uuid = true]; + + // x must be a valid header name (via RFC 7230) + string x = 1 [(validate.rules).string.header_name = true]; + + // x must be a valid header value (via RFC 7230) + string x = 1 [(validate.rules).string.header_value = true]; ``` ### Bytes diff --git a/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java b/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java index c676d2490..4094e63b8 100644 --- a/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java +++ b/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java @@ -208,6 +208,32 @@ public static void uuid(final String field, final String value) throws Validatio throw new ValidationException(field, enquote(value), "invalid UUID string"); } + public static void headerName(final String field, final String value) throws ValidationException { + final char[] chars = value.toCharArray(); + + final String whitelist = "!#$%&'`*+-.^_|~"; + + for (int i = 0; i < chars.length; i++) { + final char c = chars[i]; + if ((c < '0' || c > '9') && (c < 'a' || c > 'z') && (c < 'A' || c > 'Z') && whitelist.indexOf(c) < 0) { + throw new ValidationException(field, enquote(value), "invalid header name string"); + } + } + return; + } + + public static void headerValue(final String field, final String value) throws ValidationException { + final char[] chars = value.toCharArray(); + + for (int i = 0; i < chars.length; i++) { + final char c = chars[i]; + if (!(c == '\t' || c == ' ' || ('!' <= c && c <= '~') || 127 < c)) { + throw new ValidationException(field, enquote(value), "invalid header value string"); + } + } + return; + } + private static String enquote(String value) { return "\"" + value + "\""; } diff --git a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java index 7a4423aa8..aa225b5a5 100644 --- a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java +++ b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java @@ -253,4 +253,33 @@ public void uuidWorks() throws ValidationException { assertValidationException(() -> uuid("4_dash_at_22", "00000000-0000-0000-000-0000000000000")); assertValidationException(() -> uuid("4_dash_at_24", "00000000-0000-0000-00000-00000000000")); } + + @Test + public void headerNameWorks() throws ValidationException { + // Match + StringValidation.header_name("x", "cluster.name"); + StringValidation.header_name("x", "/TEST/LONG/URL"); + StringValidation.header_name("x", "clustername"); + StringValidation.header_name("x", "!#%&./+"); + + // No Match + assertThatThrownBy(() -> StringValidation.header_name("x", "foo\000bar")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.header_name("x", "cluster name")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.header_name("x", "example\r")).isInstanceOf(ValidationException.class); + } + + @Test + public void headerValueWorks() throws ValidationException { + // Match + StringValidation.header_value("x", "cluster.name"); + StringValidation.header_value("x", "/TEST/LONG/URL"); + StringValidation.header_value("x", "cluster name"); + StringValidation.header_value("x", "!#%&./+"); + + // No Match + assertThatThrownBy(() -> StringValidation.header_value("x", "foo\000bar")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.header_value("x", "\x7f")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.header_value("x", "example\r")).isInstanceOf(ValidationException.class); + } + } diff --git a/rule_comparison.md b/rule_comparison.md index f40b4a71e..9d7678945 100644 --- a/rule_comparison.md +++ b/rule_comparison.md @@ -32,9 +32,11 @@ | ip |✅|✅|✅|✅|✅| | ipv4 |✅|✅|✅|✅|✅| | ipv6 |✅|✅|✅|✅|✅| -| uri |✅|✅|✅|✅|✅| -| uri_ref |✅|✅|✅|✅|✅| -| uuid |✅|✅|❌|✅|✅| +| uri |✅|✅|❌|✅|✅| +| uri_ref |✅|✅|❌|✅|✅| +| uuid |✅|✅|✅|✅|✅| +| header_name |✅|✅|✅|✅|✅| +| header_value |✅|✅|✅|✅|✅| ## Bytes | Constraint Rule | Go | GoGo | C++ | Java | Python | diff --git a/templates/cc/file.go b/templates/cc/file.go index 1b7746b3d..4087ae8b2 100644 --- a/templates/cc/file.go +++ b/templates/cc/file.go @@ -18,6 +18,9 @@ namespace protobuf_wkt = google::protobuf; namespace validate { using std::string; +// define the regex for a UUID once up-front +const re2::RE2 _uuidPattern("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"); + {{ range .AllMessages }} {{- if not (disabled .) -}} diff --git a/templates/cc/string.go b/templates/cc/string.go index 1a9a1e06b..00af09c34 100644 --- a/templates/cc/string.go +++ b/templates/cc/string.go @@ -176,11 +176,24 @@ const strTpl = ` } */}} {{ else if $r.GetUuid }} - {{ unimplemented "C++ UUID validation is not implemented" }} - {{/* TODO(akonradi) implement UUID constraints - if err := m._validateUuid({{ accessor . }}); err != nil { - return {{ errCause . "err" "value must be a valid UUID" }} + if (!RE2::FullMatch(re2::StringPiece({{ accessor . }}), pgv::validate::_uuidPattern)) { + {{ err . "value must be a valid UUID" }} } - */}} + {{ else if $r.GetHeaderName }} + { + const std::string& name = {{ accessor . }}; + + if (!pgv::IsHeaderName(name)) { + {{ err . "value must be a valid HTTP header name" }} + } + } + {{ else if $r.GetHeaderValue }} + { + const std::string& value = {{ accessor . }}; + + if (!pgv::IsHeaderValue(value)) { + {{ err . "value must be a valid HTTP header value" }} + } + } {{ end }} ` diff --git a/templates/goshared/known.go b/templates/goshared/known.go index ad32cfcb3..66f60b732 100644 --- a/templates/goshared/known.go +++ b/templates/goshared/known.go @@ -63,3 +63,28 @@ const uuidTpl = ` return nil } ` + +const headerNameTpl = ` + func (m {{ (msgTyp .).Pointer }}) _validateHeaderName(hdr string) error { + for _, r := range hdr { + if ((r < 'A' || r > 'Z') && (r < 'a' || r > 'z') && (r < '0' || r > '9') && + !strings.ContainsRune("!#$%&'*+-.^_|~", r)) { + return fmt.Errorf("invalid header name character, got %q", string(r)) + } + } + + return nil + } +` + +const headerValueTpl = ` + func (m {{ (msgTyp .).Pointer }}) _validateHeaderValue(hdr string) error { + for _, r := range hdr { + if !(r == '\t' || r == ' ' || '!' <= r && r <= '~' || '\x7f' < r) { + return fmt.Errorf("invalid header value character, got %q", string(r)) + } + } + + return nil + } +` diff --git a/templates/goshared/msg.go b/templates/goshared/msg.go index 55bd556c1..952438a8f 100644 --- a/templates/goshared/msg.go +++ b/templates/goshared/msg.go @@ -42,6 +42,10 @@ func (m {{ (msgTyp .).Pointer }}) Validate() error { {{ if needs . "uuid" }}{{ template "uuid" . }}{{ end }} +{{ if needs . "headername" }}{{ template "headername" . }}{{ end }} + +{{ if needs . "headervalue" }}{{ template "headervalue" . }}{{ end }} + {{ cmt (errname .) " is the validation error returned by " (msgTyp .) ".Validate if the designated constraints aren't met." -}} type {{ errname . }} struct { field string diff --git a/templates/goshared/register.go b/templates/goshared/register.go index 296fd19e0..3bb910d20 100644 --- a/templates/goshared/register.go +++ b/templates/goshared/register.go @@ -21,7 +21,7 @@ func Register(tpl *template.Template, params pgs.Parameters) { tpl.Funcs(map[string]interface{}{ "accessor": fns.accessor, "byteStr": fns.byteStr, - "snakeCase": fns.snakeCase, + "snakeCase": fns.snakeCase, "cmt": pgs.C80, "durGt": fns.durGt, "durLit": fns.durLit, @@ -76,6 +76,8 @@ func Register(tpl *template.Template, params pgs.Parameters) { template.Must(tpl.New("hostname").Parse(hostTpl)) template.Must(tpl.New("address").Parse(hostTpl)) template.Must(tpl.New("uuid").Parse(uuidTpl)) + template.Must(tpl.New("headername").Parse(headerNameTpl)) + template.Must(tpl.New("headervalue").Parse(headerValueTpl)) template.Must(tpl.New("enum").Parse(enumTpl)) template.Must(tpl.New("repeated").Parse(repTpl)) diff --git a/templates/goshared/string.go b/templates/goshared/string.go index 1b6e3ecd1..cd4f8a3e7 100644 --- a/templates/goshared/string.go +++ b/templates/goshared/string.go @@ -120,8 +120,15 @@ const strTpl = ` if err := m._validateUuid({{ accessor . }}); err != nil { return {{ errCause . "err" "value must be a valid UUID" }} } + {{ else if $r.GetHeaderName }} + if err := m._validateHeaderName({{ accessor . }}); err != nil { + return {{ errCause . "err" "value must be a valid HTTP header name" }} + } + {{ else if $r.GetHeaderValue }} + if err := m._validateHeaderValue({{ accessor . }}); err != nil { + return {{ errCause . "err" "value must be a valid HTTP header value" }} + } {{ end }} - {{ if $r.Pattern }} if !{{ lookup $f "Pattern" }}.MatchString({{ accessor . }}) { return {{ err . "value does not match regex pattern " (lit $r.GetPattern) }} diff --git a/templates/java/string.go b/templates/java/string.go index fd9eea40d..db4dd70ec 100644 --- a/templates/java/string.go +++ b/templates/java/string.go @@ -89,4 +89,10 @@ const stringTpl = `{{ $f := .Field }}{{ $r := .Rules -}} {{- if $r.GetUuid }} io.envoyproxy.pgv.StringValidation.uuid("{{ $f.FullyQualifiedName }}", {{ accessor . }}); {{- end -}} +{{- if $r.GetHeaderName }} + io.envoyproxy.pgv.StringValidation.headerName("{{ $f.FullyQualifiedName }}", {{ accessor . }}); +{{- end -}} +{{- if $r.GetHeaderValue }} + io.envoyproxy.pgv.StringValidation.headerValue("{{ $f.FullyQualifiedName }}", {{ accessor . }}); +{{- end -}} ` diff --git a/templates/shared/well_known.go b/templates/shared/well_known.go index 6ec62af14..75b2f3c5f 100644 --- a/templates/shared/well_known.go +++ b/templates/shared/well_known.go @@ -8,9 +8,11 @@ import ( type WellKnown string const ( - Email WellKnown = "email" - Hostname WellKnown = "hostname" - UUID WellKnown = "uuid" + Email WellKnown = "email" + Hostname WellKnown = "hostname" + UUID WellKnown = "uuid" + HeaderName WellKnown = "headername" + HeaderValue WellKnown = "headervalue" ) // Needs returns true if a well-known string validator is needed for this @@ -61,6 +63,14 @@ func strRulesNeeds(rules *validate.StringRules, wk WellKnown) bool { if rules.GetUuid() { return true } + case HeaderName: + if rules.GetHeaderName() { + return true + } + case HeaderValue: + if rules.GetHeaderValue() { + return true + } } return false diff --git a/tests/harness/cases/strings.proto b/tests/harness/cases/strings.proto index 9e94c3ae5..daf51e3a6 100644 --- a/tests/harness/cases/strings.proto +++ b/tests/harness/cases/strings.proto @@ -34,3 +34,5 @@ message StringIPv6 { string val = 1 [(validate.rules).string.ipv6 = tr message StringURI { string val = 1 [(validate.rules).string.uri = true]; } message StringURIRef { string val = 1 [(validate.rules).string.uri_ref = true]; } message StringUUID { string val = 1 [(validate.rules).string.uuid = true]; } +message StringHeaderName { string val = 1 [(validate.rules).string.header_name = true]; } +message StringHeaderValue { string val = 1 [(validate.rules).string.header_value = true]; } diff --git a/tests/harness/executor/cases.go b/tests/harness/executor/cases.go index bf6965dd6..1695b0640 100644 --- a/tests/harness/executor/cases.go +++ b/tests/harness/executor/cases.go @@ -864,6 +864,23 @@ var stringCases = []TestCase{ {"string - UUID - valid (v5 - case-insensitive)", &cases.StringUUID{Val: "A6EDC906-2F9F-5FB2-A373-EFAC406F0EF2"}, true}, {"string - UUID - invalid", &cases.StringUUID{Val: "foobar"}, false}, {"string - UUID - invalid (bad UUID)", &cases.StringUUID{Val: "ffffffff-ffff-ffff-ffff-fffffffffffff"}, false}, + + {"string - header name - valid", &cases.StringHeaderName{Val: "clustername"}, true}, + {"string - header name - valid (nums)", &cases.StringHeaderName{Val: "cluster-123"}, true}, + {"string - header name - valid (special token)", &cases.StringHeaderName{Val: "!+#&.%"}, true}, + {"string - header name - valid (period)", &cases.StringHeaderName{Val: "cluster.name"}, true}, + {"string - header name - invalid (space)", &cases.StringHeaderName{Val: "cluster name"}, false}, + {"string - header name - invalid (return)", &cases.StringHeaderName{Val: "example\r"}, false}, + {"string - header name - invalid (tab)", &cases.StringHeaderName{Val: "example\t"}, false}, + + {"string - header value - valid", &cases.StringHeaderValue{Val: "cluster.name.123"}, true}, + {"string - header value - valid (uppercase)", &cases.StringHeaderValue{Val: "/TEST/LONG/URL"}, true}, + {"string - header value - valid (spaces)", &cases.StringHeaderValue{Val: "cluster name"}, true}, + {"string - header value - valid (tab)", &cases.StringHeaderValue{Val: "example\t"}, true}, + {"string - header value - valid (special token)", &cases.StringHeaderValue{Val: "!#%&./+"}, true}, + {"string - header value - invalid (NUL)", &cases.StringHeaderValue{Val: "foo\000bar"}, false}, + {"string - header value - invalid (DEL)", &cases.StringHeaderValue{Val: "\x7f"}, false}, + {"string - header value - invalid", &cases.StringHeaderValue{Val: "example\r"}, false}, } var bytesCases = []TestCase{ diff --git a/validate/validate.h b/validate/validate.h index b8594978d..14887a657 100644 --- a/validate/validate.h +++ b/validate/validate.h @@ -137,6 +137,26 @@ static inline bool IsHostname(const string& to_validate) { return true; } +static inline bool IsHeaderName(const string& to_validate) { + const std::string whitelist = "!#$%&'*+-.^_`|~"; + for (const char& r : to_validate) { + if ((r < 'A' || r > 'Z') && (r < 'a' || r > 'z') && (r < '0' || r > '9') && + whitelist.find(r) == std::string::npos) { + return false; + } + } + return true; +} + +static inline bool IsHeaderValue(const string& to_validate) { + for (const char& r : to_validate) { + if (!((r == '\t') || (r == ' ') || ('!' <= r && r <= '~') || ('\x7f' < r))) { + return false; + } + } + return true; +} + static inline size_t Utf8Len(const string& narrow_string) { const char *str_char = narrow_string.c_str(); ptrdiff_t byte_len = narrow_string.length(); diff --git a/validate/validate.proto b/validate/validate.proto index 5623b4e96..ed0fd32d8 100644 --- a/validate/validate.proto +++ b/validate/validate.proto @@ -553,6 +553,14 @@ message StringRules { // Uuid specifies that the field must be a valid UUID as defined by // RFC 4122 bool uuid = 22; + + // HeaderName specified that the field must be a valid header name as + // defined by RFC 7230. + bool header_name = 24; + + // HeaderValue specified that the field must be a valid header value as + // defined by RFC 7230. + bool header_value = 25; } } diff --git a/validate/validator.py b/validate/validator.py index 7eb62802c..78188a656 100644 --- a/validate/validator.py +++ b/validate/validator.py @@ -72,6 +72,18 @@ def _validateEmail(addr): return False return _validateHostName(parts[1]) +def _validateHeaderName(header): + for r in header: + if (r < 'A' or r > 'Z') and (r < 'a' or r > 'z') and (r < '0' or r > '9') and (r not in "!#$%&'*+-.^_`|~"): + return False + return True + +def _validateHeaderValue(header): + for r in header: + if not (r == '\t' or r == ' ' or ('!' <= r and r <= '~') or '\x7f' < r): + return False + return True + def _has_field(message_pb, property_name): # NOTE: As of proto3, HasField() only works for message fields, not for # singular (non-message) fields. First try to use HasField and @@ -213,7 +225,15 @@ def string_template(option_value, name): try: uuid.UUID({{ name }}) except ValueError: - raise ValidationFailed(\"{{ name }} is not a valid UUID\") + raise ValidationFailed(\"{{ name }} is not a valid UUID\") + {%- endif -%} + {%- if s['header_name'] %} + if not _validateHeaderName({{ name }}): + raise ValidationFailed(\"{{ name }} is not a valid header name\") + {%- endif -%} + {%- if s['header_value'] %} + if not _validateHeaderValue({{ name }}): + raise ValidationFailed(\"{{ name }} is not a valid header value\") {%- endif -%} """ return Template(str_templ).render(o = option_value, name = name, const_template = const_template, in_template = in_template) From 3f0ef08a2dbcd6619745397784e01f0d134b8e37 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Mon, 16 Dec 2019 16:03:42 -0500 Subject: [PATCH 02/25] update validate.pb.go Signed-off-by: Asra Ali --- validate/validate.pb.go | 330 ++++++++++++++++++++++++---------------- 1 file changed, 198 insertions(+), 132 deletions(-) diff --git a/validate/validate.pb.go b/validate/validate.pb.go index 7bba226f8..e50a93673 100644 --- a/validate/validate.pb.go +++ b/validate/validate.pb.go @@ -57,7 +57,7 @@ func (m *FieldRules) Reset() { *m = FieldRules{} } func (m *FieldRules) String() string { return proto.CompactTextString(m) } func (*FieldRules) ProtoMessage() {} func (*FieldRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{0} + return fileDescriptor_validate_c04c5f1a429949aa, []int{0} } func (m *FieldRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FieldRules.Unmarshal(m, b) @@ -836,7 +836,7 @@ func (m *FloatRules) Reset() { *m = FloatRules{} } func (m *FloatRules) String() string { return proto.CompactTextString(m) } func (*FloatRules) ProtoMessage() {} func (*FloatRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{1} + return fileDescriptor_validate_c04c5f1a429949aa, []int{1} } func (m *FloatRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FloatRules.Unmarshal(m, b) @@ -938,7 +938,7 @@ func (m *DoubleRules) Reset() { *m = DoubleRules{} } func (m *DoubleRules) String() string { return proto.CompactTextString(m) } func (*DoubleRules) ProtoMessage() {} func (*DoubleRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{2} + return fileDescriptor_validate_c04c5f1a429949aa, []int{2} } func (m *DoubleRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DoubleRules.Unmarshal(m, b) @@ -1040,7 +1040,7 @@ func (m *Int32Rules) Reset() { *m = Int32Rules{} } func (m *Int32Rules) String() string { return proto.CompactTextString(m) } func (*Int32Rules) ProtoMessage() {} func (*Int32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{3} + return fileDescriptor_validate_c04c5f1a429949aa, []int{3} } func (m *Int32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Int32Rules.Unmarshal(m, b) @@ -1142,7 +1142,7 @@ func (m *Int64Rules) Reset() { *m = Int64Rules{} } func (m *Int64Rules) String() string { return proto.CompactTextString(m) } func (*Int64Rules) ProtoMessage() {} func (*Int64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{4} + return fileDescriptor_validate_c04c5f1a429949aa, []int{4} } func (m *Int64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Int64Rules.Unmarshal(m, b) @@ -1244,7 +1244,7 @@ func (m *UInt32Rules) Reset() { *m = UInt32Rules{} } func (m *UInt32Rules) String() string { return proto.CompactTextString(m) } func (*UInt32Rules) ProtoMessage() {} func (*UInt32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{5} + return fileDescriptor_validate_c04c5f1a429949aa, []int{5} } func (m *UInt32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UInt32Rules.Unmarshal(m, b) @@ -1346,7 +1346,7 @@ func (m *UInt64Rules) Reset() { *m = UInt64Rules{} } func (m *UInt64Rules) String() string { return proto.CompactTextString(m) } func (*UInt64Rules) ProtoMessage() {} func (*UInt64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{6} + return fileDescriptor_validate_c04c5f1a429949aa, []int{6} } func (m *UInt64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UInt64Rules.Unmarshal(m, b) @@ -1448,7 +1448,7 @@ func (m *SInt32Rules) Reset() { *m = SInt32Rules{} } func (m *SInt32Rules) String() string { return proto.CompactTextString(m) } func (*SInt32Rules) ProtoMessage() {} func (*SInt32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{7} + return fileDescriptor_validate_c04c5f1a429949aa, []int{7} } func (m *SInt32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SInt32Rules.Unmarshal(m, b) @@ -1550,7 +1550,7 @@ func (m *SInt64Rules) Reset() { *m = SInt64Rules{} } func (m *SInt64Rules) String() string { return proto.CompactTextString(m) } func (*SInt64Rules) ProtoMessage() {} func (*SInt64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{8} + return fileDescriptor_validate_c04c5f1a429949aa, []int{8} } func (m *SInt64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SInt64Rules.Unmarshal(m, b) @@ -1652,7 +1652,7 @@ func (m *Fixed32Rules) Reset() { *m = Fixed32Rules{} } func (m *Fixed32Rules) String() string { return proto.CompactTextString(m) } func (*Fixed32Rules) ProtoMessage() {} func (*Fixed32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{9} + return fileDescriptor_validate_c04c5f1a429949aa, []int{9} } func (m *Fixed32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Fixed32Rules.Unmarshal(m, b) @@ -1754,7 +1754,7 @@ func (m *Fixed64Rules) Reset() { *m = Fixed64Rules{} } func (m *Fixed64Rules) String() string { return proto.CompactTextString(m) } func (*Fixed64Rules) ProtoMessage() {} func (*Fixed64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{10} + return fileDescriptor_validate_c04c5f1a429949aa, []int{10} } func (m *Fixed64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Fixed64Rules.Unmarshal(m, b) @@ -1856,7 +1856,7 @@ func (m *SFixed32Rules) Reset() { *m = SFixed32Rules{} } func (m *SFixed32Rules) String() string { return proto.CompactTextString(m) } func (*SFixed32Rules) ProtoMessage() {} func (*SFixed32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{11} + return fileDescriptor_validate_c04c5f1a429949aa, []int{11} } func (m *SFixed32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SFixed32Rules.Unmarshal(m, b) @@ -1958,7 +1958,7 @@ func (m *SFixed64Rules) Reset() { *m = SFixed64Rules{} } func (m *SFixed64Rules) String() string { return proto.CompactTextString(m) } func (*SFixed64Rules) ProtoMessage() {} func (*SFixed64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{12} + return fileDescriptor_validate_c04c5f1a429949aa, []int{12} } func (m *SFixed64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SFixed64Rules.Unmarshal(m, b) @@ -2040,7 +2040,7 @@ func (m *BoolRules) Reset() { *m = BoolRules{} } func (m *BoolRules) String() string { return proto.CompactTextString(m) } func (*BoolRules) ProtoMessage() {} func (*BoolRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{13} + return fileDescriptor_validate_c04c5f1a429949aa, []int{13} } func (m *BoolRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BoolRules.Unmarshal(m, b) @@ -2127,6 +2127,8 @@ type StringRules struct { // *StringRules_UriRef // *StringRules_Address // *StringRules_Uuid + // *StringRules_HeaderName + // *StringRules_HeaderValue WellKnown isStringRules_WellKnown `protobuf_oneof:"well_known"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -2137,7 +2139,7 @@ func (m *StringRules) Reset() { *m = StringRules{} } func (m *StringRules) String() string { return proto.CompactTextString(m) } func (*StringRules) ProtoMessage() {} func (*StringRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{14} + return fileDescriptor_validate_c04c5f1a429949aa, []int{14} } func (m *StringRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StringRules.Unmarshal(m, b) @@ -2295,6 +2297,14 @@ type StringRules_Uuid struct { Uuid bool `protobuf:"varint,22,opt,name=uuid,oneof"` } +type StringRules_HeaderName struct { + HeaderName bool `protobuf:"varint,24,opt,name=header_name,json=headerName,oneof"` +} + +type StringRules_HeaderValue struct { + HeaderValue bool `protobuf:"varint,25,opt,name=header_value,json=headerValue,oneof"` +} + func (*StringRules_Email) isStringRules_WellKnown() {} func (*StringRules_Hostname) isStringRules_WellKnown() {} @@ -2313,6 +2323,10 @@ func (*StringRules_Address) isStringRules_WellKnown() {} func (*StringRules_Uuid) isStringRules_WellKnown() {} +func (*StringRules_HeaderName) isStringRules_WellKnown() {} + +func (*StringRules_HeaderValue) isStringRules_WellKnown() {} + func (m *StringRules) GetWellKnown() isStringRules_WellKnown { if m != nil { return m.WellKnown @@ -2383,6 +2397,20 @@ func (m *StringRules) GetUuid() bool { return false } +func (m *StringRules) GetHeaderName() bool { + if x, ok := m.GetWellKnown().(*StringRules_HeaderName); ok { + return x.HeaderName + } + return false +} + +func (m *StringRules) GetHeaderValue() bool { + if x, ok := m.GetWellKnown().(*StringRules_HeaderValue); ok { + return x.HeaderValue + } + return false +} + // XXX_OneofFuncs is for the internal use of the proto package. func (*StringRules) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { return _StringRules_OneofMarshaler, _StringRules_OneofUnmarshaler, _StringRules_OneofSizer, []interface{}{ @@ -2395,6 +2423,8 @@ func (*StringRules) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) e (*StringRules_UriRef)(nil), (*StringRules_Address)(nil), (*StringRules_Uuid)(nil), + (*StringRules_HeaderName)(nil), + (*StringRules_HeaderValue)(nil), } } @@ -2465,6 +2495,20 @@ func _StringRules_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { } b.EncodeVarint(22<<3 | proto.WireVarint) b.EncodeVarint(t) + case *StringRules_HeaderName: + t := uint64(0) + if x.HeaderName { + t = 1 + } + b.EncodeVarint(24<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *StringRules_HeaderValue: + t := uint64(0) + if x.HeaderValue { + t = 1 + } + b.EncodeVarint(25<<3 | proto.WireVarint) + b.EncodeVarint(t) case nil: default: return fmt.Errorf("StringRules.WellKnown has unexpected type %T", x) @@ -2538,6 +2582,20 @@ func _StringRules_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Bu x, err := b.DecodeVarint() m.WellKnown = &StringRules_Uuid{x != 0} return true, err + case 24: // well_known.header_name + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &StringRules_HeaderName{x != 0} + return true, err + case 25: // well_known.header_value + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &StringRules_HeaderValue{x != 0} + return true, err default: return false, nil } @@ -2574,6 +2632,12 @@ func _StringRules_OneofSizer(msg proto.Message) (n int) { case *StringRules_Uuid: n += 2 // tag and wire n += 1 + case *StringRules_HeaderName: + n += 2 // tag and wire + n += 1 + case *StringRules_HeaderValue: + n += 2 // tag and wire + n += 1 case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) @@ -2629,7 +2693,7 @@ func (m *BytesRules) Reset() { *m = BytesRules{} } func (m *BytesRules) String() string { return proto.CompactTextString(m) } func (*BytesRules) ProtoMessage() {} func (*BytesRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{15} + return fileDescriptor_validate_c04c5f1a429949aa, []int{15} } func (m *BytesRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BytesRules.Unmarshal(m, b) @@ -2881,7 +2945,7 @@ func (m *EnumRules) Reset() { *m = EnumRules{} } func (m *EnumRules) String() string { return proto.CompactTextString(m) } func (*EnumRules) ProtoMessage() {} func (*EnumRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{16} + return fileDescriptor_validate_c04c5f1a429949aa, []int{16} } func (m *EnumRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumRules.Unmarshal(m, b) @@ -2946,7 +3010,7 @@ func (m *MessageRules) Reset() { *m = MessageRules{} } func (m *MessageRules) String() string { return proto.CompactTextString(m) } func (*MessageRules) ProtoMessage() {} func (*MessageRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{17} + return fileDescriptor_validate_c04c5f1a429949aa, []int{17} } func (m *MessageRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MessageRules.Unmarshal(m, b) @@ -3005,7 +3069,7 @@ func (m *RepeatedRules) Reset() { *m = RepeatedRules{} } func (m *RepeatedRules) String() string { return proto.CompactTextString(m) } func (*RepeatedRules) ProtoMessage() {} func (*RepeatedRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{18} + return fileDescriptor_validate_c04c5f1a429949aa, []int{18} } func (m *RepeatedRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RepeatedRules.Unmarshal(m, b) @@ -3079,7 +3143,7 @@ func (m *MapRules) Reset() { *m = MapRules{} } func (m *MapRules) String() string { return proto.CompactTextString(m) } func (*MapRules) ProtoMessage() {} func (*MapRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{19} + return fileDescriptor_validate_c04c5f1a429949aa, []int{19} } func (m *MapRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MapRules.Unmarshal(m, b) @@ -3154,7 +3218,7 @@ func (m *AnyRules) Reset() { *m = AnyRules{} } func (m *AnyRules) String() string { return proto.CompactTextString(m) } func (*AnyRules) ProtoMessage() {} func (*AnyRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{20} + return fileDescriptor_validate_c04c5f1a429949aa, []int{20} } func (m *AnyRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AnyRules.Unmarshal(m, b) @@ -3229,7 +3293,7 @@ func (m *DurationRules) Reset() { *m = DurationRules{} } func (m *DurationRules) String() string { return proto.CompactTextString(m) } func (*DurationRules) ProtoMessage() {} func (*DurationRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{21} + return fileDescriptor_validate_c04c5f1a429949aa, []int{21} } func (m *DurationRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DurationRules.Unmarshal(m, b) @@ -3343,7 +3407,7 @@ func (m *TimestampRules) Reset() { *m = TimestampRules{} } func (m *TimestampRules) String() string { return proto.CompactTextString(m) } func (*TimestampRules) ProtoMessage() {} func (*TimestampRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_66fcefccc247e3b8, []int{22} + return fileDescriptor_validate_c04c5f1a429949aa, []int{22} } func (m *TimestampRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TimestampRules.Unmarshal(m, b) @@ -3482,113 +3546,115 @@ func init() { proto.RegisterExtension(E_Rules) } -func init() { proto.RegisterFile("validate/validate.proto", fileDescriptor_validate_66fcefccc247e3b8) } - -var fileDescriptor_validate_66fcefccc247e3b8 = []byte{ - // 1670 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x98, 0x4b, 0x73, 0xdb, 0xc8, - 0x11, 0xc7, 0x43, 0xbc, 0x39, 0x24, 0x4d, 0x72, 0xac, 0x07, 0xac, 0x3c, 0x2c, 0xf3, 0x90, 0x92, - 0x1d, 0x5b, 0x72, 0x64, 0x85, 0x95, 0x52, 0xa5, 0x52, 0x15, 0xc5, 0x71, 0xc5, 0xa9, 0x38, 0x76, - 0x41, 0xf1, 0x65, 0x2f, 0x2c, 0x48, 0x1c, 0xd2, 0x53, 0x02, 0x07, 0x30, 0x1e, 0x92, 0xf8, 0x21, - 0xf6, 0xf1, 0x4d, 0xf6, 0xbc, 0xa7, 0xbd, 0xee, 0x75, 0x3f, 0xc6, 0x9e, 0xf7, 0x0b, 0x6c, 0xcd, - 0x0c, 0x06, 0x8f, 0x06, 0x44, 0x1d, 0xf6, 0xc6, 0xe9, 0xfe, 0xf7, 0xcc, 0x8f, 0xdd, 0x98, 0x41, - 0x0f, 0xd0, 0xee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0x5b, 0x40, 0xb9, 0x40, 0x2e, 0xe3, 0x01, - 0x89, 0x5c, 0xc1, 0x86, 0x01, 0xe7, 0xf5, 0x15, 0x92, 0x62, 0x85, 0x44, 0xae, 0xe0, 0xb4, 0x05, - 0x54, 0x56, 0x90, 0x32, 0x7c, 0x8c, 0xec, 0x05, 0xbd, 0x25, 0xf3, 0x57, 0xc7, 0x6e, 0x17, 0x16, - 0xec, 0x8d, 0x74, 0xa8, 0x10, 0x25, 0x2c, 0x62, 0xa6, 0x27, 0x2e, 0x6a, 0x8d, 0x29, 0x97, 0x51, - 0x42, 0xfc, 0x17, 0xe4, 0x24, 0x6a, 0xa1, 0x9e, 0x08, 0xda, 0xad, 0xa0, 0x81, 0x95, 0x0a, 0x69, - 0x19, 0x36, 0x3d, 0x71, 0xfb, 0xed, 0x61, 0xe5, 0x62, 0x85, 0x14, 0x3f, 0x45, 0xc6, 0x45, 0x18, - 0x06, 0xee, 0x40, 0x84, 0x3c, 0x2c, 0x43, 0xce, 0xc2, 0x30, 0x50, 0x72, 0x21, 0x11, 0x19, 0x4b, - 0x63, 0xca, 0x96, 0xee, 0x83, 0x46, 0xc6, 0x84, 0xbd, 0xcc, 0x98, 0x18, 0xf2, 0x67, 0xe4, 0x62, - 0x9d, 0x92, 0xc4, 0x1d, 0xc2, 0x67, 0xe4, 0x8c, 0x9b, 0x8b, 0x67, 0x44, 0x88, 0x38, 0x09, 0x61, - 0xd9, 0xca, 0x1d, 0x41, 0x92, 0x7f, 0xb1, 0x6c, 0x55, 0x90, 0x70, 0x09, 0xff, 0xaf, 0x31, 0x89, - 0x88, 0x9f, 0x92, 0xb9, 0x8b, 0xe1, 0x7f, 0xf5, 0x72, 0x4f, 0xf1, 0x5f, 0x95, 0x14, 0xff, 0x11, - 0xe9, 0x2b, 0x3f, 0x72, 0x1f, 0x8a, 0x08, 0x5c, 0xd9, 0x6e, 0x7e, 0xa4, 0xc4, 0x5c, 0xc0, 0x75, - 0x3e, 0x5b, 0xbb,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, 0x4d, 0x1e, 0x1d, 0xf2, 0xe8, 0x90, - 0x47, 0x87, 0x3c, 0x3a, 0xe4, 0xd1, 0x5b, 0x78, 0xf4, 0x6a, 0xc1, 0x3e, 0xde, 0x95, 0xa0, 0x41, - 0x13, 0x68, 0x00, 0x81, 0x06, 0x10, 0x68, 0x00, 0x81, 0x06, 0x10, 0x68, 0xd0, 0x02, 0x34, 0x80, - 0x40, 0xad, 0x19, 0x32, 0x9a, 0x40, 0x06, 0x04, 0x32, 0x20, 0x90, 0x01, 0x81, 0x0c, 0x08, 0x64, - 0xb4, 0x00, 0x19, 0x55, 0xa0, 0xf3, 0xbb, 0x32, 0x34, 0x6e, 0x02, 0x8d, 0x21, 0xd0, 0x18, 0x02, - 0x8d, 0x21, 0xd0, 0x18, 0x02, 0x8d, 0x5b, 0x80, 0xc6, 0x10, 0xa8, 0x35, 0x43, 0xb8, 0x09, 0x84, - 0x21, 0x10, 0x86, 0x40, 0x18, 0x02, 0x61, 0x08, 0x84, 0x5b, 0x80, 0xb0, 0x02, 0xfa, 0xba, 0x83, - 0xfa, 0xd5, 0xb7, 0x51, 0x9d, 0xc8, 0x6e, 0x12, 0xd9, 0x90, 0xc8, 0x86, 0x44, 0x36, 0x24, 0xb2, - 0x21, 0x91, 0xdd, 0x42, 0x64, 0x37, 0x88, 0x5a, 0x73, 0x64, 0x35, 0x89, 0x2c, 0x48, 0x64, 0x41, - 0x22, 0x0b, 0x12, 0x59, 0x90, 0xc8, 0x6a, 0x21, 0xb2, 0x14, 0xd1, 0x37, 0x1d, 0x34, 0x38, 0xbf, - 0x3b, 0x49, 0xc3, 0x26, 0xd2, 0x10, 0x22, 0x0d, 0x21, 0xd2, 0x10, 0x22, 0x0d, 0x21, 0xd2, 0xb0, - 0x05, 0x69, 0xd8, 0x44, 0x6a, 0xcd, 0xd2, 0xa8, 0x89, 0x34, 0x82, 0x48, 0x23, 0x88, 0x34, 0x82, - 0x48, 0x23, 0x88, 0x34, 0x6a, 0x41, 0x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, 0x11, 0x90, 0x39, 0x7e, 0xdc, 0x90, 0xe7, - 0xe7, 0xda, 0xfb, 0x88, 0xc7, 0x24, 0xee, 0xb7, 0x72, 0xb5, 0x22, 0xe2, 0xf4, 0xb4, 0x2c, 0x10, - 0xfe, 0x7d, 0x23, 0xfa, 0x3d, 0x23, 0xe1, 0x02, 0xc6, 0x2a, 0xfd, 0xe9, 0x7f, 0x90, 0x19, 0x8b, - 0x2a, 0x37, 0x03, 0xc5, 0xc6, 0xae, 0x05, 0xde, 0x79, 0x64, 0x89, 0x29, 0xce, 0x3e, 0xa0, 0x3d, - 0x1a, 0x1e, 0x12, 0x76, 0x1d, 0xae, 0xa3, 0x38, 0xbc, 0x5d, 0x1f, 0x46, 0xcb, 0xeb, 0x42, 0xff, - 0xc5, 0xf1, 0x92, 0xa6, 0x9f, 0xb2, 0x8b, 0xc3, 0xcb, 0x70, 0x75, 0x54, 0x6a, 0xe4, 0x07, 0xd1, - 0xcb, 0x17, 0x4b, 0xc2, 0x5e, 0x34, 0xbe, 0xc3, 0xfe, 0x12, 0x00, 0x00, 0xff, 0xff, 0xff, 0xae, - 0xfa, 0x73, 0x9b, 0x15, 0x00, 0x00, +func init() { proto.RegisterFile("validate/validate.proto", fileDescriptor_validate_c04c5f1a429949aa) } + +var fileDescriptor_validate_c04c5f1a429949aa = []byte{ + // 1707 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x98, 0x4b, 0x6f, 0x23, 0xb9, + 0x11, 0xc7, 0xa3, 0x7e, 0x8b, 0x92, 0x46, 0x12, 0xd7, 0xe3, 0xe9, 0x71, 0x1e, 0xeb, 0x51, 0x80, + 0xc0, 0x33, 0x99, 0xb5, 0x27, 0x5e, 0x47, 0x08, 0x8c, 0x20, 0x40, 0x9c, 0xcd, 0x20, 0x13, 0x64, + 0x77, 0x16, 0xed, 0x6c, 0x0e, 0xb9, 0x08, 0x6d, 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, 0x4f, 0xd8, 0xc5, 0x08, 0x1f, 0x20, 0xef, 0x3a, + 0x66, 0x79, 0x48, 0x59, 0x06, 0x8d, 0x68, 0x3f, 0x28, 0xc7, 0xf8, 0x15, 0x1a, 0xf2, 0x04, 0x97, + 0xfe, 0x17, 0xe0, 0x1f, 0xb0, 0x38, 0xff, 0x8d, 0x92, 0x88, 0x3d, 0x41, 0x87, 0xe6, 0x51, 0x5f, + 0xdb, 0x93, 0x01, 0xd8, 0xc4, 0x9e, 0xe0, 0x7d, 0x64, 0x93, 0x4d, 0x48, 0x23, 0xe8, 0x25, 0x3d, + 0xde, 0xa5, 0xc1, 0x10, 0xff, 0x00, 0x79, 0x37, 0x71, 0x96, 0xb3, 0x70, 0x43, 0xa0, 0x67, 0xe4, + 0xae, 0xd2, 0x82, 0x27, 0xc8, 0xa0, 0x09, 0xb4, 0x87, 0xdc, 0x6e, 0xd0, 0x04, 0xef, 0x21, 0x8b, + 0x26, 0x77, 0x67, 0xd0, 0x02, 0x72, 0x1b, 0x8c, 0xa4, 0x75, 0x0e, 0xbd, 0x9e, 0xb2, 0xce, 0x31, + 0x46, 0x66, 0x91, 0x52, 0xb8, 0x0e, 0x71, 0x23, 0x1f, 0xe0, 0x97, 0xc8, 0x2d, 0x52, 0xba, 0x48, + 0xc9, 0x0a, 0x3a, 0x3d, 0x0f, 0x5a, 0xfe, 0x94, 0x06, 0x64, 0x85, 0x0f, 0x90, 0x1b, 0x2e, 0x97, + 0x29, 0xc9, 0x32, 0xe8, 0xbe, 0xb8, 0x4b, 0x19, 0xf8, 0x02, 0x45, 0x41, 0x97, 0xd0, 0x5e, 0xc1, + 0x02, 0x7c, 0x84, 0x5f, 0xa1, 0xc1, 0x0d, 0x09, 0x97, 0x24, 0x5d, 0x00, 0xbf, 0x2f, 0x9d, 0x48, + 0x18, 0xbf, 0xe2, 0xff, 0xe0, 0xc7, 0x68, 0x28, 0x25, 0x77, 0x61, 0x54, 0x10, 0xff, 0xa5, 0xd4, + 0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0xff, 0xff, 0xcc, 0x4e, 0xd6, 0x62, 0xe3, 0x15, 0x00, 0x00, } From 0ada956989fe6799b29a1e7cb9df1dcb3812421f Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Tue, 17 Dec 2019 09:44:50 -0500 Subject: [PATCH 03/25] simplify conditions Signed-off-by: Asra Ali --- .../src/main/java/io/envoyproxy/pgv/StringValidation.java | 2 +- templates/go/file.go | 2 ++ templates/gogo/file.go | 2 ++ templates/goshared/known.go | 2 +- validate/validate.h | 4 ++-- validate/validator.py | 4 ++-- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java b/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java index 4094e63b8..7df6fa2e0 100644 --- a/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java +++ b/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java @@ -227,7 +227,7 @@ public static void headerValue(final String field, final String value) throws Va for (int i = 0; i < chars.length; i++) { final char c = chars[i]; - if (!(c == '\t' || c == ' ' || ('!' <= c && c <= '~') || 127 < c)) { + if (c < 32 && c != '\t' || c == 127) { throw new ValidationException(field, enquote(value), "invalid header value string"); } } diff --git a/templates/go/file.go b/templates/go/file.go index 757d4262a..73b19b771 100644 --- a/templates/go/file.go +++ b/templates/go/file.go @@ -15,6 +15,7 @@ import ( "regexp" "strings" "time" + "unicode" "unicode/utf8" "github.com/golang/protobuf/ptypes" @@ -37,6 +38,7 @@ var ( _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = ptypes.DynamicAny{} + _ = unicode.IsControl {{ range (externalEnums .) }} _ = {{ pkg . }}.{{ name . }}(0) diff --git a/templates/gogo/file.go b/templates/gogo/file.go index 0f19a3e4d..5b3da8c56 100644 --- a/templates/gogo/file.go +++ b/templates/gogo/file.go @@ -15,6 +15,7 @@ import ( "regexp" "strings" "time" + "unicode" "unicode/utf8" "github.com/gogo/protobuf/types" @@ -37,6 +38,7 @@ var ( _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = types.DynamicAny{} + _ = unicode.IsControl {{ range (externalEnums .) }} _ = {{ pkg . }}.{{ name . }}(0) diff --git a/templates/goshared/known.go b/templates/goshared/known.go index 66f60b732..7d16405f5 100644 --- a/templates/goshared/known.go +++ b/templates/goshared/known.go @@ -80,7 +80,7 @@ const headerNameTpl = ` const headerValueTpl = ` func (m {{ (msgTyp .).Pointer }}) _validateHeaderValue(hdr string) error { for _, r := range hdr { - if !(r == '\t' || r == ' ' || '!' <= r && r <= '~' || '\x7f' < r) { + if unicode.IsControl(r) && (r != '\t') { return fmt.Errorf("invalid header value character, got %q", string(r)) } } diff --git a/validate/validate.h b/validate/validate.h index 14887a657..d922968cc 100644 --- a/validate/validate.h +++ b/validate/validate.h @@ -149,8 +149,8 @@ static inline bool IsHeaderName(const string& to_validate) { } static inline bool IsHeaderValue(const string& to_validate) { - for (const char& r : to_validate) { - if (!((r == '\t') || (r == ' ') || ('!' <= r && r <= '~') || ('\x7f' < r))) { + for (const unsigned char& r : to_validate) { + if (std::iscntrl(r) && r != '\t') { return false; } } diff --git a/validate/validator.py b/validate/validator.py index 78188a656..8acbe5e40 100644 --- a/validate/validator.py +++ b/validate/validator.py @@ -77,10 +77,10 @@ def _validateHeaderName(header): if (r < 'A' or r > 'Z') and (r < 'a' or r > 'z') and (r < '0' or r > '9') and (r not in "!#$%&'*+-.^_`|~"): return False return True - + def _validateHeaderValue(header): for r in header: - if not (r == '\t' or r == ' ' or ('!' <= r and r <= '~') or '\x7f' < r): + if (ord(r) < 32 and (r != '\t')) or (ord(r) == 127): return False return True From b538b97209d78a204219bba4a0f617f3981f1f8f Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Tue, 17 Dec 2019 10:08:58 -0500 Subject: [PATCH 04/25] fix java build Signed-off-by: Asra Ali --- .../src/main/java/io/envoyproxy/pgv/StringValidation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java b/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java index 7df6fa2e0..d185f44be 100644 --- a/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java +++ b/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java @@ -211,7 +211,7 @@ public static void uuid(final String field, final String value) throws Validatio public static void headerName(final String field, final String value) throws ValidationException { final char[] chars = value.toCharArray(); - final String whitelist = "!#$%&'`*+-.^_|~"; + final String whitelist = "!#$%&\'`*+-.^_|~"; for (int i = 0; i < chars.length; i++) { final char c = chars[i]; From 183e106237f65ba3c58dfc282a5af6c6d40f4eb4 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Tue, 17 Dec 2019 10:14:21 -0500 Subject: [PATCH 05/25] bad test Signed-off-by: Asra Ali --- .../src/test/java/io/envoyproxy/pgv/StringValidationTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java index aa225b5a5..14b92ad2b 100644 --- a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java +++ b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java @@ -278,7 +278,6 @@ public void headerValueWorks() throws ValidationException { // No Match assertThatThrownBy(() -> StringValidation.header_value("x", "foo\000bar")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.header_value("x", "\x7f")).isInstanceOf(ValidationException.class); assertThatThrownBy(() -> StringValidation.header_value("x", "example\r")).isInstanceOf(ValidationException.class); } From cfaec72605aabb0c53f161944cff10aa01cdf358 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Tue, 17 Dec 2019 10:18:44 -0500 Subject: [PATCH 06/25] java Signed-off-by: Asra Ali --- .../envoyproxy/pgv/StringValidationTest.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java index 14b92ad2b..7ee110f74 100644 --- a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java +++ b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java @@ -257,28 +257,28 @@ public void uuidWorks() throws ValidationException { @Test public void headerNameWorks() throws ValidationException { // Match - StringValidation.header_name("x", "cluster.name"); - StringValidation.header_name("x", "/TEST/LONG/URL"); - StringValidation.header_name("x", "clustername"); - StringValidation.header_name("x", "!#%&./+"); + StringValidation.headerName("x", "cluster.name"); + StringValidation.headerName("x", "/TEST/LONG/URL"); + StringValidation.headerName("x", "clustername"); + StringValidation.headerName("x", "!#%&./+"); // No Match - assertThatThrownBy(() -> StringValidation.header_name("x", "foo\000bar")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.header_name("x", "cluster name")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.header_name("x", "example\r")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.headerName("x", "foo\000bar")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.headerName("x", "cluster name")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.headerName("x", "example\r")).isInstanceOf(ValidationException.class); } @Test public void headerValueWorks() throws ValidationException { // Match - StringValidation.header_value("x", "cluster.name"); - StringValidation.header_value("x", "/TEST/LONG/URL"); - StringValidation.header_value("x", "cluster name"); - StringValidation.header_value("x", "!#%&./+"); + StringValidation.headerValue("x", "cluster.name"); + StringValidation.headerValue("x", "/TEST/LONG/URL"); + StringValidation.headerValue("x", "cluster name"); + StringValidation.headerValue("x", "!#%&./+"); // No Match - assertThatThrownBy(() -> StringValidation.header_value("x", "foo\000bar")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.header_value("x", "example\r")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.headerValue("x", "foo\000bar")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.headerValue("x", "example\r")).isInstanceOf(ValidationException.class); } } From c9f0f24a97621589be9685025bb64e556e207120 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Tue, 17 Dec 2019 10:25:47 -0500 Subject: [PATCH 07/25] check for slashes in hdr name Signed-off-by: Asra Ali --- .../src/test/java/io/envoyproxy/pgv/StringValidationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java index 7ee110f74..271b17c54 100644 --- a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java +++ b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java @@ -258,12 +258,12 @@ public void uuidWorks() throws ValidationException { public void headerNameWorks() throws ValidationException { // Match StringValidation.headerName("x", "cluster.name"); - StringValidation.headerName("x", "/TEST/LONG/URL"); StringValidation.headerName("x", "clustername"); StringValidation.headerName("x", "!#%&./+"); // No Match assertThatThrownBy(() -> StringValidation.headerName("x", "foo\000bar")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.headerName("x", "test/long/url")).isInstanceOf(ValidationException.class); assertThatThrownBy(() -> StringValidation.headerName("x", "cluster name")).isInstanceOf(ValidationException.class); assertThatThrownBy(() -> StringValidation.headerName("x", "example\r")).isInstanceOf(ValidationException.class); } From a8bdbfbe851137fd5d6a1af168c8bfc0e1207efb Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Tue, 17 Dec 2019 11:05:12 -0500 Subject: [PATCH 08/25] add more testcases Signed-off-by: Asra Ali --- .../main/java/io/envoyproxy/pgv/StringValidation.java | 10 +++++++++- .../java/io/envoyproxy/pgv/StringValidationTest.java | 5 ++++- templates/goshared/known.go | 9 ++++++++- tests/harness/executor/cases.go | 6 +++++- validate/validate.h | 10 +++++++++- validate/validator.py | 8 +++++++- 6 files changed, 42 insertions(+), 6 deletions(-) diff --git a/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java b/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java index d185f44be..38a36d511 100644 --- a/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java +++ b/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java @@ -211,9 +211,17 @@ public static void uuid(final String field, final String value) throws Validatio public static void headerName(final String field, final String value) throws ValidationException { final char[] chars = value.toCharArray(); + int start = 0; + if (chars[0] == ':') { + if (chars.length == 1) { + throw new ValidationException(field, enquote(value), "invalid header name string"); + } + start = 1; + } + final String whitelist = "!#$%&\'`*+-.^_|~"; - for (int i = 0; i < chars.length; i++) { + for (int i = start; i < chars.length; i++) { final char c = chars[i]; if ((c < '0' || c > '9') && (c < 'a' || c > 'z') && (c < 'A' || c > 'Z') && whitelist.indexOf(c) < 0) { throw new ValidationException(field, enquote(value), "invalid header name string"); diff --git a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java index 271b17c54..e714f8031 100644 --- a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java +++ b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java @@ -258,14 +258,17 @@ public void uuidWorks() throws ValidationException { public void headerNameWorks() throws ValidationException { // Match StringValidation.headerName("x", "cluster.name"); + StringValidation.headerName("x", ":path"); StringValidation.headerName("x", "clustername"); - StringValidation.headerName("x", "!#%&./+"); + StringValidation.headerName("x", "!#%&.+"); // No Match assertThatThrownBy(() -> StringValidation.headerName("x", "foo\000bar")).isInstanceOf(ValidationException.class); assertThatThrownBy(() -> StringValidation.headerName("x", "test/long/url")).isInstanceOf(ValidationException.class); assertThatThrownBy(() -> StringValidation.headerName("x", "cluster name")).isInstanceOf(ValidationException.class); assertThatThrownBy(() -> StringValidation.headerName("x", "example\r")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.headerName("x", ":")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.headerName("x", "")).isInstanceOf(ValidationException.class); } @Test diff --git a/templates/goshared/known.go b/templates/goshared/known.go index 7d16405f5..2b282c444 100644 --- a/templates/goshared/known.go +++ b/templates/goshared/known.go @@ -66,7 +66,14 @@ const uuidTpl = ` const headerNameTpl = ` func (m {{ (msgTyp .).Pointer }}) _validateHeaderName(hdr string) error { - for _, r := range hdr { + var start = 0; + if hdr[0] == ':' { + if len(hdr) == 1 { + return fmt.Errorf("invalid HTTP header name") + } + start += 1; + } + for _, r := range hdr[start:] { if ((r < 'A' || r > 'Z') && (r < 'a' || r > 'z') && (r < '0' || r > '9') && !strings.ContainsRune("!#$%&'*+-.^_|~", r)) { return fmt.Errorf("invalid header name character, got %q", string(r)) diff --git a/tests/harness/executor/cases.go b/tests/harness/executor/cases.go index 1695b0640..cd472538f 100644 --- a/tests/harness/executor/cases.go +++ b/tests/harness/executor/cases.go @@ -866,12 +866,16 @@ var stringCases = []TestCase{ {"string - UUID - invalid (bad UUID)", &cases.StringUUID{Val: "ffffffff-ffff-ffff-ffff-fffffffffffff"}, false}, {"string - header name - valid", &cases.StringHeaderName{Val: "clustername"}, true}, + {"string - header name - valid", &cases.StringHeaderName{Val: ":path"}, true}, {"string - header name - valid (nums)", &cases.StringHeaderName{Val: "cluster-123"}, true}, {"string - header name - valid (special token)", &cases.StringHeaderName{Val: "!+#&.%"}, true}, - {"string - header name - valid (period)", &cases.StringHeaderName{Val: "cluster.name"}, true}, + {"string - header name - valid (period)", &cases.StringHeaderName{Val: "CLUSTER.NAME"}, true}, + {"string - header name - invalid", &cases.StringHeaderName{Val: ":"}, false}, + {"string - header name - invalid", &cases.StringHeaderName{Val: ":path:"}, false}, {"string - header name - invalid (space)", &cases.StringHeaderName{Val: "cluster name"}, false}, {"string - header name - invalid (return)", &cases.StringHeaderName{Val: "example\r"}, false}, {"string - header name - invalid (tab)", &cases.StringHeaderName{Val: "example\t"}, false}, + {"string - header name - invalid (slash)", &cases.StringHeaderName{Val: "/test/long/url"}, false}, {"string - header value - valid", &cases.StringHeaderValue{Val: "cluster.name.123"}, true}, {"string - header value - valid (uppercase)", &cases.StringHeaderValue{Val: "/TEST/LONG/URL"}, true}, diff --git a/validate/validate.h b/validate/validate.h index d922968cc..a1e1b31a8 100644 --- a/validate/validate.h +++ b/validate/validate.h @@ -138,8 +138,16 @@ static inline bool IsHostname(const string& to_validate) { } static inline bool IsHeaderName(const string& to_validate) { + int start = 0; + if (to_validate[0] == ':') { + if (to_validate.size() == 1) { + return false; + } + start = 1; + } + const std::string whitelist = "!#$%&'*+-.^_`|~"; - for (const char& r : to_validate) { + for (const char& r : to_validate.substr(start)) { if ((r < 'A' || r > 'Z') && (r < 'a' || r > 'z') && (r < '0' || r > '9') && whitelist.find(r) == std::string::npos) { return false; diff --git a/validate/validator.py b/validate/validator.py index 8acbe5e40..428c2fdc0 100644 --- a/validate/validator.py +++ b/validate/validator.py @@ -73,7 +73,13 @@ def _validateEmail(addr): return _validateHostName(parts[1]) def _validateHeaderName(header): - for r in header: + start = 0 + if header[0] == ":": + if len(header) == 1: + return False + start = 1 + + for r in header[start:]: if (r < 'A' or r > 'Z') and (r < 'a' or r > 'z') and (r < '0' or r > '9') and (r not in "!#$%&'*+-.^_`|~"): return False return True From 084d9ab803ec435d21ccc4ed22860ffe7631b674 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Tue, 17 Dec 2019 11:11:45 -0500 Subject: [PATCH 09/25] empty Signed-off-by: Asra Ali --- .../src/test/java/io/envoyproxy/pgv/StringValidationTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java index e714f8031..6322f3d3b 100644 --- a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java +++ b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java @@ -268,7 +268,6 @@ public void headerNameWorks() throws ValidationException { assertThatThrownBy(() -> StringValidation.headerName("x", "cluster name")).isInstanceOf(ValidationException.class); assertThatThrownBy(() -> StringValidation.headerName("x", "example\r")).isInstanceOf(ValidationException.class); assertThatThrownBy(() -> StringValidation.headerName("x", ":")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.headerName("x", "")).isInstanceOf(ValidationException.class); } @Test From 61dad583b63f1a618c2e6ce7c4b0f94c2261ab91 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Wed, 18 Dec 2019 11:16:45 -0500 Subject: [PATCH 10/25] define regex for http header name/value Signed-off-by: Asra Ali --- README.md | 8 +- .../io/envoyproxy/pgv/StringValidation.java | 34 +- .../envoyproxy/pgv/StringValidationTest.java | 34 +- rule_comparison.md | 4 +- templates/cc/file.go | 6 + templates/cc/string.go | 16 +- templates/go/file.go | 9 +- templates/gogo/file.go | 6 + templates/goshared/known.go | 28 +- templates/goshared/msg.go | 4 +- templates/goshared/register.go | 4 +- templates/goshared/string.go | 8 +- templates/java/string.go | 8 +- templates/shared/well_known.go | 18 +- tests/harness/cases/strings.proto | 4 +- tests/harness/executor/cases.go | 40 +-- validate/validate.h | 28 -- validate/validate.pb.go | 321 +++++++++--------- validate/validate.proto | 12 +- validate/validator.py | 30 +- 20 files changed, 281 insertions(+), 341 deletions(-) diff --git a/README.md b/README.md index d389b1397..527050d5a 100644 --- a/README.md +++ b/README.md @@ -399,11 +399,11 @@ Check the [constraint rule comparison matrix](rule_comparison.md) for language-s // x must be a valid UUID (via RFC 4122) string x = 1 [(validate.rules).string.uuid = true]; - // x must be a valid header name (via RFC 7230) - string x = 1 [(validate.rules).string.header_name = true]; + // x must be a valid HTTP header name (via RFC 7230) + string x = 1 [(validate.rules).string.http_header_name = true]; - // x must be a valid header value (via RFC 7230) - string x = 1 [(validate.rules).string.header_value = true]; + // x must be a valid HTTP header value (via RFC 7230) + string x = 1 [(validate.rules).string.http_header_value = true]; ``` ### Bytes diff --git a/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java b/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java index 38a36d511..df9af10c0 100644 --- a/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java +++ b/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java @@ -19,6 +19,8 @@ public final class StringValidation { private static final int UUID_DASH_3 = 18; private static final int UUID_DASH_4 = 23; private static final int UUID_LEN = 36; + private static final Pattern HTTP_HEADER_NAME_PATTERN = Pattern.compile("^:?[0-9a-zA-Z!#$%&'*+-.^_|~\u002C]+$"); + private static final Pattern HTTP_HEADER_VALUE_PATTERN = Pattern.compile("^[ \t]*(?:[\u0020-\u007E\u0080-\u00FF](?:[ \t]+[\u0020-\u007E\u0080-\u00FF])?)*[ \t]*$"); private StringValidation() { // Intentionally left blank. @@ -208,37 +210,19 @@ public static void uuid(final String field, final String value) throws Validatio throw new ValidationException(field, enquote(value), "invalid UUID string"); } - public static void headerName(final String field, final String value) throws ValidationException { - final char[] chars = value.toCharArray(); - - int start = 0; - if (chars[0] == ':') { - if (chars.length == 1) { - throw new ValidationException(field, enquote(value), "invalid header name string"); - } - start = 1; + public static void httpHeaderName(final String field, final String value) throws ValidationException { + if (!HTTP_HEADER_NAME_PATTERN.matches(value)) { + throw new ValidationException(field, enquote(value), "invalid HTTP header name string"); } - final String whitelist = "!#$%&\'`*+-.^_|~"; - - for (int i = start; i < chars.length; i++) { - final char c = chars[i]; - if ((c < '0' || c > '9') && (c < 'a' || c > 'z') && (c < 'A' || c > 'Z') && whitelist.indexOf(c) < 0) { - throw new ValidationException(field, enquote(value), "invalid header name string"); - } - } return; } - public static void headerValue(final String field, final String value) throws ValidationException { - final char[] chars = value.toCharArray(); - - for (int i = 0; i < chars.length; i++) { - final char c = chars[i]; - if (c < 32 && c != '\t' || c == 127) { - throw new ValidationException(field, enquote(value), "invalid header value string"); - } + public static void httpHeaderValue(final String field, final String value) throws ValidationException { + if (!HTTP_HEADER_VALUE_PATTERN.matches(value)) { + throw new ValidationException(field, enquote(value), "invalid HTTP header value string"); } + return; } diff --git a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java index 6322f3d3b..6380d5725 100644 --- a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java +++ b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java @@ -255,32 +255,32 @@ public void uuidWorks() throws ValidationException { } @Test - public void headerNameWorks() throws ValidationException { + public void httpHeaderNameWorks() throws ValidationException { // Match - StringValidation.headerName("x", "cluster.name"); - StringValidation.headerName("x", ":path"); - StringValidation.headerName("x", "clustername"); - StringValidation.headerName("x", "!#%&.+"); + StringValidation.httpHeaderName("x", "cluster.name"); + StringValidation.httpHeaderName("x", ":path"); + StringValidation.httpHeaderName("x", "clustername"); + StringValidation.httpHeaderName("x", "!#%&.+"); // No Match - assertThatThrownBy(() -> StringValidation.headerName("x", "foo\000bar")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.headerName("x", "test/long/url")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.headerName("x", "cluster name")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.headerName("x", "example\r")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.headerName("x", ":")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.httpHeaderName("x", "foo\000bar")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.httpHeaderName("x", "test/long/url")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.httpHeaderName("x", "cluster name")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.httpHeaderName("x", "example\r")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.httpHeaderName("x", ":")).isInstanceOf(ValidationException.class); } @Test - public void headerValueWorks() throws ValidationException { + public void httpHeaderValueWorks() throws ValidationException { // Match - StringValidation.headerValue("x", "cluster.name"); - StringValidation.headerValue("x", "/TEST/LONG/URL"); - StringValidation.headerValue("x", "cluster name"); - StringValidation.headerValue("x", "!#%&./+"); + StringValidation.httpHeaderValue("x", "cluster.name"); + StringValidation.httpHeaderValue("x", "/TEST/LONG/URL"); + StringValidation.httpHeaderValue("x", "cluster name"); + StringValidation.httpHeaderValue("x", "!#%&./+"); // No Match - assertThatThrownBy(() -> StringValidation.headerValue("x", "foo\000bar")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.headerValue("x", "example\r")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.httpHeaderValue("x", "foo\000bar")).isInstanceOf(ValidationException.class); + assertThatThrownBy(() -> StringValidation.httpHeaderValue("x", "example\r")).isInstanceOf(ValidationException.class); } } diff --git a/rule_comparison.md b/rule_comparison.md index 9d7678945..0c6756134 100644 --- a/rule_comparison.md +++ b/rule_comparison.md @@ -35,8 +35,8 @@ | uri |✅|✅|❌|✅|✅| | uri_ref |✅|✅|❌|✅|✅| | uuid |✅|✅|✅|✅|✅| -| header_name |✅|✅|✅|✅|✅| -| header_value |✅|✅|✅|✅|✅| +| http_header_name |✅|✅|✅|✅|✅| +| http_header_value |✅|✅|✅|✅|✅| ## Bytes | Constraint Rule | Go | GoGo | C++ | Java | Python | diff --git a/templates/cc/file.go b/templates/cc/file.go index 4087ae8b2..4ed86a004 100644 --- a/templates/cc/file.go +++ b/templates/cc/file.go @@ -21,6 +21,12 @@ using std::string; // define the regex for a UUID once up-front const re2::RE2 _uuidPattern("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"); +// define the regex for an HTTP header name once up-front +const re2::RE2 _httpHeaderName("^:?[0-9a-zA-Z!#$%&'*+-.^_|~\x2C]+$"); + +// define the regex for an HTTP header value once up-front +const re2::RE2 _httpHeaderValue("^[ \t]*(?:[\x20-\x7E\u0080-\u00FF](?:[ \t]+[\x20-\x7E\u0080-\u00FF])?)*[ \t]*$"); + {{ range .AllMessages }} {{- if not (disabled .) -}} diff --git a/templates/cc/string.go b/templates/cc/string.go index 00af09c34..a7929d39d 100644 --- a/templates/cc/string.go +++ b/templates/cc/string.go @@ -179,20 +179,16 @@ const strTpl = ` if (!RE2::FullMatch(re2::StringPiece({{ accessor . }}), pgv::validate::_uuidPattern)) { {{ err . "value must be a valid UUID" }} } - {{ else if $r.GetHeaderName }} + {{ else if $r.GetHttpHeaderName }} { - const std::string& name = {{ accessor . }}; - - if (!pgv::IsHeaderName(name)) { - {{ err . "value must be a valid HTTP header name" }} + if (!RE2::FullMatch(re2::StringPiece({{ accessor . }}), pgv::validate::_httpHeaderName)) { + {{ err . "value must be a valid HTTP Header Name" }} } } - {{ else if $r.GetHeaderValue }} + {{ else if $r.GetHttpHeaderValue }} { - const std::string& value = {{ accessor . }}; - - if (!pgv::IsHeaderValue(value)) { - {{ err . "value must be a valid HTTP header value" }} + if (!RE2::FullMatch(re2::StringPiece({{ accessor . }}), pgv::validate::_httpHeaderValue)) { + {{ err . "value must be a valid HTTP Header Value" }} } } {{ end }} diff --git a/templates/go/file.go b/templates/go/file.go index 73b19b771..d690f9023 100644 --- a/templates/go/file.go +++ b/templates/go/file.go @@ -15,7 +15,6 @@ import ( "regexp" "strings" "time" - "unicode" "unicode/utf8" "github.com/golang/protobuf/ptypes" @@ -38,7 +37,6 @@ var ( _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = ptypes.DynamicAny{} - _ = unicode.IsControl {{ range (externalEnums .) }} _ = {{ pkg . }}.{{ name . }}(0) @@ -48,6 +46,13 @@ var ( // define the regex for a UUID once up-front var _{{ snakeCase .File.InputPath.BaseName }}_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") +// define the regex for an HTTP header name once up-front +var _{{ snakeCase .File.InputPath.BaseName }}_httpHeaderName = regexp.MustCompile("^:?[0-9a-zA-Z!#$%&'*+-.^_|~\x2C]+$") + +// define the regex for an HTTP header value once up-front +var _{{ snakeCase .File.InputPath.BaseName }}_httpHeaderValue = regexp.MustCompile("^[ \t]*(?:[\x20-\x7E\u0080-\u00FF](?:[ \t]+[\x20-\x7E\u0080-\u00FF])?)*[ \t]*$") + + {{ range .AllMessages }} {{ template "msg" . }} {{ end }} diff --git a/templates/gogo/file.go b/templates/gogo/file.go index 5b3da8c56..aeca554e8 100644 --- a/templates/gogo/file.go +++ b/templates/gogo/file.go @@ -48,6 +48,12 @@ var ( // define the regex for a UUID once up-front var _{{ snakeCase .File.InputPath.BaseName }}_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") +// define the regex for an HTTP header name once up-front +var _{{ snakeCase .File.InputPath.BaseName }}_httpHeaderName = regexp.MustCompile("^:?[0-9a-zA-Z!#$%&'*+-.^_|~\x2C]+$") + +// define the regex for an HTTP header value once up-front +var _{{ snakeCase .File.InputPath.BaseName }}_httpHeaderValue = regexp.MustCompile("^[ \t]*(?:[\x20-\x7E\u0080-\u00FF](?:[ \t]+[\x20-\x7E\u0080-\u00FF])?)*[ \t]*$") + {{ range .AllMessages }} {{ template "msg" . }} {{ end }} diff --git a/templates/goshared/known.go b/templates/goshared/known.go index 2b282c444..2211f87a8 100644 --- a/templates/goshared/known.go +++ b/templates/goshared/known.go @@ -64,32 +64,20 @@ const uuidTpl = ` } ` -const headerNameTpl = ` - func (m {{ (msgTyp .).Pointer }}) _validateHeaderName(hdr string) error { - var start = 0; - if hdr[0] == ':' { - if len(hdr) == 1 { - return fmt.Errorf("invalid HTTP header name") - } - start += 1; - } - for _, r := range hdr[start:] { - if ((r < 'A' || r > 'Z') && (r < 'a' || r > 'z') && (r < '0' || r > '9') && - !strings.ContainsRune("!#$%&'*+-.^_|~", r)) { - return fmt.Errorf("invalid header name character, got %q", string(r)) - } +const httpHeaderNameTpl = ` + func (m {{ (msgTyp .).Pointer }}) _validateHttpHeaderName(hdr string) error { + if matched := _{{ snakeCase .File.InputPath.BaseName }}_httpHeaderName.MatchString(hdr); !matched { + return errors.New("invalid HTTP header name format") } return nil } ` -const headerValueTpl = ` - func (m {{ (msgTyp .).Pointer }}) _validateHeaderValue(hdr string) error { - for _, r := range hdr { - if unicode.IsControl(r) && (r != '\t') { - return fmt.Errorf("invalid header value character, got %q", string(r)) - } +const httpHeaderValueTpl = ` + func (m {{ (msgTyp .).Pointer }}) _validateHttpHeaderValue(hdr string) error { + if matched := _{{ snakeCase .File.InputPath.BaseName }}_httpHeaderValue.MatchString(hdr); !matched { + return errors.New("invalid HTTP header name format") } return nil diff --git a/templates/goshared/msg.go b/templates/goshared/msg.go index 952438a8f..edb4b80ba 100644 --- a/templates/goshared/msg.go +++ b/templates/goshared/msg.go @@ -42,9 +42,9 @@ func (m {{ (msgTyp .).Pointer }}) Validate() error { {{ if needs . "uuid" }}{{ template "uuid" . }}{{ end }} -{{ if needs . "headername" }}{{ template "headername" . }}{{ end }} +{{ if needs . "httpheadername" }}{{ template "httpheadername" . }}{{ end }} -{{ if needs . "headervalue" }}{{ template "headervalue" . }}{{ end }} +{{ if needs . "httpheadervalue" }}{{ template "httpheadervalue" . }}{{ end }} {{ cmt (errname .) " is the validation error returned by " (msgTyp .) ".Validate if the designated constraints aren't met." -}} type {{ errname . }} struct { diff --git a/templates/goshared/register.go b/templates/goshared/register.go index 3bb910d20..ea4d7bb22 100644 --- a/templates/goshared/register.go +++ b/templates/goshared/register.go @@ -76,8 +76,8 @@ func Register(tpl *template.Template, params pgs.Parameters) { template.Must(tpl.New("hostname").Parse(hostTpl)) template.Must(tpl.New("address").Parse(hostTpl)) template.Must(tpl.New("uuid").Parse(uuidTpl)) - template.Must(tpl.New("headername").Parse(headerNameTpl)) - template.Must(tpl.New("headervalue").Parse(headerValueTpl)) + template.Must(tpl.New("httpheadername").Parse(httpHeaderNameTpl)) + template.Must(tpl.New("httpheadervalue").Parse(httpHeaderValueTpl)) template.Must(tpl.New("enum").Parse(enumTpl)) template.Must(tpl.New("repeated").Parse(repTpl)) diff --git a/templates/goshared/string.go b/templates/goshared/string.go index cd4f8a3e7..ea8cb1454 100644 --- a/templates/goshared/string.go +++ b/templates/goshared/string.go @@ -120,12 +120,12 @@ const strTpl = ` if err := m._validateUuid({{ accessor . }}); err != nil { return {{ errCause . "err" "value must be a valid UUID" }} } - {{ else if $r.GetHeaderName }} - if err := m._validateHeaderName({{ accessor . }}); err != nil { + {{ else if $r.GetHttpHeaderName }} + if err := m._validateHttpHeaderName({{ accessor . }}); err != nil { return {{ errCause . "err" "value must be a valid HTTP header name" }} } - {{ else if $r.GetHeaderValue }} - if err := m._validateHeaderValue({{ accessor . }}); err != nil { + {{ else if $r.GetHttpHeaderValue }} + if err := m._validateHttpHeaderValue({{ accessor . }}); err != nil { return {{ errCause . "err" "value must be a valid HTTP header value" }} } {{ end }} diff --git a/templates/java/string.go b/templates/java/string.go index db4dd70ec..8e296ed35 100644 --- a/templates/java/string.go +++ b/templates/java/string.go @@ -89,10 +89,10 @@ const stringTpl = `{{ $f := .Field }}{{ $r := .Rules -}} {{- if $r.GetUuid }} io.envoyproxy.pgv.StringValidation.uuid("{{ $f.FullyQualifiedName }}", {{ accessor . }}); {{- end -}} -{{- if $r.GetHeaderName }} - io.envoyproxy.pgv.StringValidation.headerName("{{ $f.FullyQualifiedName }}", {{ accessor . }}); +{{- if $r.GetHttpHeaderName }} + io.envoyproxy.pgv.StringValidation.httpHeaderName("{{ $f.FullyQualifiedName }}", {{ accessor . }}); {{- end -}} -{{- if $r.GetHeaderValue }} - io.envoyproxy.pgv.StringValidation.headerValue("{{ $f.FullyQualifiedName }}", {{ accessor . }}); +{{- if $r.GetHttpHeaderValue }} + io.envoyproxy.pgv.StringValidation.httpHeaderValue("{{ $f.FullyQualifiedName }}", {{ accessor . }}); {{- end -}} ` diff --git a/templates/shared/well_known.go b/templates/shared/well_known.go index 75b2f3c5f..158573612 100644 --- a/templates/shared/well_known.go +++ b/templates/shared/well_known.go @@ -8,11 +8,11 @@ import ( type WellKnown string const ( - Email WellKnown = "email" - Hostname WellKnown = "hostname" - UUID WellKnown = "uuid" - HeaderName WellKnown = "headername" - HeaderValue WellKnown = "headervalue" + Email WellKnown = "email" + Hostname WellKnown = "hostname" + UUID WellKnown = "uuid" + HttpHeaderName WellKnown = "httpheadername" + HttpHeaderValue WellKnown = "httpheadervalue" ) // Needs returns true if a well-known string validator is needed for this @@ -63,12 +63,12 @@ func strRulesNeeds(rules *validate.StringRules, wk WellKnown) bool { if rules.GetUuid() { return true } - case HeaderName: - if rules.GetHeaderName() { + case HttpHeaderName: + if rules.GetHttpHeaderName() { return true } - case HeaderValue: - if rules.GetHeaderValue() { + case HttpHeaderValue: + if rules.GetHttpHeaderValue() { return true } } diff --git a/tests/harness/cases/strings.proto b/tests/harness/cases/strings.proto index daf51e3a6..6629a8bea 100644 --- a/tests/harness/cases/strings.proto +++ b/tests/harness/cases/strings.proto @@ -34,5 +34,5 @@ message StringIPv6 { string val = 1 [(validate.rules).string.ipv6 = tr message StringURI { string val = 1 [(validate.rules).string.uri = true]; } message StringURIRef { string val = 1 [(validate.rules).string.uri_ref = true]; } message StringUUID { string val = 1 [(validate.rules).string.uuid = true]; } -message StringHeaderName { string val = 1 [(validate.rules).string.header_name = true]; } -message StringHeaderValue { string val = 1 [(validate.rules).string.header_value = true]; } +message StringHttpHeaderName { string val = 1 [(validate.rules).string.http_header_name = true]; } +message StringHttpHeaderValue { string val = 1 [(validate.rules).string.http_header_value = true]; } diff --git a/tests/harness/executor/cases.go b/tests/harness/executor/cases.go index cd472538f..d924d4005 100644 --- a/tests/harness/executor/cases.go +++ b/tests/harness/executor/cases.go @@ -865,26 +865,26 @@ var stringCases = []TestCase{ {"string - UUID - invalid", &cases.StringUUID{Val: "foobar"}, false}, {"string - UUID - invalid (bad UUID)", &cases.StringUUID{Val: "ffffffff-ffff-ffff-ffff-fffffffffffff"}, false}, - {"string - header name - valid", &cases.StringHeaderName{Val: "clustername"}, true}, - {"string - header name - valid", &cases.StringHeaderName{Val: ":path"}, true}, - {"string - header name - valid (nums)", &cases.StringHeaderName{Val: "cluster-123"}, true}, - {"string - header name - valid (special token)", &cases.StringHeaderName{Val: "!+#&.%"}, true}, - {"string - header name - valid (period)", &cases.StringHeaderName{Val: "CLUSTER.NAME"}, true}, - {"string - header name - invalid", &cases.StringHeaderName{Val: ":"}, false}, - {"string - header name - invalid", &cases.StringHeaderName{Val: ":path:"}, false}, - {"string - header name - invalid (space)", &cases.StringHeaderName{Val: "cluster name"}, false}, - {"string - header name - invalid (return)", &cases.StringHeaderName{Val: "example\r"}, false}, - {"string - header name - invalid (tab)", &cases.StringHeaderName{Val: "example\t"}, false}, - {"string - header name - invalid (slash)", &cases.StringHeaderName{Val: "/test/long/url"}, false}, - - {"string - header value - valid", &cases.StringHeaderValue{Val: "cluster.name.123"}, true}, - {"string - header value - valid (uppercase)", &cases.StringHeaderValue{Val: "/TEST/LONG/URL"}, true}, - {"string - header value - valid (spaces)", &cases.StringHeaderValue{Val: "cluster name"}, true}, - {"string - header value - valid (tab)", &cases.StringHeaderValue{Val: "example\t"}, true}, - {"string - header value - valid (special token)", &cases.StringHeaderValue{Val: "!#%&./+"}, true}, - {"string - header value - invalid (NUL)", &cases.StringHeaderValue{Val: "foo\000bar"}, false}, - {"string - header value - invalid (DEL)", &cases.StringHeaderValue{Val: "\x7f"}, false}, - {"string - header value - invalid", &cases.StringHeaderValue{Val: "example\r"}, false}, + {"string - http header name - valid", &cases.StringHttpHeaderName{Val: "clustername"}, true}, + {"string - http header name - valid", &cases.StringHttpHeaderName{Val: ":path"}, true}, + {"string - http header name - valid (nums)", &cases.StringHttpHeaderName{Val: "cluster-123"}, true}, + {"string - http header name - valid (special token)", &cases.StringHttpHeaderName{Val: "!+#&.%"}, true}, + {"string - http header name - valid (period)", &cases.StringHttpHeaderName{Val: "CLUSTER.NAME"}, true}, + {"string - http header name - invalid", &cases.StringHttpHeaderName{Val: ":"}, false}, + {"string - http header name - invalid", &cases.StringHttpHeaderName{Val: ":path:"}, false}, + {"string - http header name - invalid (space)", &cases.StringHttpHeaderName{Val: "cluster name"}, false}, + {"string - http header name - invalid (return)", &cases.StringHttpHeaderName{Val: "example\r"}, false}, + {"string - http header name - invalid (tab)", &cases.StringHttpHeaderName{Val: "example\t"}, false}, + {"string - http header name - invalid (slash)", &cases.StringHttpHeaderName{Val: "/test/long/url"}, false}, + + {"string - http header value - valid", &cases.StringHttpHeaderValue{Val: "cluster.name.123"}, true}, + {"string - http header value - valid (uppercase)", &cases.StringHttpHeaderValue{Val: "/TEST/LONG/URL"}, true}, + {"string - http header value - valid (spaces)", &cases.StringHttpHeaderValue{Val: "cluster name"}, true}, + {"string - http header value - valid (tab)", &cases.StringHttpHeaderValue{Val: "example\t"}, true}, + {"string - http header value - valid (special token)", &cases.StringHttpHeaderValue{Val: "!#%&./+"}, true}, + {"string - http header value - invalid (NUL)", &cases.StringHttpHeaderValue{Val: "foo\000bar"}, false}, + {"string - http header value - invalid (DEL)", &cases.StringHttpHeaderValue{Val: "\x7f"}, false}, + {"string - http header value - invalid", &cases.StringHttpHeaderValue{Val: "example\r"}, false}, } var bytesCases = []TestCase{ diff --git a/validate/validate.h b/validate/validate.h index a1e1b31a8..b8594978d 100644 --- a/validate/validate.h +++ b/validate/validate.h @@ -137,34 +137,6 @@ static inline bool IsHostname(const string& to_validate) { return true; } -static inline bool IsHeaderName(const string& to_validate) { - int start = 0; - if (to_validate[0] == ':') { - if (to_validate.size() == 1) { - return false; - } - start = 1; - } - - const std::string whitelist = "!#$%&'*+-.^_`|~"; - for (const char& r : to_validate.substr(start)) { - if ((r < 'A' || r > 'Z') && (r < 'a' || r > 'z') && (r < '0' || r > '9') && - whitelist.find(r) == std::string::npos) { - return false; - } - } - return true; -} - -static inline bool IsHeaderValue(const string& to_validate) { - for (const unsigned char& r : to_validate) { - if (std::iscntrl(r) && r != '\t') { - return false; - } - } - return true; -} - static inline size_t Utf8Len(const string& narrow_string) { const char *str_char = narrow_string.c_str(); ptrdiff_t byte_len = narrow_string.length(); diff --git a/validate/validate.pb.go b/validate/validate.pb.go index e50a93673..d47503cb2 100644 --- a/validate/validate.pb.go +++ b/validate/validate.pb.go @@ -57,7 +57,7 @@ func (m *FieldRules) Reset() { *m = FieldRules{} } func (m *FieldRules) String() string { return proto.CompactTextString(m) } func (*FieldRules) ProtoMessage() {} func (*FieldRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{0} + return fileDescriptor_validate_43c63909c1bdffc1, []int{0} } func (m *FieldRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FieldRules.Unmarshal(m, b) @@ -836,7 +836,7 @@ func (m *FloatRules) Reset() { *m = FloatRules{} } func (m *FloatRules) String() string { return proto.CompactTextString(m) } func (*FloatRules) ProtoMessage() {} func (*FloatRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{1} + return fileDescriptor_validate_43c63909c1bdffc1, []int{1} } func (m *FloatRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FloatRules.Unmarshal(m, b) @@ -938,7 +938,7 @@ func (m *DoubleRules) Reset() { *m = DoubleRules{} } func (m *DoubleRules) String() string { return proto.CompactTextString(m) } func (*DoubleRules) ProtoMessage() {} func (*DoubleRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{2} + return fileDescriptor_validate_43c63909c1bdffc1, []int{2} } func (m *DoubleRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DoubleRules.Unmarshal(m, b) @@ -1040,7 +1040,7 @@ func (m *Int32Rules) Reset() { *m = Int32Rules{} } func (m *Int32Rules) String() string { return proto.CompactTextString(m) } func (*Int32Rules) ProtoMessage() {} func (*Int32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{3} + return fileDescriptor_validate_43c63909c1bdffc1, []int{3} } func (m *Int32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Int32Rules.Unmarshal(m, b) @@ -1142,7 +1142,7 @@ func (m *Int64Rules) Reset() { *m = Int64Rules{} } func (m *Int64Rules) String() string { return proto.CompactTextString(m) } func (*Int64Rules) ProtoMessage() {} func (*Int64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{4} + return fileDescriptor_validate_43c63909c1bdffc1, []int{4} } func (m *Int64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Int64Rules.Unmarshal(m, b) @@ -1244,7 +1244,7 @@ func (m *UInt32Rules) Reset() { *m = UInt32Rules{} } func (m *UInt32Rules) String() string { return proto.CompactTextString(m) } func (*UInt32Rules) ProtoMessage() {} func (*UInt32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{5} + return fileDescriptor_validate_43c63909c1bdffc1, []int{5} } func (m *UInt32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UInt32Rules.Unmarshal(m, b) @@ -1346,7 +1346,7 @@ func (m *UInt64Rules) Reset() { *m = UInt64Rules{} } func (m *UInt64Rules) String() string { return proto.CompactTextString(m) } func (*UInt64Rules) ProtoMessage() {} func (*UInt64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{6} + return fileDescriptor_validate_43c63909c1bdffc1, []int{6} } func (m *UInt64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UInt64Rules.Unmarshal(m, b) @@ -1448,7 +1448,7 @@ func (m *SInt32Rules) Reset() { *m = SInt32Rules{} } func (m *SInt32Rules) String() string { return proto.CompactTextString(m) } func (*SInt32Rules) ProtoMessage() {} func (*SInt32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{7} + return fileDescriptor_validate_43c63909c1bdffc1, []int{7} } func (m *SInt32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SInt32Rules.Unmarshal(m, b) @@ -1550,7 +1550,7 @@ func (m *SInt64Rules) Reset() { *m = SInt64Rules{} } func (m *SInt64Rules) String() string { return proto.CompactTextString(m) } func (*SInt64Rules) ProtoMessage() {} func (*SInt64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{8} + return fileDescriptor_validate_43c63909c1bdffc1, []int{8} } func (m *SInt64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SInt64Rules.Unmarshal(m, b) @@ -1652,7 +1652,7 @@ func (m *Fixed32Rules) Reset() { *m = Fixed32Rules{} } func (m *Fixed32Rules) String() string { return proto.CompactTextString(m) } func (*Fixed32Rules) ProtoMessage() {} func (*Fixed32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{9} + return fileDescriptor_validate_43c63909c1bdffc1, []int{9} } func (m *Fixed32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Fixed32Rules.Unmarshal(m, b) @@ -1754,7 +1754,7 @@ func (m *Fixed64Rules) Reset() { *m = Fixed64Rules{} } func (m *Fixed64Rules) String() string { return proto.CompactTextString(m) } func (*Fixed64Rules) ProtoMessage() {} func (*Fixed64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{10} + return fileDescriptor_validate_43c63909c1bdffc1, []int{10} } func (m *Fixed64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Fixed64Rules.Unmarshal(m, b) @@ -1856,7 +1856,7 @@ func (m *SFixed32Rules) Reset() { *m = SFixed32Rules{} } func (m *SFixed32Rules) String() string { return proto.CompactTextString(m) } func (*SFixed32Rules) ProtoMessage() {} func (*SFixed32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{11} + return fileDescriptor_validate_43c63909c1bdffc1, []int{11} } func (m *SFixed32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SFixed32Rules.Unmarshal(m, b) @@ -1958,7 +1958,7 @@ func (m *SFixed64Rules) Reset() { *m = SFixed64Rules{} } func (m *SFixed64Rules) String() string { return proto.CompactTextString(m) } func (*SFixed64Rules) ProtoMessage() {} func (*SFixed64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{12} + return fileDescriptor_validate_43c63909c1bdffc1, []int{12} } func (m *SFixed64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SFixed64Rules.Unmarshal(m, b) @@ -2040,7 +2040,7 @@ func (m *BoolRules) Reset() { *m = BoolRules{} } func (m *BoolRules) String() string { return proto.CompactTextString(m) } func (*BoolRules) ProtoMessage() {} func (*BoolRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{13} + return fileDescriptor_validate_43c63909c1bdffc1, []int{13} } func (m *BoolRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BoolRules.Unmarshal(m, b) @@ -2127,8 +2127,8 @@ type StringRules struct { // *StringRules_UriRef // *StringRules_Address // *StringRules_Uuid - // *StringRules_HeaderName - // *StringRules_HeaderValue + // *StringRules_HttpHeaderName + // *StringRules_HttpHeaderValue WellKnown isStringRules_WellKnown `protobuf_oneof:"well_known"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -2139,7 +2139,7 @@ func (m *StringRules) Reset() { *m = StringRules{} } func (m *StringRules) String() string { return proto.CompactTextString(m) } func (*StringRules) ProtoMessage() {} func (*StringRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{14} + return fileDescriptor_validate_43c63909c1bdffc1, []int{14} } func (m *StringRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StringRules.Unmarshal(m, b) @@ -2297,12 +2297,12 @@ type StringRules_Uuid struct { Uuid bool `protobuf:"varint,22,opt,name=uuid,oneof"` } -type StringRules_HeaderName struct { - HeaderName bool `protobuf:"varint,24,opt,name=header_name,json=headerName,oneof"` +type StringRules_HttpHeaderName struct { + HttpHeaderName bool `protobuf:"varint,24,opt,name=http_header_name,json=httpHeaderName,oneof"` } -type StringRules_HeaderValue struct { - HeaderValue bool `protobuf:"varint,25,opt,name=header_value,json=headerValue,oneof"` +type StringRules_HttpHeaderValue struct { + HttpHeaderValue bool `protobuf:"varint,25,opt,name=http_header_value,json=httpHeaderValue,oneof"` } func (*StringRules_Email) isStringRules_WellKnown() {} @@ -2323,9 +2323,9 @@ func (*StringRules_Address) isStringRules_WellKnown() {} func (*StringRules_Uuid) isStringRules_WellKnown() {} -func (*StringRules_HeaderName) isStringRules_WellKnown() {} +func (*StringRules_HttpHeaderName) isStringRules_WellKnown() {} -func (*StringRules_HeaderValue) isStringRules_WellKnown() {} +func (*StringRules_HttpHeaderValue) isStringRules_WellKnown() {} func (m *StringRules) GetWellKnown() isStringRules_WellKnown { if m != nil { @@ -2397,16 +2397,16 @@ func (m *StringRules) GetUuid() bool { return false } -func (m *StringRules) GetHeaderName() bool { - if x, ok := m.GetWellKnown().(*StringRules_HeaderName); ok { - return x.HeaderName +func (m *StringRules) GetHttpHeaderName() bool { + if x, ok := m.GetWellKnown().(*StringRules_HttpHeaderName); ok { + return x.HttpHeaderName } return false } -func (m *StringRules) GetHeaderValue() bool { - if x, ok := m.GetWellKnown().(*StringRules_HeaderValue); ok { - return x.HeaderValue +func (m *StringRules) GetHttpHeaderValue() bool { + if x, ok := m.GetWellKnown().(*StringRules_HttpHeaderValue); ok { + return x.HttpHeaderValue } return false } @@ -2423,8 +2423,8 @@ func (*StringRules) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) e (*StringRules_UriRef)(nil), (*StringRules_Address)(nil), (*StringRules_Uuid)(nil), - (*StringRules_HeaderName)(nil), - (*StringRules_HeaderValue)(nil), + (*StringRules_HttpHeaderName)(nil), + (*StringRules_HttpHeaderValue)(nil), } } @@ -2495,16 +2495,16 @@ func _StringRules_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { } b.EncodeVarint(22<<3 | proto.WireVarint) b.EncodeVarint(t) - case *StringRules_HeaderName: + case *StringRules_HttpHeaderName: t := uint64(0) - if x.HeaderName { + if x.HttpHeaderName { t = 1 } b.EncodeVarint(24<<3 | proto.WireVarint) b.EncodeVarint(t) - case *StringRules_HeaderValue: + case *StringRules_HttpHeaderValue: t := uint64(0) - if x.HeaderValue { + if x.HttpHeaderValue { t = 1 } b.EncodeVarint(25<<3 | proto.WireVarint) @@ -2582,19 +2582,19 @@ func _StringRules_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Bu x, err := b.DecodeVarint() m.WellKnown = &StringRules_Uuid{x != 0} return true, err - case 24: // well_known.header_name + case 24: // well_known.http_header_name if wire != proto.WireVarint { return true, proto.ErrInternalBadWireType } x, err := b.DecodeVarint() - m.WellKnown = &StringRules_HeaderName{x != 0} + m.WellKnown = &StringRules_HttpHeaderName{x != 0} return true, err - case 25: // well_known.header_value + case 25: // well_known.http_header_value if wire != proto.WireVarint { return true, proto.ErrInternalBadWireType } x, err := b.DecodeVarint() - m.WellKnown = &StringRules_HeaderValue{x != 0} + m.WellKnown = &StringRules_HttpHeaderValue{x != 0} return true, err default: return false, nil @@ -2632,10 +2632,10 @@ func _StringRules_OneofSizer(msg proto.Message) (n int) { case *StringRules_Uuid: n += 2 // tag and wire n += 1 - case *StringRules_HeaderName: + case *StringRules_HttpHeaderName: n += 2 // tag and wire n += 1 - case *StringRules_HeaderValue: + case *StringRules_HttpHeaderValue: n += 2 // tag and wire n += 1 case nil: @@ -2693,7 +2693,7 @@ func (m *BytesRules) Reset() { *m = BytesRules{} } func (m *BytesRules) String() string { return proto.CompactTextString(m) } func (*BytesRules) ProtoMessage() {} func (*BytesRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{15} + return fileDescriptor_validate_43c63909c1bdffc1, []int{15} } func (m *BytesRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BytesRules.Unmarshal(m, b) @@ -2945,7 +2945,7 @@ func (m *EnumRules) Reset() { *m = EnumRules{} } func (m *EnumRules) String() string { return proto.CompactTextString(m) } func (*EnumRules) ProtoMessage() {} func (*EnumRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{16} + return fileDescriptor_validate_43c63909c1bdffc1, []int{16} } func (m *EnumRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumRules.Unmarshal(m, b) @@ -3010,7 +3010,7 @@ func (m *MessageRules) Reset() { *m = MessageRules{} } func (m *MessageRules) String() string { return proto.CompactTextString(m) } func (*MessageRules) ProtoMessage() {} func (*MessageRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{17} + return fileDescriptor_validate_43c63909c1bdffc1, []int{17} } func (m *MessageRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MessageRules.Unmarshal(m, b) @@ -3069,7 +3069,7 @@ func (m *RepeatedRules) Reset() { *m = RepeatedRules{} } func (m *RepeatedRules) String() string { return proto.CompactTextString(m) } func (*RepeatedRules) ProtoMessage() {} func (*RepeatedRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{18} + return fileDescriptor_validate_43c63909c1bdffc1, []int{18} } func (m *RepeatedRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RepeatedRules.Unmarshal(m, b) @@ -3143,7 +3143,7 @@ func (m *MapRules) Reset() { *m = MapRules{} } func (m *MapRules) String() string { return proto.CompactTextString(m) } func (*MapRules) ProtoMessage() {} func (*MapRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{19} + return fileDescriptor_validate_43c63909c1bdffc1, []int{19} } func (m *MapRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MapRules.Unmarshal(m, b) @@ -3218,7 +3218,7 @@ func (m *AnyRules) Reset() { *m = AnyRules{} } func (m *AnyRules) String() string { return proto.CompactTextString(m) } func (*AnyRules) ProtoMessage() {} func (*AnyRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{20} + return fileDescriptor_validate_43c63909c1bdffc1, []int{20} } func (m *AnyRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AnyRules.Unmarshal(m, b) @@ -3293,7 +3293,7 @@ func (m *DurationRules) Reset() { *m = DurationRules{} } func (m *DurationRules) String() string { return proto.CompactTextString(m) } func (*DurationRules) ProtoMessage() {} func (*DurationRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{21} + return fileDescriptor_validate_43c63909c1bdffc1, []int{21} } func (m *DurationRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DurationRules.Unmarshal(m, b) @@ -3407,7 +3407,7 @@ func (m *TimestampRules) Reset() { *m = TimestampRules{} } func (m *TimestampRules) String() string { return proto.CompactTextString(m) } func (*TimestampRules) ProtoMessage() {} func (*TimestampRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_c04c5f1a429949aa, []int{22} + return fileDescriptor_validate_43c63909c1bdffc1, []int{22} } func (m *TimestampRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TimestampRules.Unmarshal(m, b) @@ -3546,115 +3546,116 @@ func init() { proto.RegisterExtension(E_Rules) } -func init() { proto.RegisterFile("validate/validate.proto", fileDescriptor_validate_c04c5f1a429949aa) } - -var fileDescriptor_validate_c04c5f1a429949aa = []byte{ - // 1707 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x98, 0x4b, 0x6f, 0x23, 0xb9, - 0x11, 0xc7, 0xa3, 0x7e, 0x8b, 0x92, 0x46, 0x12, 0xd7, 0xe3, 0xe9, 0x71, 0x1e, 0xeb, 0x51, 0x80, - 0xc0, 0x33, 0x99, 0xb5, 0x27, 0x5e, 0x47, 0x08, 0x8c, 0x20, 0x40, 0x9c, 0xcd, 0x20, 0x13, 0x64, - 0x77, 0x16, 0xed, 0x6c, 0x0e, 0xb9, 0x08, 0x6d, 0x8b, 0x92, 0x09, 0xb7, 0xd8, 0xbd, 0xfd, 0xb0, - 0xad, 0x0f, 0x91, 0xc7, 0x35, 0x9f, 0x22, 0xe7, 0x9c, 0x72, 0xcd, 0x57, 0xc9, 0x39, 0x5f, 0x20, - 0x60, 0x91, 0xec, 0x07, 0xbb, 0x2d, 0x1f, 0xf6, 0x26, 0x56, 0xfd, 0x8b, 0xfc, 0xa9, 0xc8, 0xae, - 0x2e, 0x36, 0x7a, 0x71, 0x17, 0x46, 0x74, 0x19, 0xe6, 0xe4, 0x44, 0xfd, 0x38, 0x4e, 0xd2, 0x38, - 0x8f, 0xb1, 0xa7, 0xc6, 0x07, 0x87, 0xeb, 0x38, 0x5e, 0x47, 0xe4, 0x04, 0xec, 0x57, 0xc5, 0xea, - 0x64, 0x49, 0xb2, 0xeb, 0x94, 0x26, 0x79, 0x9c, 0x0a, 0xed, 0xc1, 0x8f, 0x5a, 0x8a, 0x22, 0x0d, - 0x73, 0x1a, 0x33, 0xe9, 0xff, 0x54, 0xf7, 0xe7, 0x74, 0x43, 0xb2, 0x3c, 0xdc, 0x24, 0x42, 0x30, - 0xfb, 0x8f, 0x87, 0xd0, 0x7b, 0x4a, 0xa2, 0x65, 0x50, 0x44, 0x24, 0xc3, 0xef, 0x90, 0xbb, 0x21, - 0x59,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f, 0x11, 0xb6, 0x10, 0x8d, 0xcb, 0x1e, 0xb8, - 0xbc, 0x88, 0x30, 0xe8, 0x58, 0xb8, 0x93, 0x4f, 0x27, 0x9c, 0xa2, 0xca, 0x78, 0x1b, 0x5a, 0x73, - 0x86, 0x0f, 0xd2, 0x69, 0x4b, 0x67, 0xf8, 0x20, 0x9c, 0x3e, 0x72, 0x93, 0x30, 0xcf, 0x49, 0xca, - 0xa0, 0xa3, 0xed, 0x07, 0x6a, 0x88, 0xf7, 0x91, 0x93, 0xa4, 0x64, 0x45, 0x1f, 0xa0, 0x73, 0xed, - 0x07, 0x72, 0xc4, 0xed, 0x59, 0xb1, 0xe2, 0x76, 0x4f, 0xd8, 0xc5, 0x08, 0x1f, 0x20, 0xef, 0x3a, - 0x66, 0x79, 0x48, 0x59, 0x06, 0x8d, 0x68, 0x3f, 0x28, 0xc7, 0xf8, 0x15, 0x1a, 0xf2, 0x04, 0x97, - 0xfe, 0x17, 0xe0, 0x1f, 0xb0, 0x38, 0xff, 0x8d, 0x92, 0x88, 0x3d, 0x41, 0x87, 0xe6, 0x51, 0x5f, - 0xdb, 0x93, 0x01, 0xd8, 0xc4, 0x9e, 0xe0, 0x7d, 0x64, 0x93, 0x4d, 0x48, 0x23, 0xe8, 0x25, 0x3d, - 0xde, 0xa5, 0xc1, 0x10, 0xff, 0x00, 0x79, 0x37, 0x71, 0x96, 0xb3, 0x70, 0x43, 0xa0, 0x67, 0xe4, - 0xae, 0xd2, 0x82, 0x27, 0xc8, 0xa0, 0x09, 0xb4, 0x87, 0xdc, 0x6e, 0xd0, 0x04, 0xef, 0x21, 0x8b, - 0x26, 0x77, 0x67, 0xd0, 0x02, 0x72, 0x1b, 0x8c, 0xa4, 0x75, 0x0e, 0xbd, 0x9e, 0xb2, 0xce, 0x31, - 0x46, 0x66, 0x91, 0x52, 0xb8, 0x0e, 0x71, 0x23, 0x1f, 0xe0, 0x97, 0xc8, 0x2d, 0x52, 0xba, 0x48, - 0xc9, 0x0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, 0x61, 0x97, 0xdb, 0x81, 0xf0, 0x60, 0x37, 0x02, 0x1f, 0x2d, 0x59, 0x30, - 0xc5, 0xc5, 0xd7, 0xe8, 0x80, 0xc6, 0xc7, 0x84, 0xdd, 0xc5, 0xdb, 0x24, 0x8d, 0x1f, 0xb6, 0xc7, - 0xc9, 0xfa, 0xae, 0xd4, 0xff, 0xf9, 0x74, 0x4d, 0xf3, 0x9b, 0xe2, 0xea, 0xf8, 0x3a, 0xde, 0x9c, - 0x54, 0x1a, 0xf1, 0x61, 0xf5, 0xfa, 0xb3, 0x35, 0x61, 0x9f, 0xb5, 0xbe, 0xe7, 0xfe, 0x3f, 0x00, - 0x00, 0xff, 0xff, 0xcc, 0x4e, 0xd6, 0x62, 0xe3, 0x15, 0x00, 0x00, +func init() { proto.RegisterFile("validate/validate.proto", fileDescriptor_validate_43c63909c1bdffc1) } + +var fileDescriptor_validate_43c63909c1bdffc1 = []byte{ + // 1716 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x98, 0x4b, 0x73, 0xe3, 0xb8, + 0x11, 0xc7, 0x23, 0xbe, 0x05, 0x49, 0x23, 0x09, 0xeb, 0xf1, 0x70, 0x9c, 0xc7, 0x7a, 0x74, 0x48, + 0xcd, 0x4c, 0xbc, 0xf6, 0xc4, 0xeb, 0xa8, 0x52, 0xae, 0x54, 0xaa, 0xe2, 0x6c, 0xa6, 0x76, 0x52, + 0xd9, 0x9d, 0x2d, 0x3a, 0x9b, 0x43, 0x2e, 0x2a, 0xda, 0x82, 0x64, 0x94, 0x29, 0x90, 0xcb, 0x87, + 0x6d, 0x7d, 0x88, 0x3c, 0xbe, 0x47, 0x0e, 0x39, 0xe7, 0x94, 0x6b, 0xbe, 0x4a, 0xce, 0xf9, 0x02, + 0x29, 0x34, 0x00, 0x3e, 0x40, 0x5a, 0x3e, 0xec, 0x4d, 0xe8, 0xfe, 0x37, 0x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cc, 0x2e, 0x65, 0x2a, 0x60, 0x7e, 0xe6, 0x3b, 0x5d, 0x01, 0xd5, 0x02, 0x52, 0xc6, 0x03, + 0x32, 0xb1, 0x82, 0xab, 0x07, 0x5c, 0x36, 0x57, 0xc8, 0xca, 0x15, 0x32, 0xb1, 0x82, 0xd7, 0x15, + 0x50, 0x5b, 0x41, 0xc8, 0xf0, 0x29, 0x72, 0x57, 0xf4, 0x81, 0x2c, 0x3f, 0x3f, 0xf5, 0xfb, 0xfa, + 0x86, 0xbd, 0x17, 0x0e, 0x15, 0xa2, 0x84, 0x65, 0xcc, 0xfc, 0xcc, 0x47, 0x9d, 0x31, 0xd5, 0x32, + 0x4a, 0x88, 0x7f, 0x81, 0xbc, 0x4c, 0x2d, 0x34, 0x80, 0xa0, 0x17, 0x35, 0x34, 0x6d, 0xa5, 0x52, + 0x5a, 0x85, 0xcd, 0xcf, 0xfc, 0x61, 0x77, 0x58, 0xb5, 0x58, 0x29, 0xc5, 0x6f, 0x90, 0x75, 0x15, + 0xc7, 0x91, 0x3f, 0x82, 0x90, 0x4f, 0xaa, 0x90, 0x8b, 0x38, 0x8e, 0x94, 0x1c, 0x24, 0x90, 0xb1, + 0x3c, 0xa5, 0x6c, 0xed, 0x3f, 0x6b, 0x65, 0x0c, 0xec, 0x55, 0xc6, 0x60, 0xc8, 0xcf, 0xc8, 0xd5, + 0x36, 0x27, 0x99, 0x3f, 0xd6, 0xcf, 0xc8, 0x05, 0x37, 0x97, 0x67, 0x04, 0x44, 0x9c, 0x84, 0xb0, + 0x62, 0xe3, 0x4f, 0x74, 0x92, 0xdf, 0xb1, 0x62, 0x53, 0x92, 0x70, 0x09, 0xff, 0xaf, 0x29, 0x49, + 0x48, 0x98, 0x93, 0xa5, 0x8f, 0xf5, 0xff, 0x1a, 0x48, 0x4f, 0xf9, 0x5f, 0x95, 0x14, 0xff, 0x14, + 0x99, 0x9b, 0x30, 0xf1, 0x3f, 0x81, 0x08, 0x5c, 0x7b, 0xdc, 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0x7c, 0xef, 0x9c, + 0x79, 0x0d, 0x33, 0x57, 0x09, 0xdf, 0x39, 0x33, 0xcf, 0xf8, 0x73, 0xe4, 0x44, 0xf9, 0x82, 0xc5, + 0xf7, 0x50, 0x55, 0xbd, 0xc0, 0x8e, 0xf2, 0xaf, 0xe3, 0x7b, 0x6e, 0x5e, 0x0b, 0xb3, 0x27, 0xcc, + 0x6b, 0x30, 0xff, 0x1c, 0x39, 0xf7, 0x34, 0xbf, 0x81, 0xca, 0xfa, 0xc4, 0x7e, 0x4a, 0xe1, 0xf9, + 0xaf, 0x90, 0xb7, 0xa4, 0x59, 0x78, 0x15, 0x91, 0x25, 0xfe, 0xb4, 0x25, 0x97, 0x75, 0xed, 0x63, + 0xc2, 0x63, 0x32, 0xff, 0x9f, 0x62, 0xb5, 0x32, 0xe2, 0xfc, 0xbc, 0xda, 0x20, 0xfc, 0xe3, 0x56, + 0xf4, 0x47, 0x46, 0xe2, 0x95, 0x1e, 0xab, 0xf4, 0xe7, 0xbf, 0x47, 0x76, 0x0a, 0xbb, 0xdc, 0x0e, + 0x84, 0x07, 0xbb, 0x11, 0xf8, 0x68, 0xc9, 0x82, 0x29, 0x2e, 0xbe, 0x41, 0x07, 0x34, 0x3e, 0x26, + 0xec, 0x2e, 0xde, 0x26, 0x69, 0xfc, 0xb0, 0x3d, 0x4e, 0xd6, 0x77, 0xa5, 0xfe, 0xcf, 0xa7, 0x6b, + 0x9a, 0xdf, 0x14, 0x57, 0xc7, 0xd7, 0xf1, 0xe6, 0xa4, 0xd2, 0x88, 0x4f, 0xad, 0xd7, 0x9f, 0xad, + 0x09, 0xfb, 0xac, 0xf5, 0x85, 0xf7, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x25, 0xee, 0x13, 0xbc, + 0xf5, 0x15, 0x00, 0x00, } diff --git a/validate/validate.proto b/validate/validate.proto index ed0fd32d8..2122b2b8e 100644 --- a/validate/validate.proto +++ b/validate/validate.proto @@ -554,13 +554,13 @@ message StringRules { // RFC 4122 bool uuid = 22; - // HeaderName specified that the field must be a valid header name as - // defined by RFC 7230. - bool header_name = 24; + // HttpHeaderName specified that the field must be a valid HTTP header name + // as defined by RFC 7230. + bool http_header_name = 24; - // HeaderValue specified that the field must be a valid header value as - // defined by RFC 7230. - bool header_value = 25; + // HttpHeaderValue specified that the field must be a valid HTTP header value + // as defined by RFC 7230. + bool http_header_value = 25; } } diff --git a/validate/validator.py b/validate/validator.py index 428c2fdc0..ce0b31a23 100644 --- a/validate/validator.py +++ b/validate/validator.py @@ -72,24 +72,6 @@ def _validateEmail(addr): return False return _validateHostName(parts[1]) -def _validateHeaderName(header): - start = 0 - if header[0] == ":": - if len(header) == 1: - return False - start = 1 - - for r in header[start:]: - if (r < 'A' or r > 'Z') and (r < 'a' or r > 'z') and (r < '0' or r > '9') and (r not in "!#$%&'*+-.^_`|~"): - return False - return True - -def _validateHeaderValue(header): - for r in header: - if (ord(r) < 32 and (r != '\t')) or (ord(r) == 127): - return False - return True - def _has_field(message_pb, property_name): # NOTE: As of proto3, HasField() only works for message fields, not for # singular (non-message) fields. First try to use HasField and @@ -233,13 +215,13 @@ def string_template(option_value, name): except ValueError: raise ValidationFailed(\"{{ name }} is not a valid UUID\") {%- endif -%} - {%- if s['header_name'] %} - if not _validateHeaderName({{ name }}): - raise ValidationFailed(\"{{ name }} is not a valid header name\") + {%- if s['http_header_name'] %} + if not re.match("^:?[0-9a-zA-Z!#$%&'*+-.^_|~\x2C]+$", {{ name}}): + raise ValidationFailed(\"{{ name }} is not a valid HTTP header name\") {%- endif -%} - {%- if s['header_value'] %} - if not _validateHeaderValue({{ name }}): - raise ValidationFailed(\"{{ name }} is not a valid header value\") + {%- if s['http_header_value'] %} + if not re.match("^[ \t]*(?:[\x20-\x7E\u0080-\u00FF](?:[ \t]+[\x20-\x7E\u0080-\u00FF])?)*[ \t]*$", {{ name }}): + raise ValidationFailed(\"{{ name }} is not a valid HTTP header value\") {%- endif -%} """ return Template(str_templ).render(o = option_value, name = name, const_template = const_template, in_template = in_template) From 52baf9ebe158772744991ceb5ee45a4b79b8760b Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Mon, 23 Dec 2019 08:46:26 -0500 Subject: [PATCH 11/25] make patterns in to well known regex Signed-off-by: Asra Ali --- .bazelversion | 1 + README.md | 8 +- .../io/envoyproxy/pgv/StringValidation.java | 18 - .../envoyproxy/pgv/StringValidationTest.java | 30 -- module/checker.go | 20 +- rule_comparison.md | 3 +- templates/cc/file.go | 6 - templates/cc/string.go | 12 - templates/go/file.go | 7 - templates/gogo/file.go | 2 - templates/goshared/known.go | 20 - templates/goshared/msg.go | 4 - templates/goshared/register.go | 5 +- templates/goshared/string.go | 8 - templates/java/string.go | 6 - templates/shared/well_known.go | 17 +- tests/harness/cases/strings.proto | 4 +- validate/validate.pb.go | 381 +++++++++--------- validate/validate.proto | 20 +- validate/validator.py | 17 +- validate/validator.pyc | Bin 0 -> 43224 bytes 21 files changed, 249 insertions(+), 340 deletions(-) create mode 100644 .bazelversion create mode 100644 validate/validator.pyc diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 000000000..1cc5f657e --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +1.1.0 \ No newline at end of file diff --git a/README.md b/README.md index 527050d5a..906a970c6 100644 --- a/README.md +++ b/README.md @@ -399,11 +399,11 @@ Check the [constraint rule comparison matrix](rule_comparison.md) for language-s // x must be a valid UUID (via RFC 4122) string x = 1 [(validate.rules).string.uuid = true]; - // x must be a valid HTTP header name (via RFC 7230) - string x = 1 [(validate.rules).string.http_header_name = true]; + // x must conform to a well known regex for HTTP header names (via RFC 7230) + string x = 1 [(validate.rules).string.well_known_regex = HTTP_HEADER_NAME] - // x must be a valid HTTP header value (via RFC 7230) - string x = 1 [(validate.rules).string.http_header_value = true]; + // x must conform to a well known regex for HTTP header values (via RFC 7230) + string x = 1 [(validate.rules).string.well_known_regex = HTTP_HEADER_VALUE]; ``` ### Bytes diff --git a/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java b/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java index df9af10c0..c676d2490 100644 --- a/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java +++ b/java/pgv-java-stub/src/main/java/io/envoyproxy/pgv/StringValidation.java @@ -19,8 +19,6 @@ public final class StringValidation { private static final int UUID_DASH_3 = 18; private static final int UUID_DASH_4 = 23; private static final int UUID_LEN = 36; - private static final Pattern HTTP_HEADER_NAME_PATTERN = Pattern.compile("^:?[0-9a-zA-Z!#$%&'*+-.^_|~\u002C]+$"); - private static final Pattern HTTP_HEADER_VALUE_PATTERN = Pattern.compile("^[ \t]*(?:[\u0020-\u007E\u0080-\u00FF](?:[ \t]+[\u0020-\u007E\u0080-\u00FF])?)*[ \t]*$"); private StringValidation() { // Intentionally left blank. @@ -210,22 +208,6 @@ public static void uuid(final String field, final String value) throws Validatio throw new ValidationException(field, enquote(value), "invalid UUID string"); } - public static void httpHeaderName(final String field, final String value) throws ValidationException { - if (!HTTP_HEADER_NAME_PATTERN.matches(value)) { - throw new ValidationException(field, enquote(value), "invalid HTTP header name string"); - } - - return; - } - - public static void httpHeaderValue(final String field, final String value) throws ValidationException { - if (!HTTP_HEADER_VALUE_PATTERN.matches(value)) { - throw new ValidationException(field, enquote(value), "invalid HTTP header value string"); - } - - return; - } - private static String enquote(String value) { return "\"" + value + "\""; } diff --git a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java index 6380d5725..7a4423aa8 100644 --- a/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java +++ b/java/pgv-java-stub/src/test/java/io/envoyproxy/pgv/StringValidationTest.java @@ -253,34 +253,4 @@ public void uuidWorks() throws ValidationException { assertValidationException(() -> uuid("4_dash_at_22", "00000000-0000-0000-000-0000000000000")); assertValidationException(() -> uuid("4_dash_at_24", "00000000-0000-0000-00000-00000000000")); } - - @Test - public void httpHeaderNameWorks() throws ValidationException { - // Match - StringValidation.httpHeaderName("x", "cluster.name"); - StringValidation.httpHeaderName("x", ":path"); - StringValidation.httpHeaderName("x", "clustername"); - StringValidation.httpHeaderName("x", "!#%&.+"); - - // No Match - assertThatThrownBy(() -> StringValidation.httpHeaderName("x", "foo\000bar")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.httpHeaderName("x", "test/long/url")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.httpHeaderName("x", "cluster name")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.httpHeaderName("x", "example\r")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.httpHeaderName("x", ":")).isInstanceOf(ValidationException.class); - } - - @Test - public void httpHeaderValueWorks() throws ValidationException { - // Match - StringValidation.httpHeaderValue("x", "cluster.name"); - StringValidation.httpHeaderValue("x", "/TEST/LONG/URL"); - StringValidation.httpHeaderValue("x", "cluster name"); - StringValidation.httpHeaderValue("x", "!#%&./+"); - - // No Match - assertThatThrownBy(() -> StringValidation.httpHeaderValue("x", "foo\000bar")).isInstanceOf(ValidationException.class); - assertThatThrownBy(() -> StringValidation.httpHeaderValue("x", "example\r")).isInstanceOf(ValidationException.class); - } - } diff --git a/module/checker.go b/module/checker.go index 9ab0e982c..ca1f7d1d6 100644 --- a/module/checker.go +++ b/module/checker.go @@ -14,6 +14,17 @@ import ( "github.com/lyft/protoc-gen-star" ) +var unknown = "" +var httpHeaderName = "^:?[0-9a-zA-Z!#$%&'*+-.^_|~\x2C]+$" +var httpHeaderValue = "^[ \t]*(?:[\x20-\x7E\u0080-\u00FF](?:[ \t]+[\x20-\x7E\u0080-\u00FF])?)*[ \t]*$" + +// Map from well known regex to regex pattern. +var regex_map = map[string]*string{ + "UNKNOWN": &unknown, + "HTTP_HEADER_NAME": &httpHeaderName, + "HTTP_HEADER_VALUE": &httpHeaderValue, +} + type FieldType interface { ProtoType() pgs.ProtoType Embed() pgs.Message @@ -196,6 +207,7 @@ func (m *Module) CheckString(r *validate.StringRules) { m.checkMinMax(r.MinLen, r.MaxLen) m.checkMinMax(r.MinBytes, r.MaxBytes) m.checkIns(len(r.In), len(r.NotIn)) + m.checkWellKnownRegex(r.GetWellKnownRegex(), r) m.checkPattern(r.Pattern, len(r.In)) if r.MaxLen != nil { @@ -452,6 +464,13 @@ func (m *Module) checkLen(len, min, max *uint64) { "cannot have both `len` and `max_len` rules on the same field") } +func (m *Module) checkWellKnownRegex(wk validate.KnownRegex, r *validate.StringRules) { + if wk != 0 { + m.Assert(r.Pattern == nil, "regex `well_known_regex` and regex `pattern` are incompatible") + r.Pattern = regex_map[wk.String()] + } +} + func (m *Module) checkPattern(p *string, in int) { if p != nil { m.Assert(in == 0, "regex `pattern` and `in` rules are incompatible") @@ -479,4 +498,3 @@ func (m *Module) checkTS(ts *timestamp.Timestamp) *int64 { m.CheckErr(err, "could not resolve timestamp") return proto.Int64(t.UnixNano()) } - diff --git a/rule_comparison.md b/rule_comparison.md index 0c6756134..05b65b4f9 100644 --- a/rule_comparison.md +++ b/rule_comparison.md @@ -35,8 +35,7 @@ | uri |✅|✅|❌|✅|✅| | uri_ref |✅|✅|❌|✅|✅| | uuid |✅|✅|✅|✅|✅| -| http_header_name |✅|✅|✅|✅|✅| -| http_header_value |✅|✅|✅|✅|✅| +| well_known_regex |✅|✅|✅|✅|✅| ## Bytes | Constraint Rule | Go | GoGo | C++ | Java | Python | diff --git a/templates/cc/file.go b/templates/cc/file.go index 4ed86a004..4087ae8b2 100644 --- a/templates/cc/file.go +++ b/templates/cc/file.go @@ -21,12 +21,6 @@ using std::string; // define the regex for a UUID once up-front const re2::RE2 _uuidPattern("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"); -// define the regex for an HTTP header name once up-front -const re2::RE2 _httpHeaderName("^:?[0-9a-zA-Z!#$%&'*+-.^_|~\x2C]+$"); - -// define the regex for an HTTP header value once up-front -const re2::RE2 _httpHeaderValue("^[ \t]*(?:[\x20-\x7E\u0080-\u00FF](?:[ \t]+[\x20-\x7E\u0080-\u00FF])?)*[ \t]*$"); - {{ range .AllMessages }} {{- if not (disabled .) -}} diff --git a/templates/cc/string.go b/templates/cc/string.go index a7929d39d..a24bf79e9 100644 --- a/templates/cc/string.go +++ b/templates/cc/string.go @@ -179,17 +179,5 @@ const strTpl = ` if (!RE2::FullMatch(re2::StringPiece({{ accessor . }}), pgv::validate::_uuidPattern)) { {{ err . "value must be a valid UUID" }} } - {{ else if $r.GetHttpHeaderName }} - { - if (!RE2::FullMatch(re2::StringPiece({{ accessor . }}), pgv::validate::_httpHeaderName)) { - {{ err . "value must be a valid HTTP Header Name" }} - } - } - {{ else if $r.GetHttpHeaderValue }} - { - if (!RE2::FullMatch(re2::StringPiece({{ accessor . }}), pgv::validate::_httpHeaderValue)) { - {{ err . "value must be a valid HTTP Header Value" }} - } - } {{ end }} ` diff --git a/templates/go/file.go b/templates/go/file.go index d690f9023..757d4262a 100644 --- a/templates/go/file.go +++ b/templates/go/file.go @@ -46,13 +46,6 @@ var ( // define the regex for a UUID once up-front var _{{ snakeCase .File.InputPath.BaseName }}_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") -// define the regex for an HTTP header name once up-front -var _{{ snakeCase .File.InputPath.BaseName }}_httpHeaderName = regexp.MustCompile("^:?[0-9a-zA-Z!#$%&'*+-.^_|~\x2C]+$") - -// define the regex for an HTTP header value once up-front -var _{{ snakeCase .File.InputPath.BaseName }}_httpHeaderValue = regexp.MustCompile("^[ \t]*(?:[\x20-\x7E\u0080-\u00FF](?:[ \t]+[\x20-\x7E\u0080-\u00FF])?)*[ \t]*$") - - {{ range .AllMessages }} {{ template "msg" . }} {{ end }} diff --git a/templates/gogo/file.go b/templates/gogo/file.go index aeca554e8..84584ae40 100644 --- a/templates/gogo/file.go +++ b/templates/gogo/file.go @@ -15,7 +15,6 @@ import ( "regexp" "strings" "time" - "unicode" "unicode/utf8" "github.com/gogo/protobuf/types" @@ -38,7 +37,6 @@ var ( _ = (*url.URL)(nil) _ = (*mail.Address)(nil) _ = types.DynamicAny{} - _ = unicode.IsControl {{ range (externalEnums .) }} _ = {{ pkg . }}.{{ name . }}(0) diff --git a/templates/goshared/known.go b/templates/goshared/known.go index 2211f87a8..ad32cfcb3 100644 --- a/templates/goshared/known.go +++ b/templates/goshared/known.go @@ -63,23 +63,3 @@ const uuidTpl = ` return nil } ` - -const httpHeaderNameTpl = ` - func (m {{ (msgTyp .).Pointer }}) _validateHttpHeaderName(hdr string) error { - if matched := _{{ snakeCase .File.InputPath.BaseName }}_httpHeaderName.MatchString(hdr); !matched { - return errors.New("invalid HTTP header name format") - } - - return nil - } -` - -const httpHeaderValueTpl = ` - func (m {{ (msgTyp .).Pointer }}) _validateHttpHeaderValue(hdr string) error { - if matched := _{{ snakeCase .File.InputPath.BaseName }}_httpHeaderValue.MatchString(hdr); !matched { - return errors.New("invalid HTTP header name format") - } - - return nil - } -` diff --git a/templates/goshared/msg.go b/templates/goshared/msg.go index edb4b80ba..55bd556c1 100644 --- a/templates/goshared/msg.go +++ b/templates/goshared/msg.go @@ -42,10 +42,6 @@ func (m {{ (msgTyp .).Pointer }}) Validate() error { {{ if needs . "uuid" }}{{ template "uuid" . }}{{ end }} -{{ if needs . "httpheadername" }}{{ template "httpheadername" . }}{{ end }} - -{{ if needs . "httpheadervalue" }}{{ template "httpheadervalue" . }}{{ end }} - {{ cmt (errname .) " is the validation error returned by " (msgTyp .) ".Validate if the designated constraints aren't met." -}} type {{ errname . }} struct { field string diff --git a/templates/goshared/register.go b/templates/goshared/register.go index ea4d7bb22..d132d5f30 100644 --- a/templates/goshared/register.go +++ b/templates/goshared/register.go @@ -2,11 +2,12 @@ package goshared import ( "fmt" - "github.com/iancoleman/strcase" "reflect" "strings" "text/template" + "github.com/iancoleman/strcase" + "github.com/envoyproxy/protoc-gen-validate/templates/shared" "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/duration" @@ -76,8 +77,6 @@ func Register(tpl *template.Template, params pgs.Parameters) { template.Must(tpl.New("hostname").Parse(hostTpl)) template.Must(tpl.New("address").Parse(hostTpl)) template.Must(tpl.New("uuid").Parse(uuidTpl)) - template.Must(tpl.New("httpheadername").Parse(httpHeaderNameTpl)) - template.Must(tpl.New("httpheadervalue").Parse(httpHeaderValueTpl)) template.Must(tpl.New("enum").Parse(enumTpl)) template.Must(tpl.New("repeated").Parse(repTpl)) diff --git a/templates/goshared/string.go b/templates/goshared/string.go index ea8cb1454..0231a17f5 100644 --- a/templates/goshared/string.go +++ b/templates/goshared/string.go @@ -120,14 +120,6 @@ const strTpl = ` if err := m._validateUuid({{ accessor . }}); err != nil { return {{ errCause . "err" "value must be a valid UUID" }} } - {{ else if $r.GetHttpHeaderName }} - if err := m._validateHttpHeaderName({{ accessor . }}); err != nil { - return {{ errCause . "err" "value must be a valid HTTP header name" }} - } - {{ else if $r.GetHttpHeaderValue }} - if err := m._validateHttpHeaderValue({{ accessor . }}); err != nil { - return {{ errCause . "err" "value must be a valid HTTP header value" }} - } {{ end }} {{ if $r.Pattern }} if !{{ lookup $f "Pattern" }}.MatchString({{ accessor . }}) { diff --git a/templates/java/string.go b/templates/java/string.go index 8e296ed35..fd9eea40d 100644 --- a/templates/java/string.go +++ b/templates/java/string.go @@ -89,10 +89,4 @@ const stringTpl = `{{ $f := .Field }}{{ $r := .Rules -}} {{- if $r.GetUuid }} io.envoyproxy.pgv.StringValidation.uuid("{{ $f.FullyQualifiedName }}", {{ accessor . }}); {{- end -}} -{{- if $r.GetHttpHeaderName }} - io.envoyproxy.pgv.StringValidation.httpHeaderName("{{ $f.FullyQualifiedName }}", {{ accessor . }}); -{{- end -}} -{{- if $r.GetHttpHeaderValue }} - io.envoyproxy.pgv.StringValidation.httpHeaderValue("{{ $f.FullyQualifiedName }}", {{ accessor . }}); -{{- end -}} ` diff --git a/templates/shared/well_known.go b/templates/shared/well_known.go index 158573612..b66b44c51 100644 --- a/templates/shared/well_known.go +++ b/templates/shared/well_known.go @@ -8,11 +8,9 @@ import ( type WellKnown string const ( - Email WellKnown = "email" - Hostname WellKnown = "hostname" - UUID WellKnown = "uuid" - HttpHeaderName WellKnown = "httpheadername" - HttpHeaderValue WellKnown = "httpheadervalue" + Email WellKnown = "email" + Hostname WellKnown = "hostname" + UUID WellKnown = "uuid" ) // Needs returns true if a well-known string validator is needed for this @@ -63,15 +61,6 @@ func strRulesNeeds(rules *validate.StringRules, wk WellKnown) bool { if rules.GetUuid() { return true } - case HttpHeaderName: - if rules.GetHttpHeaderName() { - return true - } - case HttpHeaderValue: - if rules.GetHttpHeaderValue() { - return true - } } - return false } diff --git a/tests/harness/cases/strings.proto b/tests/harness/cases/strings.proto index 6629a8bea..97e78d770 100644 --- a/tests/harness/cases/strings.proto +++ b/tests/harness/cases/strings.proto @@ -34,5 +34,5 @@ message StringIPv6 { string val = 1 [(validate.rules).string.ipv6 = tr message StringURI { string val = 1 [(validate.rules).string.uri = true]; } message StringURIRef { string val = 1 [(validate.rules).string.uri_ref = true]; } message StringUUID { string val = 1 [(validate.rules).string.uuid = true]; } -message StringHttpHeaderName { string val = 1 [(validate.rules).string.http_header_name = true]; } -message StringHttpHeaderValue { string val = 1 [(validate.rules).string.http_header_value = true]; } +message StringHttpHeaderName { string val = 1 [(validate.rules).string.well_known_regex = HTTP_HEADER_NAME]; } +message StringHttpHeaderValue { string val = 1 [(validate.rules).string.well_known_regex = HTTP_HEADER_VALUE]; } diff --git a/validate/validate.pb.go b/validate/validate.pb.go index d47503cb2..a38bbbe2d 100644 --- a/validate/validate.pb.go +++ b/validate/validate.pb.go @@ -21,6 +21,48 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +// WellKnownRegex contain some well-known patterns. +type KnownRegex int32 + +const ( + KnownRegex_UNKNOWN KnownRegex = 0 + // HTTP header name as defined by RFC 7230. + KnownRegex_HTTP_HEADER_NAME KnownRegex = 1 + // HTTP header value as defined by RFC 7230. + KnownRegex_HTTP_HEADER_VALUE KnownRegex = 2 +) + +var KnownRegex_name = map[int32]string{ + 0: "UNKNOWN", + 1: "HTTP_HEADER_NAME", + 2: "HTTP_HEADER_VALUE", +} +var KnownRegex_value = map[string]int32{ + "UNKNOWN": 0, + "HTTP_HEADER_NAME": 1, + "HTTP_HEADER_VALUE": 2, +} + +func (x KnownRegex) Enum() *KnownRegex { + p := new(KnownRegex) + *p = x + return p +} +func (x KnownRegex) String() string { + return proto.EnumName(KnownRegex_name, int32(x)) +} +func (x *KnownRegex) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(KnownRegex_value, data, "KnownRegex") + if err != nil { + return err + } + *x = KnownRegex(value) + return nil +} +func (KnownRegex) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{0} +} + // FieldRules encapsulates the rules for each type of field. Depending on the // field, the correct set should be used to ensure proper validations. type FieldRules struct { @@ -57,7 +99,7 @@ func (m *FieldRules) Reset() { *m = FieldRules{} } func (m *FieldRules) String() string { return proto.CompactTextString(m) } func (*FieldRules) ProtoMessage() {} func (*FieldRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{0} + return fileDescriptor_validate_9eaa14bea8038a77, []int{0} } func (m *FieldRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FieldRules.Unmarshal(m, b) @@ -836,7 +878,7 @@ func (m *FloatRules) Reset() { *m = FloatRules{} } func (m *FloatRules) String() string { return proto.CompactTextString(m) } func (*FloatRules) ProtoMessage() {} func (*FloatRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{1} + return fileDescriptor_validate_9eaa14bea8038a77, []int{1} } func (m *FloatRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_FloatRules.Unmarshal(m, b) @@ -938,7 +980,7 @@ func (m *DoubleRules) Reset() { *m = DoubleRules{} } func (m *DoubleRules) String() string { return proto.CompactTextString(m) } func (*DoubleRules) ProtoMessage() {} func (*DoubleRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{2} + return fileDescriptor_validate_9eaa14bea8038a77, []int{2} } func (m *DoubleRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DoubleRules.Unmarshal(m, b) @@ -1040,7 +1082,7 @@ func (m *Int32Rules) Reset() { *m = Int32Rules{} } func (m *Int32Rules) String() string { return proto.CompactTextString(m) } func (*Int32Rules) ProtoMessage() {} func (*Int32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{3} + return fileDescriptor_validate_9eaa14bea8038a77, []int{3} } func (m *Int32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Int32Rules.Unmarshal(m, b) @@ -1142,7 +1184,7 @@ func (m *Int64Rules) Reset() { *m = Int64Rules{} } func (m *Int64Rules) String() string { return proto.CompactTextString(m) } func (*Int64Rules) ProtoMessage() {} func (*Int64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{4} + return fileDescriptor_validate_9eaa14bea8038a77, []int{4} } func (m *Int64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Int64Rules.Unmarshal(m, b) @@ -1244,7 +1286,7 @@ func (m *UInt32Rules) Reset() { *m = UInt32Rules{} } func (m *UInt32Rules) String() string { return proto.CompactTextString(m) } func (*UInt32Rules) ProtoMessage() {} func (*UInt32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{5} + return fileDescriptor_validate_9eaa14bea8038a77, []int{5} } func (m *UInt32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UInt32Rules.Unmarshal(m, b) @@ -1346,7 +1388,7 @@ func (m *UInt64Rules) Reset() { *m = UInt64Rules{} } func (m *UInt64Rules) String() string { return proto.CompactTextString(m) } func (*UInt64Rules) ProtoMessage() {} func (*UInt64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{6} + return fileDescriptor_validate_9eaa14bea8038a77, []int{6} } func (m *UInt64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_UInt64Rules.Unmarshal(m, b) @@ -1448,7 +1490,7 @@ func (m *SInt32Rules) Reset() { *m = SInt32Rules{} } func (m *SInt32Rules) String() string { return proto.CompactTextString(m) } func (*SInt32Rules) ProtoMessage() {} func (*SInt32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{7} + return fileDescriptor_validate_9eaa14bea8038a77, []int{7} } func (m *SInt32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SInt32Rules.Unmarshal(m, b) @@ -1550,7 +1592,7 @@ func (m *SInt64Rules) Reset() { *m = SInt64Rules{} } func (m *SInt64Rules) String() string { return proto.CompactTextString(m) } func (*SInt64Rules) ProtoMessage() {} func (*SInt64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{8} + return fileDescriptor_validate_9eaa14bea8038a77, []int{8} } func (m *SInt64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SInt64Rules.Unmarshal(m, b) @@ -1652,7 +1694,7 @@ func (m *Fixed32Rules) Reset() { *m = Fixed32Rules{} } func (m *Fixed32Rules) String() string { return proto.CompactTextString(m) } func (*Fixed32Rules) ProtoMessage() {} func (*Fixed32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{9} + return fileDescriptor_validate_9eaa14bea8038a77, []int{9} } func (m *Fixed32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Fixed32Rules.Unmarshal(m, b) @@ -1754,7 +1796,7 @@ func (m *Fixed64Rules) Reset() { *m = Fixed64Rules{} } func (m *Fixed64Rules) String() string { return proto.CompactTextString(m) } func (*Fixed64Rules) ProtoMessage() {} func (*Fixed64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{10} + return fileDescriptor_validate_9eaa14bea8038a77, []int{10} } func (m *Fixed64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Fixed64Rules.Unmarshal(m, b) @@ -1856,7 +1898,7 @@ func (m *SFixed32Rules) Reset() { *m = SFixed32Rules{} } func (m *SFixed32Rules) String() string { return proto.CompactTextString(m) } func (*SFixed32Rules) ProtoMessage() {} func (*SFixed32Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{11} + return fileDescriptor_validate_9eaa14bea8038a77, []int{11} } func (m *SFixed32Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SFixed32Rules.Unmarshal(m, b) @@ -1958,7 +2000,7 @@ func (m *SFixed64Rules) Reset() { *m = SFixed64Rules{} } func (m *SFixed64Rules) String() string { return proto.CompactTextString(m) } func (*SFixed64Rules) ProtoMessage() {} func (*SFixed64Rules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{12} + return fileDescriptor_validate_9eaa14bea8038a77, []int{12} } func (m *SFixed64Rules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SFixed64Rules.Unmarshal(m, b) @@ -2040,7 +2082,7 @@ func (m *BoolRules) Reset() { *m = BoolRules{} } func (m *BoolRules) String() string { return proto.CompactTextString(m) } func (*BoolRules) ProtoMessage() {} func (*BoolRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{13} + return fileDescriptor_validate_9eaa14bea8038a77, []int{13} } func (m *BoolRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BoolRules.Unmarshal(m, b) @@ -2127,8 +2169,7 @@ type StringRules struct { // *StringRules_UriRef // *StringRules_Address // *StringRules_Uuid - // *StringRules_HttpHeaderName - // *StringRules_HttpHeaderValue + // *StringRules_WellKnownRegex WellKnown isStringRules_WellKnown `protobuf_oneof:"well_known"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -2139,7 +2180,7 @@ func (m *StringRules) Reset() { *m = StringRules{} } func (m *StringRules) String() string { return proto.CompactTextString(m) } func (*StringRules) ProtoMessage() {} func (*StringRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{14} + return fileDescriptor_validate_9eaa14bea8038a77, []int{14} } func (m *StringRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_StringRules.Unmarshal(m, b) @@ -2297,12 +2338,8 @@ type StringRules_Uuid struct { Uuid bool `protobuf:"varint,22,opt,name=uuid,oneof"` } -type StringRules_HttpHeaderName struct { - HttpHeaderName bool `protobuf:"varint,24,opt,name=http_header_name,json=httpHeaderName,oneof"` -} - -type StringRules_HttpHeaderValue struct { - HttpHeaderValue bool `protobuf:"varint,25,opt,name=http_header_value,json=httpHeaderValue,oneof"` +type StringRules_WellKnownRegex struct { + WellKnownRegex KnownRegex `protobuf:"varint,24,opt,name=well_known_regex,json=wellKnownRegex,enum=validate.KnownRegex,oneof"` } func (*StringRules_Email) isStringRules_WellKnown() {} @@ -2323,9 +2360,7 @@ func (*StringRules_Address) isStringRules_WellKnown() {} func (*StringRules_Uuid) isStringRules_WellKnown() {} -func (*StringRules_HttpHeaderName) isStringRules_WellKnown() {} - -func (*StringRules_HttpHeaderValue) isStringRules_WellKnown() {} +func (*StringRules_WellKnownRegex) isStringRules_WellKnown() {} func (m *StringRules) GetWellKnown() isStringRules_WellKnown { if m != nil { @@ -2397,18 +2432,11 @@ func (m *StringRules) GetUuid() bool { return false } -func (m *StringRules) GetHttpHeaderName() bool { - if x, ok := m.GetWellKnown().(*StringRules_HttpHeaderName); ok { - return x.HttpHeaderName - } - return false -} - -func (m *StringRules) GetHttpHeaderValue() bool { - if x, ok := m.GetWellKnown().(*StringRules_HttpHeaderValue); ok { - return x.HttpHeaderValue +func (m *StringRules) GetWellKnownRegex() KnownRegex { + if x, ok := m.GetWellKnown().(*StringRules_WellKnownRegex); ok { + return x.WellKnownRegex } - return false + return KnownRegex_UNKNOWN } // XXX_OneofFuncs is for the internal use of the proto package. @@ -2423,8 +2451,7 @@ func (*StringRules) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) e (*StringRules_UriRef)(nil), (*StringRules_Address)(nil), (*StringRules_Uuid)(nil), - (*StringRules_HttpHeaderName)(nil), - (*StringRules_HttpHeaderValue)(nil), + (*StringRules_WellKnownRegex)(nil), } } @@ -2495,20 +2522,9 @@ func _StringRules_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { } b.EncodeVarint(22<<3 | proto.WireVarint) b.EncodeVarint(t) - case *StringRules_HttpHeaderName: - t := uint64(0) - if x.HttpHeaderName { - t = 1 - } + case *StringRules_WellKnownRegex: b.EncodeVarint(24<<3 | proto.WireVarint) - b.EncodeVarint(t) - case *StringRules_HttpHeaderValue: - t := uint64(0) - if x.HttpHeaderValue { - t = 1 - } - b.EncodeVarint(25<<3 | proto.WireVarint) - b.EncodeVarint(t) + b.EncodeVarint(uint64(x.WellKnownRegex)) case nil: default: return fmt.Errorf("StringRules.WellKnown has unexpected type %T", x) @@ -2582,19 +2598,12 @@ func _StringRules_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Bu x, err := b.DecodeVarint() m.WellKnown = &StringRules_Uuid{x != 0} return true, err - case 24: // well_known.http_header_name + case 24: // well_known.well_known_regex if wire != proto.WireVarint { return true, proto.ErrInternalBadWireType } x, err := b.DecodeVarint() - m.WellKnown = &StringRules_HttpHeaderName{x != 0} - return true, err - case 25: // well_known.http_header_value - if wire != proto.WireVarint { - return true, proto.ErrInternalBadWireType - } - x, err := b.DecodeVarint() - m.WellKnown = &StringRules_HttpHeaderValue{x != 0} + m.WellKnown = &StringRules_WellKnownRegex{KnownRegex(x)} return true, err default: return false, nil @@ -2632,12 +2641,9 @@ func _StringRules_OneofSizer(msg proto.Message) (n int) { case *StringRules_Uuid: n += 2 // tag and wire n += 1 - case *StringRules_HttpHeaderName: - n += 2 // tag and wire - n += 1 - case *StringRules_HttpHeaderValue: + case *StringRules_WellKnownRegex: n += 2 // tag and wire - n += 1 + n += proto.SizeVarint(uint64(x.WellKnownRegex)) case nil: default: panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) @@ -2693,7 +2699,7 @@ func (m *BytesRules) Reset() { *m = BytesRules{} } func (m *BytesRules) String() string { return proto.CompactTextString(m) } func (*BytesRules) ProtoMessage() {} func (*BytesRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{15} + return fileDescriptor_validate_9eaa14bea8038a77, []int{15} } func (m *BytesRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_BytesRules.Unmarshal(m, b) @@ -2945,7 +2951,7 @@ func (m *EnumRules) Reset() { *m = EnumRules{} } func (m *EnumRules) String() string { return proto.CompactTextString(m) } func (*EnumRules) ProtoMessage() {} func (*EnumRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{16} + return fileDescriptor_validate_9eaa14bea8038a77, []int{16} } func (m *EnumRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_EnumRules.Unmarshal(m, b) @@ -3010,7 +3016,7 @@ func (m *MessageRules) Reset() { *m = MessageRules{} } func (m *MessageRules) String() string { return proto.CompactTextString(m) } func (*MessageRules) ProtoMessage() {} func (*MessageRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{17} + return fileDescriptor_validate_9eaa14bea8038a77, []int{17} } func (m *MessageRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MessageRules.Unmarshal(m, b) @@ -3069,7 +3075,7 @@ func (m *RepeatedRules) Reset() { *m = RepeatedRules{} } func (m *RepeatedRules) String() string { return proto.CompactTextString(m) } func (*RepeatedRules) ProtoMessage() {} func (*RepeatedRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{18} + return fileDescriptor_validate_9eaa14bea8038a77, []int{18} } func (m *RepeatedRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_RepeatedRules.Unmarshal(m, b) @@ -3143,7 +3149,7 @@ func (m *MapRules) Reset() { *m = MapRules{} } func (m *MapRules) String() string { return proto.CompactTextString(m) } func (*MapRules) ProtoMessage() {} func (*MapRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{19} + return fileDescriptor_validate_9eaa14bea8038a77, []int{19} } func (m *MapRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_MapRules.Unmarshal(m, b) @@ -3218,7 +3224,7 @@ func (m *AnyRules) Reset() { *m = AnyRules{} } func (m *AnyRules) String() string { return proto.CompactTextString(m) } func (*AnyRules) ProtoMessage() {} func (*AnyRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{20} + return fileDescriptor_validate_9eaa14bea8038a77, []int{20} } func (m *AnyRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AnyRules.Unmarshal(m, b) @@ -3293,7 +3299,7 @@ func (m *DurationRules) Reset() { *m = DurationRules{} } func (m *DurationRules) String() string { return proto.CompactTextString(m) } func (*DurationRules) ProtoMessage() {} func (*DurationRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{21} + return fileDescriptor_validate_9eaa14bea8038a77, []int{21} } func (m *DurationRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DurationRules.Unmarshal(m, b) @@ -3407,7 +3413,7 @@ func (m *TimestampRules) Reset() { *m = TimestampRules{} } func (m *TimestampRules) String() string { return proto.CompactTextString(m) } func (*TimestampRules) ProtoMessage() {} func (*TimestampRules) Descriptor() ([]byte, []int) { - return fileDescriptor_validate_43c63909c1bdffc1, []int{22} + return fileDescriptor_validate_9eaa14bea8038a77, []int{22} } func (m *TimestampRules) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TimestampRules.Unmarshal(m, b) @@ -3541,121 +3547,124 @@ func init() { proto.RegisterType((*AnyRules)(nil), "validate.AnyRules") proto.RegisterType((*DurationRules)(nil), "validate.DurationRules") proto.RegisterType((*TimestampRules)(nil), "validate.TimestampRules") + proto.RegisterEnum("validate.KnownRegex", KnownRegex_name, KnownRegex_value) proto.RegisterExtension(E_Disabled) proto.RegisterExtension(E_Required) proto.RegisterExtension(E_Rules) } -func init() { proto.RegisterFile("validate/validate.proto", fileDescriptor_validate_43c63909c1bdffc1) } - -var fileDescriptor_validate_43c63909c1bdffc1 = []byte{ - // 1716 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x98, 0x4b, 0x73, 0xe3, 0xb8, - 0x11, 0xc7, 0x23, 0xbe, 0x05, 0x49, 0x23, 0x09, 0xeb, 0xf1, 0x70, 0x9c, 0xc7, 0x7a, 0x74, 0x48, - 0xcd, 0x4c, 0xbc, 0xf6, 0xc4, 0xeb, 0xa8, 0x52, 0xae, 0x54, 0xaa, 0xe2, 0x6c, 0xa6, 0x76, 0x52, - 0xd9, 0x9d, 0x2d, 0x3a, 0x9b, 0x43, 0x2e, 0x2a, 0xda, 0x82, 0x64, 0x94, 0x29, 0x90, 0xcb, 0x87, - 0x6d, 0x7d, 0x88, 0x3c, 0xbe, 0x47, 0x0e, 0x39, 0xe7, 0x94, 0x6b, 0xbe, 0x4a, 0xce, 0xf9, 0x02, - 0x29, 0x34, 0x00, 0x3e, 0x40, 0x5a, 0x3e, 0xec, 0x4d, 0xe8, 0xfe, 0x37, 0xf0, 0x53, 0x03, 0x6c, - 0x36, 0x88, 0x5e, 0xdc, 0x85, 0x11, 0x5d, 0x86, 0x39, 0x39, 0x51, 0x3f, 0x8e, 0x93, 0x34, 0xce, - 0x63, 0xec, 0xa9, 0xf1, 0xc1, 0xe1, 0x3a, 0x8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0xf5, 0xcb, 0x6e, 0xa3, 0x49, 0xe3, 0x49, 0x9a, 0xd9, 0x3f, 0x6c, 0x34, 0xa8, 0x35, 0x19, - 0x4d, 0x55, 0x5f, 0x31, 0x73, 0x46, 0xc2, 0xe0, 0x05, 0xcf, 0xeb, 0x01, 0x61, 0xf8, 0x05, 0x72, - 0x37, 0x94, 0x2d, 0xb8, 0x55, 0x94, 0x0d, 0x67, 0x43, 0xd9, 0x1f, 0xa4, 0x23, 0x7c, 0x00, 0x87, - 0x29, 0x1d, 0xe1, 0x03, 0x77, 0xfc, 0x10, 0xf5, 0x23, 0xc2, 0x16, 0xa2, 0x71, 0xd9, 0x03, 0x97, - 0x17, 0x11, 0x06, 0x1d, 0x0b, 0x77, 0xf2, 0xe9, 0x84, 0x53, 0x54, 0x19, 0x6f, 0x43, 0x6b, 0xce, - 0xf0, 0x41, 0x3a, 0x6d, 0xe9, 0x0c, 0x1f, 0x84, 0xd3, 0x47, 0x6e, 0x12, 0xe6, 0x39, 0x49, 0x19, - 0x74, 0xb4, 0xfd, 0x40, 0x0d, 0xf1, 0x3e, 0x72, 0x92, 0x94, 0xac, 0xe8, 0x03, 0x74, 0xae, 0xfd, - 0x40, 0x8e, 0xb8, 0x3d, 0x2b, 0x56, 0xdc, 0xee, 0x09, 0xbb, 0x18, 0xe1, 0x03, 0xe4, 0x5d, 0xc7, - 0x2c, 0x0f, 0x29, 0xcb, 0xa0, 0x11, 0xed, 0x07, 0xe5, 0x18, 0xbf, 0x42, 0x43, 0x9e, 0xe0, 0xd2, - 0xff, 0x02, 0xfc, 0x03, 0x16, 0xe7, 0xbf, 0x55, 0x12, 0xb1, 0x27, 0xe8, 0xd0, 0x7c, 0xdd, 0xd7, - 0xf6, 0x64, 0x00, 0x36, 0xb1, 0x27, 0x78, 0x1f, 0xd9, 0x64, 0x13, 0xd2, 0x08, 0x7a, 0x49, 0x8f, - 0x77, 0x69, 0x30, 0xc4, 0x3f, 0x42, 0xde, 0x4d, 0x9c, 0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, 0xe3, 0x7b, 0x6e, 0x5e, 0x0b, 0xb3, 0x27, 0xcc, - 0x6b, 0x30, 0xff, 0x1c, 0x39, 0xf7, 0x34, 0xbf, 0x81, 0xca, 0xfa, 0xc4, 0x7e, 0x4a, 0xe1, 0xf9, - 0xaf, 0x90, 0xb7, 0xa4, 0x59, 0x78, 0x15, 0x91, 0x25, 0xfe, 0xb4, 0x25, 0x97, 0x75, 0xed, 0x63, - 0xc2, 0x63, 0x32, 0xff, 0x9f, 0x62, 0xb5, 0x32, 0xe2, 0xfc, 0xbc, 0xda, 0x20, 0xfc, 0xe3, 0x56, - 0xf4, 0x47, 0x46, 0xe2, 0x95, 0x1e, 0xab, 0xf4, 0xe7, 0xbf, 0x47, 0x76, 0x0a, 0xbb, 0xdc, 0x0e, - 0x84, 0x07, 0xbb, 0x11, 0xf8, 0x68, 0xc9, 0x82, 0x29, 0x2e, 0xbe, 0x41, 0x07, 0x34, 0x3e, 0x26, - 0xec, 0x2e, 0xde, 0x26, 0x69, 0xfc, 0xb0, 0x3d, 0x4e, 0xd6, 0x77, 0xa5, 0xfe, 0xcf, 0xa7, 0x6b, - 0x9a, 0xdf, 0x14, 0x57, 0xc7, 0xd7, 0xf1, 0xe6, 0xa4, 0xd2, 0x88, 0x4f, 0xad, 0xd7, 0x9f, 0xad, - 0x09, 0xfb, 0xac, 0xf5, 0x85, 0xf7, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0x25, 0xee, 0x13, 0xbc, - 0xf5, 0x15, 0x00, 0x00, +func init() { proto.RegisterFile("validate/validate.proto", fileDescriptor_validate_9eaa14bea8038a77) } + +var fileDescriptor_validate_9eaa14bea8038a77 = []byte{ + // 1758 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x98, 0x4b, 0x6f, 0xdc, 0xba, + 0x15, 0xc7, 0xa3, 0xb7, 0xe6, 0xcc, 0x8c, 0x3d, 0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x08, 0xf5, 0xec, 0x1d, 0x83, + 0x29, 0x08, 0x45, 0x9b, 0x60, 0xd3, 0x38, 0x9f, 0x11, 0xea, 0x39, 0xdc, 0x66, 0xd1, 0x38, 0x7f, + 0x43, 0x77, 0xff, 0xa2, 0xc1, 0xb0, 0x51, 0x54, 0xda, 0x40, 0x5a, 0x17, 0x48, 0x53, 0x81, 0x34, + 0x15, 0x48, 0x53, 0x81, 0x34, 0x15, 0x48, 0xeb, 0x01, 0xd2, 0x24, 0x10, 0x4b, 0x50, 0xfd, 0xd4, + 0xb7, 0x79, 0xac, 0x2e, 0x8f, 0xa5, 0xf2, 0x58, 0x2a, 0x8f, 0xa5, 0xf2, 0x58, 0x2a, 0x8f, 0xd5, + 0xc3, 0x63, 0x29, 0x3c, 0xe5, 0x03, 0xd8, 0xe6, 0x31, 0xba, 0x3c, 0x86, 0xca, 0x63, 0xa8, 0x3c, + 0x86, 0xca, 0x63, 0xa8, 0x3c, 0x46, 0x0f, 0x8f, 0xd1, 0xdc, 0xb0, 0x4f, 0xb7, 0x25, 0x68, 0xdc, + 0x05, 0x1a, 0xab, 0x40, 0x63, 0x15, 0x68, 0xac, 0x02, 0x8d, 0x55, 0xa0, 0x71, 0x0f, 0xd0, 0x58, + 0x05, 0xea, 0xcd, 0x90, 0xd9, 0x05, 0x32, 0x55, 0x20, 0x53, 0x05, 0x32, 0x55, 0x20, 0x53, 0x05, + 0x32, 0x7b, 0x80, 0xcc, 0x26, 0xd0, 0x87, 0xdb, 0x32, 0x34, 0xed, 0x02, 0x4d, 0x55, 0xa0, 0xa9, + 0x0a, 0x34, 0x55, 0x81, 0xa6, 0x2a, 0xd0, 0xb4, 0x07, 0x68, 0xaa, 0x02, 0xf5, 0x66, 0x08, 0x75, + 0x81, 0x90, 0x0a, 0x84, 0x54, 0x20, 0xa4, 0x02, 0x21, 0x15, 0x08, 0xf5, 0x00, 0x21, 0x09, 0xf4, + 0x57, 0x0d, 0x46, 0xcd, 0xdb, 0xa8, 0x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x41, + 0x5d, 0x45, 0x3c, 0x7f, 0x5e, 0x6f, 0x34, 0xfa, 0x49, 0x27, 0xfa, 0x1d, 0xc5, 0xf1, 0x42, 0x8d, + 0x95, 0xfa, 0xe7, 0xbf, 0x07, 0x2b, 0xe5, 0xa7, 0xa5, 0x1b, 0xc8, 0x0b, 0x44, 0x2b, 0xf0, 0xd6, + 0xd2, 0xc7, 0xa7, 0x38, 0x79, 0x0f, 0xdb, 0x24, 0xde, 0xc7, 0xf4, 0x2a, 0x5e, 0x25, 0x69, 0x7c, + 0xb3, 0xda, 0x4f, 0xc2, 0xab, 0x4a, 0xff, 0xa7, 0xc3, 0x90, 0xe4, 0x9f, 0x8b, 0xf3, 0xfd, 0x8b, + 0x78, 0x79, 0x50, 0x6b, 0xc4, 0xa7, 0xd9, 0x8b, 0x6f, 0x43, 0x4c, 0xbf, 0xed, 0x7c, 0x11, 0xfe, + 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x97, 0xba, 0x5c, 0x25, 0x16, 0x00, 0x00, } diff --git a/validate/validate.proto b/validate/validate.proto index 2122b2b8e..6d0ab5885 100644 --- a/validate/validate.proto +++ b/validate/validate.proto @@ -554,16 +554,22 @@ message StringRules { // RFC 4122 bool uuid = 22; - // HttpHeaderName specified that the field must be a valid HTTP header name - // as defined by RFC 7230. - bool http_header_name = 24; - - // HttpHeaderValue specified that the field must be a valid HTTP header value - // as defined by RFC 7230. - bool http_header_value = 25; + // WellKnownRegex specifies a common well known pattern defined as a regex. + KnownRegex well_known_regex = 24; } } +// WellKnownRegex contain some well-known patterns. +enum KnownRegex { + UNKNOWN = 0; + + // HTTP header name as defined by RFC 7230. + HTTP_HEADER_NAME = 1; + + // HTTP header value as defined by RFC 7230. + HTTP_HEADER_VALUE = 2; +} + // BytesRules describe the constraints applied to `bytes` values message BytesRules { // Const specifies that this field must be exactly the specified value diff --git a/validate/validator.py b/validate/validator.py index ce0b31a23..e986828a7 100644 --- a/validate/validator.py +++ b/validate/validator.py @@ -13,6 +13,13 @@ printer = "" +# Well known regex mapping. +regex_map = { + 0: "", # UNKNOWN + 1: r'^:?[0-9a-zA-Z!#$%&\'*+-.^_|~\x2C]+$', # HTTP_HEADER_NAME + 2: r'^[ \t]*(?:[\x20-\x7E\u0080-\u00FF](?:[ \t]+[\x20-\x7E\u0080-\u00FF])?)*[ \t]*$' #HTTP_HEADER_VALUE +} + def validate(proto_message): func = file_template(proto_message) global printer @@ -118,6 +125,8 @@ def in_template(value, name): return Template(in_tmpl).render(value = value, name = name) def string_template(option_value, name): + if option_value.string.well_known_regex: + option_value.string.pattern = regex_map[option_value.string.well_known_regex] str_templ = """ {{ const_template(o, name) -}} {{ in_template(o.string, name) -}} @@ -215,14 +224,6 @@ def string_template(option_value, name): except ValueError: raise ValidationFailed(\"{{ name }} is not a valid UUID\") {%- endif -%} - {%- if s['http_header_name'] %} - if not re.match("^:?[0-9a-zA-Z!#$%&'*+-.^_|~\x2C]+$", {{ name}}): - raise ValidationFailed(\"{{ name }} is not a valid HTTP header name\") - {%- endif -%} - {%- if s['http_header_value'] %} - if not re.match("^[ \t]*(?:[\x20-\x7E\u0080-\u00FF](?:[ \t]+[\x20-\x7E\u0080-\u00FF])?)*[ \t]*$", {{ name }}): - raise ValidationFailed(\"{{ name }} is not a valid HTTP header value\") - {%- endif -%} """ return Template(str_templ).render(o = option_value, name = name, const_template = const_template, in_template = in_template) diff --git a/validate/validator.pyc b/validate/validator.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aba6c9703e121433a5363342c095a06106dd4d32 GIT binary patch literal 43224 zcmdUY-H%*Hc3*YRkm687QWPapl(efBDQbF1P7k%K<$Co&Q7e&J#qvn$(JpPya>vc- zJHsY>x|@A(OB_=)49NCFfB@M90qg{@0V5ma#eaYwY`}2x805_lF&249fCNY$64*hW z?D+RPRduWG*Yw9UIcrLN=ia*Yaq65?=bSpHs_x8RA36N*7ytIwhBE&S;O|xZ!oMjg z)x`fL)mG}JzAvkGNo|+Z&5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p##;~RnqqX=we+wOv#{BDn4X!L{cIM^Fsccfv8r{dM_32#h=h|soDcw?fz`YO zQn_u(9)+;R!M2Oe({pBe<>F99F{n?48sJ=wNrNDI>a46vt?|sxs4B^xd!)Cqf5YK1 z)e?LxsbS0}7M-Renr_CkiRmHsjgozA%~>i{>=q_lQDU-_1%FVObCbG@m)foH_181$;+$|)csG(CiD zA^k$32lk+f+Z|S#QXg;ky8Y-{zmF@Yv3S{T-LB~jRAKs#JTVxwn%c67`0Z)Az1!;C zZG21S?qavl&d}?XSym1jxD!Ra9|VnN&|ksQd(4ECa!Ek^AgI&+sFMzLvFu*v-34CQ zn>s&fR=>*22fSS4Qooy!3bxi%Lu$ zT2wM9Wh@Bh;^2d@O`X`@CrS(H-qC~S3Wr_D4$|(JFU{b31oqCn*de%<50>#^yz<=P zxtX~`a|h?1ojZ#AlXFMr?#vyUKY^4hc%GgA(R_D)5qX}Te_`(9`Ac(W=Vs?F&wVoY I%E_6(2cDC9u>b%7 literal 0 HcmV?d00001 From cb4812e5c5cd0888459bc275161e49412c17ea9b Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Mon, 23 Dec 2019 09:04:05 -0500 Subject: [PATCH 12/25] fix bazel Signed-off-by: Asra Ali --- .bazelversion | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .bazelversion diff --git a/.bazelversion b/.bazelversion deleted file mode 100644 index 1cc5f657e..000000000 --- a/.bazelversion +++ /dev/null @@ -1 +0,0 @@ -1.1.0 \ No newline at end of file From 9bc951e744dfa59ab025edaaaaf0953e742d1767 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Mon, 23 Dec 2019 09:59:20 -0500 Subject: [PATCH 13/25] fix bazel maven_jar defn Signed-off-by: Asra Ali --- WORKSPACE | 3 +++ bazel/repositories.bzl | 21 ++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 8acb616f3..7a11b7743 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,5 +1,6 @@ workspace(name = "com_envoyproxy_protoc_gen_validate") +load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") load("//bazel:repositories.bzl", "pgv_dependencies") pgv_dependencies() @@ -11,3 +12,5 @@ pgv_dependency_imports() load("//bazel:pip_dependencies.bzl", "pgv_pip_dependencies") pgv_pip_dependencies() + + diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index e5210f53e..af251cc00 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -1,5 +1,6 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") def pgv_dependencies(): if not native.existing_rule("io_bazel_rules_go"): @@ -58,9 +59,11 @@ def pgv_dependencies(): ) if not native.existing_rule("com_google_re2j"): - native.maven_jar( + jvm_maven_import_external( name = "com_google_re2j", artifact = "com.google.re2j:re2j:1.2", + artifact_sha256 = "e9dc705fd4c570344b54a7146b2e3a819cdc271a29793f4acc1a93b56a388e59", + server_urls = ["http://central.maven.org/maven2"], ) if not native.existing_rule("com_googlesource_code_re2"): @@ -72,9 +75,11 @@ def pgv_dependencies(): ) if not native.existing_rule("com_google_guava"): - native.maven_jar( + jvm_maven_import_external( name = "com_google_guava", artifact = "com.google.guava:guava:27.0-jre", + artifact_sha256 = "63b09db6861011e7fb2481be7790c7fd4b03f0bb884b3de2ecba8823ad19bf3f", + server_urls = ["http://central.maven.org/maven2"], ) if not native.existing_rule("guava"): @@ -84,9 +89,11 @@ def pgv_dependencies(): ) if not native.existing_rule("com_google_gson"): - native.maven_jar( + jvm_maven_import_external( name = "com_google_gson", artifact = "com.google.code.gson:gson:2.8.5", + artifact_sha256 = "233a0149fc365c9f6edbd683cfe266b19bdc773be98eabdaf6b3c924b48e7d81", + server_urls = ["http://central.maven.org/maven2"], ) if not native.existing_rule("gson"): @@ -96,9 +103,11 @@ def pgv_dependencies(): ) if not native.existing_rule("error_prone_annotations_maven"): - native.maven_jar( + jvm_maven_import_external( name = "error_prone_annotations_maven", artifact = "com.google.errorprone:error_prone_annotations:2.3.2", + artifact_sha256 = "357cd6cfb067c969226c442451502aee13800a24e950fdfde77bcdb4565a668d", + server_urls = ["http://central.maven.org/maven2"], ) if not native.existing_rule("error_prone_annotations"): @@ -108,9 +117,11 @@ def pgv_dependencies(): ) if not native.existing_rule("org_apache_commons_validator"): - native.maven_jar( + jvm_maven_import_external( name = "org_apache_commons_validator", artifact = "commons-validator:commons-validator:1.6", + artifact_sha256 = "bd62795d7068a69cbea333f6dbf9c9c1a6ad7521443fb57202a44874f240ba25", + server_urls = ["http://central.maven.org/maven2"], ) if not native.existing_rule("io_bazel_rules_python"): From a7e22e9d282cd5d2f491bd38d10875a697b28980 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Thu, 26 Dec 2019 13:16:02 -0500 Subject: [PATCH 14/25] remove fixes for build Signed-off-by: Asra Ali --- WORKSPACE | 1 - 1 file changed, 1 deletion(-) diff --git a/WORKSPACE b/WORKSPACE index 7a11b7743..e48809981 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,6 +1,5 @@ workspace(name = "com_envoyproxy_protoc_gen_validate") -load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") load("//bazel:repositories.bzl", "pgv_dependencies") pgv_dependencies() From 5dba63dbbb4cbb6cfb07374c6bc6ab5477d25745 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Thu, 26 Dec 2019 13:27:57 -0500 Subject: [PATCH 15/25] fix merge mistake Signed-off-by: Asra Ali --- bazel/repositories.bzl | 1 - 1 file changed, 1 deletion(-) diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 9a4dadec8..3967a1010 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -1,7 +1,6 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") def pgv_dependencies(): if not native.existing_rule("io_bazel_rules_go"): From 4675686acd00902f8497b08f540344fb8919a7d5 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Mon, 6 Jan 2020 14:21:30 -0500 Subject: [PATCH 16/25] encode in utf-8 when writing out Signed-off-by: Asra Ali --- tests/harness/executor/cases.go | 4 ++-- tests/harness/python/harness.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/harness/executor/cases.go b/tests/harness/executor/cases.go index d924d4005..8ca9b352f 100644 --- a/tests/harness/executor/cases.go +++ b/tests/harness/executor/cases.go @@ -882,8 +882,8 @@ var stringCases = []TestCase{ {"string - http header value - valid (spaces)", &cases.StringHttpHeaderValue{Val: "cluster name"}, true}, {"string - http header value - valid (tab)", &cases.StringHttpHeaderValue{Val: "example\t"}, true}, {"string - http header value - valid (special token)", &cases.StringHttpHeaderValue{Val: "!#%&./+"}, true}, - {"string - http header value - invalid (NUL)", &cases.StringHttpHeaderValue{Val: "foo\000bar"}, false}, - {"string - http header value - invalid (DEL)", &cases.StringHttpHeaderValue{Val: "\x7f"}, false}, + {"string - http header value - invalid (NUL)", &cases.StringHttpHeaderValue{Val: "foo\u0000bar"}, false}, + {"string - http header value - invalid (DEL)", &cases.StringHttpHeaderValue{Val: "\u007f"}, false}, {"string - http header value - invalid", &cases.StringHttpHeaderValue{Val: "example\r"}, false}, } diff --git a/tests/harness/python/harness.py b/tests/harness/python/harness.py index 3321483ff..55bcd3ef4 100644 --- a/tests/harness/python/harness.py +++ b/tests/harness/python/harness.py @@ -58,7 +58,8 @@ def unpack(message): result.Error = False result.AllowFailure = True result.Reason = repr(e) + sys.stdout = open(sys.stdout.fileno(), mode='w', encoding='utf8') try: - sys.stdout.write(result.SerializeToString()) + sys.stdout.write(result.SerializeToString().decode("utf-8")) except TypeError: - sys.stdout.write(result.SerializeToString().decode(errors='surrogateescape')) + sys.stdout.write(result.SerializeToString().decode("utf-8", errors='surrogateescape')) From 94d5d8d93bbd6c7e03a277e84144e8af3f732106 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Mon, 6 Jan 2020 15:08:57 -0500 Subject: [PATCH 17/25] cleanup Signed-off-by: Asra Ali --- WORKSPACE | 2 -- bazel/repositories.bzl | 10 +++++----- templates/goshared/register.go | 5 ++--- templates/goshared/string.go | 1 + templates/shared/well_known.go | 1 + 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index e48809981..8acb616f3 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -11,5 +11,3 @@ pgv_dependency_imports() load("//bazel:pip_dependencies.bzl", "pgv_pip_dependencies") pgv_pip_dependencies() - - diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 3967a1010..ad0fcb5cc 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -1,6 +1,6 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") -load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") def pgv_dependencies(): if not native.existing_rule("io_bazel_rules_go"): @@ -62,7 +62,7 @@ def pgv_dependencies(): jvm_maven_import_external( name = "com_google_re2j", artifact = "com.google.re2j:re2j:1.2", - artifact_sha256 = "e9dc705fd4c570344b54a7146b2e3a819cdc271a29793f4acc1a93b56a388e59", + artifact_sha256 = "e9dc705fd4c570344b54a7146b2e3a819cdc271a29793f4acc1a93b56a388e59", server_urls = ["http://central.maven.org/maven2"], ) @@ -78,7 +78,7 @@ def pgv_dependencies(): jvm_maven_import_external( name = "com_google_guava", artifact = "com.google.guava:guava:27.0-jre", - artifact_sha256 = "63b09db6861011e7fb2481be7790c7fd4b03f0bb884b3de2ecba8823ad19bf3f", + artifact_sha256 = "63b09db6861011e7fb2481be7790c7fd4b03f0bb884b3de2ecba8823ad19bf3f", server_urls = ["http://central.maven.org/maven2"], ) @@ -106,7 +106,7 @@ def pgv_dependencies(): jvm_maven_import_external( name = "error_prone_annotations_maven", artifact = "com.google.errorprone:error_prone_annotations:2.3.2", - artifact_sha256 = "357cd6cfb067c969226c442451502aee13800a24e950fdfde77bcdb4565a668d", + artifact_sha256 = "357cd6cfb067c969226c442451502aee13800a24e950fdfde77bcdb4565a668d", server_urls = ["http://central.maven.org/maven2"], ) @@ -120,7 +120,7 @@ def pgv_dependencies(): jvm_maven_import_external( name = "org_apache_commons_validator", artifact = "commons-validator:commons-validator:1.6", - artifact_sha256 = "bd62795d7068a69cbea333f6dbf9c9c1a6ad7521443fb57202a44874f240ba25", + artifact_sha256 = "bd62795d7068a69cbea333f6dbf9c9c1a6ad7521443fb57202a44874f240ba25", server_urls = ["http://central.maven.org/maven2"], ) diff --git a/templates/goshared/register.go b/templates/goshared/register.go index d132d5f30..296fd19e0 100644 --- a/templates/goshared/register.go +++ b/templates/goshared/register.go @@ -2,12 +2,11 @@ package goshared import ( "fmt" + "github.com/iancoleman/strcase" "reflect" "strings" "text/template" - "github.com/iancoleman/strcase" - "github.com/envoyproxy/protoc-gen-validate/templates/shared" "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/duration" @@ -22,7 +21,7 @@ func Register(tpl *template.Template, params pgs.Parameters) { tpl.Funcs(map[string]interface{}{ "accessor": fns.accessor, "byteStr": fns.byteStr, - "snakeCase": fns.snakeCase, + "snakeCase": fns.snakeCase, "cmt": pgs.C80, "durGt": fns.durGt, "durLit": fns.durLit, diff --git a/templates/goshared/string.go b/templates/goshared/string.go index 0231a17f5..1b6e3ecd1 100644 --- a/templates/goshared/string.go +++ b/templates/goshared/string.go @@ -121,6 +121,7 @@ const strTpl = ` return {{ errCause . "err" "value must be a valid UUID" }} } {{ end }} + {{ if $r.Pattern }} if !{{ lookup $f "Pattern" }}.MatchString({{ accessor . }}) { return {{ err . "value does not match regex pattern " (lit $r.GetPattern) }} diff --git a/templates/shared/well_known.go b/templates/shared/well_known.go index b66b44c51..6ec62af14 100644 --- a/templates/shared/well_known.go +++ b/templates/shared/well_known.go @@ -62,5 +62,6 @@ func strRulesNeeds(rules *validate.StringRules, wk WellKnown) bool { return true } } + return false } From a41290c66b281015a7f3fda05d7ad9f41931b3f5 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Tue, 7 Jan 2020 13:01:55 -0500 Subject: [PATCH 18/25] remove unused regex definitions Signed-off-by: Asra Ali --- templates/gogo/file.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/templates/gogo/file.go b/templates/gogo/file.go index 84584ae40..0f19a3e4d 100644 --- a/templates/gogo/file.go +++ b/templates/gogo/file.go @@ -46,12 +46,6 @@ var ( // define the regex for a UUID once up-front var _{{ snakeCase .File.InputPath.BaseName }}_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$") -// define the regex for an HTTP header name once up-front -var _{{ snakeCase .File.InputPath.BaseName }}_httpHeaderName = regexp.MustCompile("^:?[0-9a-zA-Z!#$%&'*+-.^_|~\x2C]+$") - -// define the regex for an HTTP header value once up-front -var _{{ snakeCase .File.InputPath.BaseName }}_httpHeaderValue = regexp.MustCompile("^[ \t]*(?:[\x20-\x7E\u0080-\u00FF](?:[ \t]+[\x20-\x7E\u0080-\u00FF])?)*[ \t]*$") - {{ range .AllMessages }} {{ template "msg" . }} {{ end }} From b43d32eda82b89a8268b5a26a09332b395245fe5 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Fri, 24 Jan 2020 09:10:50 -0500 Subject: [PATCH 19/25] add backtick Signed-off-by: Asra Ali --- module/checker.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/checker.go b/module/checker.go index ca1f7d1d6..57a48f350 100644 --- a/module/checker.go +++ b/module/checker.go @@ -11,11 +11,11 @@ import ( "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/duration" "github.com/golang/protobuf/ptypes/timestamp" - "github.com/lyft/protoc-gen-star" + pgs "github.com/lyft/protoc-gen-star" ) var unknown = "" -var httpHeaderName = "^:?[0-9a-zA-Z!#$%&'*+-.^_|~\x2C]+$" +var httpHeaderName = "^:?[0-9a-zA-Z!#$%&'*+-.^_|~\x60]+$" var httpHeaderValue = "^[ \t]*(?:[\x20-\x7E\u0080-\u00FF](?:[ \t]+[\x20-\x7E\u0080-\u00FF])?)*[ \t]*$" // Map from well known regex to regex pattern. From 87e9ca4a81d4c5a30acbf83076462a3bbc097efd Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Fri, 24 Jan 2020 09:46:55 -0500 Subject: [PATCH 20/25] simplify header value regex as blacklist Signed-off-by: Asra Ali --- module/checker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/checker.go b/module/checker.go index 57a48f350..5e02a6a57 100644 --- a/module/checker.go +++ b/module/checker.go @@ -16,7 +16,7 @@ import ( var unknown = "" var httpHeaderName = "^:?[0-9a-zA-Z!#$%&'*+-.^_|~\x60]+$" -var httpHeaderValue = "^[ \t]*(?:[\x20-\x7E\u0080-\u00FF](?:[ \t]+[\x20-\x7E\u0080-\u00FF])?)*[ \t]*$" +var httpHeaderValue = "^[^\x00-\x08\x0A-\x1F\x7F]" // Map from well known regex to regex pattern. var regex_map = map[string]*string{ From a7debef2b3b13cebe8b69230edb2de0a739db209 Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Fri, 24 Jan 2020 12:06:36 -0500 Subject: [PATCH 21/25] fixup to match entire string + also fixup dependency Signed-off-by: Asra Ali --- bazel/repositories.bzl | 14 +++++++------- module/checker.go | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index ad0fcb5cc..60c171943 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -6,8 +6,8 @@ def pgv_dependencies(): if not native.existing_rule("io_bazel_rules_go"): http_archive( name = "io_bazel_rules_go", - urls = ["https://github.com/bazelbuild/rules_go/releases/download/0.18.5/rules_go-0.18.5.tar.gz"], - sha256 = "a82a352bffae6bee4e95f68a8d80a70e87f42c4741e6a448bec11998fcc82329", + urls = ["https://github.com/bazelbuild/rules_go/releases/download/v0.21.0/rules_go-v0.21.0.tar.gz"], + sha256 = "b27e55d2dcc9e6020e17614ae6e0374818a3e3ce6f2024036e688ada24110444", ) if not native.existing_rule("bazel_gazelle"): @@ -63,7 +63,7 @@ def pgv_dependencies(): name = "com_google_re2j", artifact = "com.google.re2j:re2j:1.2", artifact_sha256 = "e9dc705fd4c570344b54a7146b2e3a819cdc271a29793f4acc1a93b56a388e59", - server_urls = ["http://central.maven.org/maven2"], + server_urls = ["https://repo.maven.apache.org/maven2"], ) if not native.existing_rule("com_googlesource_code_re2"): @@ -79,7 +79,7 @@ def pgv_dependencies(): name = "com_google_guava", artifact = "com.google.guava:guava:27.0-jre", artifact_sha256 = "63b09db6861011e7fb2481be7790c7fd4b03f0bb884b3de2ecba8823ad19bf3f", - server_urls = ["http://central.maven.org/maven2"], + server_urls = ["https://repo.maven.apache.org/maven2"], ) if not native.existing_rule("guava"): @@ -93,7 +93,7 @@ def pgv_dependencies(): name = "com_google_gson", artifact = "com.google.code.gson:gson:2.8.5", artifact_sha256 = "233a0149fc365c9f6edbd683cfe266b19bdc773be98eabdaf6b3c924b48e7d81", - server_urls = ["http://central.maven.org/maven2"], + server_urls = ["https://repo.maven.apache.org/maven2"], ) if not native.existing_rule("gson"): @@ -107,7 +107,7 @@ def pgv_dependencies(): name = "error_prone_annotations_maven", artifact = "com.google.errorprone:error_prone_annotations:2.3.2", artifact_sha256 = "357cd6cfb067c969226c442451502aee13800a24e950fdfde77bcdb4565a668d", - server_urls = ["http://central.maven.org/maven2"], + server_urls = ["https://repo.maven.apache.org/maven2"], ) if not native.existing_rule("error_prone_annotations"): @@ -121,7 +121,7 @@ def pgv_dependencies(): name = "org_apache_commons_validator", artifact = "commons-validator:commons-validator:1.6", artifact_sha256 = "bd62795d7068a69cbea333f6dbf9c9c1a6ad7521443fb57202a44874f240ba25", - server_urls = ["http://central.maven.org/maven2"], + server_urls = ["https://repo.maven.apache.org/maven2"], ) if not native.existing_rule("io_bazel_rules_python"): diff --git a/module/checker.go b/module/checker.go index 5e02a6a57..15ba16d90 100644 --- a/module/checker.go +++ b/module/checker.go @@ -16,7 +16,7 @@ import ( var unknown = "" var httpHeaderName = "^:?[0-9a-zA-Z!#$%&'*+-.^_|~\x60]+$" -var httpHeaderValue = "^[^\x00-\x08\x0A-\x1F\x7F]" +var httpHeaderValue = "^[^\u0000-\u0008\u000A-\u001F\u007F]*$" // Map from well known regex to regex pattern. var regex_map = map[string]*string{ From 5a4746076a7443a72545898c2e502aceb9883d0a Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Mon, 27 Jan 2020 15:15:49 -0500 Subject: [PATCH 22/25] python regex Signed-off-by: Asra Ali --- validate/validator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/validate/validator.py b/validate/validator.py index e986828a7..9b93c819f 100644 --- a/validate/validator.py +++ b/validate/validator.py @@ -16,8 +16,8 @@ # Well known regex mapping. regex_map = { 0: "", # UNKNOWN - 1: r'^:?[0-9a-zA-Z!#$%&\'*+-.^_|~\x2C]+$', # HTTP_HEADER_NAME - 2: r'^[ \t]*(?:[\x20-\x7E\u0080-\u00FF](?:[ \t]+[\x20-\x7E\u0080-\u00FF])?)*[ \t]*$' #HTTP_HEADER_VALUE + 1: r'^:?[0-9a-zA-Z!#$%&\'*+-.^_|~\x60]+$', # HTTP_HEADER_NAME + 2: r'^[^\u0000-\u0008\u000A-\u001F\u007F]*$' #HTTP_HEADER_VALUE } def validate(proto_message): From bbc4c85327955ee6afefbbb7a847cefbe2fc743c Mon Sep 17 00:00:00 2001 From: Asra Ali Date: Mon, 3 Feb 2020 09:09:30 -0500 Subject: [PATCH 23/25] remove pyc Signed-off-by: Asra Ali --- validate/validator.pyc | Bin 43224 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 validate/validator.pyc diff --git a/validate/validator.pyc b/validate/validator.pyc deleted file mode 100644 index aba6c9703e121433a5363342c095a06106dd4d32..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 43224 zcmdUY-H%*Hc3*YRkm687QWPapl(efBDQbF1P7k%K<$Co&Q7e&J#qvn$(JpPya>vc- zJHsY>x|@A(OB_=)49NCFfB@M90qg{@0V5ma#eaYwY`}2x805_lF&249fCNY$64*hW z?D+RPRduWG*Yw9UIcrLN=ia*Yaq65?=bSpHs_x8RA36N*7ytIwhBE&S;O|xZ!oMjg z)x`fL)mG}JzAvkGNo|+Z&5|macV%_6tahHUS!dME8FiymQM19Ux_4OhZ>mzs<~^Y9 z9_0H@N&TuR{*=1;lr4Km-8>}sGpaqOwhybDhvR0RRyUuv`R3KldDWa%jU%dgK;1m5 znyB@dYCffY8;}B&LvnLmHRt5!S=Br&Hz!o{X}Nh$HRt8#dDT23Hz!r|sN9@V&0})& zf@(e^H>XwexZJ#`f|peDS@qjMz{{$6LK45Bn$OA2H&yd_xp_r3Ps&Y2@}H9Yugd)k za(_ndPs{yT)qGJhzowcm$;~-=`?9=!T{XWUi3^hWO-Zb(<|~r8sG1eIIj@?p%FPAU zJR>(3Rr9ReEUD&eDyXT=l4_n~%GXN$+RbIveBGul#Hp7^?A2-&)NlQN{9CDl1ypnt zmoFOaR%n%T)z;~Ukp6kF-D@K~!o3P#!R04!y|;F0>3fZ(-*|uN=BsC4JNNp+ z`3p<6pR9lNn-_0gcrAR7dDbd(x6W7Jduy$-^qW5(T)Om2mzMbF`t@6qICtwp_RZpZ zi|3`>Ya0Zsj30UR`}l?b2$w*quh6}cdQ?(TNqvP5m(;26H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00:00:00 2001 From: Asra Ali Date: Tue, 4 Feb 2020 13:43:29 -0500 Subject: [PATCH 24/25] there's gotta be another way Signed-off-by: Asra Ali --- bazel/repositories.bzl | 8 +- .../validate/validate.pb.go | 3670 +++++++++++++++++ validate/validator.py | 13 +- 3 files changed, 3682 insertions(+), 9 deletions(-) create mode 100644 validate/github.com/envoyproxy/protoc-gen-validate/validate/validate.pb.go diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 60c171943..338b0ede7 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -133,9 +133,9 @@ def pgv_dependencies(): ) if not native.existing_rule("rules_proto"): - git_repository( + http_archive( name = "rules_proto", - remote = "https://github.com/bazelbuild/rules_proto.git", - commit = "2c0468366367d7ed97a1f702f9cd7155ab3f73c5", - shallow_since = "1575470667 +0100" + sha256 = "73ebe9d15ba42401c785f9d0aeebccd73bd80bf6b8ac78f74996d31f2c0ad7a6", + strip_prefix = "rules_proto-2c0468366367d7ed97a1f702f9cd7155ab3f73c5", + urls = ["https://github.com/bazelbuild/rules_proto/archive/2c0468366367d7ed97a1f702f9cd7155ab3f73c5.tar.gz"], ) diff --git a/validate/github.com/envoyproxy/protoc-gen-validate/validate/validate.pb.go b/validate/github.com/envoyproxy/protoc-gen-validate/validate/validate.pb.go new file mode 100644 index 000000000..a38bbbe2d --- /dev/null +++ b/validate/github.com/envoyproxy/protoc-gen-validate/validate/validate.pb.go @@ -0,0 +1,3670 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: validate/validate.proto + +package validate // import "github.com/envoyproxy/protoc-gen-validate/validate" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" +import duration "github.com/golang/protobuf/ptypes/duration" +import timestamp "github.com/golang/protobuf/ptypes/timestamp" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// WellKnownRegex contain some well-known patterns. +type KnownRegex int32 + +const ( + KnownRegex_UNKNOWN KnownRegex = 0 + // HTTP header name as defined by RFC 7230. + KnownRegex_HTTP_HEADER_NAME KnownRegex = 1 + // HTTP header value as defined by RFC 7230. + KnownRegex_HTTP_HEADER_VALUE KnownRegex = 2 +) + +var KnownRegex_name = map[int32]string{ + 0: "UNKNOWN", + 1: "HTTP_HEADER_NAME", + 2: "HTTP_HEADER_VALUE", +} +var KnownRegex_value = map[string]int32{ + "UNKNOWN": 0, + "HTTP_HEADER_NAME": 1, + "HTTP_HEADER_VALUE": 2, +} + +func (x KnownRegex) Enum() *KnownRegex { + p := new(KnownRegex) + *p = x + return p +} +func (x KnownRegex) String() string { + return proto.EnumName(KnownRegex_name, int32(x)) +} +func (x *KnownRegex) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(KnownRegex_value, data, "KnownRegex") + if err != nil { + return err + } + *x = KnownRegex(value) + return nil +} +func (KnownRegex) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{0} +} + +// FieldRules encapsulates the rules for each type of field. Depending on the +// field, the correct set should be used to ensure proper validations. +type FieldRules struct { + Message *MessageRules `protobuf:"bytes,17,opt,name=message" json:"message,omitempty"` + // Types that are valid to be assigned to Type: + // *FieldRules_Float + // *FieldRules_Double + // *FieldRules_Int32 + // *FieldRules_Int64 + // *FieldRules_Uint32 + // *FieldRules_Uint64 + // *FieldRules_Sint32 + // *FieldRules_Sint64 + // *FieldRules_Fixed32 + // *FieldRules_Fixed64 + // *FieldRules_Sfixed32 + // *FieldRules_Sfixed64 + // *FieldRules_Bool + // *FieldRules_String_ + // *FieldRules_Bytes + // *FieldRules_Enum + // *FieldRules_Repeated + // *FieldRules_Map + // *FieldRules_Any + // *FieldRules_Duration + // *FieldRules_Timestamp + Type isFieldRules_Type `protobuf_oneof:"type"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FieldRules) Reset() { *m = FieldRules{} } +func (m *FieldRules) String() string { return proto.CompactTextString(m) } +func (*FieldRules) ProtoMessage() {} +func (*FieldRules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{0} +} +func (m *FieldRules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FieldRules.Unmarshal(m, b) +} +func (m *FieldRules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FieldRules.Marshal(b, m, deterministic) +} +func (dst *FieldRules) XXX_Merge(src proto.Message) { + xxx_messageInfo_FieldRules.Merge(dst, src) +} +func (m *FieldRules) XXX_Size() int { + return xxx_messageInfo_FieldRules.Size(m) +} +func (m *FieldRules) XXX_DiscardUnknown() { + xxx_messageInfo_FieldRules.DiscardUnknown(m) +} + +var xxx_messageInfo_FieldRules proto.InternalMessageInfo + +func (m *FieldRules) GetMessage() *MessageRules { + if m != nil { + return m.Message + } + return nil +} + +type isFieldRules_Type interface { + isFieldRules_Type() +} + +type FieldRules_Float struct { + Float *FloatRules `protobuf:"bytes,1,opt,name=float,oneof"` +} + +type FieldRules_Double struct { + Double *DoubleRules `protobuf:"bytes,2,opt,name=double,oneof"` +} + +type FieldRules_Int32 struct { + Int32 *Int32Rules `protobuf:"bytes,3,opt,name=int32,oneof"` +} + +type FieldRules_Int64 struct { + Int64 *Int64Rules `protobuf:"bytes,4,opt,name=int64,oneof"` +} + +type FieldRules_Uint32 struct { + Uint32 *UInt32Rules `protobuf:"bytes,5,opt,name=uint32,oneof"` +} + +type FieldRules_Uint64 struct { + Uint64 *UInt64Rules `protobuf:"bytes,6,opt,name=uint64,oneof"` +} + +type FieldRules_Sint32 struct { + Sint32 *SInt32Rules `protobuf:"bytes,7,opt,name=sint32,oneof"` +} + +type FieldRules_Sint64 struct { + Sint64 *SInt64Rules `protobuf:"bytes,8,opt,name=sint64,oneof"` +} + +type FieldRules_Fixed32 struct { + Fixed32 *Fixed32Rules `protobuf:"bytes,9,opt,name=fixed32,oneof"` +} + +type FieldRules_Fixed64 struct { + Fixed64 *Fixed64Rules `protobuf:"bytes,10,opt,name=fixed64,oneof"` +} + +type FieldRules_Sfixed32 struct { + Sfixed32 *SFixed32Rules `protobuf:"bytes,11,opt,name=sfixed32,oneof"` +} + +type FieldRules_Sfixed64 struct { + Sfixed64 *SFixed64Rules `protobuf:"bytes,12,opt,name=sfixed64,oneof"` +} + +type FieldRules_Bool struct { + Bool *BoolRules `protobuf:"bytes,13,opt,name=bool,oneof"` +} + +type FieldRules_String_ struct { + String_ *StringRules `protobuf:"bytes,14,opt,name=string,oneof"` +} + +type FieldRules_Bytes struct { + Bytes *BytesRules `protobuf:"bytes,15,opt,name=bytes,oneof"` +} + +type FieldRules_Enum struct { + Enum *EnumRules `protobuf:"bytes,16,opt,name=enum,oneof"` +} + +type FieldRules_Repeated struct { + Repeated *RepeatedRules `protobuf:"bytes,18,opt,name=repeated,oneof"` +} + +type FieldRules_Map struct { + Map *MapRules `protobuf:"bytes,19,opt,name=map,oneof"` +} + +type FieldRules_Any struct { + Any *AnyRules `protobuf:"bytes,20,opt,name=any,oneof"` +} + +type FieldRules_Duration struct { + Duration *DurationRules `protobuf:"bytes,21,opt,name=duration,oneof"` +} + +type FieldRules_Timestamp struct { + Timestamp *TimestampRules `protobuf:"bytes,22,opt,name=timestamp,oneof"` +} + +func (*FieldRules_Float) isFieldRules_Type() {} + +func (*FieldRules_Double) isFieldRules_Type() {} + +func (*FieldRules_Int32) isFieldRules_Type() {} + +func (*FieldRules_Int64) isFieldRules_Type() {} + +func (*FieldRules_Uint32) isFieldRules_Type() {} + +func (*FieldRules_Uint64) isFieldRules_Type() {} + +func (*FieldRules_Sint32) isFieldRules_Type() {} + +func (*FieldRules_Sint64) isFieldRules_Type() {} + +func (*FieldRules_Fixed32) isFieldRules_Type() {} + +func (*FieldRules_Fixed64) isFieldRules_Type() {} + +func (*FieldRules_Sfixed32) isFieldRules_Type() {} + +func (*FieldRules_Sfixed64) isFieldRules_Type() {} + +func (*FieldRules_Bool) isFieldRules_Type() {} + +func (*FieldRules_String_) isFieldRules_Type() {} + +func (*FieldRules_Bytes) isFieldRules_Type() {} + +func (*FieldRules_Enum) isFieldRules_Type() {} + +func (*FieldRules_Repeated) isFieldRules_Type() {} + +func (*FieldRules_Map) isFieldRules_Type() {} + +func (*FieldRules_Any) isFieldRules_Type() {} + +func (*FieldRules_Duration) isFieldRules_Type() {} + +func (*FieldRules_Timestamp) isFieldRules_Type() {} + +func (m *FieldRules) GetType() isFieldRules_Type { + if m != nil { + return m.Type + } + return nil +} + +func (m *FieldRules) GetFloat() *FloatRules { + if x, ok := m.GetType().(*FieldRules_Float); ok { + return x.Float + } + return nil +} + +func (m *FieldRules) GetDouble() *DoubleRules { + if x, ok := m.GetType().(*FieldRules_Double); ok { + return x.Double + } + return nil +} + +func (m *FieldRules) GetInt32() *Int32Rules { + if x, ok := m.GetType().(*FieldRules_Int32); ok { + return x.Int32 + } + return nil +} + +func (m *FieldRules) GetInt64() *Int64Rules { + if x, ok := m.GetType().(*FieldRules_Int64); ok { + return x.Int64 + } + return nil +} + +func (m *FieldRules) GetUint32() *UInt32Rules { + if x, ok := m.GetType().(*FieldRules_Uint32); ok { + return x.Uint32 + } + return nil +} + +func (m *FieldRules) GetUint64() *UInt64Rules { + if x, ok := m.GetType().(*FieldRules_Uint64); ok { + return x.Uint64 + } + return nil +} + +func (m *FieldRules) GetSint32() *SInt32Rules { + if x, ok := m.GetType().(*FieldRules_Sint32); ok { + return x.Sint32 + } + return nil +} + +func (m *FieldRules) GetSint64() *SInt64Rules { + if x, ok := m.GetType().(*FieldRules_Sint64); ok { + return x.Sint64 + } + return nil +} + +func (m *FieldRules) GetFixed32() *Fixed32Rules { + if x, ok := m.GetType().(*FieldRules_Fixed32); ok { + return x.Fixed32 + } + return nil +} + +func (m *FieldRules) GetFixed64() *Fixed64Rules { + if x, ok := m.GetType().(*FieldRules_Fixed64); ok { + return x.Fixed64 + } + return nil +} + +func (m *FieldRules) GetSfixed32() *SFixed32Rules { + if x, ok := m.GetType().(*FieldRules_Sfixed32); ok { + return x.Sfixed32 + } + return nil +} + +func (m *FieldRules) GetSfixed64() *SFixed64Rules { + if x, ok := m.GetType().(*FieldRules_Sfixed64); ok { + return x.Sfixed64 + } + return nil +} + +func (m *FieldRules) GetBool() *BoolRules { + if x, ok := m.GetType().(*FieldRules_Bool); ok { + return x.Bool + } + return nil +} + +func (m *FieldRules) GetString_() *StringRules { + if x, ok := m.GetType().(*FieldRules_String_); ok { + return x.String_ + } + return nil +} + +func (m *FieldRules) GetBytes() *BytesRules { + if x, ok := m.GetType().(*FieldRules_Bytes); ok { + return x.Bytes + } + return nil +} + +func (m *FieldRules) GetEnum() *EnumRules { + if x, ok := m.GetType().(*FieldRules_Enum); ok { + return x.Enum + } + return nil +} + +func (m *FieldRules) GetRepeated() *RepeatedRules { + if x, ok := m.GetType().(*FieldRules_Repeated); ok { + return x.Repeated + } + return nil +} + +func (m *FieldRules) GetMap() *MapRules { + if x, ok := m.GetType().(*FieldRules_Map); ok { + return x.Map + } + return nil +} + +func (m *FieldRules) GetAny() *AnyRules { + if x, ok := m.GetType().(*FieldRules_Any); ok { + return x.Any + } + return nil +} + +func (m *FieldRules) GetDuration() *DurationRules { + if x, ok := m.GetType().(*FieldRules_Duration); ok { + return x.Duration + } + return nil +} + +func (m *FieldRules) GetTimestamp() *TimestampRules { + if x, ok := m.GetType().(*FieldRules_Timestamp); ok { + return x.Timestamp + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*FieldRules) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _FieldRules_OneofMarshaler, _FieldRules_OneofUnmarshaler, _FieldRules_OneofSizer, []interface{}{ + (*FieldRules_Float)(nil), + (*FieldRules_Double)(nil), + (*FieldRules_Int32)(nil), + (*FieldRules_Int64)(nil), + (*FieldRules_Uint32)(nil), + (*FieldRules_Uint64)(nil), + (*FieldRules_Sint32)(nil), + (*FieldRules_Sint64)(nil), + (*FieldRules_Fixed32)(nil), + (*FieldRules_Fixed64)(nil), + (*FieldRules_Sfixed32)(nil), + (*FieldRules_Sfixed64)(nil), + (*FieldRules_Bool)(nil), + (*FieldRules_String_)(nil), + (*FieldRules_Bytes)(nil), + (*FieldRules_Enum)(nil), + (*FieldRules_Repeated)(nil), + (*FieldRules_Map)(nil), + (*FieldRules_Any)(nil), + (*FieldRules_Duration)(nil), + (*FieldRules_Timestamp)(nil), + } +} + +func _FieldRules_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*FieldRules) + // type + switch x := m.Type.(type) { + case *FieldRules_Float: + b.EncodeVarint(1<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Float); err != nil { + return err + } + case *FieldRules_Double: + b.EncodeVarint(2<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Double); err != nil { + return err + } + case *FieldRules_Int32: + b.EncodeVarint(3<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Int32); err != nil { + return err + } + case *FieldRules_Int64: + b.EncodeVarint(4<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Int64); err != nil { + return err + } + case *FieldRules_Uint32: + b.EncodeVarint(5<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Uint32); err != nil { + return err + } + case *FieldRules_Uint64: + b.EncodeVarint(6<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Uint64); err != nil { + return err + } + case *FieldRules_Sint32: + b.EncodeVarint(7<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Sint32); err != nil { + return err + } + case *FieldRules_Sint64: + b.EncodeVarint(8<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Sint64); err != nil { + return err + } + case *FieldRules_Fixed32: + b.EncodeVarint(9<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Fixed32); err != nil { + return err + } + case *FieldRules_Fixed64: + b.EncodeVarint(10<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Fixed64); err != nil { + return err + } + case *FieldRules_Sfixed32: + b.EncodeVarint(11<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Sfixed32); err != nil { + return err + } + case *FieldRules_Sfixed64: + b.EncodeVarint(12<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Sfixed64); err != nil { + return err + } + case *FieldRules_Bool: + b.EncodeVarint(13<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Bool); err != nil { + return err + } + case *FieldRules_String_: + b.EncodeVarint(14<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.String_); err != nil { + return err + } + case *FieldRules_Bytes: + b.EncodeVarint(15<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Bytes); err != nil { + return err + } + case *FieldRules_Enum: + b.EncodeVarint(16<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Enum); err != nil { + return err + } + case *FieldRules_Repeated: + b.EncodeVarint(18<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Repeated); err != nil { + return err + } + case *FieldRules_Map: + b.EncodeVarint(19<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Map); err != nil { + return err + } + case *FieldRules_Any: + b.EncodeVarint(20<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Any); err != nil { + return err + } + case *FieldRules_Duration: + b.EncodeVarint(21<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Duration); err != nil { + return err + } + case *FieldRules_Timestamp: + b.EncodeVarint(22<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Timestamp); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("FieldRules.Type has unexpected type %T", x) + } + return nil +} + +func _FieldRules_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*FieldRules) + switch tag { + case 1: // type.float + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(FloatRules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Float{msg} + return true, err + case 2: // type.double + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DoubleRules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Double{msg} + return true, err + case 3: // type.int32 + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Int32Rules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Int32{msg} + return true, err + case 4: // type.int64 + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Int64Rules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Int64{msg} + return true, err + case 5: // type.uint32 + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(UInt32Rules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Uint32{msg} + return true, err + case 6: // type.uint64 + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(UInt64Rules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Uint64{msg} + return true, err + case 7: // type.sint32 + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SInt32Rules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Sint32{msg} + return true, err + case 8: // type.sint64 + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SInt64Rules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Sint64{msg} + return true, err + case 9: // type.fixed32 + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Fixed32Rules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Fixed32{msg} + return true, err + case 10: // type.fixed64 + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(Fixed64Rules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Fixed64{msg} + return true, err + case 11: // type.sfixed32 + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SFixed32Rules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Sfixed32{msg} + return true, err + case 12: // type.sfixed64 + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(SFixed64Rules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Sfixed64{msg} + return true, err + case 13: // type.bool + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BoolRules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Bool{msg} + return true, err + case 14: // type.string + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(StringRules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_String_{msg} + return true, err + case 15: // type.bytes + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(BytesRules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Bytes{msg} + return true, err + case 16: // type.enum + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(EnumRules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Enum{msg} + return true, err + case 18: // type.repeated + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(RepeatedRules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Repeated{msg} + return true, err + case 19: // type.map + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(MapRules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Map{msg} + return true, err + case 20: // type.any + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(AnyRules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Any{msg} + return true, err + case 21: // type.duration + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(DurationRules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Duration{msg} + return true, err + case 22: // type.timestamp + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(TimestampRules) + err := b.DecodeMessage(msg) + m.Type = &FieldRules_Timestamp{msg} + return true, err + default: + return false, nil + } +} + +func _FieldRules_OneofSizer(msg proto.Message) (n int) { + m := msg.(*FieldRules) + // type + switch x := m.Type.(type) { + case *FieldRules_Float: + s := proto.Size(x.Float) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Double: + s := proto.Size(x.Double) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Int32: + s := proto.Size(x.Int32) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Int64: + s := proto.Size(x.Int64) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Uint32: + s := proto.Size(x.Uint32) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Uint64: + s := proto.Size(x.Uint64) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Sint32: + s := proto.Size(x.Sint32) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Sint64: + s := proto.Size(x.Sint64) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Fixed32: + s := proto.Size(x.Fixed32) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Fixed64: + s := proto.Size(x.Fixed64) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Sfixed32: + s := proto.Size(x.Sfixed32) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Sfixed64: + s := proto.Size(x.Sfixed64) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Bool: + s := proto.Size(x.Bool) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_String_: + s := proto.Size(x.String_) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Bytes: + s := proto.Size(x.Bytes) + n += 1 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Enum: + s := proto.Size(x.Enum) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Repeated: + s := proto.Size(x.Repeated) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Map: + s := proto.Size(x.Map) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Any: + s := proto.Size(x.Any) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Duration: + s := proto.Size(x.Duration) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case *FieldRules_Timestamp: + s := proto.Size(x.Timestamp) + n += 2 // tag and wire + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// FloatRules describes the constraints applied to `float` values +type FloatRules struct { + // Const specifies that this field must be exactly the specified value + Const *float32 `protobuf:"fixed32,1,opt,name=const" json:"const,omitempty"` + // Lt specifies that this field must be less than the specified value, + // exclusive + Lt *float32 `protobuf:"fixed32,2,opt,name=lt" json:"lt,omitempty"` + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + Lte *float32 `protobuf:"fixed32,3,opt,name=lte" json:"lte,omitempty"` + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + Gt *float32 `protobuf:"fixed32,4,opt,name=gt" json:"gt,omitempty"` + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + Gte *float32 `protobuf:"fixed32,5,opt,name=gte" json:"gte,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []float32 `protobuf:"fixed32,6,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []float32 `protobuf:"fixed32,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *FloatRules) Reset() { *m = FloatRules{} } +func (m *FloatRules) String() string { return proto.CompactTextString(m) } +func (*FloatRules) ProtoMessage() {} +func (*FloatRules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{1} +} +func (m *FloatRules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_FloatRules.Unmarshal(m, b) +} +func (m *FloatRules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_FloatRules.Marshal(b, m, deterministic) +} +func (dst *FloatRules) XXX_Merge(src proto.Message) { + xxx_messageInfo_FloatRules.Merge(dst, src) +} +func (m *FloatRules) XXX_Size() int { + return xxx_messageInfo_FloatRules.Size(m) +} +func (m *FloatRules) XXX_DiscardUnknown() { + xxx_messageInfo_FloatRules.DiscardUnknown(m) +} + +var xxx_messageInfo_FloatRules proto.InternalMessageInfo + +func (m *FloatRules) GetConst() float32 { + if m != nil && m.Const != nil { + return *m.Const + } + return 0 +} + +func (m *FloatRules) GetLt() float32 { + if m != nil && m.Lt != nil { + return *m.Lt + } + return 0 +} + +func (m *FloatRules) GetLte() float32 { + if m != nil && m.Lte != nil { + return *m.Lte + } + return 0 +} + +func (m *FloatRules) GetGt() float32 { + if m != nil && m.Gt != nil { + return *m.Gt + } + return 0 +} + +func (m *FloatRules) GetGte() float32 { + if m != nil && m.Gte != nil { + return *m.Gte + } + return 0 +} + +func (m *FloatRules) GetIn() []float32 { + if m != nil { + return m.In + } + return nil +} + +func (m *FloatRules) GetNotIn() []float32 { + if m != nil { + return m.NotIn + } + return nil +} + +// DoubleRules describes the constraints applied to `double` values +type DoubleRules struct { + // Const specifies that this field must be exactly the specified value + Const *float64 `protobuf:"fixed64,1,opt,name=const" json:"const,omitempty"` + // Lt specifies that this field must be less than the specified value, + // exclusive + Lt *float64 `protobuf:"fixed64,2,opt,name=lt" json:"lt,omitempty"` + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + Lte *float64 `protobuf:"fixed64,3,opt,name=lte" json:"lte,omitempty"` + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + Gt *float64 `protobuf:"fixed64,4,opt,name=gt" json:"gt,omitempty"` + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + Gte *float64 `protobuf:"fixed64,5,opt,name=gte" json:"gte,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []float64 `protobuf:"fixed64,6,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []float64 `protobuf:"fixed64,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DoubleRules) Reset() { *m = DoubleRules{} } +func (m *DoubleRules) String() string { return proto.CompactTextString(m) } +func (*DoubleRules) ProtoMessage() {} +func (*DoubleRules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{2} +} +func (m *DoubleRules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DoubleRules.Unmarshal(m, b) +} +func (m *DoubleRules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DoubleRules.Marshal(b, m, deterministic) +} +func (dst *DoubleRules) XXX_Merge(src proto.Message) { + xxx_messageInfo_DoubleRules.Merge(dst, src) +} +func (m *DoubleRules) XXX_Size() int { + return xxx_messageInfo_DoubleRules.Size(m) +} +func (m *DoubleRules) XXX_DiscardUnknown() { + xxx_messageInfo_DoubleRules.DiscardUnknown(m) +} + +var xxx_messageInfo_DoubleRules proto.InternalMessageInfo + +func (m *DoubleRules) GetConst() float64 { + if m != nil && m.Const != nil { + return *m.Const + } + return 0 +} + +func (m *DoubleRules) GetLt() float64 { + if m != nil && m.Lt != nil { + return *m.Lt + } + return 0 +} + +func (m *DoubleRules) GetLte() float64 { + if m != nil && m.Lte != nil { + return *m.Lte + } + return 0 +} + +func (m *DoubleRules) GetGt() float64 { + if m != nil && m.Gt != nil { + return *m.Gt + } + return 0 +} + +func (m *DoubleRules) GetGte() float64 { + if m != nil && m.Gte != nil { + return *m.Gte + } + return 0 +} + +func (m *DoubleRules) GetIn() []float64 { + if m != nil { + return m.In + } + return nil +} + +func (m *DoubleRules) GetNotIn() []float64 { + if m != nil { + return m.NotIn + } + return nil +} + +// Int32Rules describes the constraints applied to `int32` values +type Int32Rules struct { + // Const specifies that this field must be exactly the specified value + Const *int32 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"` + // Lt specifies that this field must be less than the specified value, + // exclusive + Lt *int32 `protobuf:"varint,2,opt,name=lt" json:"lt,omitempty"` + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + Lte *int32 `protobuf:"varint,3,opt,name=lte" json:"lte,omitempty"` + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + Gt *int32 `protobuf:"varint,4,opt,name=gt" json:"gt,omitempty"` + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + Gte *int32 `protobuf:"varint,5,opt,name=gte" json:"gte,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []int32 `protobuf:"varint,6,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []int32 `protobuf:"varint,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Int32Rules) Reset() { *m = Int32Rules{} } +func (m *Int32Rules) String() string { return proto.CompactTextString(m) } +func (*Int32Rules) ProtoMessage() {} +func (*Int32Rules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{3} +} +func (m *Int32Rules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Int32Rules.Unmarshal(m, b) +} +func (m *Int32Rules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Int32Rules.Marshal(b, m, deterministic) +} +func (dst *Int32Rules) XXX_Merge(src proto.Message) { + xxx_messageInfo_Int32Rules.Merge(dst, src) +} +func (m *Int32Rules) XXX_Size() int { + return xxx_messageInfo_Int32Rules.Size(m) +} +func (m *Int32Rules) XXX_DiscardUnknown() { + xxx_messageInfo_Int32Rules.DiscardUnknown(m) +} + +var xxx_messageInfo_Int32Rules proto.InternalMessageInfo + +func (m *Int32Rules) GetConst() int32 { + if m != nil && m.Const != nil { + return *m.Const + } + return 0 +} + +func (m *Int32Rules) GetLt() int32 { + if m != nil && m.Lt != nil { + return *m.Lt + } + return 0 +} + +func (m *Int32Rules) GetLte() int32 { + if m != nil && m.Lte != nil { + return *m.Lte + } + return 0 +} + +func (m *Int32Rules) GetGt() int32 { + if m != nil && m.Gt != nil { + return *m.Gt + } + return 0 +} + +func (m *Int32Rules) GetGte() int32 { + if m != nil && m.Gte != nil { + return *m.Gte + } + return 0 +} + +func (m *Int32Rules) GetIn() []int32 { + if m != nil { + return m.In + } + return nil +} + +func (m *Int32Rules) GetNotIn() []int32 { + if m != nil { + return m.NotIn + } + return nil +} + +// Int64Rules describes the constraints applied to `int64` values +type Int64Rules struct { + // Const specifies that this field must be exactly the specified value + Const *int64 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"` + // Lt specifies that this field must be less than the specified value, + // exclusive + Lt *int64 `protobuf:"varint,2,opt,name=lt" json:"lt,omitempty"` + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + Lte *int64 `protobuf:"varint,3,opt,name=lte" json:"lte,omitempty"` + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + Gt *int64 `protobuf:"varint,4,opt,name=gt" json:"gt,omitempty"` + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + Gte *int64 `protobuf:"varint,5,opt,name=gte" json:"gte,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []int64 `protobuf:"varint,6,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []int64 `protobuf:"varint,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Int64Rules) Reset() { *m = Int64Rules{} } +func (m *Int64Rules) String() string { return proto.CompactTextString(m) } +func (*Int64Rules) ProtoMessage() {} +func (*Int64Rules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{4} +} +func (m *Int64Rules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Int64Rules.Unmarshal(m, b) +} +func (m *Int64Rules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Int64Rules.Marshal(b, m, deterministic) +} +func (dst *Int64Rules) XXX_Merge(src proto.Message) { + xxx_messageInfo_Int64Rules.Merge(dst, src) +} +func (m *Int64Rules) XXX_Size() int { + return xxx_messageInfo_Int64Rules.Size(m) +} +func (m *Int64Rules) XXX_DiscardUnknown() { + xxx_messageInfo_Int64Rules.DiscardUnknown(m) +} + +var xxx_messageInfo_Int64Rules proto.InternalMessageInfo + +func (m *Int64Rules) GetConst() int64 { + if m != nil && m.Const != nil { + return *m.Const + } + return 0 +} + +func (m *Int64Rules) GetLt() int64 { + if m != nil && m.Lt != nil { + return *m.Lt + } + return 0 +} + +func (m *Int64Rules) GetLte() int64 { + if m != nil && m.Lte != nil { + return *m.Lte + } + return 0 +} + +func (m *Int64Rules) GetGt() int64 { + if m != nil && m.Gt != nil { + return *m.Gt + } + return 0 +} + +func (m *Int64Rules) GetGte() int64 { + if m != nil && m.Gte != nil { + return *m.Gte + } + return 0 +} + +func (m *Int64Rules) GetIn() []int64 { + if m != nil { + return m.In + } + return nil +} + +func (m *Int64Rules) GetNotIn() []int64 { + if m != nil { + return m.NotIn + } + return nil +} + +// UInt32Rules describes the constraints applied to `uint32` values +type UInt32Rules struct { + // Const specifies that this field must be exactly the specified value + Const *uint32 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"` + // Lt specifies that this field must be less than the specified value, + // exclusive + Lt *uint32 `protobuf:"varint,2,opt,name=lt" json:"lt,omitempty"` + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + Lte *uint32 `protobuf:"varint,3,opt,name=lte" json:"lte,omitempty"` + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + Gt *uint32 `protobuf:"varint,4,opt,name=gt" json:"gt,omitempty"` + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + Gte *uint32 `protobuf:"varint,5,opt,name=gte" json:"gte,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []uint32 `protobuf:"varint,6,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []uint32 `protobuf:"varint,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UInt32Rules) Reset() { *m = UInt32Rules{} } +func (m *UInt32Rules) String() string { return proto.CompactTextString(m) } +func (*UInt32Rules) ProtoMessage() {} +func (*UInt32Rules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{5} +} +func (m *UInt32Rules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UInt32Rules.Unmarshal(m, b) +} +func (m *UInt32Rules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UInt32Rules.Marshal(b, m, deterministic) +} +func (dst *UInt32Rules) XXX_Merge(src proto.Message) { + xxx_messageInfo_UInt32Rules.Merge(dst, src) +} +func (m *UInt32Rules) XXX_Size() int { + return xxx_messageInfo_UInt32Rules.Size(m) +} +func (m *UInt32Rules) XXX_DiscardUnknown() { + xxx_messageInfo_UInt32Rules.DiscardUnknown(m) +} + +var xxx_messageInfo_UInt32Rules proto.InternalMessageInfo + +func (m *UInt32Rules) GetConst() uint32 { + if m != nil && m.Const != nil { + return *m.Const + } + return 0 +} + +func (m *UInt32Rules) GetLt() uint32 { + if m != nil && m.Lt != nil { + return *m.Lt + } + return 0 +} + +func (m *UInt32Rules) GetLte() uint32 { + if m != nil && m.Lte != nil { + return *m.Lte + } + return 0 +} + +func (m *UInt32Rules) GetGt() uint32 { + if m != nil && m.Gt != nil { + return *m.Gt + } + return 0 +} + +func (m *UInt32Rules) GetGte() uint32 { + if m != nil && m.Gte != nil { + return *m.Gte + } + return 0 +} + +func (m *UInt32Rules) GetIn() []uint32 { + if m != nil { + return m.In + } + return nil +} + +func (m *UInt32Rules) GetNotIn() []uint32 { + if m != nil { + return m.NotIn + } + return nil +} + +// UInt64Rules describes the constraints applied to `uint64` values +type UInt64Rules struct { + // Const specifies that this field must be exactly the specified value + Const *uint64 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"` + // Lt specifies that this field must be less than the specified value, + // exclusive + Lt *uint64 `protobuf:"varint,2,opt,name=lt" json:"lt,omitempty"` + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + Lte *uint64 `protobuf:"varint,3,opt,name=lte" json:"lte,omitempty"` + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + Gt *uint64 `protobuf:"varint,4,opt,name=gt" json:"gt,omitempty"` + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + Gte *uint64 `protobuf:"varint,5,opt,name=gte" json:"gte,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []uint64 `protobuf:"varint,6,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []uint64 `protobuf:"varint,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UInt64Rules) Reset() { *m = UInt64Rules{} } +func (m *UInt64Rules) String() string { return proto.CompactTextString(m) } +func (*UInt64Rules) ProtoMessage() {} +func (*UInt64Rules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{6} +} +func (m *UInt64Rules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UInt64Rules.Unmarshal(m, b) +} +func (m *UInt64Rules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UInt64Rules.Marshal(b, m, deterministic) +} +func (dst *UInt64Rules) XXX_Merge(src proto.Message) { + xxx_messageInfo_UInt64Rules.Merge(dst, src) +} +func (m *UInt64Rules) XXX_Size() int { + return xxx_messageInfo_UInt64Rules.Size(m) +} +func (m *UInt64Rules) XXX_DiscardUnknown() { + xxx_messageInfo_UInt64Rules.DiscardUnknown(m) +} + +var xxx_messageInfo_UInt64Rules proto.InternalMessageInfo + +func (m *UInt64Rules) GetConst() uint64 { + if m != nil && m.Const != nil { + return *m.Const + } + return 0 +} + +func (m *UInt64Rules) GetLt() uint64 { + if m != nil && m.Lt != nil { + return *m.Lt + } + return 0 +} + +func (m *UInt64Rules) GetLte() uint64 { + if m != nil && m.Lte != nil { + return *m.Lte + } + return 0 +} + +func (m *UInt64Rules) GetGt() uint64 { + if m != nil && m.Gt != nil { + return *m.Gt + } + return 0 +} + +func (m *UInt64Rules) GetGte() uint64 { + if m != nil && m.Gte != nil { + return *m.Gte + } + return 0 +} + +func (m *UInt64Rules) GetIn() []uint64 { + if m != nil { + return m.In + } + return nil +} + +func (m *UInt64Rules) GetNotIn() []uint64 { + if m != nil { + return m.NotIn + } + return nil +} + +// SInt32Rules describes the constraints applied to `sint32` values +type SInt32Rules struct { + // Const specifies that this field must be exactly the specified value + Const *int32 `protobuf:"zigzag32,1,opt,name=const" json:"const,omitempty"` + // Lt specifies that this field must be less than the specified value, + // exclusive + Lt *int32 `protobuf:"zigzag32,2,opt,name=lt" json:"lt,omitempty"` + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + Lte *int32 `protobuf:"zigzag32,3,opt,name=lte" json:"lte,omitempty"` + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + Gt *int32 `protobuf:"zigzag32,4,opt,name=gt" json:"gt,omitempty"` + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + Gte *int32 `protobuf:"zigzag32,5,opt,name=gte" json:"gte,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []int32 `protobuf:"zigzag32,6,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []int32 `protobuf:"zigzag32,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SInt32Rules) Reset() { *m = SInt32Rules{} } +func (m *SInt32Rules) String() string { return proto.CompactTextString(m) } +func (*SInt32Rules) ProtoMessage() {} +func (*SInt32Rules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{7} +} +func (m *SInt32Rules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SInt32Rules.Unmarshal(m, b) +} +func (m *SInt32Rules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SInt32Rules.Marshal(b, m, deterministic) +} +func (dst *SInt32Rules) XXX_Merge(src proto.Message) { + xxx_messageInfo_SInt32Rules.Merge(dst, src) +} +func (m *SInt32Rules) XXX_Size() int { + return xxx_messageInfo_SInt32Rules.Size(m) +} +func (m *SInt32Rules) XXX_DiscardUnknown() { + xxx_messageInfo_SInt32Rules.DiscardUnknown(m) +} + +var xxx_messageInfo_SInt32Rules proto.InternalMessageInfo + +func (m *SInt32Rules) GetConst() int32 { + if m != nil && m.Const != nil { + return *m.Const + } + return 0 +} + +func (m *SInt32Rules) GetLt() int32 { + if m != nil && m.Lt != nil { + return *m.Lt + } + return 0 +} + +func (m *SInt32Rules) GetLte() int32 { + if m != nil && m.Lte != nil { + return *m.Lte + } + return 0 +} + +func (m *SInt32Rules) GetGt() int32 { + if m != nil && m.Gt != nil { + return *m.Gt + } + return 0 +} + +func (m *SInt32Rules) GetGte() int32 { + if m != nil && m.Gte != nil { + return *m.Gte + } + return 0 +} + +func (m *SInt32Rules) GetIn() []int32 { + if m != nil { + return m.In + } + return nil +} + +func (m *SInt32Rules) GetNotIn() []int32 { + if m != nil { + return m.NotIn + } + return nil +} + +// SInt64Rules describes the constraints applied to `sint64` values +type SInt64Rules struct { + // Const specifies that this field must be exactly the specified value + Const *int64 `protobuf:"zigzag64,1,opt,name=const" json:"const,omitempty"` + // Lt specifies that this field must be less than the specified value, + // exclusive + Lt *int64 `protobuf:"zigzag64,2,opt,name=lt" json:"lt,omitempty"` + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + Lte *int64 `protobuf:"zigzag64,3,opt,name=lte" json:"lte,omitempty"` + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + Gt *int64 `protobuf:"zigzag64,4,opt,name=gt" json:"gt,omitempty"` + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + Gte *int64 `protobuf:"zigzag64,5,opt,name=gte" json:"gte,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []int64 `protobuf:"zigzag64,6,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []int64 `protobuf:"zigzag64,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SInt64Rules) Reset() { *m = SInt64Rules{} } +func (m *SInt64Rules) String() string { return proto.CompactTextString(m) } +func (*SInt64Rules) ProtoMessage() {} +func (*SInt64Rules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{8} +} +func (m *SInt64Rules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SInt64Rules.Unmarshal(m, b) +} +func (m *SInt64Rules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SInt64Rules.Marshal(b, m, deterministic) +} +func (dst *SInt64Rules) XXX_Merge(src proto.Message) { + xxx_messageInfo_SInt64Rules.Merge(dst, src) +} +func (m *SInt64Rules) XXX_Size() int { + return xxx_messageInfo_SInt64Rules.Size(m) +} +func (m *SInt64Rules) XXX_DiscardUnknown() { + xxx_messageInfo_SInt64Rules.DiscardUnknown(m) +} + +var xxx_messageInfo_SInt64Rules proto.InternalMessageInfo + +func (m *SInt64Rules) GetConst() int64 { + if m != nil && m.Const != nil { + return *m.Const + } + return 0 +} + +func (m *SInt64Rules) GetLt() int64 { + if m != nil && m.Lt != nil { + return *m.Lt + } + return 0 +} + +func (m *SInt64Rules) GetLte() int64 { + if m != nil && m.Lte != nil { + return *m.Lte + } + return 0 +} + +func (m *SInt64Rules) GetGt() int64 { + if m != nil && m.Gt != nil { + return *m.Gt + } + return 0 +} + +func (m *SInt64Rules) GetGte() int64 { + if m != nil && m.Gte != nil { + return *m.Gte + } + return 0 +} + +func (m *SInt64Rules) GetIn() []int64 { + if m != nil { + return m.In + } + return nil +} + +func (m *SInt64Rules) GetNotIn() []int64 { + if m != nil { + return m.NotIn + } + return nil +} + +// Fixed32Rules describes the constraints applied to `fixed32` values +type Fixed32Rules struct { + // Const specifies that this field must be exactly the specified value + Const *uint32 `protobuf:"fixed32,1,opt,name=const" json:"const,omitempty"` + // Lt specifies that this field must be less than the specified value, + // exclusive + Lt *uint32 `protobuf:"fixed32,2,opt,name=lt" json:"lt,omitempty"` + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + Lte *uint32 `protobuf:"fixed32,3,opt,name=lte" json:"lte,omitempty"` + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + Gt *uint32 `protobuf:"fixed32,4,opt,name=gt" json:"gt,omitempty"` + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + Gte *uint32 `protobuf:"fixed32,5,opt,name=gte" json:"gte,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []uint32 `protobuf:"fixed32,6,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []uint32 `protobuf:"fixed32,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Fixed32Rules) Reset() { *m = Fixed32Rules{} } +func (m *Fixed32Rules) String() string { return proto.CompactTextString(m) } +func (*Fixed32Rules) ProtoMessage() {} +func (*Fixed32Rules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{9} +} +func (m *Fixed32Rules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Fixed32Rules.Unmarshal(m, b) +} +func (m *Fixed32Rules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Fixed32Rules.Marshal(b, m, deterministic) +} +func (dst *Fixed32Rules) XXX_Merge(src proto.Message) { + xxx_messageInfo_Fixed32Rules.Merge(dst, src) +} +func (m *Fixed32Rules) XXX_Size() int { + return xxx_messageInfo_Fixed32Rules.Size(m) +} +func (m *Fixed32Rules) XXX_DiscardUnknown() { + xxx_messageInfo_Fixed32Rules.DiscardUnknown(m) +} + +var xxx_messageInfo_Fixed32Rules proto.InternalMessageInfo + +func (m *Fixed32Rules) GetConst() uint32 { + if m != nil && m.Const != nil { + return *m.Const + } + return 0 +} + +func (m *Fixed32Rules) GetLt() uint32 { + if m != nil && m.Lt != nil { + return *m.Lt + } + return 0 +} + +func (m *Fixed32Rules) GetLte() uint32 { + if m != nil && m.Lte != nil { + return *m.Lte + } + return 0 +} + +func (m *Fixed32Rules) GetGt() uint32 { + if m != nil && m.Gt != nil { + return *m.Gt + } + return 0 +} + +func (m *Fixed32Rules) GetGte() uint32 { + if m != nil && m.Gte != nil { + return *m.Gte + } + return 0 +} + +func (m *Fixed32Rules) GetIn() []uint32 { + if m != nil { + return m.In + } + return nil +} + +func (m *Fixed32Rules) GetNotIn() []uint32 { + if m != nil { + return m.NotIn + } + return nil +} + +// Fixed64Rules describes the constraints applied to `fixed64` values +type Fixed64Rules struct { + // Const specifies that this field must be exactly the specified value + Const *uint64 `protobuf:"fixed64,1,opt,name=const" json:"const,omitempty"` + // Lt specifies that this field must be less than the specified value, + // exclusive + Lt *uint64 `protobuf:"fixed64,2,opt,name=lt" json:"lt,omitempty"` + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + Lte *uint64 `protobuf:"fixed64,3,opt,name=lte" json:"lte,omitempty"` + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + Gt *uint64 `protobuf:"fixed64,4,opt,name=gt" json:"gt,omitempty"` + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + Gte *uint64 `protobuf:"fixed64,5,opt,name=gte" json:"gte,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []uint64 `protobuf:"fixed64,6,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []uint64 `protobuf:"fixed64,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Fixed64Rules) Reset() { *m = Fixed64Rules{} } +func (m *Fixed64Rules) String() string { return proto.CompactTextString(m) } +func (*Fixed64Rules) ProtoMessage() {} +func (*Fixed64Rules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{10} +} +func (m *Fixed64Rules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Fixed64Rules.Unmarshal(m, b) +} +func (m *Fixed64Rules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Fixed64Rules.Marshal(b, m, deterministic) +} +func (dst *Fixed64Rules) XXX_Merge(src proto.Message) { + xxx_messageInfo_Fixed64Rules.Merge(dst, src) +} +func (m *Fixed64Rules) XXX_Size() int { + return xxx_messageInfo_Fixed64Rules.Size(m) +} +func (m *Fixed64Rules) XXX_DiscardUnknown() { + xxx_messageInfo_Fixed64Rules.DiscardUnknown(m) +} + +var xxx_messageInfo_Fixed64Rules proto.InternalMessageInfo + +func (m *Fixed64Rules) GetConst() uint64 { + if m != nil && m.Const != nil { + return *m.Const + } + return 0 +} + +func (m *Fixed64Rules) GetLt() uint64 { + if m != nil && m.Lt != nil { + return *m.Lt + } + return 0 +} + +func (m *Fixed64Rules) GetLte() uint64 { + if m != nil && m.Lte != nil { + return *m.Lte + } + return 0 +} + +func (m *Fixed64Rules) GetGt() uint64 { + if m != nil && m.Gt != nil { + return *m.Gt + } + return 0 +} + +func (m *Fixed64Rules) GetGte() uint64 { + if m != nil && m.Gte != nil { + return *m.Gte + } + return 0 +} + +func (m *Fixed64Rules) GetIn() []uint64 { + if m != nil { + return m.In + } + return nil +} + +func (m *Fixed64Rules) GetNotIn() []uint64 { + if m != nil { + return m.NotIn + } + return nil +} + +// SFixed32Rules describes the constraints applied to `sfixed32` values +type SFixed32Rules struct { + // Const specifies that this field must be exactly the specified value + Const *int32 `protobuf:"fixed32,1,opt,name=const" json:"const,omitempty"` + // Lt specifies that this field must be less than the specified value, + // exclusive + Lt *int32 `protobuf:"fixed32,2,opt,name=lt" json:"lt,omitempty"` + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + Lte *int32 `protobuf:"fixed32,3,opt,name=lte" json:"lte,omitempty"` + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + Gt *int32 `protobuf:"fixed32,4,opt,name=gt" json:"gt,omitempty"` + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + Gte *int32 `protobuf:"fixed32,5,opt,name=gte" json:"gte,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []int32 `protobuf:"fixed32,6,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []int32 `protobuf:"fixed32,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SFixed32Rules) Reset() { *m = SFixed32Rules{} } +func (m *SFixed32Rules) String() string { return proto.CompactTextString(m) } +func (*SFixed32Rules) ProtoMessage() {} +func (*SFixed32Rules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{11} +} +func (m *SFixed32Rules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SFixed32Rules.Unmarshal(m, b) +} +func (m *SFixed32Rules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SFixed32Rules.Marshal(b, m, deterministic) +} +func (dst *SFixed32Rules) XXX_Merge(src proto.Message) { + xxx_messageInfo_SFixed32Rules.Merge(dst, src) +} +func (m *SFixed32Rules) XXX_Size() int { + return xxx_messageInfo_SFixed32Rules.Size(m) +} +func (m *SFixed32Rules) XXX_DiscardUnknown() { + xxx_messageInfo_SFixed32Rules.DiscardUnknown(m) +} + +var xxx_messageInfo_SFixed32Rules proto.InternalMessageInfo + +func (m *SFixed32Rules) GetConst() int32 { + if m != nil && m.Const != nil { + return *m.Const + } + return 0 +} + +func (m *SFixed32Rules) GetLt() int32 { + if m != nil && m.Lt != nil { + return *m.Lt + } + return 0 +} + +func (m *SFixed32Rules) GetLte() int32 { + if m != nil && m.Lte != nil { + return *m.Lte + } + return 0 +} + +func (m *SFixed32Rules) GetGt() int32 { + if m != nil && m.Gt != nil { + return *m.Gt + } + return 0 +} + +func (m *SFixed32Rules) GetGte() int32 { + if m != nil && m.Gte != nil { + return *m.Gte + } + return 0 +} + +func (m *SFixed32Rules) GetIn() []int32 { + if m != nil { + return m.In + } + return nil +} + +func (m *SFixed32Rules) GetNotIn() []int32 { + if m != nil { + return m.NotIn + } + return nil +} + +// SFixed64Rules describes the constraints applied to `sfixed64` values +type SFixed64Rules struct { + // Const specifies that this field must be exactly the specified value + Const *int64 `protobuf:"fixed64,1,opt,name=const" json:"const,omitempty"` + // Lt specifies that this field must be less than the specified value, + // exclusive + Lt *int64 `protobuf:"fixed64,2,opt,name=lt" json:"lt,omitempty"` + // Lte specifies that this field must be less than or equal to the + // specified value, inclusive + Lte *int64 `protobuf:"fixed64,3,opt,name=lte" json:"lte,omitempty"` + // Gt specifies that this field must be greater than the specified value, + // exclusive. If the value of Gt is larger than a specified Lt or Lte, the + // range is reversed. + Gt *int64 `protobuf:"fixed64,4,opt,name=gt" json:"gt,omitempty"` + // Gte specifies that this field must be greater than or equal to the + // specified value, inclusive. If the value of Gte is larger than a + // specified Lt or Lte, the range is reversed. + Gte *int64 `protobuf:"fixed64,5,opt,name=gte" json:"gte,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []int64 `protobuf:"fixed64,6,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []int64 `protobuf:"fixed64,7,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SFixed64Rules) Reset() { *m = SFixed64Rules{} } +func (m *SFixed64Rules) String() string { return proto.CompactTextString(m) } +func (*SFixed64Rules) ProtoMessage() {} +func (*SFixed64Rules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{12} +} +func (m *SFixed64Rules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SFixed64Rules.Unmarshal(m, b) +} +func (m *SFixed64Rules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SFixed64Rules.Marshal(b, m, deterministic) +} +func (dst *SFixed64Rules) XXX_Merge(src proto.Message) { + xxx_messageInfo_SFixed64Rules.Merge(dst, src) +} +func (m *SFixed64Rules) XXX_Size() int { + return xxx_messageInfo_SFixed64Rules.Size(m) +} +func (m *SFixed64Rules) XXX_DiscardUnknown() { + xxx_messageInfo_SFixed64Rules.DiscardUnknown(m) +} + +var xxx_messageInfo_SFixed64Rules proto.InternalMessageInfo + +func (m *SFixed64Rules) GetConst() int64 { + if m != nil && m.Const != nil { + return *m.Const + } + return 0 +} + +func (m *SFixed64Rules) GetLt() int64 { + if m != nil && m.Lt != nil { + return *m.Lt + } + return 0 +} + +func (m *SFixed64Rules) GetLte() int64 { + if m != nil && m.Lte != nil { + return *m.Lte + } + return 0 +} + +func (m *SFixed64Rules) GetGt() int64 { + if m != nil && m.Gt != nil { + return *m.Gt + } + return 0 +} + +func (m *SFixed64Rules) GetGte() int64 { + if m != nil && m.Gte != nil { + return *m.Gte + } + return 0 +} + +func (m *SFixed64Rules) GetIn() []int64 { + if m != nil { + return m.In + } + return nil +} + +func (m *SFixed64Rules) GetNotIn() []int64 { + if m != nil { + return m.NotIn + } + return nil +} + +// BoolRules describes the constraints applied to `bool` values +type BoolRules struct { + // Const specifies that this field must be exactly the specified value + Const *bool `protobuf:"varint,1,opt,name=const" json:"const,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BoolRules) Reset() { *m = BoolRules{} } +func (m *BoolRules) String() string { return proto.CompactTextString(m) } +func (*BoolRules) ProtoMessage() {} +func (*BoolRules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{13} +} +func (m *BoolRules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BoolRules.Unmarshal(m, b) +} +func (m *BoolRules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BoolRules.Marshal(b, m, deterministic) +} +func (dst *BoolRules) XXX_Merge(src proto.Message) { + xxx_messageInfo_BoolRules.Merge(dst, src) +} +func (m *BoolRules) XXX_Size() int { + return xxx_messageInfo_BoolRules.Size(m) +} +func (m *BoolRules) XXX_DiscardUnknown() { + xxx_messageInfo_BoolRules.DiscardUnknown(m) +} + +var xxx_messageInfo_BoolRules proto.InternalMessageInfo + +func (m *BoolRules) GetConst() bool { + if m != nil && m.Const != nil { + return *m.Const + } + return false +} + +// StringRules describe the constraints applied to `string` values +type StringRules struct { + // Const specifies that this field must be exactly the specified value + Const *string `protobuf:"bytes,1,opt,name=const" json:"const,omitempty"` + // Len specifies that this field must be the specified number of + // characters (Unicode code points). Note that the number of + // characters may differ from the number of bytes in the string. + Len *uint64 `protobuf:"varint,19,opt,name=len" json:"len,omitempty"` + // MinLen specifies that this field must be the specified number of + // characters (Unicode code points) at a minimum. Note that the number of + // characters may differ from the number of bytes in the string. + MinLen *uint64 `protobuf:"varint,2,opt,name=min_len,json=minLen" json:"min_len,omitempty"` + // MaxLen specifies that this field must be the specified number of + // characters (Unicode code points) at a maximum. Note that the number of + // characters may differ from the number of bytes in the string. + MaxLen *uint64 `protobuf:"varint,3,opt,name=max_len,json=maxLen" json:"max_len,omitempty"` + // LenBytes specifies that this field must be the specified number of bytes + // at a minimum + LenBytes *uint64 `protobuf:"varint,20,opt,name=len_bytes,json=lenBytes" json:"len_bytes,omitempty"` + // MinBytes specifies that this field must be the specified number of bytes + // at a minimum + MinBytes *uint64 `protobuf:"varint,4,opt,name=min_bytes,json=minBytes" json:"min_bytes,omitempty"` + // MaxBytes specifies that this field must be the specified number of bytes + // at a maximum + MaxBytes *uint64 `protobuf:"varint,5,opt,name=max_bytes,json=maxBytes" json:"max_bytes,omitempty"` + // Pattern specifes that this field must match against the specified + // regular expression (RE2 syntax). The included expression should elide + // any delimiters. + Pattern *string `protobuf:"bytes,6,opt,name=pattern" json:"pattern,omitempty"` + // Prefix specifies that this field must have the specified substring at + // the beginning of the string. + Prefix *string `protobuf:"bytes,7,opt,name=prefix" json:"prefix,omitempty"` + // Suffix specifies that this field must have the specified substring at + // the end of the string. + Suffix *string `protobuf:"bytes,8,opt,name=suffix" json:"suffix,omitempty"` + // Contains specifies that this field must have the specified substring + // anywhere in the string. + Contains *string `protobuf:"bytes,9,opt,name=contains" json:"contains,omitempty"` + // NotContains specifies that this field cannot have the specified substring + // anywhere in the string. + NotContains *string `protobuf:"bytes,23,opt,name=not_contains,json=notContains" json:"not_contains,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []string `protobuf:"bytes,10,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []string `protobuf:"bytes,11,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // WellKnown rules provide advanced constraints against common string + // patterns + // + // Types that are valid to be assigned to WellKnown: + // *StringRules_Email + // *StringRules_Hostname + // *StringRules_Ip + // *StringRules_Ipv4 + // *StringRules_Ipv6 + // *StringRules_Uri + // *StringRules_UriRef + // *StringRules_Address + // *StringRules_Uuid + // *StringRules_WellKnownRegex + WellKnown isStringRules_WellKnown `protobuf_oneof:"well_known"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StringRules) Reset() { *m = StringRules{} } +func (m *StringRules) String() string { return proto.CompactTextString(m) } +func (*StringRules) ProtoMessage() {} +func (*StringRules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{14} +} +func (m *StringRules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_StringRules.Unmarshal(m, b) +} +func (m *StringRules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_StringRules.Marshal(b, m, deterministic) +} +func (dst *StringRules) XXX_Merge(src proto.Message) { + xxx_messageInfo_StringRules.Merge(dst, src) +} +func (m *StringRules) XXX_Size() int { + return xxx_messageInfo_StringRules.Size(m) +} +func (m *StringRules) XXX_DiscardUnknown() { + xxx_messageInfo_StringRules.DiscardUnknown(m) +} + +var xxx_messageInfo_StringRules proto.InternalMessageInfo + +func (m *StringRules) GetConst() string { + if m != nil && m.Const != nil { + return *m.Const + } + return "" +} + +func (m *StringRules) GetLen() uint64 { + if m != nil && m.Len != nil { + return *m.Len + } + return 0 +} + +func (m *StringRules) GetMinLen() uint64 { + if m != nil && m.MinLen != nil { + return *m.MinLen + } + return 0 +} + +func (m *StringRules) GetMaxLen() uint64 { + if m != nil && m.MaxLen != nil { + return *m.MaxLen + } + return 0 +} + +func (m *StringRules) GetLenBytes() uint64 { + if m != nil && m.LenBytes != nil { + return *m.LenBytes + } + return 0 +} + +func (m *StringRules) GetMinBytes() uint64 { + if m != nil && m.MinBytes != nil { + return *m.MinBytes + } + return 0 +} + +func (m *StringRules) GetMaxBytes() uint64 { + if m != nil && m.MaxBytes != nil { + return *m.MaxBytes + } + return 0 +} + +func (m *StringRules) GetPattern() string { + if m != nil && m.Pattern != nil { + return *m.Pattern + } + return "" +} + +func (m *StringRules) GetPrefix() string { + if m != nil && m.Prefix != nil { + return *m.Prefix + } + return "" +} + +func (m *StringRules) GetSuffix() string { + if m != nil && m.Suffix != nil { + return *m.Suffix + } + return "" +} + +func (m *StringRules) GetContains() string { + if m != nil && m.Contains != nil { + return *m.Contains + } + return "" +} + +func (m *StringRules) GetNotContains() string { + if m != nil && m.NotContains != nil { + return *m.NotContains + } + return "" +} + +func (m *StringRules) GetIn() []string { + if m != nil { + return m.In + } + return nil +} + +func (m *StringRules) GetNotIn() []string { + if m != nil { + return m.NotIn + } + return nil +} + +type isStringRules_WellKnown interface { + isStringRules_WellKnown() +} + +type StringRules_Email struct { + Email bool `protobuf:"varint,12,opt,name=email,oneof"` +} + +type StringRules_Hostname struct { + Hostname bool `protobuf:"varint,13,opt,name=hostname,oneof"` +} + +type StringRules_Ip struct { + Ip bool `protobuf:"varint,14,opt,name=ip,oneof"` +} + +type StringRules_Ipv4 struct { + Ipv4 bool `protobuf:"varint,15,opt,name=ipv4,oneof"` +} + +type StringRules_Ipv6 struct { + Ipv6 bool `protobuf:"varint,16,opt,name=ipv6,oneof"` +} + +type StringRules_Uri struct { + Uri bool `protobuf:"varint,17,opt,name=uri,oneof"` +} + +type StringRules_UriRef struct { + UriRef bool `protobuf:"varint,18,opt,name=uri_ref,json=uriRef,oneof"` +} + +type StringRules_Address struct { + Address bool `protobuf:"varint,21,opt,name=address,oneof"` +} + +type StringRules_Uuid struct { + Uuid bool `protobuf:"varint,22,opt,name=uuid,oneof"` +} + +type StringRules_WellKnownRegex struct { + WellKnownRegex KnownRegex `protobuf:"varint,24,opt,name=well_known_regex,json=wellKnownRegex,enum=validate.KnownRegex,oneof"` +} + +func (*StringRules_Email) isStringRules_WellKnown() {} + +func (*StringRules_Hostname) isStringRules_WellKnown() {} + +func (*StringRules_Ip) isStringRules_WellKnown() {} + +func (*StringRules_Ipv4) isStringRules_WellKnown() {} + +func (*StringRules_Ipv6) isStringRules_WellKnown() {} + +func (*StringRules_Uri) isStringRules_WellKnown() {} + +func (*StringRules_UriRef) isStringRules_WellKnown() {} + +func (*StringRules_Address) isStringRules_WellKnown() {} + +func (*StringRules_Uuid) isStringRules_WellKnown() {} + +func (*StringRules_WellKnownRegex) isStringRules_WellKnown() {} + +func (m *StringRules) GetWellKnown() isStringRules_WellKnown { + if m != nil { + return m.WellKnown + } + return nil +} + +func (m *StringRules) GetEmail() bool { + if x, ok := m.GetWellKnown().(*StringRules_Email); ok { + return x.Email + } + return false +} + +func (m *StringRules) GetHostname() bool { + if x, ok := m.GetWellKnown().(*StringRules_Hostname); ok { + return x.Hostname + } + return false +} + +func (m *StringRules) GetIp() bool { + if x, ok := m.GetWellKnown().(*StringRules_Ip); ok { + return x.Ip + } + return false +} + +func (m *StringRules) GetIpv4() bool { + if x, ok := m.GetWellKnown().(*StringRules_Ipv4); ok { + return x.Ipv4 + } + return false +} + +func (m *StringRules) GetIpv6() bool { + if x, ok := m.GetWellKnown().(*StringRules_Ipv6); ok { + return x.Ipv6 + } + return false +} + +func (m *StringRules) GetUri() bool { + if x, ok := m.GetWellKnown().(*StringRules_Uri); ok { + return x.Uri + } + return false +} + +func (m *StringRules) GetUriRef() bool { + if x, ok := m.GetWellKnown().(*StringRules_UriRef); ok { + return x.UriRef + } + return false +} + +func (m *StringRules) GetAddress() bool { + if x, ok := m.GetWellKnown().(*StringRules_Address); ok { + return x.Address + } + return false +} + +func (m *StringRules) GetUuid() bool { + if x, ok := m.GetWellKnown().(*StringRules_Uuid); ok { + return x.Uuid + } + return false +} + +func (m *StringRules) GetWellKnownRegex() KnownRegex { + if x, ok := m.GetWellKnown().(*StringRules_WellKnownRegex); ok { + return x.WellKnownRegex + } + return KnownRegex_UNKNOWN +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*StringRules) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _StringRules_OneofMarshaler, _StringRules_OneofUnmarshaler, _StringRules_OneofSizer, []interface{}{ + (*StringRules_Email)(nil), + (*StringRules_Hostname)(nil), + (*StringRules_Ip)(nil), + (*StringRules_Ipv4)(nil), + (*StringRules_Ipv6)(nil), + (*StringRules_Uri)(nil), + (*StringRules_UriRef)(nil), + (*StringRules_Address)(nil), + (*StringRules_Uuid)(nil), + (*StringRules_WellKnownRegex)(nil), + } +} + +func _StringRules_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*StringRules) + // well_known + switch x := m.WellKnown.(type) { + case *StringRules_Email: + t := uint64(0) + if x.Email { + t = 1 + } + b.EncodeVarint(12<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *StringRules_Hostname: + t := uint64(0) + if x.Hostname { + t = 1 + } + b.EncodeVarint(13<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *StringRules_Ip: + t := uint64(0) + if x.Ip { + t = 1 + } + b.EncodeVarint(14<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *StringRules_Ipv4: + t := uint64(0) + if x.Ipv4 { + t = 1 + } + b.EncodeVarint(15<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *StringRules_Ipv6: + t := uint64(0) + if x.Ipv6 { + t = 1 + } + b.EncodeVarint(16<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *StringRules_Uri: + t := uint64(0) + if x.Uri { + t = 1 + } + b.EncodeVarint(17<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *StringRules_UriRef: + t := uint64(0) + if x.UriRef { + t = 1 + } + b.EncodeVarint(18<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *StringRules_Address: + t := uint64(0) + if x.Address { + t = 1 + } + b.EncodeVarint(21<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *StringRules_Uuid: + t := uint64(0) + if x.Uuid { + t = 1 + } + b.EncodeVarint(22<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *StringRules_WellKnownRegex: + b.EncodeVarint(24<<3 | proto.WireVarint) + b.EncodeVarint(uint64(x.WellKnownRegex)) + case nil: + default: + return fmt.Errorf("StringRules.WellKnown has unexpected type %T", x) + } + return nil +} + +func _StringRules_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*StringRules) + switch tag { + case 12: // well_known.email + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &StringRules_Email{x != 0} + return true, err + case 13: // well_known.hostname + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &StringRules_Hostname{x != 0} + return true, err + case 14: // well_known.ip + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &StringRules_Ip{x != 0} + return true, err + case 15: // well_known.ipv4 + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &StringRules_Ipv4{x != 0} + return true, err + case 16: // well_known.ipv6 + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &StringRules_Ipv6{x != 0} + return true, err + case 17: // well_known.uri + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &StringRules_Uri{x != 0} + return true, err + case 18: // well_known.uri_ref + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &StringRules_UriRef{x != 0} + return true, err + case 21: // well_known.address + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &StringRules_Address{x != 0} + return true, err + case 22: // well_known.uuid + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &StringRules_Uuid{x != 0} + return true, err + case 24: // well_known.well_known_regex + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &StringRules_WellKnownRegex{KnownRegex(x)} + return true, err + default: + return false, nil + } +} + +func _StringRules_OneofSizer(msg proto.Message) (n int) { + m := msg.(*StringRules) + // well_known + switch x := m.WellKnown.(type) { + case *StringRules_Email: + n += 1 // tag and wire + n += 1 + case *StringRules_Hostname: + n += 1 // tag and wire + n += 1 + case *StringRules_Ip: + n += 1 // tag and wire + n += 1 + case *StringRules_Ipv4: + n += 1 // tag and wire + n += 1 + case *StringRules_Ipv6: + n += 2 // tag and wire + n += 1 + case *StringRules_Uri: + n += 2 // tag and wire + n += 1 + case *StringRules_UriRef: + n += 2 // tag and wire + n += 1 + case *StringRules_Address: + n += 2 // tag and wire + n += 1 + case *StringRules_Uuid: + n += 2 // tag and wire + n += 1 + case *StringRules_WellKnownRegex: + n += 2 // tag and wire + n += proto.SizeVarint(uint64(x.WellKnownRegex)) + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// BytesRules describe the constraints applied to `bytes` values +type BytesRules struct { + // Const specifies that this field must be exactly the specified value + Const []byte `protobuf:"bytes,1,opt,name=const" json:"const,omitempty"` + // Len specifies that this field must be the specified number of bytes + Len *uint64 `protobuf:"varint,13,opt,name=len" json:"len,omitempty"` + // MinLen specifies that this field must be the specified number of bytes + // at a minimum + MinLen *uint64 `protobuf:"varint,2,opt,name=min_len,json=minLen" json:"min_len,omitempty"` + // MaxLen specifies that this field must be the specified number of bytes + // at a maximum + MaxLen *uint64 `protobuf:"varint,3,opt,name=max_len,json=maxLen" json:"max_len,omitempty"` + // Pattern specifes that this field must match against the specified + // regular expression (RE2 syntax). The included expression should elide + // any delimiters. + Pattern *string `protobuf:"bytes,4,opt,name=pattern" json:"pattern,omitempty"` + // Prefix specifies that this field must have the specified bytes at the + // beginning of the string. + Prefix []byte `protobuf:"bytes,5,opt,name=prefix" json:"prefix,omitempty"` + // Suffix specifies that this field must have the specified bytes at the + // end of the string. + Suffix []byte `protobuf:"bytes,6,opt,name=suffix" json:"suffix,omitempty"` + // Contains specifies that this field must have the specified bytes + // anywhere in the string. + Contains []byte `protobuf:"bytes,7,opt,name=contains" json:"contains,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In [][]byte `protobuf:"bytes,8,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn [][]byte `protobuf:"bytes,9,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + // WellKnown rules provide advanced constraints against common byte + // patterns + // + // Types that are valid to be assigned to WellKnown: + // *BytesRules_Ip + // *BytesRules_Ipv4 + // *BytesRules_Ipv6 + WellKnown isBytesRules_WellKnown `protobuf_oneof:"well_known"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *BytesRules) Reset() { *m = BytesRules{} } +func (m *BytesRules) String() string { return proto.CompactTextString(m) } +func (*BytesRules) ProtoMessage() {} +func (*BytesRules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{15} +} +func (m *BytesRules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_BytesRules.Unmarshal(m, b) +} +func (m *BytesRules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_BytesRules.Marshal(b, m, deterministic) +} +func (dst *BytesRules) XXX_Merge(src proto.Message) { + xxx_messageInfo_BytesRules.Merge(dst, src) +} +func (m *BytesRules) XXX_Size() int { + return xxx_messageInfo_BytesRules.Size(m) +} +func (m *BytesRules) XXX_DiscardUnknown() { + xxx_messageInfo_BytesRules.DiscardUnknown(m) +} + +var xxx_messageInfo_BytesRules proto.InternalMessageInfo + +func (m *BytesRules) GetConst() []byte { + if m != nil { + return m.Const + } + return nil +} + +func (m *BytesRules) GetLen() uint64 { + if m != nil && m.Len != nil { + return *m.Len + } + return 0 +} + +func (m *BytesRules) GetMinLen() uint64 { + if m != nil && m.MinLen != nil { + return *m.MinLen + } + return 0 +} + +func (m *BytesRules) GetMaxLen() uint64 { + if m != nil && m.MaxLen != nil { + return *m.MaxLen + } + return 0 +} + +func (m *BytesRules) GetPattern() string { + if m != nil && m.Pattern != nil { + return *m.Pattern + } + return "" +} + +func (m *BytesRules) GetPrefix() []byte { + if m != nil { + return m.Prefix + } + return nil +} + +func (m *BytesRules) GetSuffix() []byte { + if m != nil { + return m.Suffix + } + return nil +} + +func (m *BytesRules) GetContains() []byte { + if m != nil { + return m.Contains + } + return nil +} + +func (m *BytesRules) GetIn() [][]byte { + if m != nil { + return m.In + } + return nil +} + +func (m *BytesRules) GetNotIn() [][]byte { + if m != nil { + return m.NotIn + } + return nil +} + +type isBytesRules_WellKnown interface { + isBytesRules_WellKnown() +} + +type BytesRules_Ip struct { + Ip bool `protobuf:"varint,10,opt,name=ip,oneof"` +} + +type BytesRules_Ipv4 struct { + Ipv4 bool `protobuf:"varint,11,opt,name=ipv4,oneof"` +} + +type BytesRules_Ipv6 struct { + Ipv6 bool `protobuf:"varint,12,opt,name=ipv6,oneof"` +} + +func (*BytesRules_Ip) isBytesRules_WellKnown() {} + +func (*BytesRules_Ipv4) isBytesRules_WellKnown() {} + +func (*BytesRules_Ipv6) isBytesRules_WellKnown() {} + +func (m *BytesRules) GetWellKnown() isBytesRules_WellKnown { + if m != nil { + return m.WellKnown + } + return nil +} + +func (m *BytesRules) GetIp() bool { + if x, ok := m.GetWellKnown().(*BytesRules_Ip); ok { + return x.Ip + } + return false +} + +func (m *BytesRules) GetIpv4() bool { + if x, ok := m.GetWellKnown().(*BytesRules_Ipv4); ok { + return x.Ipv4 + } + return false +} + +func (m *BytesRules) GetIpv6() bool { + if x, ok := m.GetWellKnown().(*BytesRules_Ipv6); ok { + return x.Ipv6 + } + return false +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*BytesRules) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _BytesRules_OneofMarshaler, _BytesRules_OneofUnmarshaler, _BytesRules_OneofSizer, []interface{}{ + (*BytesRules_Ip)(nil), + (*BytesRules_Ipv4)(nil), + (*BytesRules_Ipv6)(nil), + } +} + +func _BytesRules_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*BytesRules) + // well_known + switch x := m.WellKnown.(type) { + case *BytesRules_Ip: + t := uint64(0) + if x.Ip { + t = 1 + } + b.EncodeVarint(10<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *BytesRules_Ipv4: + t := uint64(0) + if x.Ipv4 { + t = 1 + } + b.EncodeVarint(11<<3 | proto.WireVarint) + b.EncodeVarint(t) + case *BytesRules_Ipv6: + t := uint64(0) + if x.Ipv6 { + t = 1 + } + b.EncodeVarint(12<<3 | proto.WireVarint) + b.EncodeVarint(t) + case nil: + default: + return fmt.Errorf("BytesRules.WellKnown has unexpected type %T", x) + } + return nil +} + +func _BytesRules_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*BytesRules) + switch tag { + case 10: // well_known.ip + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &BytesRules_Ip{x != 0} + return true, err + case 11: // well_known.ipv4 + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &BytesRules_Ipv4{x != 0} + return true, err + case 12: // well_known.ipv6 + if wire != proto.WireVarint { + return true, proto.ErrInternalBadWireType + } + x, err := b.DecodeVarint() + m.WellKnown = &BytesRules_Ipv6{x != 0} + return true, err + default: + return false, nil + } +} + +func _BytesRules_OneofSizer(msg proto.Message) (n int) { + m := msg.(*BytesRules) + // well_known + switch x := m.WellKnown.(type) { + case *BytesRules_Ip: + n += 1 // tag and wire + n += 1 + case *BytesRules_Ipv4: + n += 1 // tag and wire + n += 1 + case *BytesRules_Ipv6: + n += 1 // tag and wire + n += 1 + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +// EnumRules describe the constraints applied to enum values +type EnumRules struct { + // Const specifies that this field must be exactly the specified value + Const *int32 `protobuf:"varint,1,opt,name=const" json:"const,omitempty"` + // DefinedOnly specifies that this field must be only one of the defined + // values for this enum, failing on any undefined value. + DefinedOnly *bool `protobuf:"varint,2,opt,name=defined_only,json=definedOnly" json:"defined_only,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []int32 `protobuf:"varint,3,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []int32 `protobuf:"varint,4,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnumRules) Reset() { *m = EnumRules{} } +func (m *EnumRules) String() string { return proto.CompactTextString(m) } +func (*EnumRules) ProtoMessage() {} +func (*EnumRules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{16} +} +func (m *EnumRules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_EnumRules.Unmarshal(m, b) +} +func (m *EnumRules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_EnumRules.Marshal(b, m, deterministic) +} +func (dst *EnumRules) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnumRules.Merge(dst, src) +} +func (m *EnumRules) XXX_Size() int { + return xxx_messageInfo_EnumRules.Size(m) +} +func (m *EnumRules) XXX_DiscardUnknown() { + xxx_messageInfo_EnumRules.DiscardUnknown(m) +} + +var xxx_messageInfo_EnumRules proto.InternalMessageInfo + +func (m *EnumRules) GetConst() int32 { + if m != nil && m.Const != nil { + return *m.Const + } + return 0 +} + +func (m *EnumRules) GetDefinedOnly() bool { + if m != nil && m.DefinedOnly != nil { + return *m.DefinedOnly + } + return false +} + +func (m *EnumRules) GetIn() []int32 { + if m != nil { + return m.In + } + return nil +} + +func (m *EnumRules) GetNotIn() []int32 { + if m != nil { + return m.NotIn + } + return nil +} + +// MessageRules describe the constraints applied to embedded message values. +// For message-type fields, validation is performed recursively. +type MessageRules struct { + // Skip specifies that the validation rules of this field should not be + // evaluated + Skip *bool `protobuf:"varint,1,opt,name=skip" json:"skip,omitempty"` + // Required specifies that this field must be set + Required *bool `protobuf:"varint,2,opt,name=required" json:"required,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MessageRules) Reset() { *m = MessageRules{} } +func (m *MessageRules) String() string { return proto.CompactTextString(m) } +func (*MessageRules) ProtoMessage() {} +func (*MessageRules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{17} +} +func (m *MessageRules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MessageRules.Unmarshal(m, b) +} +func (m *MessageRules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MessageRules.Marshal(b, m, deterministic) +} +func (dst *MessageRules) XXX_Merge(src proto.Message) { + xxx_messageInfo_MessageRules.Merge(dst, src) +} +func (m *MessageRules) XXX_Size() int { + return xxx_messageInfo_MessageRules.Size(m) +} +func (m *MessageRules) XXX_DiscardUnknown() { + xxx_messageInfo_MessageRules.DiscardUnknown(m) +} + +var xxx_messageInfo_MessageRules proto.InternalMessageInfo + +func (m *MessageRules) GetSkip() bool { + if m != nil && m.Skip != nil { + return *m.Skip + } + return false +} + +func (m *MessageRules) GetRequired() bool { + if m != nil && m.Required != nil { + return *m.Required + } + return false +} + +// RepeatedRules describe the constraints applied to `repeated` values +type RepeatedRules struct { + // MinItems specifies that this field must have the specified number of + // items at a minimum + MinItems *uint64 `protobuf:"varint,1,opt,name=min_items,json=minItems" json:"min_items,omitempty"` + // MaxItems specifies that this field must have the specified number of + // items at a maximum + MaxItems *uint64 `protobuf:"varint,2,opt,name=max_items,json=maxItems" json:"max_items,omitempty"` + // Unique specifies that all elements in this field must be unique. This + // contraint is only applicable to scalar and enum types (messages are not + // supported). + Unique *bool `protobuf:"varint,3,opt,name=unique" json:"unique,omitempty"` + // Items specifies the contraints to be applied to each item in the field. + // Repeated message fields will still execute validation against each item + // unless skip is specified here. + Items *FieldRules `protobuf:"bytes,4,opt,name=items" json:"items,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RepeatedRules) Reset() { *m = RepeatedRules{} } +func (m *RepeatedRules) String() string { return proto.CompactTextString(m) } +func (*RepeatedRules) ProtoMessage() {} +func (*RepeatedRules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{18} +} +func (m *RepeatedRules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_RepeatedRules.Unmarshal(m, b) +} +func (m *RepeatedRules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_RepeatedRules.Marshal(b, m, deterministic) +} +func (dst *RepeatedRules) XXX_Merge(src proto.Message) { + xxx_messageInfo_RepeatedRules.Merge(dst, src) +} +func (m *RepeatedRules) XXX_Size() int { + return xxx_messageInfo_RepeatedRules.Size(m) +} +func (m *RepeatedRules) XXX_DiscardUnknown() { + xxx_messageInfo_RepeatedRules.DiscardUnknown(m) +} + +var xxx_messageInfo_RepeatedRules proto.InternalMessageInfo + +func (m *RepeatedRules) GetMinItems() uint64 { + if m != nil && m.MinItems != nil { + return *m.MinItems + } + return 0 +} + +func (m *RepeatedRules) GetMaxItems() uint64 { + if m != nil && m.MaxItems != nil { + return *m.MaxItems + } + return 0 +} + +func (m *RepeatedRules) GetUnique() bool { + if m != nil && m.Unique != nil { + return *m.Unique + } + return false +} + +func (m *RepeatedRules) GetItems() *FieldRules { + if m != nil { + return m.Items + } + return nil +} + +// MapRules describe the constraints applied to `map` values +type MapRules struct { + // MinPairs specifies that this field must have the specified number of + // KVs at a minimum + MinPairs *uint64 `protobuf:"varint,1,opt,name=min_pairs,json=minPairs" json:"min_pairs,omitempty"` + // MaxPairs specifies that this field must have the specified number of + // KVs at a maximum + MaxPairs *uint64 `protobuf:"varint,2,opt,name=max_pairs,json=maxPairs" json:"max_pairs,omitempty"` + // NoSparse specifies values in this field cannot be unset. This only + // applies to map's with message value types. + NoSparse *bool `protobuf:"varint,3,opt,name=no_sparse,json=noSparse" json:"no_sparse,omitempty"` + // Keys specifies the constraints to be applied to each key in the field. + Keys *FieldRules `protobuf:"bytes,4,opt,name=keys" json:"keys,omitempty"` + // Values specifies the constraints to be applied to the value of each key + // in the field. Message values will still have their validations evaluated + // unless skip is specified here. + Values *FieldRules `protobuf:"bytes,5,opt,name=values" json:"values,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MapRules) Reset() { *m = MapRules{} } +func (m *MapRules) String() string { return proto.CompactTextString(m) } +func (*MapRules) ProtoMessage() {} +func (*MapRules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{19} +} +func (m *MapRules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MapRules.Unmarshal(m, b) +} +func (m *MapRules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MapRules.Marshal(b, m, deterministic) +} +func (dst *MapRules) XXX_Merge(src proto.Message) { + xxx_messageInfo_MapRules.Merge(dst, src) +} +func (m *MapRules) XXX_Size() int { + return xxx_messageInfo_MapRules.Size(m) +} +func (m *MapRules) XXX_DiscardUnknown() { + xxx_messageInfo_MapRules.DiscardUnknown(m) +} + +var xxx_messageInfo_MapRules proto.InternalMessageInfo + +func (m *MapRules) GetMinPairs() uint64 { + if m != nil && m.MinPairs != nil { + return *m.MinPairs + } + return 0 +} + +func (m *MapRules) GetMaxPairs() uint64 { + if m != nil && m.MaxPairs != nil { + return *m.MaxPairs + } + return 0 +} + +func (m *MapRules) GetNoSparse() bool { + if m != nil && m.NoSparse != nil { + return *m.NoSparse + } + return false +} + +func (m *MapRules) GetKeys() *FieldRules { + if m != nil { + return m.Keys + } + return nil +} + +func (m *MapRules) GetValues() *FieldRules { + if m != nil { + return m.Values + } + return nil +} + +// AnyRules describe constraints applied exclusively to the +// `google.protobuf.Any` well-known type +type AnyRules struct { + // Required specifies that this field must be set + Required *bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"` + // In specifies that this field's `type_url` must be equal to one of the + // specified values. + In []string `protobuf:"bytes,2,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field's `type_url` must not be equal to any of + // the specified values. + NotIn []string `protobuf:"bytes,3,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *AnyRules) Reset() { *m = AnyRules{} } +func (m *AnyRules) String() string { return proto.CompactTextString(m) } +func (*AnyRules) ProtoMessage() {} +func (*AnyRules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{20} +} +func (m *AnyRules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_AnyRules.Unmarshal(m, b) +} +func (m *AnyRules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_AnyRules.Marshal(b, m, deterministic) +} +func (dst *AnyRules) XXX_Merge(src proto.Message) { + xxx_messageInfo_AnyRules.Merge(dst, src) +} +func (m *AnyRules) XXX_Size() int { + return xxx_messageInfo_AnyRules.Size(m) +} +func (m *AnyRules) XXX_DiscardUnknown() { + xxx_messageInfo_AnyRules.DiscardUnknown(m) +} + +var xxx_messageInfo_AnyRules proto.InternalMessageInfo + +func (m *AnyRules) GetRequired() bool { + if m != nil && m.Required != nil { + return *m.Required + } + return false +} + +func (m *AnyRules) GetIn() []string { + if m != nil { + return m.In + } + return nil +} + +func (m *AnyRules) GetNotIn() []string { + if m != nil { + return m.NotIn + } + return nil +} + +// DurationRules describe the constraints applied exclusively to the +// `google.protobuf.Duration` well-known type +type DurationRules struct { + // Required specifies that this field must be set + Required *bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"` + // Const specifies that this field must be exactly the specified value + Const *duration.Duration `protobuf:"bytes,2,opt,name=const" json:"const,omitempty"` + // Lt specifies that this field must be less than the specified value, + // exclusive + Lt *duration.Duration `protobuf:"bytes,3,opt,name=lt" json:"lt,omitempty"` + // Lt specifies that this field must be less than the specified value, + // inclusive + Lte *duration.Duration `protobuf:"bytes,4,opt,name=lte" json:"lte,omitempty"` + // Gt specifies that this field must be greater than the specified value, + // exclusive + Gt *duration.Duration `protobuf:"bytes,5,opt,name=gt" json:"gt,omitempty"` + // Gte specifies that this field must be greater than the specified value, + // inclusive + Gte *duration.Duration `protobuf:"bytes,6,opt,name=gte" json:"gte,omitempty"` + // In specifies that this field must be equal to one of the specified + // values + In []*duration.Duration `protobuf:"bytes,7,rep,name=in" json:"in,omitempty"` + // NotIn specifies that this field cannot be equal to one of the specified + // values + NotIn []*duration.Duration `protobuf:"bytes,8,rep,name=not_in,json=notIn" json:"not_in,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DurationRules) Reset() { *m = DurationRules{} } +func (m *DurationRules) String() string { return proto.CompactTextString(m) } +func (*DurationRules) ProtoMessage() {} +func (*DurationRules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{21} +} +func (m *DurationRules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DurationRules.Unmarshal(m, b) +} +func (m *DurationRules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DurationRules.Marshal(b, m, deterministic) +} +func (dst *DurationRules) XXX_Merge(src proto.Message) { + xxx_messageInfo_DurationRules.Merge(dst, src) +} +func (m *DurationRules) XXX_Size() int { + return xxx_messageInfo_DurationRules.Size(m) +} +func (m *DurationRules) XXX_DiscardUnknown() { + xxx_messageInfo_DurationRules.DiscardUnknown(m) +} + +var xxx_messageInfo_DurationRules proto.InternalMessageInfo + +func (m *DurationRules) GetRequired() bool { + if m != nil && m.Required != nil { + return *m.Required + } + return false +} + +func (m *DurationRules) GetConst() *duration.Duration { + if m != nil { + return m.Const + } + return nil +} + +func (m *DurationRules) GetLt() *duration.Duration { + if m != nil { + return m.Lt + } + return nil +} + +func (m *DurationRules) GetLte() *duration.Duration { + if m != nil { + return m.Lte + } + return nil +} + +func (m *DurationRules) GetGt() *duration.Duration { + if m != nil { + return m.Gt + } + return nil +} + +func (m *DurationRules) GetGte() *duration.Duration { + if m != nil { + return m.Gte + } + return nil +} + +func (m *DurationRules) GetIn() []*duration.Duration { + if m != nil { + return m.In + } + return nil +} + +func (m *DurationRules) GetNotIn() []*duration.Duration { + if m != nil { + return m.NotIn + } + return nil +} + +// TimestampRules describe the constraints applied exclusively to the +// `google.protobuf.Timestamp` well-known type +type TimestampRules struct { + // Required specifies that this field must be set + Required *bool `protobuf:"varint,1,opt,name=required" json:"required,omitempty"` + // Const specifies that this field must be exactly the specified value + Const *timestamp.Timestamp `protobuf:"bytes,2,opt,name=const" json:"const,omitempty"` + // Lt specifies that this field must be less than the specified value, + // exclusive + Lt *timestamp.Timestamp `protobuf:"bytes,3,opt,name=lt" json:"lt,omitempty"` + // Lte specifies that this field must be less than the specified value, + // inclusive + Lte *timestamp.Timestamp `protobuf:"bytes,4,opt,name=lte" json:"lte,omitempty"` + // Gt specifies that this field must be greater than the specified value, + // exclusive + Gt *timestamp.Timestamp `protobuf:"bytes,5,opt,name=gt" json:"gt,omitempty"` + // Gte specifies that this field must be greater than the specified value, + // inclusive + Gte *timestamp.Timestamp `protobuf:"bytes,6,opt,name=gte" json:"gte,omitempty"` + // LtNow specifies that this must be less than the current time. LtNow + // can only be used with the Within rule. + LtNow *bool `protobuf:"varint,7,opt,name=lt_now,json=ltNow" json:"lt_now,omitempty"` + // GtNow specifies that this must be greater than the current time. GtNow + // can only be used with the Within rule. + GtNow *bool `protobuf:"varint,8,opt,name=gt_now,json=gtNow" json:"gt_now,omitempty"` + // Within specifies that this field must be within this duration of the + // current time. This constraint can be used alone or with the LtNow and + // GtNow rules. + Within *duration.Duration `protobuf:"bytes,9,opt,name=within" json:"within,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TimestampRules) Reset() { *m = TimestampRules{} } +func (m *TimestampRules) String() string { return proto.CompactTextString(m) } +func (*TimestampRules) ProtoMessage() {} +func (*TimestampRules) Descriptor() ([]byte, []int) { + return fileDescriptor_validate_9eaa14bea8038a77, []int{22} +} +func (m *TimestampRules) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_TimestampRules.Unmarshal(m, b) +} +func (m *TimestampRules) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_TimestampRules.Marshal(b, m, deterministic) +} +func (dst *TimestampRules) XXX_Merge(src proto.Message) { + xxx_messageInfo_TimestampRules.Merge(dst, src) +} +func (m *TimestampRules) XXX_Size() int { + return xxx_messageInfo_TimestampRules.Size(m) +} +func (m *TimestampRules) XXX_DiscardUnknown() { + xxx_messageInfo_TimestampRules.DiscardUnknown(m) +} + +var xxx_messageInfo_TimestampRules proto.InternalMessageInfo + +func (m *TimestampRules) GetRequired() bool { + if m != nil && m.Required != nil { + return *m.Required + } + return false +} + +func (m *TimestampRules) GetConst() *timestamp.Timestamp { + if m != nil { + return m.Const + } + return nil +} + +func (m *TimestampRules) GetLt() *timestamp.Timestamp { + if m != nil { + return m.Lt + } + return nil +} + +func (m *TimestampRules) GetLte() *timestamp.Timestamp { + if m != nil { + return m.Lte + } + return nil +} + +func (m *TimestampRules) GetGt() *timestamp.Timestamp { + if m != nil { + return m.Gt + } + return nil +} + +func (m *TimestampRules) GetGte() *timestamp.Timestamp { + if m != nil { + return m.Gte + } + return nil +} + +func (m *TimestampRules) GetLtNow() bool { + if m != nil && m.LtNow != nil { + return *m.LtNow + } + return false +} + +func (m *TimestampRules) GetGtNow() bool { + if m != nil && m.GtNow != nil { + return *m.GtNow + } + return false +} + +func (m *TimestampRules) GetWithin() *duration.Duration { + if m != nil { + return m.Within + } + return nil +} + +var E_Disabled = &proto.ExtensionDesc{ + ExtendedType: (*descriptor.MessageOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 1071, + Name: "validate.disabled", + Tag: "varint,1071,opt,name=disabled", + Filename: "validate/validate.proto", +} + +var E_Required = &proto.ExtensionDesc{ + ExtendedType: (*descriptor.OneofOptions)(nil), + ExtensionType: (*bool)(nil), + Field: 1071, + Name: "validate.required", + Tag: "varint,1071,opt,name=required", + Filename: "validate/validate.proto", +} + +var E_Rules = &proto.ExtensionDesc{ + ExtendedType: (*descriptor.FieldOptions)(nil), + ExtensionType: (*FieldRules)(nil), + Field: 1071, + Name: "validate.rules", + Tag: "bytes,1071,opt,name=rules", + Filename: "validate/validate.proto", +} + +func init() { + proto.RegisterType((*FieldRules)(nil), "validate.FieldRules") + proto.RegisterType((*FloatRules)(nil), "validate.FloatRules") + proto.RegisterType((*DoubleRules)(nil), "validate.DoubleRules") + proto.RegisterType((*Int32Rules)(nil), "validate.Int32Rules") + proto.RegisterType((*Int64Rules)(nil), "validate.Int64Rules") + proto.RegisterType((*UInt32Rules)(nil), "validate.UInt32Rules") + proto.RegisterType((*UInt64Rules)(nil), "validate.UInt64Rules") + proto.RegisterType((*SInt32Rules)(nil), "validate.SInt32Rules") + proto.RegisterType((*SInt64Rules)(nil), "validate.SInt64Rules") + proto.RegisterType((*Fixed32Rules)(nil), "validate.Fixed32Rules") + proto.RegisterType((*Fixed64Rules)(nil), "validate.Fixed64Rules") + proto.RegisterType((*SFixed32Rules)(nil), "validate.SFixed32Rules") + proto.RegisterType((*SFixed64Rules)(nil), "validate.SFixed64Rules") + proto.RegisterType((*BoolRules)(nil), "validate.BoolRules") + proto.RegisterType((*StringRules)(nil), "validate.StringRules") + proto.RegisterType((*BytesRules)(nil), "validate.BytesRules") + proto.RegisterType((*EnumRules)(nil), "validate.EnumRules") + proto.RegisterType((*MessageRules)(nil), "validate.MessageRules") + proto.RegisterType((*RepeatedRules)(nil), "validate.RepeatedRules") + proto.RegisterType((*MapRules)(nil), "validate.MapRules") + proto.RegisterType((*AnyRules)(nil), "validate.AnyRules") + proto.RegisterType((*DurationRules)(nil), "validate.DurationRules") + proto.RegisterType((*TimestampRules)(nil), "validate.TimestampRules") + proto.RegisterEnum("validate.KnownRegex", KnownRegex_name, KnownRegex_value) + proto.RegisterExtension(E_Disabled) + proto.RegisterExtension(E_Required) + proto.RegisterExtension(E_Rules) +} + +func init() { proto.RegisterFile("validate/validate.proto", fileDescriptor_validate_9eaa14bea8038a77) } + +var fileDescriptor_validate_9eaa14bea8038a77 = []byte{ + // 1758 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x98, 0x4b, 0x6f, 0xdc, 0xba, + 0x15, 0xc7, 0xa3, 0xb7, 0xe6, 0xcc, 0x8c, 0x3d, 0xc3, 0x6b, 0x3b, 0xba, 0xee, 0xe3, 0x3a, 0x5e, + 0x14, 0x4e, 0x9a, 0x6b, 0xa7, 0xbe, 0xae, 0x51, 0x04, 0x45, 0xd1, 0xb8, 0x71, 0x90, 0xf4, 0xde, + 0x38, 0x81, 0x92, 0xb4, 0x40, 0x37, 0x03, 0xd9, 0xc3, 0x51, 0x08, 0x6b, 0x28, 0x45, 0x0f, 0xdb, + 0xf3, 0x21, 0xf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, 0x27, + 0x38, 0xc8, 0xf1, 0xdc, 0x43, 0xea, 0x7f, 0xf5, 0x4b, 0x4f, 0xf5, 0x5f, 0xa5, 0x14, 0xfd, 0x0c, + 0x8c, 0x65, 0x90, 0x78, 0x5f, 0xf1, 0x08, 0xd4, 0x78, 0xdc, 0x82, 0x44, 0x8a, 0x99, 0x80, 0xe9, + 0x02, 0xba, 0xf2, 0x36, 0x54, 0xdd, 0x0b, 0xba, 0xaa, 0x74, 0x01, 0x5d, 0x31, 0x0c, 0x59, 0x04, + 0xbc, 0x4d, 0x15, 0xe3, 0x65, 0xe9, 0xa9, 0x30, 0xa4, 0x14, 0xfd, 0x0a, 0x06, 0x55, 0x6d, 0xf0, + 0xb6, 0x78, 0x9c, 0x57, 0xc7, 0x7d, 0x94, 0x2e, 0x19, 0x58, 0x8b, 0x4f, 0x6c, 0x30, 0xf3, 0x55, + 0x82, 0x77, 0xff, 0xac, 0x01, 0xd4, 0xcf, 0x3c, 0xda, 0x00, 0xeb, 0x22, 0xa6, 0x99, 0x28, 0x0c, + 0xba, 0x2f, 0x06, 0x68, 0x0d, 0xf4, 0x28, 0xe7, 0x0f, 0xbf, 0xee, 0xeb, 0x51, 0x8e, 0x26, 0x60, + 0x44, 0x39, 0xe6, 0x4f, 0xb7, 0xee, 0xb3, 0x9f, 0x4c, 0x11, 0xe6, 0xfc, 0x01, 0xd6, 0x7d, 0x3d, + 0xe4, 0x8a, 0x30, 0xc7, 0xfc, 0x11, 0xd5, 0x7d, 0xf6, 0x93, 0x29, 0x08, 0xf5, 0xec, 0x1d, 0x83, + 0x29, 0x08, 0x45, 0x9b, 0x60, 0xd3, 0x38, 0x9f, 0x11, 0xea, 0x39, 0xdc, 0x66, 0xd1, 0x38, 0x7f, + 0x43, 0x77, 0xff, 0xa2, 0xc1, 0xb0, 0x51, 0x54, 0xda, 0x40, 0x5a, 0x17, 0x48, 0x53, 0x81, 0x34, + 0x15, 0x48, 0x53, 0x81, 0x34, 0x15, 0x48, 0xeb, 0x01, 0xd2, 0x24, 0x10, 0x4b, 0x50, 0xfd, 0xd4, + 0xb7, 0x79, 0xac, 0x2e, 0x8f, 0xa5, 0xf2, 0x58, 0x2a, 0x8f, 0xa5, 0xf2, 0x58, 0x2a, 0x8f, 0xd5, + 0xc3, 0x63, 0x29, 0x3c, 0xe5, 0x03, 0xd8, 0xe6, 0x31, 0xba, 0x3c, 0x86, 0xca, 0x63, 0xa8, 0x3c, + 0x86, 0xca, 0x63, 0xa8, 0x3c, 0x46, 0x0f, 0x8f, 0xd1, 0xdc, 0xb0, 0x4f, 0xb7, 0x25, 0x68, 0xdc, + 0x05, 0x1a, 0xab, 0x40, 0x63, 0x15, 0x68, 0xac, 0x02, 0x8d, 0x55, 0xa0, 0x71, 0x0f, 0xd0, 0x58, + 0x05, 0xea, 0xcd, 0x90, 0xd9, 0x05, 0x32, 0x55, 0x20, 0x53, 0x05, 0x32, 0x55, 0x20, 0x53, 0x05, + 0x32, 0x7b, 0x80, 0xcc, 0x26, 0xd0, 0x87, 0xdb, 0x32, 0x34, 0xed, 0x02, 0x4d, 0x55, 0xa0, 0xa9, + 0x0a, 0x34, 0x55, 0x81, 0xa6, 0x2a, 0xd0, 0xb4, 0x07, 0x68, 0xaa, 0x02, 0xf5, 0x66, 0x08, 0x75, + 0x81, 0x90, 0x0a, 0x84, 0x54, 0x20, 0xa4, 0x02, 0x21, 0x15, 0x08, 0xf5, 0x00, 0x21, 0x09, 0xf4, + 0x57, 0x0d, 0x46, 0xcd, 0xdb, 0xa8, 0x4d, 0xe4, 0x74, 0x89, 0x1c, 0x95, 0xc8, 0x51, 0x89, 0x1c, + 0x95, 0xc8, 0x51, 0x89, 0x9c, 0x1e, 0x22, 0xa7, 0x43, 0xd4, 0x9b, 0x23, 0xbb, 0x4b, 0x64, 0xab, + 0x44, 0xb6, 0x4a, 0x64, 0xab, 0x44, 0xb6, 0x4a, 0x64, 0xf7, 0x10, 0xd9, 0x92, 0xe8, 0x6f, 0x1a, + 0x8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0xde, 0xc7, 0xf4, 0x2a, 0x5e, 0x25, 0x69, 0x7c, + 0xb3, 0xda, 0x4f, 0xc2, 0xab, 0x4a, 0xff, 0xa7, 0xc3, 0x90, 0xe4, 0x9f, 0x8b, 0xf3, 0xfd, 0x8b, + 0x78, 0x79, 0x50, 0x6b, 0xc4, 0xa7, 0xd9, 0x8b, 0x6f, 0x43, 0x4c, 0xbf, 0xed, 0x7c, 0x11, 0xfe, + 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x97, 0xba, 0x5c, 0x25, 0x16, 0x00, 0x00, +} diff --git a/validate/validator.py b/validate/validator.py index 9b93c819f..048157102 100644 --- a/validate/validator.py +++ b/validate/validator.py @@ -15,9 +15,9 @@ # Well known regex mapping. regex_map = { - 0: "", # UNKNOWN - 1: r'^:?[0-9a-zA-Z!#$%&\'*+-.^_|~\x60]+$', # HTTP_HEADER_NAME - 2: r'^[^\u0000-\u0008\u000A-\u001F\u007F]*$' #HTTP_HEADER_VALUE + "UNKNOWN": "", + "HTTP_HEADER_NAME": r'^:?[0-9a-zA-Z!#$%&\'*+-.^_|~\x60]+$', + "HTTP_HEADER_VALUE": r'^[^\u0000-\u0008\u000A-\u001F\u007F]*$' } def validate(proto_message): @@ -126,7 +126,10 @@ def in_template(value, name): def string_template(option_value, name): if option_value.string.well_known_regex: - option_value.string.pattern = regex_map[option_value.string.well_known_regex] + known_regex_type = option_value.string.DESCRIPTOR.fields_by_name['well_known_regex'].enum_type + regex_value = option_value.string.well_known_regex + regex_name = known_regex_type.values_by_number[regex_value].name + option_value.string.pattern = regex_map[regex_name] str_templ = """ {{ const_template(o, name) -}} {{ in_template(o.string, name) -}} @@ -317,7 +320,7 @@ def num_template(option_value, name, num): raise ValidationFailed(\"{{ name }} is not greater than {{ num['gt'] }}\") {%- elif num.HasField('gte') %} if {{ name }} < {{ num['gte'] }}: - raise ValidationFailed(\"{{ name }} is not greater than or equal to {{ num['gte'] }}\") + raise ValidationFailed(\"{{ name }} is not greater than or equal to {{ num['gte'] }}\") {%- endif -%} """ return Template(num_tmpl).render(o = option_value, name = name, num = num, in_template = in_template, str = str) From 0b11e920bfd85247a627dc312ba987ac784e1f62 Mon Sep 17 00:00:00 2001 From: asraa Date: Tue, 11 Feb 2020 14:26:00 -0500 Subject: [PATCH 25/25] remove autosaved pgs Signed-off-by: Asra Ali --- module/checker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/checker.go b/module/checker.go index 15ba16d90..bb45ef0a8 100644 --- a/module/checker.go +++ b/module/checker.go @@ -11,7 +11,7 @@ import ( "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/duration" "github.com/golang/protobuf/ptypes/timestamp" - pgs "github.com/lyft/protoc-gen-star" + "github.com/lyft/protoc-gen-star" ) var unknown = ""