/
string.proto
67 lines (55 loc) · 2.08 KB
/
string.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
syntax = "proto3";
package envoy.type.matcher;
option java_outer_classname = "StringProto";
option java_multiple_files = true;
option java_package = "io.envoyproxy.envoy.type.matcher";
import "envoy/type/matcher/regex.proto";
import "validate/validate.proto";
// [#protodoc-title: StringMatcher]
// Specifies the way to match a string.
// [#next-free-field: 6]
message StringMatcher {
oneof match_pattern {
option (validate.required) = true;
// The input string must match exactly the string specified here.
//
// Examples:
//
// * *abc* only matches the value *abc*.
string exact = 1;
// The input string must have the prefix specified here.
// Note: empty prefix is not allowed, please use regex instead.
//
// Examples:
//
// * *abc* matches the value *abc.xyz*
string prefix = 2 [(validate.rules).string = {min_bytes: 1}];
// The input string must have the suffix specified here.
// Note: empty prefix is not allowed, please use regex instead.
//
// Examples:
//
// * *abc* matches the value *xyz.abc*
string suffix = 3 [(validate.rules).string = {min_bytes: 1}];
// The input string must match the regular expression specified here.
// The regex grammar is defined `here
// <https://en.cppreference.com/w/cpp/regex/ecmascript>`_.
//
// Examples:
//
// * The regex ``\d{3}`` matches the value *123*
// * The regex ``\d{3}`` does not match the value *1234*
// * The regex ``\d{3}`` does not match the value *123.456*
//
// .. attention::
// This field has been deprecated in favor of `safe_regex` as it is not safe for use with
// untrusted input in all cases.
string regex = 4 [(validate.rules).string = {max_bytes: 1024}, deprecated = true];
// The input string must match the regular expression specified here.
RegexMatcher safe_regex = 5 [(validate.rules).message = {required: true}];
}
}
// Specifies a list of ways to match a string.
message ListStringMatcher {
repeated StringMatcher patterns = 1 [(validate.rules).repeated = {min_items: 1}];
}