2023-07-21 16:21:39 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-21 17:31:54 +00:00
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
2023-07-21 16:21:39 +00:00
|
|
|
|
|
|
|
syntax = "proto3";
|
|
|
|
|
2023-09-22 16:51:15 +00:00
|
|
|
package hashicorp.consul.mesh.v2beta1.pbproxystate;
|
2023-07-21 16:21:39 +00:00
|
|
|
|
|
|
|
import "google/protobuf/duration.proto";
|
|
|
|
import "google/protobuf/wrappers.proto";
|
2023-09-22 16:51:15 +00:00
|
|
|
import "pbmesh/v2beta1/pbproxystate/cluster.proto";
|
|
|
|
import "pbmesh/v2beta1/pbproxystate/header_mutations.proto";
|
2023-07-21 16:21:39 +00:00
|
|
|
|
|
|
|
message Route {
|
|
|
|
// virtual_hosts is a list of virtual hosts. A virtual host is selected based on an incoming request's host header.
|
2023-08-01 17:35:17 +00:00
|
|
|
repeated VirtualHost virtual_hosts = 1;
|
2023-07-21 16:21:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message VirtualHost {
|
|
|
|
string name = 1;
|
|
|
|
// domains are used to match an incoming request's host header and determine which virtual host to use.
|
|
|
|
repeated string domains = 2;
|
|
|
|
// header_mutations to apply to the request when it matches this virtual host. These are applied after any headers in
|
|
|
|
// the RouteRule.
|
|
|
|
repeated HeaderMutation header_mutations = 3;
|
|
|
|
// route_rules are a list of rules to use for what to do next with this request. The first rule with a match will be
|
|
|
|
// used.
|
|
|
|
repeated RouteRule route_rules = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message RouteRule {
|
|
|
|
// match determines how to match the request. The first match determines which destination the request will go to.
|
|
|
|
RouteMatch match = 1;
|
|
|
|
// destination is where to send the request to.
|
|
|
|
RouteDestination destination = 2;
|
|
|
|
// header_mutations to apply to the request. These are applied before the VirtualHost header mutations.
|
|
|
|
repeated HeaderMutation header_mutations = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// RouteMatch has configuration to match a request.
|
|
|
|
message RouteMatch {
|
|
|
|
PathMatch path_match = 1;
|
|
|
|
repeated HeaderMatch header_matches = 2;
|
|
|
|
repeated string method_matches = 3;
|
|
|
|
repeated QueryParameterMatch query_parameter_matches = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message PathMatch {
|
|
|
|
oneof path_match {
|
|
|
|
string exact = 1;
|
|
|
|
string prefix = 2;
|
|
|
|
string regex = 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message QueryParameterMatch {
|
|
|
|
string name = 1;
|
|
|
|
oneof match {
|
|
|
|
string exact = 2;
|
|
|
|
string regex = 3;
|
|
|
|
bool present = 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message HeaderMatch {
|
|
|
|
string name = 1;
|
|
|
|
oneof match {
|
|
|
|
string exact = 2;
|
|
|
|
string prefix = 3;
|
|
|
|
string suffix = 4;
|
|
|
|
string regex = 5;
|
|
|
|
bool present = 6;
|
|
|
|
}
|
|
|
|
bool invert_match = 7;
|
|
|
|
}
|
|
|
|
|
|
|
|
// RouteDestination has configuration for where to send a request.
|
|
|
|
message RouteDestination {
|
|
|
|
// destination is one or more clusters to route to.
|
|
|
|
oneof destination {
|
|
|
|
DestinationCluster cluster = 1;
|
|
|
|
L7WeightedClusterGroup weighted_clusters = 2;
|
|
|
|
}
|
|
|
|
DestinationConfiguration destination_configuration = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DestinationConfiguration {
|
|
|
|
google.protobuf.BoolValue auto_host_rewrite = 1;
|
|
|
|
repeated LoadBalancerHashPolicy hash_policies = 2;
|
|
|
|
TimeoutConfig timeout_config = 3;
|
|
|
|
string prefix_rewrite = 4;
|
|
|
|
RetryPolicy retry_policy = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
message RetryPolicy {
|
|
|
|
string retry_on = 1;
|
|
|
|
google.protobuf.UInt32Value num_retries = 2;
|
|
|
|
repeated uint32 retriable_status_codes = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message TimeoutConfig {
|
2023-10-13 14:55:58 +00:00
|
|
|
// +kubebuilder:validation:Format=duration
|
2023-07-21 16:21:39 +00:00
|
|
|
google.protobuf.Duration timeout = 1;
|
2023-10-13 14:55:58 +00:00
|
|
|
// +kubebuilder:validation:Format=duration
|
2023-07-21 16:21:39 +00:00
|
|
|
google.protobuf.Duration idle_timeout = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message LoadBalancerHashPolicy {
|
|
|
|
oneof policy {
|
|
|
|
CookiePolicy cookie = 1;
|
|
|
|
HeaderPolicy header = 2;
|
|
|
|
QueryParameterPolicy query_parameter = 3;
|
|
|
|
ConnectionPropertiesPolicy connection_properties = 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message CookiePolicy {
|
|
|
|
string name = 1;
|
2023-10-13 14:55:58 +00:00
|
|
|
// +kubebuilder:validation:Format=duration
|
2023-07-21 16:21:39 +00:00
|
|
|
google.protobuf.Duration ttl = 2;
|
|
|
|
string path = 3;
|
|
|
|
bool terminal = 4;
|
|
|
|
}
|
|
|
|
message HeaderPolicy {
|
|
|
|
string name = 1;
|
|
|
|
bool terminal = 2;
|
|
|
|
}
|
|
|
|
message QueryParameterPolicy {
|
|
|
|
string name = 1;
|
|
|
|
bool terminal = 2;
|
|
|
|
}
|
|
|
|
message ConnectionPropertiesPolicy {
|
|
|
|
bool source_ip = 1;
|
|
|
|
bool terminal = 2;
|
|
|
|
}
|