consul/proto-public/pbmesh/v1alpha1/pbproxystate/route.proto

137 lines
3.6 KiB
Protocol Buffer
Raw Normal View History

// Copyright (c) HashiCorp, Inc.
[COMPLIANCE] License changes (#18443) * Adding explicit MPL license for sub-package This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Adding explicit MPL license for sub-package This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Updating the license from MPL to Business Source License Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at <Blog URL>, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl. * add missing license headers * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-08-11 13:12:13 +00:00
// SPDX-License-Identifier: BUSL-1.1
syntax = "proto3";
package hashicorp.consul.mesh.v1alpha1.pbproxystate;
import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";
import "pbmesh/v1alpha1/pbproxystate/cluster.proto";
import "pbmesh/v1alpha1/pbproxystate/header_mutations.proto";
message Route {
// virtual_hosts is a list of virtual hosts. A virtual host is selected based on an incoming request's host header.
repeated VirtualHost virtual_hosts = 1;
}
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 {
google.protobuf.Duration timeout = 1;
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;
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;
}
message DestinationCluster {
// name is the name of the cluster. This will be used to look up a cluster in the clusters map.
string name = 1;
}