forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidation.proto
106 lines (84 loc) · 4.55 KB
/
validation.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
syntax = "proto3";
package envoy.RouterCheckToolSchema;
import "envoy/api/v2/core/base.proto";
import "google/protobuf/wrappers.proto";
import "validate/validate.proto";
// [#protodoc-title: RouterCheckTool Validation]
// The Validation Schema of the envoy router check test files.
// The accepted input formats for the test are json and yaml.
// The tool transparently converts json/yaml into this proto schema.
message Validation {
// A collection of test cases.
repeated ValidationItem tests = 1 [(validate.rules).repeated .min_items = 1];
}
// Schema for each test case.
message ValidationItem {
// Name of the test case. There is no uniqueness constraint among the test case names.
// The name has to be non empty.
string test_name = 1 [(validate.rules).string.min_bytes = 1];
// The input constraints of the test case.
ValidationInput input = 2 [(validate.rules).message.required = true];
// The validations that need to be performed on the resultant route.
ValidationAssert validate = 3 [(validate.rules).message.required = true];
}
// Input values sent to the router that determine the returned route.
// This includes the `pseudo-header <https://http2.github.io/http2-spec/#HttpRequest>`_ fields
// defined in HTTP2.
message ValidationInput {
// This pseudo-header field includes the authority portion of the target URI.
// Clients that generate HTTP/2 requests directly SHOULD use the :authority pseudo-header field
// instead of the Host header field.
string authority = 1 [(validate.rules).string.min_bytes = 1];
// The :path pseudo-header field includes the path and query parts of the target URI.
// This pseudo-header field MUST NOT be empty for http or https URIs.
// http or https URIs that do not contain a path component MUST include a value of '/'
// The exception to this rule is an OPTIONS request for an http or https URI that does not include
// a path component.
string path = 2 [(validate.rules).string.min_bytes = 1];
// This pseudo-header field includes the HTTP method.
string method = 4 [(validate.rules).string.min_bytes = 3];
// An integer used to identify the target for weighted cluster selection.
// The default value of random_value is 0.
uint64 random_value = 5;
// A flag that determines whether to set x-forwarded-proto to https or http.
// By setting x-forwarded-proto to a given protocol, the tool is able to simulate the behavior of
// a client issuing a request via http or https. By default ssl is false which corresponds to
// x-forwarded-proto set to http.
bool ssl = 6;
// A flag that determines whether to set x-envoy-internal to “true”.
// If not specified, or if internal is equal to false, x-envoy-internal is not set.
bool internal = 7;
// Additional headers to be added as input for route determination.
// The “:authority”, “:path”, “:method”, “x-forwarded-proto”, and “x-envoy-internal” fields are
// specified by the other config options and should not be set here.
repeated envoy.api.v2.core.HeaderValue additional_headers = 8;
// Runtime setting key to enable for the test case.
// If a route depends on the runtime, the route will be enabled based on the random_value defined
// in the test. Only a random_value less than the fractional percentage will enable the route.
string runtime = 9;
}
// The validate object specifies the returned route parameters to match.
// At least one test parameter must be specified.
// Use “” (empty string) to indicate that no return value is expected.
// For example, to test that no cluster match is expected use {“cluster_name”: “”}.
message ValidationAssert {
// Match the cluster name.
google.protobuf.StringValue cluster_name = 1;
// Match the virtual cluster name.
google.protobuf.StringValue virtual_cluster_name = 2;
// Match the virtual host name.
google.protobuf.StringValue virtual_host_name = 3;
// Match the host header field after rewrite.
google.protobuf.StringValue host_rewrite = 4;
// Match the path header field after rewrite.
google.protobuf.StringValue path_rewrite = 5;
// Match the returned redirect path.
google.protobuf.StringValue path_redirect = 6;
// Match the listed header fields.
// Examples header fields include the “:path”, “cookie”, and “date” fields.
// The header fields are checked after all other test cases.
// Thus, the header fields checked will be those of the redirected or rewritten routes when
// applicable.
repeated envoy.api.v2.core.HeaderValue header_fields = 7;
repeated envoy.api.v2.core.HeaderValue custom_header_fields = 8;
}