xref: /aosp_15_r20/external/grpc-grpc/src/proto/grpc/testing/xds/v3/string.proto (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1// Copyright 2020 The gRPC Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Local copy of Envoy xDS proto file, used for testing only.
16
17syntax = "proto3";
18
19package envoy.type.matcher.v3;
20
21import "src/proto/grpc/testing/xds/v3/regex.proto";
22
23message StringMatcher {
24  oneof match_pattern {
25    // The input string must match exactly the string specified here.
26    //
27    // Examples:
28    //
29    // * *abc* only matches the value *abc*.
30    string exact = 1;
31
32    // The input string must have the prefix specified here.
33    // Note: empty prefix is not allowed, please use regex instead.
34    //
35    // Examples:
36    //
37    // * *abc* matches the value *abc.xyz*
38    string prefix = 2;
39
40    // The input string must have the suffix specified here.
41    // Note: empty prefix is not allowed, please use regex instead.
42    //
43    // Examples:
44    //
45    // * *abc* matches the value *xyz.abc*
46    string suffix = 3;
47
48    // The input string must match the regular expression specified here.
49    RegexMatcher safe_regex = 5;
50
51    // The input string must have the substring specified here.
52    // Note: empty contains match is not allowed, please use regex instead.
53    //
54    // Examples:
55    //
56    // * *abc* matches the value *xyz.abc.def*
57    string contains = 7;
58  }
59
60  // If true, indicates the exact/prefix/suffix matching should be case insensitive. This has no
61  // effect for the safe_regex match.
62  // For example, the matcher *data* will match both input string *Data* and *data* if set to true.
63  bool ignore_case = 6;
64}
65