async-grpc-xds 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data/fixtures/async/grpc/test_interface.rb +79 -0
- data/fixtures/async/grpc/test_message.rb +56 -0
- data/lib/async/grpc/xds/ads_stream.rb +70 -0
- data/lib/async/grpc/xds/client.rb +255 -0
- data/lib/async/grpc/xds/context.rb +201 -0
- data/lib/async/grpc/xds/control_plane.rb +143 -0
- data/lib/async/grpc/xds/discovery_client.rb +356 -0
- data/lib/async/grpc/xds/health_checker.rb +88 -0
- data/lib/async/grpc/xds/load_balancer.rb +196 -0
- data/lib/async/grpc/xds/resource_builder.rb +138 -0
- data/lib/async/grpc/xds/resource_cache.rb +55 -0
- data/lib/async/grpc/xds/resources.rb +270 -0
- data/lib/async/grpc/xds/server.rb +34 -0
- data/lib/async/grpc/xds/service.rb +117 -0
- data/lib/async/grpc/xds/version.rb +12 -0
- data/lib/async/grpc/xds.rb +42 -0
- data/lib/envoy/annotations/deprecation_pb.rb +19 -0
- data/lib/envoy/config/cluster/v3/circuit_breaker_pb.rb +31 -0
- data/lib/envoy/config/cluster/v3/cluster_pb.rb +80 -0
- data/lib/envoy/config/cluster/v3/filter_pb.rb +28 -0
- data/lib/envoy/config/cluster/v3/outlier_detection_pb.rb +29 -0
- data/lib/envoy/config/core/v3/address_pb.rb +38 -0
- data/lib/envoy/config/core/v3/backoff_pb.rb +27 -0
- data/lib/envoy/config/core/v3/base_pb.rb +68 -0
- data/lib/envoy/config/core/v3/cel_pb.rb +24 -0
- data/lib/envoy/config/core/v3/config_source_pb.rb +42 -0
- data/lib/envoy/config/core/v3/event_service_config_pb.rb +27 -0
- data/lib/envoy/config/core/v3/extension_pb.rb +26 -0
- data/lib/envoy/config/core/v3/grpc_method_list_pb.rb +27 -0
- data/lib/envoy/config/core/v3/grpc_service_pb.rb +45 -0
- data/lib/envoy/config/core/v3/health_check_pb.rb +47 -0
- data/lib/envoy/config/core/v3/http_service_pb.rb +27 -0
- data/lib/envoy/config/core/v3/http_uri_pb.rb +27 -0
- data/lib/envoy/config/core/v3/protocol_pb.rb +51 -0
- data/lib/envoy/config/core/v3/proxy_protocol_pb.rb +31 -0
- data/lib/envoy/config/core/v3/resolver_pb.rb +27 -0
- data/lib/envoy/config/core/v3/socket_cmsg_headers_pb.rb +25 -0
- data/lib/envoy/config/core/v3/socket_option_pb.rb +31 -0
- data/lib/envoy/config/core/v3/substitution_format_string_pb.rb +30 -0
- data/lib/envoy/config/core/v3/udp_socket_config_pb.rb +26 -0
- data/lib/envoy/config/endpoint/v3/endpoint_components_pb.rb +40 -0
- data/lib/envoy/config/endpoint/v3/endpoint_pb.rb +32 -0
- data/lib/envoy/config/endpoint/v3/load_report_pb.rb +36 -0
- data/lib/envoy/service/discovery/v3/ads_pb.rb +26 -0
- data/lib/envoy/service/discovery/v3/aggregated_discovery_service.rb +64 -0
- data/lib/envoy/service/discovery/v3/discovery_pb.rb +42 -0
- data/lib/envoy/type/matcher/v3/address_pb.rb +25 -0
- data/lib/envoy/type/matcher/v3/filter_state_pb.rb +27 -0
- data/lib/envoy/type/matcher/v3/http_inputs_pb.rb +29 -0
- data/lib/envoy/type/matcher/v3/metadata_pb.rb +28 -0
- data/lib/envoy/type/matcher/v3/node_pb.rb +27 -0
- data/lib/envoy/type/matcher/v3/number_pb.rb +27 -0
- data/lib/envoy/type/matcher/v3/path_pb.rb +27 -0
- data/lib/envoy/type/matcher/v3/regex_pb.rb +30 -0
- data/lib/envoy/type/matcher/v3/status_code_input_pb.rb +25 -0
- data/lib/envoy/type/matcher/v3/string_pb.rb +29 -0
- data/lib/envoy/type/matcher/v3/struct_pb.rb +28 -0
- data/lib/envoy/type/matcher/v3/value_pb.rb +31 -0
- data/lib/envoy/type/metadata/v3/metadata_pb.rb +32 -0
- data/lib/envoy/type/v3/hash_policy_pb.rb +26 -0
- data/lib/envoy/type/v3/http_pb.rb +22 -0
- data/lib/envoy/type/v3/http_status_pb.rb +25 -0
- data/lib/envoy/type/v3/percent_pb.rb +26 -0
- data/lib/envoy/type/v3/range_pb.rb +25 -0
- data/lib/envoy/type/v3/ratelimit_strategy_pb.rb +28 -0
- data/lib/envoy/type/v3/ratelimit_unit_pb.rb +22 -0
- data/lib/envoy/type/v3/semantic_version_pb.rb +23 -0
- data/lib/envoy/type/v3/token_bucket_pb.rb +26 -0
- data/lib/envoy.rb +83 -0
- data/lib/google/protobuf/any_pb.rb +18 -0
- data/lib/google/protobuf/duration_pb.rb +18 -0
- data/lib/google/protobuf/empty_pb.rb +18 -0
- data/lib/google/protobuf/struct_pb.rb +21 -0
- data/lib/google/protobuf/timestamp_pb.rb +18 -0
- data/lib/google/protobuf/wrappers_pb.rb +26 -0
- data/lib/google/rpc/status_pb.rb +20 -0
- data/lib/udpa/annotations/migrate_pb.rb +22 -0
- data/lib/udpa/annotations/security_pb.rb +23 -0
- data/lib/udpa/annotations/sensitive_pb.rb +19 -0
- data/lib/udpa/annotations/status_pb.rb +21 -0
- data/lib/udpa/annotations/versioning_pb.rb +20 -0
- data/lib/validate/validate_pb.rb +43 -0
- data/lib/xds/annotations/v3/status_pb.rb +26 -0
- data/lib/xds/core/v3/authority_pb.rb +23 -0
- data/lib/xds/core/v3/cidr_pb.rb +24 -0
- data/lib/xds/core/v3/collection_entry_pb.rb +26 -0
- data/lib/xds/core/v3/context_params_pb.rb +22 -0
- data/lib/xds/core/v3/extension_pb.rb +23 -0
- data/lib/xds/core/v3/resource_locator_pb.rb +26 -0
- data/lib/xds/core/v3/resource_name_pb.rb +24 -0
- data/lib/xds/core/v3/resource_pb.rb +24 -0
- data/lib/xds/type/matcher/v3/domain_pb.rb +27 -0
- data/lib/xds/type/matcher/v3/http_inputs_pb.rb +22 -0
- data/lib/xds/type/matcher/v3/ip_pb.rb +28 -0
- data/lib/xds/type/matcher/v3/matcher_pb.rb +34 -0
- data/lib/xds/type/matcher/v3/range_pb.rb +31 -0
- data/lib/xds/type/matcher/v3/regex_pb.rb +25 -0
- data/lib/xds/type/matcher/v3/string_pb.rb +27 -0
- data/license.md +21 -0
- data/plan.md +156 -0
- data/proto/envoy/annotations/deprecation.proto +34 -0
- data/proto/envoy/annotations/resource.proto +19 -0
- data/proto/envoy/config/README.md +3 -0
- data/proto/envoy/config/cluster/v3/BUILD +18 -0
- data/proto/envoy/config/cluster/v3/circuit_breaker.proto +121 -0
- data/proto/envoy/config/cluster/v3/cluster.proto +1407 -0
- data/proto/envoy/config/cluster/v3/filter.proto +40 -0
- data/proto/envoy/config/cluster/v3/outlier_detection.proto +180 -0
- data/proto/envoy/config/core/v3/BUILD +16 -0
- data/proto/envoy/config/core/v3/address.proto +214 -0
- data/proto/envoy/config/core/v3/backoff.proto +37 -0
- data/proto/envoy/config/core/v3/base.proto +662 -0
- data/proto/envoy/config/core/v3/cel.proto +63 -0
- data/proto/envoy/config/core/v3/config_source.proto +283 -0
- data/proto/envoy/config/core/v3/event_service_config.proto +29 -0
- data/proto/envoy/config/core/v3/extension.proto +32 -0
- data/proto/envoy/config/core/v3/grpc_method_list.proto +33 -0
- data/proto/envoy/config/core/v3/grpc_service.proto +355 -0
- data/proto/envoy/config/core/v3/health_check.proto +443 -0
- data/proto/envoy/config/core/v3/http_service.proto +35 -0
- data/proto/envoy/config/core/v3/http_uri.proto +58 -0
- data/proto/envoy/config/core/v3/protocol.proto +807 -0
- data/proto/envoy/config/core/v3/proxy_protocol.proto +114 -0
- data/proto/envoy/config/core/v3/resolver.proto +36 -0
- data/proto/envoy/config/core/v3/socket_cmsg_headers.proto +28 -0
- data/proto/envoy/config/core/v3/socket_option.proto +108 -0
- data/proto/envoy/config/core/v3/substitution_format_string.proto +136 -0
- data/proto/envoy/config/core/v3/udp_socket_config.proto +32 -0
- data/proto/envoy/config/endpoint/v3/BUILD +16 -0
- data/proto/envoy/config/endpoint/v3/endpoint.proto +137 -0
- data/proto/envoy/config/endpoint/v3/endpoint_components.proto +229 -0
- data/proto/envoy/config/endpoint/v3/load_report.proto +220 -0
- data/proto/envoy/config/listener/v3/BUILD +18 -0
- data/proto/envoy/config/listener/v3/api_listener.proto +34 -0
- data/proto/envoy/config/listener/v3/listener.proto +455 -0
- data/proto/envoy/config/listener/v3/listener_components.proto +353 -0
- data/proto/envoy/config/listener/v3/quic_config.proto +108 -0
- data/proto/envoy/config/listener/v3/udp_listener_config.proto +52 -0
- data/proto/envoy/config/route/v3/BUILD +19 -0
- data/proto/envoy/config/route/v3/route.proto +172 -0
- data/proto/envoy/config/route/v3/route_components.proto +2918 -0
- data/proto/envoy/config/route/v3/scoped_route.proto +133 -0
- data/proto/envoy/extensions/transport_sockets/tls/v3/BUILD +14 -0
- data/proto/envoy/extensions/transport_sockets/tls/v3/cert.proto +12 -0
- data/proto/envoy/extensions/transport_sockets/tls/v3/common.proto +597 -0
- data/proto/envoy/extensions/transport_sockets/tls/v3/secret.proto +61 -0
- data/proto/envoy/extensions/transport_sockets/tls/v3/tls.proto +366 -0
- data/proto/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.proto +67 -0
- data/proto/envoy/service/README.md +3 -0
- data/proto/envoy/service/discovery/v3/BUILD +13 -0
- data/proto/envoy/service/discovery/v3/ads.proto +44 -0
- data/proto/envoy/service/discovery/v3/discovery.proto +443 -0
- data/proto/envoy/type/BUILD +9 -0
- data/proto/envoy/type/hash_policy.proto +28 -0
- data/proto/envoy/type/http.proto +24 -0
- data/proto/envoy/type/http_status.proto +140 -0
- data/proto/envoy/type/matcher/v3/address.proto +22 -0
- data/proto/envoy/type/matcher/v3/filter_state.proto +33 -0
- data/proto/envoy/type/matcher/v3/http_inputs.proto +71 -0
- data/proto/envoy/type/matcher/v3/metadata.proto +110 -0
- data/proto/envoy/type/matcher/v3/node.proto +29 -0
- data/proto/envoy/type/matcher/v3/number.proto +33 -0
- data/proto/envoy/type/matcher/v3/path.proto +31 -0
- data/proto/envoy/type/matcher/v3/regex.proto +97 -0
- data/proto/envoy/type/matcher/v3/status_code_input.proto +23 -0
- data/proto/envoy/type/matcher/v3/string.proto +94 -0
- data/proto/envoy/type/matcher/v3/struct.proto +91 -0
- data/proto/envoy/type/matcher/v3/value.proto +80 -0
- data/proto/envoy/type/metadata/v3/metadata.proto +117 -0
- data/proto/envoy/type/percent.proto +52 -0
- data/proto/envoy/type/range.proto +43 -0
- data/proto/envoy/type/semantic_version.proto +24 -0
- data/proto/envoy/type/token_bucket.proto +36 -0
- data/proto/envoy/type/v3/BUILD +12 -0
- data/proto/envoy/type/v3/hash_policy.proto +43 -0
- data/proto/envoy/type/v3/http.proto +24 -0
- data/proto/envoy/type/v3/http_status.proto +199 -0
- data/proto/envoy/type/v3/percent.proto +57 -0
- data/proto/envoy/type/v3/range.proto +50 -0
- data/proto/envoy/type/v3/ratelimit_strategy.proto +79 -0
- data/proto/envoy/type/v3/ratelimit_unit.proto +37 -0
- data/proto/envoy/type/v3/semantic_version.proto +27 -0
- data/proto/envoy/type/v3/token_bucket.proto +39 -0
- data/proto/google/protobuf/any.proto +162 -0
- data/proto/google/protobuf/duration.proto +115 -0
- data/proto/google/protobuf/empty.proto +51 -0
- data/proto/google/protobuf/struct.proto +95 -0
- data/proto/google/protobuf/timestamp.proto +145 -0
- data/proto/google/protobuf/wrappers.proto +157 -0
- data/proto/google/rpc/status.proto +47 -0
- data/proto/readme.md +70 -0
- data/proto/udpa/annotations/migrate.proto +49 -0
- data/proto/udpa/annotations/security.proto +31 -0
- data/proto/udpa/annotations/sensitive.proto +14 -0
- data/proto/udpa/annotations/status.proto +34 -0
- data/proto/udpa/annotations/versioning.proto +17 -0
- data/proto/validate/validate.proto +862 -0
- data/proto/xds/annotations/v3/migrate.proto +46 -0
- data/proto/xds/annotations/v3/security.proto +30 -0
- data/proto/xds/annotations/v3/sensitive.proto +16 -0
- data/proto/xds/annotations/v3/status.proto +59 -0
- data/proto/xds/annotations/v3/versioning.proto +20 -0
- data/proto/xds/core/v3/authority.proto +22 -0
- data/proto/xds/core/v3/cidr.proto +25 -0
- data/proto/xds/core/v3/collection_entry.proto +55 -0
- data/proto/xds/core/v3/context_params.proto +23 -0
- data/proto/xds/core/v3/extension.proto +26 -0
- data/proto/xds/core/v3/resource.proto +29 -0
- data/proto/xds/core/v3/resource_locator.proto +118 -0
- data/proto/xds/core/v3/resource_name.proto +42 -0
- data/proto/xds/type/matcher/v3/cel.proto +37 -0
- data/proto/xds/type/matcher/v3/domain.proto +46 -0
- data/proto/xds/type/matcher/v3/http_inputs.proto +23 -0
- data/proto/xds/type/matcher/v3/ip.proto +53 -0
- data/proto/xds/type/matcher/v3/matcher.proto +144 -0
- data/proto/xds/type/matcher/v3/range.proto +69 -0
- data/proto/xds/type/matcher/v3/regex.proto +46 -0
- data/proto/xds/type/matcher/v3/string.proto +71 -0
- data/proto/xds/type/v3/cel.proto +77 -0
- data/proto/xds/type/v3/range.proto +40 -0
- data/proto/xds/type/v3/typed_struct.proto +44 -0
- data/readme.md +37 -0
- data/releases.md +5 -0
- data/xds/Dockerfile.backend +24 -0
- data/xds/Dockerfile.control-plane +22 -0
- data/xds/backend_server.rb +68 -0
- data/xds/docker-compose.yaml +89 -0
- data/xds/go.mod +22 -0
- data/xds/go.sum +82 -0
- data/xds/readme.md +122 -0
- data/xds/test/async/grpc/xds/client.rb +294 -0
- data/xds/test/async/grpc/xds/control_plane.rb +94 -0
- data/xds/test_server.go +355 -0
- data/xds/update_protos.sh +123 -0
- data.tar.gz.sig +0 -0
- metadata +386 -0
- metadata.gz.sig +2 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package envoy.type.matcher.v3;
|
|
4
|
+
|
|
5
|
+
import "envoy/type/matcher/v3/address.proto";
|
|
6
|
+
import "envoy/type/matcher/v3/string.proto";
|
|
7
|
+
|
|
8
|
+
import "udpa/annotations/status.proto";
|
|
9
|
+
import "validate/validate.proto";
|
|
10
|
+
|
|
11
|
+
option java_package = "io.envoyproxy.envoy.type.matcher.v3";
|
|
12
|
+
option java_outer_classname = "FilterStateProto";
|
|
13
|
+
option java_multiple_files = true;
|
|
14
|
+
option go_package = "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3;matcherv3";
|
|
15
|
+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
|
|
16
|
+
|
|
17
|
+
// [#protodoc-title: Filter state matcher]
|
|
18
|
+
|
|
19
|
+
// FilterStateMatcher provides a general interface for matching the filter state objects.
|
|
20
|
+
message FilterStateMatcher {
|
|
21
|
+
// The filter state key to retrieve the object.
|
|
22
|
+
string key = 1 [(validate.rules).string = {min_len: 1}];
|
|
23
|
+
|
|
24
|
+
oneof matcher {
|
|
25
|
+
option (validate.required) = true;
|
|
26
|
+
|
|
27
|
+
// Matches the filter state object as a string value.
|
|
28
|
+
StringMatcher string_match = 2;
|
|
29
|
+
|
|
30
|
+
// Matches the filter state object as a ip Instance.
|
|
31
|
+
AddressMatcher address_match = 3;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package envoy.type.matcher.v3;
|
|
4
|
+
|
|
5
|
+
import "udpa/annotations/status.proto";
|
|
6
|
+
import "validate/validate.proto";
|
|
7
|
+
|
|
8
|
+
option java_package = "io.envoyproxy.envoy.type.matcher.v3";
|
|
9
|
+
option java_outer_classname = "HttpInputsProto";
|
|
10
|
+
option java_multiple_files = true;
|
|
11
|
+
option go_package = "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3;matcherv3";
|
|
12
|
+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
|
|
13
|
+
|
|
14
|
+
// [#protodoc-title: Common HTTP inputs]
|
|
15
|
+
|
|
16
|
+
// Match input indicates that matching should be done on a specific request header.
|
|
17
|
+
// The resulting input string will be all headers for the given key joined by a comma,
|
|
18
|
+
// e.g. if the request contains two 'foo' headers with value 'bar' and 'baz', the input
|
|
19
|
+
// string will be 'bar,baz'.
|
|
20
|
+
// [#comment:TODO(snowp): Link to unified matching docs.]
|
|
21
|
+
// [#extension: envoy.matching.inputs.request_headers]
|
|
22
|
+
message HttpRequestHeaderMatchInput {
|
|
23
|
+
// The request header to match on.
|
|
24
|
+
string header_name = 1
|
|
25
|
+
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Match input indicates that matching should be done on a specific request trailer.
|
|
29
|
+
// The resulting input string will be all headers for the given key joined by a comma,
|
|
30
|
+
// e.g. if the request contains two 'foo' headers with value 'bar' and 'baz', the input
|
|
31
|
+
// string will be 'bar,baz'.
|
|
32
|
+
// [#comment:TODO(snowp): Link to unified matching docs.]
|
|
33
|
+
// [#extension: envoy.matching.inputs.request_trailers]
|
|
34
|
+
message HttpRequestTrailerMatchInput {
|
|
35
|
+
// The request trailer to match on.
|
|
36
|
+
string header_name = 1
|
|
37
|
+
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Match input indicating that matching should be done on a specific response header.
|
|
41
|
+
// The resulting input string will be all headers for the given key joined by a comma,
|
|
42
|
+
// e.g. if the response contains two 'foo' headers with value 'bar' and 'baz', the input
|
|
43
|
+
// string will be 'bar,baz'.
|
|
44
|
+
// [#comment:TODO(snowp): Link to unified matching docs.]
|
|
45
|
+
// [#extension: envoy.matching.inputs.response_headers]
|
|
46
|
+
message HttpResponseHeaderMatchInput {
|
|
47
|
+
// The response header to match on.
|
|
48
|
+
string header_name = 1
|
|
49
|
+
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Match input indicates that matching should be done on a specific response trailer.
|
|
53
|
+
// The resulting input string will be all headers for the given key joined by a comma,
|
|
54
|
+
// e.g. if the request contains two 'foo' headers with value 'bar' and 'baz', the input
|
|
55
|
+
// string will be 'bar,baz'.
|
|
56
|
+
// [#comment:TODO(snowp): Link to unified matching docs.]
|
|
57
|
+
// [#extension: envoy.matching.inputs.response_trailers]
|
|
58
|
+
message HttpResponseTrailerMatchInput {
|
|
59
|
+
// The response trailer to match on.
|
|
60
|
+
string header_name = 1
|
|
61
|
+
[(validate.rules).string = {well_known_regex: HTTP_HEADER_NAME strict: false}];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Match input indicates that matching should be done on a specific query parameter.
|
|
65
|
+
// The resulting input string will be the first query parameter for the value
|
|
66
|
+
// 'query_param'.
|
|
67
|
+
// [#extension: envoy.matching.inputs.query_params]
|
|
68
|
+
message HttpRequestQueryParamMatchInput {
|
|
69
|
+
// The query parameter to match on.
|
|
70
|
+
string query_param = 1 [(validate.rules).string = {min_len: 1}];
|
|
71
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package envoy.type.matcher.v3;
|
|
4
|
+
|
|
5
|
+
import "envoy/type/matcher/v3/value.proto";
|
|
6
|
+
|
|
7
|
+
import "udpa/annotations/status.proto";
|
|
8
|
+
import "udpa/annotations/versioning.proto";
|
|
9
|
+
import "validate/validate.proto";
|
|
10
|
+
|
|
11
|
+
option java_package = "io.envoyproxy.envoy.type.matcher.v3";
|
|
12
|
+
option java_outer_classname = "MetadataProto";
|
|
13
|
+
option java_multiple_files = true;
|
|
14
|
+
option go_package = "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3;matcherv3";
|
|
15
|
+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
|
|
16
|
+
|
|
17
|
+
// [#protodoc-title: Metadata matcher]
|
|
18
|
+
|
|
19
|
+
// ``MetadataMatcher`` provides a general interface to check if a given value is matched in
|
|
20
|
+
// :ref:`Metadata <envoy_v3_api_msg_config.core.v3.Metadata>`. It uses ``filter`` and ``path`` to retrieve the value
|
|
21
|
+
// from the ``Metadata`` and then check if it's matched to the specified value.
|
|
22
|
+
//
|
|
23
|
+
// For example, for the following ``Metadata``:
|
|
24
|
+
//
|
|
25
|
+
// .. code-block:: yaml
|
|
26
|
+
//
|
|
27
|
+
// filter_metadata:
|
|
28
|
+
// envoy.filters.http.rbac:
|
|
29
|
+
// fields:
|
|
30
|
+
// a:
|
|
31
|
+
// struct_value:
|
|
32
|
+
// fields:
|
|
33
|
+
// b:
|
|
34
|
+
// struct_value:
|
|
35
|
+
// fields:
|
|
36
|
+
// c:
|
|
37
|
+
// string_value: pro
|
|
38
|
+
// t:
|
|
39
|
+
// list_value:
|
|
40
|
+
// values:
|
|
41
|
+
// - string_value: m
|
|
42
|
+
// - string_value: n
|
|
43
|
+
//
|
|
44
|
+
// The following ``MetadataMatcher`` is matched as the path ``[a, b, c]`` will retrieve a string value ``pro``
|
|
45
|
+
// from the ``Metadata`` which is matched to the specified prefix match.
|
|
46
|
+
//
|
|
47
|
+
// .. code-block:: yaml
|
|
48
|
+
//
|
|
49
|
+
// filter: envoy.filters.http.rbac
|
|
50
|
+
// path:
|
|
51
|
+
// - key: a
|
|
52
|
+
// - key: b
|
|
53
|
+
// - key: c
|
|
54
|
+
// value:
|
|
55
|
+
// string_match:
|
|
56
|
+
// prefix: pr
|
|
57
|
+
//
|
|
58
|
+
// The following ``MetadataMatcher`` is matched as the code will match one of the string values in the
|
|
59
|
+
// list at the path [a, t].
|
|
60
|
+
//
|
|
61
|
+
// .. code-block:: yaml
|
|
62
|
+
//
|
|
63
|
+
// filter: envoy.filters.http.rbac
|
|
64
|
+
// path:
|
|
65
|
+
// - key: a
|
|
66
|
+
// - key: t
|
|
67
|
+
// value:
|
|
68
|
+
// list_match:
|
|
69
|
+
// one_of:
|
|
70
|
+
// string_match:
|
|
71
|
+
// exact: m
|
|
72
|
+
//
|
|
73
|
+
// An example use of ``MetadataMatcher`` is specifying additional metadata in ``envoy.filters.http.rbac`` to
|
|
74
|
+
// enforce access control based on dynamic metadata in a request. See :ref:`Permission
|
|
75
|
+
// <envoy_v3_api_msg_config.rbac.v3.Permission>` and :ref:`Principal
|
|
76
|
+
// <envoy_v3_api_msg_config.rbac.v3.Principal>`.
|
|
77
|
+
|
|
78
|
+
// [#next-major-version: MetadataMatcher should use StructMatcher]
|
|
79
|
+
message MetadataMatcher {
|
|
80
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.type.matcher.MetadataMatcher";
|
|
81
|
+
|
|
82
|
+
// Specifies the segment in a path to retrieve value from ``Metadata``.
|
|
83
|
+
//
|
|
84
|
+
// .. note::
|
|
85
|
+
// Currently it's not supported to retrieve a value from a list in ``Metadata``. This means that
|
|
86
|
+
// if the segment key refers to a list, it has to be the last segment in a path.
|
|
87
|
+
message PathSegment {
|
|
88
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
89
|
+
"envoy.type.matcher.MetadataMatcher.PathSegment";
|
|
90
|
+
|
|
91
|
+
oneof segment {
|
|
92
|
+
option (validate.required) = true;
|
|
93
|
+
|
|
94
|
+
// If specified, use the key to retrieve the value in a ``Struct``.
|
|
95
|
+
string key = 1 [(validate.rules).string = {min_len: 1}];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// The filter name to retrieve the ``Struct`` from the ``Metadata``.
|
|
100
|
+
string filter = 1 [(validate.rules).string = {min_len: 1}];
|
|
101
|
+
|
|
102
|
+
// The path to retrieve the ``Value`` from the ``Struct``.
|
|
103
|
+
repeated PathSegment path = 2 [(validate.rules).repeated = {min_items: 1}];
|
|
104
|
+
|
|
105
|
+
// The ``MetadataMatcher`` is matched if the value retrieved by path is matched to this value.
|
|
106
|
+
ValueMatcher value = 3 [(validate.rules).message = {required: true}];
|
|
107
|
+
|
|
108
|
+
// If true, the match result will be inverted.
|
|
109
|
+
bool invert = 4;
|
|
110
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package envoy.type.matcher.v3;
|
|
4
|
+
|
|
5
|
+
import "envoy/type/matcher/v3/string.proto";
|
|
6
|
+
import "envoy/type/matcher/v3/struct.proto";
|
|
7
|
+
|
|
8
|
+
import "udpa/annotations/status.proto";
|
|
9
|
+
import "udpa/annotations/versioning.proto";
|
|
10
|
+
|
|
11
|
+
option java_package = "io.envoyproxy.envoy.type.matcher.v3";
|
|
12
|
+
option java_outer_classname = "NodeProto";
|
|
13
|
+
option java_multiple_files = true;
|
|
14
|
+
option go_package = "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3;matcherv3";
|
|
15
|
+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
|
|
16
|
+
|
|
17
|
+
// [#protodoc-title: Node matcher]
|
|
18
|
+
|
|
19
|
+
// Specifies the way to match a Node.
|
|
20
|
+
// The match follows AND semantics.
|
|
21
|
+
message NodeMatcher {
|
|
22
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.type.matcher.NodeMatcher";
|
|
23
|
+
|
|
24
|
+
// Specifies match criteria on the node id.
|
|
25
|
+
StringMatcher node_id = 1;
|
|
26
|
+
|
|
27
|
+
// Specifies match criteria on the node metadata.
|
|
28
|
+
repeated StructMatcher node_metadatas = 2;
|
|
29
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package envoy.type.matcher.v3;
|
|
4
|
+
|
|
5
|
+
import "envoy/type/v3/range.proto";
|
|
6
|
+
|
|
7
|
+
import "udpa/annotations/status.proto";
|
|
8
|
+
import "udpa/annotations/versioning.proto";
|
|
9
|
+
import "validate/validate.proto";
|
|
10
|
+
|
|
11
|
+
option java_package = "io.envoyproxy.envoy.type.matcher.v3";
|
|
12
|
+
option java_outer_classname = "NumberProto";
|
|
13
|
+
option java_multiple_files = true;
|
|
14
|
+
option go_package = "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3;matcherv3";
|
|
15
|
+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
|
|
16
|
+
|
|
17
|
+
// [#protodoc-title: Number matcher]
|
|
18
|
+
|
|
19
|
+
// Specifies the way to match a double value.
|
|
20
|
+
message DoubleMatcher {
|
|
21
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.type.matcher.DoubleMatcher";
|
|
22
|
+
|
|
23
|
+
oneof match_pattern {
|
|
24
|
+
option (validate.required) = true;
|
|
25
|
+
|
|
26
|
+
// If specified, the input double value must be in the range specified here.
|
|
27
|
+
// Note: The range is using half-open interval semantics [start, end).
|
|
28
|
+
type.v3.DoubleRange range = 1;
|
|
29
|
+
|
|
30
|
+
// If specified, the input double value must be equal to the value specified here.
|
|
31
|
+
double exact = 2;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package envoy.type.matcher.v3;
|
|
4
|
+
|
|
5
|
+
import "envoy/type/matcher/v3/string.proto";
|
|
6
|
+
|
|
7
|
+
import "udpa/annotations/status.proto";
|
|
8
|
+
import "udpa/annotations/versioning.proto";
|
|
9
|
+
import "validate/validate.proto";
|
|
10
|
+
|
|
11
|
+
option java_package = "io.envoyproxy.envoy.type.matcher.v3";
|
|
12
|
+
option java_outer_classname = "PathProto";
|
|
13
|
+
option java_multiple_files = true;
|
|
14
|
+
option go_package = "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3;matcherv3";
|
|
15
|
+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
|
|
16
|
+
|
|
17
|
+
// [#protodoc-title: Path matcher]
|
|
18
|
+
|
|
19
|
+
// Specifies the way to match a path on HTTP request.
|
|
20
|
+
message PathMatcher {
|
|
21
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.type.matcher.PathMatcher";
|
|
22
|
+
|
|
23
|
+
oneof rule {
|
|
24
|
+
option (validate.required) = true;
|
|
25
|
+
|
|
26
|
+
// The ``path`` must match the URL path portion of the :path header. The query and fragment
|
|
27
|
+
// string (if present) are removed in the URL path portion.
|
|
28
|
+
// For example, the path ``/data`` will match the ``:path`` header ``/data#fragment?param=value``.
|
|
29
|
+
StringMatcher path = 1 [(validate.rules).message = {required: true}];
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package envoy.type.matcher.v3;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/wrappers.proto";
|
|
6
|
+
|
|
7
|
+
import "envoy/annotations/deprecation.proto";
|
|
8
|
+
import "udpa/annotations/status.proto";
|
|
9
|
+
import "udpa/annotations/versioning.proto";
|
|
10
|
+
import "validate/validate.proto";
|
|
11
|
+
|
|
12
|
+
option java_package = "io.envoyproxy.envoy.type.matcher.v3";
|
|
13
|
+
option java_outer_classname = "RegexProto";
|
|
14
|
+
option java_multiple_files = true;
|
|
15
|
+
option go_package = "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3;matcherv3";
|
|
16
|
+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
|
|
17
|
+
|
|
18
|
+
// [#protodoc-title: Regex matcher]
|
|
19
|
+
|
|
20
|
+
// A regex matcher designed for safety when used with untrusted input.
|
|
21
|
+
message RegexMatcher {
|
|
22
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.type.matcher.RegexMatcher";
|
|
23
|
+
|
|
24
|
+
// Google's `RE2 <https://github.com/google/re2>`_ regex engine. The regex string must adhere to
|
|
25
|
+
// the documented `syntax <https://github.com/google/re2/wiki/Syntax>`_. The engine is designed
|
|
26
|
+
// to complete execution in linear time as well as limit the amount of memory used.
|
|
27
|
+
//
|
|
28
|
+
// Envoy supports program size checking via runtime. The runtime keys ``re2.max_program_size.error_level``
|
|
29
|
+
// and ``re2.max_program_size.warn_level`` can be set to integers as the maximum program size or
|
|
30
|
+
// complexity that a compiled regex can have before an exception is thrown or a warning is
|
|
31
|
+
// logged, respectively. ``re2.max_program_size.error_level`` defaults to 100, and
|
|
32
|
+
// ``re2.max_program_size.warn_level`` has no default if unset (will not check/log a warning).
|
|
33
|
+
//
|
|
34
|
+
// Envoy emits two stats for tracking the program size of regexes: the histogram ``re2.program_size``,
|
|
35
|
+
// which records the program size, and the counter ``re2.exceeded_warn_level``, which is incremented
|
|
36
|
+
// each time the program size exceeds the warn level threshold.
|
|
37
|
+
message GoogleRE2 {
|
|
38
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
39
|
+
"envoy.type.matcher.RegexMatcher.GoogleRE2";
|
|
40
|
+
|
|
41
|
+
// This field controls the RE2 "program size" which is a rough estimate of how complex a
|
|
42
|
+
// compiled regex is to evaluate. A regex that has a program size greater than the configured
|
|
43
|
+
// value will fail to compile. In this case, the configured max program size can be increased
|
|
44
|
+
// or the regex can be simplified. If not specified, the default is 100.
|
|
45
|
+
//
|
|
46
|
+
// This field is deprecated; regexp validation should be performed on the management server
|
|
47
|
+
// instead of being done by each individual client.
|
|
48
|
+
//
|
|
49
|
+
// .. note::
|
|
50
|
+
//
|
|
51
|
+
// Although this field is deprecated, the program size will still be checked against the
|
|
52
|
+
// global ``re2.max_program_size.error_level`` runtime value.
|
|
53
|
+
//
|
|
54
|
+
google.protobuf.UInt32Value max_program_size = 1
|
|
55
|
+
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
oneof engine_type {
|
|
59
|
+
// Google's RE2 regex engine.
|
|
60
|
+
GoogleRE2 google_re2 = 1
|
|
61
|
+
[deprecated = true, (envoy.annotations.deprecated_at_minor_version) = "3.0"];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// The regex match string. The string must be supported by the configured engine. The regex is matched
|
|
65
|
+
// against the full string, not as a partial match.
|
|
66
|
+
string regex = 2 [(validate.rules).string = {min_len: 1}];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Describes how to match a string and then produce a new string using a regular
|
|
70
|
+
// expression and a substitution string.
|
|
71
|
+
message RegexMatchAndSubstitute {
|
|
72
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
73
|
+
"envoy.type.matcher.RegexMatchAndSubstitute";
|
|
74
|
+
|
|
75
|
+
// The regular expression used to find portions of a string (hereafter called
|
|
76
|
+
// the "subject string") that should be replaced. When a new string is
|
|
77
|
+
// produced during the substitution operation, the new string is initially
|
|
78
|
+
// the same as the subject string, but then all matches in the subject string
|
|
79
|
+
// are replaced by the substitution string. If replacing all matches isn't
|
|
80
|
+
// desired, regular expression anchors can be used to ensure a single match,
|
|
81
|
+
// so as to replace just one occurrence of a pattern. Capture groups can be
|
|
82
|
+
// used in the pattern to extract portions of the subject string, and then
|
|
83
|
+
// referenced in the substitution string.
|
|
84
|
+
RegexMatcher pattern = 1 [(validate.rules).message = {required: true}];
|
|
85
|
+
|
|
86
|
+
// The string that should be substituted into matching portions of the
|
|
87
|
+
// subject string during a substitution operation to produce a new string.
|
|
88
|
+
// Capture groups in the pattern can be referenced in the substitution
|
|
89
|
+
// string. Note, however, that the syntax for referring to capture groups is
|
|
90
|
+
// defined by the chosen regular expression engine. Google's `RE2
|
|
91
|
+
// <https://github.com/google/re2>`_ regular expression engine uses a
|
|
92
|
+
// backslash followed by the capture group number to denote a numbered
|
|
93
|
+
// capture group. E.g., ``\1`` refers to capture group 1, and ``\2`` refers
|
|
94
|
+
// to capture group 2.
|
|
95
|
+
string substitution = 2
|
|
96
|
+
[(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];
|
|
97
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package envoy.type.matcher.v3;
|
|
4
|
+
|
|
5
|
+
import "udpa/annotations/status.proto";
|
|
6
|
+
|
|
7
|
+
option java_package = "io.envoyproxy.envoy.type.matcher.v3";
|
|
8
|
+
option java_outer_classname = "StatusCodeInputProto";
|
|
9
|
+
option java_multiple_files = true;
|
|
10
|
+
option go_package = "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3;matcherv3";
|
|
11
|
+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
|
|
12
|
+
|
|
13
|
+
// [#protodoc-title: Common HTTP Inputs]
|
|
14
|
+
|
|
15
|
+
// Match input indicates that matching should be done on the response status
|
|
16
|
+
// code.
|
|
17
|
+
message HttpResponseStatusCodeMatchInput {
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Match input indicates that the matching should be done on the class of the
|
|
21
|
+
// response status code. For eg: 1xx, 2xx, 3xx, 4xx or 5xx.
|
|
22
|
+
message HttpResponseStatusCodeClassMatchInput {
|
|
23
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package envoy.type.matcher.v3;
|
|
4
|
+
|
|
5
|
+
import "envoy/type/matcher/v3/regex.proto";
|
|
6
|
+
|
|
7
|
+
import "xds/core/v3/extension.proto";
|
|
8
|
+
|
|
9
|
+
import "udpa/annotations/status.proto";
|
|
10
|
+
import "udpa/annotations/versioning.proto";
|
|
11
|
+
import "validate/validate.proto";
|
|
12
|
+
|
|
13
|
+
option java_package = "io.envoyproxy.envoy.type.matcher.v3";
|
|
14
|
+
option java_outer_classname = "StringProto";
|
|
15
|
+
option java_multiple_files = true;
|
|
16
|
+
option go_package = "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3;matcherv3";
|
|
17
|
+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
|
|
18
|
+
|
|
19
|
+
// [#protodoc-title: String matcher]
|
|
20
|
+
|
|
21
|
+
// Specifies the way to match a string.
|
|
22
|
+
// [#next-free-field: 9]
|
|
23
|
+
message StringMatcher {
|
|
24
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.type.matcher.StringMatcher";
|
|
25
|
+
|
|
26
|
+
reserved 4;
|
|
27
|
+
|
|
28
|
+
reserved "regex";
|
|
29
|
+
|
|
30
|
+
oneof match_pattern {
|
|
31
|
+
option (validate.required) = true;
|
|
32
|
+
|
|
33
|
+
// The input string must match exactly the string specified here.
|
|
34
|
+
//
|
|
35
|
+
// Examples:
|
|
36
|
+
//
|
|
37
|
+
// * ``abc`` only matches the value ``abc``.
|
|
38
|
+
string exact = 1;
|
|
39
|
+
|
|
40
|
+
// The input string must have the prefix specified here.
|
|
41
|
+
//
|
|
42
|
+
// .. note::
|
|
43
|
+
//
|
|
44
|
+
// Empty prefix match is not allowed, please use ``safe_regex`` instead.
|
|
45
|
+
//
|
|
46
|
+
// Examples:
|
|
47
|
+
//
|
|
48
|
+
// * ``abc`` matches the value ``abc.xyz``
|
|
49
|
+
string prefix = 2 [(validate.rules).string = {min_len: 1}];
|
|
50
|
+
|
|
51
|
+
// The input string must have the suffix specified here.
|
|
52
|
+
//
|
|
53
|
+
// .. note::
|
|
54
|
+
//
|
|
55
|
+
// Empty suffix match is not allowed, please use ``safe_regex`` instead.
|
|
56
|
+
//
|
|
57
|
+
// Examples:
|
|
58
|
+
//
|
|
59
|
+
// * ``abc`` matches the value ``xyz.abc``
|
|
60
|
+
string suffix = 3 [(validate.rules).string = {min_len: 1}];
|
|
61
|
+
|
|
62
|
+
// The input string must match the regular expression specified here.
|
|
63
|
+
RegexMatcher safe_regex = 5 [(validate.rules).message = {required: true}];
|
|
64
|
+
|
|
65
|
+
// The input string must have the substring specified here.
|
|
66
|
+
//
|
|
67
|
+
// .. note::
|
|
68
|
+
//
|
|
69
|
+
// Empty contains match is not allowed, please use ``safe_regex`` instead.
|
|
70
|
+
//
|
|
71
|
+
// Examples:
|
|
72
|
+
//
|
|
73
|
+
// * ``abc`` matches the value ``xyz.abc.def``
|
|
74
|
+
string contains = 7 [(validate.rules).string = {min_len: 1}];
|
|
75
|
+
|
|
76
|
+
// Use an extension as the matcher type.
|
|
77
|
+
// [#extension-category: envoy.string_matcher]
|
|
78
|
+
xds.core.v3.TypedExtensionConfig custom = 8;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// If ``true``, indicates the exact/prefix/suffix/contains matching should be case insensitive. This
|
|
82
|
+
// has no effect for the ``safe_regex`` match.
|
|
83
|
+
// For example, the matcher ``data`` will match both input string ``Data`` and ``data`` if this option
|
|
84
|
+
// is set to ``true``.
|
|
85
|
+
bool ignore_case = 6;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Specifies a list of ways to match a string.
|
|
89
|
+
message ListStringMatcher {
|
|
90
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
91
|
+
"envoy.type.matcher.ListStringMatcher";
|
|
92
|
+
|
|
93
|
+
repeated StringMatcher patterns = 1 [(validate.rules).repeated = {min_items: 1}];
|
|
94
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package envoy.type.matcher.v3;
|
|
4
|
+
|
|
5
|
+
import "envoy/type/matcher/v3/value.proto";
|
|
6
|
+
|
|
7
|
+
import "udpa/annotations/status.proto";
|
|
8
|
+
import "udpa/annotations/versioning.proto";
|
|
9
|
+
import "validate/validate.proto";
|
|
10
|
+
|
|
11
|
+
option java_package = "io.envoyproxy.envoy.type.matcher.v3";
|
|
12
|
+
option java_outer_classname = "StructProto";
|
|
13
|
+
option java_multiple_files = true;
|
|
14
|
+
option go_package = "github.com/envoyproxy/go-control-plane/envoy/type/matcher/v3;matcherv3";
|
|
15
|
+
option (udpa.annotations.file_status).package_version_status = ACTIVE;
|
|
16
|
+
|
|
17
|
+
// [#protodoc-title: Struct matcher]
|
|
18
|
+
|
|
19
|
+
// StructMatcher provides a general interface to check if a given value is matched in
|
|
20
|
+
// google.protobuf.Struct. It uses ``path`` to retrieve the value
|
|
21
|
+
// from the struct and then check if it's matched to the specified value.
|
|
22
|
+
//
|
|
23
|
+
// For example, for the following Struct:
|
|
24
|
+
//
|
|
25
|
+
// .. code-block:: yaml
|
|
26
|
+
//
|
|
27
|
+
// fields:
|
|
28
|
+
// a:
|
|
29
|
+
// struct_value:
|
|
30
|
+
// fields:
|
|
31
|
+
// b:
|
|
32
|
+
// struct_value:
|
|
33
|
+
// fields:
|
|
34
|
+
// c:
|
|
35
|
+
// string_value: pro
|
|
36
|
+
// t:
|
|
37
|
+
// list_value:
|
|
38
|
+
// values:
|
|
39
|
+
// - string_value: m
|
|
40
|
+
// - string_value: n
|
|
41
|
+
//
|
|
42
|
+
// The following MetadataMatcher is matched as the path [a, b, c] will retrieve a string value "pro"
|
|
43
|
+
// from the Metadata which is matched to the specified prefix match.
|
|
44
|
+
//
|
|
45
|
+
// .. code-block:: yaml
|
|
46
|
+
//
|
|
47
|
+
// path:
|
|
48
|
+
// - key: a
|
|
49
|
+
// - key: b
|
|
50
|
+
// - key: c
|
|
51
|
+
// value:
|
|
52
|
+
// string_match:
|
|
53
|
+
// prefix: pr
|
|
54
|
+
//
|
|
55
|
+
// The following StructMatcher is matched as the code will match one of the string values in the
|
|
56
|
+
// list at the path [a, t].
|
|
57
|
+
//
|
|
58
|
+
// .. code-block:: yaml
|
|
59
|
+
//
|
|
60
|
+
// path:
|
|
61
|
+
// - key: a
|
|
62
|
+
// - key: t
|
|
63
|
+
// value:
|
|
64
|
+
// list_match:
|
|
65
|
+
// one_of:
|
|
66
|
+
// string_match:
|
|
67
|
+
// exact: m
|
|
68
|
+
//
|
|
69
|
+
// An example use of StructMatcher is to match metadata in envoy.v*.core.Node.
|
|
70
|
+
message StructMatcher {
|
|
71
|
+
option (udpa.annotations.versioning).previous_message_type = "envoy.type.matcher.StructMatcher";
|
|
72
|
+
|
|
73
|
+
// Specifies the segment in a path to retrieve value from Struct.
|
|
74
|
+
message PathSegment {
|
|
75
|
+
option (udpa.annotations.versioning).previous_message_type =
|
|
76
|
+
"envoy.type.matcher.StructMatcher.PathSegment";
|
|
77
|
+
|
|
78
|
+
oneof segment {
|
|
79
|
+
option (validate.required) = true;
|
|
80
|
+
|
|
81
|
+
// If specified, use the key to retrieve the value in a Struct.
|
|
82
|
+
string key = 1 [(validate.rules).string = {min_len: 1}];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// The path to retrieve the Value from the Struct.
|
|
87
|
+
repeated PathSegment path = 2 [(validate.rules).repeated = {min_items: 1}];
|
|
88
|
+
|
|
89
|
+
// The StructMatcher is matched if the value retrieved by path is matched to this value.
|
|
90
|
+
ValueMatcher value = 3 [(validate.rules).message = {required: true}];
|
|
91
|
+
}
|