You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/proto-public/pbdataplane/dataplane.proto

124 lines
4.1 KiB

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Package dataplane provides a service on Consul servers for the Consul Dataplane
syntax = "proto3";
package hashicorp.consul.dataplane;
Protobuf Refactoring for Multi-Module Cleanliness (#16302) Protobuf Refactoring for Multi-Module Cleanliness This commit includes the following: Moves all packages that were within proto/ to proto/private Rewrites imports to account for the packages being moved Adds in buf.work.yaml to enable buf workspaces Names the proto-public buf module so that we can override the Go package imports within proto/buf.yaml Bumps the buf version dependency to 1.14.0 (I was trying out the version to see if it would get around an issue - it didn't but it also doesn't break things and it seemed best to keep up with the toolchain changes) Why: In the future we will need to consume other protobuf dependencies such as the Google HTTP annotations for openapi generation or grpc-gateway usage. There were some recent changes to have our own ratelimiting annotations. The two combined were not working when I was trying to use them together (attempting to rebase another branch) Buf workspaces should be the solution to the problem Buf workspaces means that each module will have generated Go code that embeds proto file names relative to the proto dir and not the top level repo root. This resulted in proto file name conflicts in the Go global protobuf type registry. The solution to that was to add in a private/ directory into the path within the proto/ directory. That then required rewriting all the imports. Is this safe? AFAICT yes The gRPC wire protocol doesn't seem to care about the proto file names (although the Go grpc code does tack on the proto file name as Metadata in the ServiceDesc) Other than imports, there were no changes to any generated code as a result of this.
2 years ago
import "annotations/ratelimit/ratelimit.proto";
import "google/protobuf/struct.proto";
import "pbmesh/v2beta1/proxy_configuration.proto";
message GetSupportedDataplaneFeaturesRequest {}
enum DataplaneFeatures {
DATAPLANE_FEATURES_UNSPECIFIED = 0;
DATAPLANE_FEATURES_WATCH_SERVERS = 1;
DATAPLANE_FEATURES_EDGE_CERTIFICATE_MANAGEMENT = 2;
DATAPLANE_FEATURES_ENVOY_BOOTSTRAP_CONFIGURATION = 3;
DATAPLANE_FEATURES_FIPS = 4;
}
message DataplaneFeatureSupport {
DataplaneFeatures feature_name = 1;
bool supported = 2;
}
message GetSupportedDataplaneFeaturesResponse {
repeated DataplaneFeatureSupport supported_dataplane_features = 1;
}
message GetEnvoyBootstrapParamsRequest {
oneof node_spec {
string node_id = 1;
string node_name = 2;
}
// The proxy service ID
string service_id = 3 [deprecated = true];
string proxy_id = 6;
string partition = 4;
string namespace = 5;
}
enum ServiceKind {
// ServiceKind UNSPECIFIED is a sentinel value for when a request
// did not specify a service kind. This will be treated the same
// as if TYPICAL was explicitly used.
SERVICE_KIND_UNSPECIFIED = 0;
// ServiceKind Typical is a typical, classic Consul service. This is
// represented by the absence of a value. This was chosen for ease of
// backwards compatibility: existing services in the catalog would
// default to the typical service.
SERVICE_KIND_TYPICAL = 1;
// ServiceKind Connect Proxy is a proxy for the Connect feature. This
// service proxies another service within Consul and speaks the connect
// protocol.
SERVICE_KIND_CONNECT_PROXY = 2;
// ServiceKind Mesh Gateway is a Mesh Gateway for the Connect feature. This
// service will proxy connections based off the SNI header set by other
// connect proxies.
SERVICE_KIND_MESH_GATEWAY = 3;
// ServiceKind Terminating Gateway is a Terminating Gateway for the Connect
// feature. This service will proxy connections to services outside the mesh.
SERVICE_KIND_TERMINATING_GATEWAY = 4;
// ServiceKind Ingress Gateway is an Ingress Gateway for the Connect feature.
// This service will ingress connections into the service mesh.
SERVICE_KIND_INGRESS_GATEWAY = 5;
Implement APIGateway proxycfg snapshot (#16194) * Stub proxycfg handler for API gateway * Add Service Kind constants/handling for API Gateway * Begin stubbing for SDS * Add new Secret type to xDS order of operations * Continue stubbing of SDS * Iterate on proxycfg handler for API gateway * Handle BoundAPIGateway config entry subscription in proxycfg-glue * Add API gateway to config snapshot validation * Add API gateway to config snapshot clone, leaf, etc. * Subscribe to bound route + cert config entries on bound-api-gateway * Track routes + certs on API gateway config snapshot * Generate DeepCopy() for types used in watch.Map * Watch all active references on api-gateway, unwatch inactive * Track loading of initial bound-api-gateway config entry * Use proper proto package for SDS mapping * Use ResourceReference instead of ServiceName, collect resources * Fix typo, add + remove TODOs * Watch discovery chains for TCPRoute * Add TODO for updating gateway services for api-gateway * make proto * Regenerate deep-copy for proxycfg * Set datacenter on upstream ID from query source * Watch discovery chains for http-route service backends * Add ServiceName getter to HTTP+TCP Service structs * Clean up unwatched discovery chains on API Gateway * Implement watch for ingress leaf certificate * Collect upstreams on http-route + tcp-route updates * Remove unused GatewayServices update handler * Remove unnecessary gateway services logic for API Gateway * Remove outdate TODO * Use .ToIngress where appropriate, including TODO for cleaning up * Cancel before returning error * Remove GatewayServices subscription * Add godoc for handlerAPIGateway functions * Update terminology from Connect => Consul Service Mesh Consistent with terminology changes in https://github.com/hashicorp/consul/pull/12690 * Add missing TODO * Remove duplicate switch case * Rerun deep-copy generator * Use correct property on config snapshot * Remove unnecessary leaf cert watch * Clean up based on code review feedback * Note handler properties that are initialized but set elsewhere * Add TODO for moving helper func into structs pkg * Update generated DeepCopy code * gofmt * Generate DeepCopy() for API gateway listener types * Improve variable name * Regenerate DeepCopy() code * Fix linting issue * Temporarily remove the secret type from resource generation
2 years ago
// ServiceKind API Gateway is an API Gateway for the Connect feature.
// This service will ingress connections in to the service mesh.
SERVICE_KIND_API_GATEWAY = 6;
}
message GetEnvoyBootstrapParamsResponse {
reserved 1;
// deprecated: use identity instead.
// service is used to identify the service (as the local cluster name and
// in metric tags). If the service is a connect proxy it will be the name of
// the proxy's destination service, for gateways it will be the gateway
// service's name.
string service = 2 [deprecated = true];
// identity is used to identify this proxy (as the local cluster name and
// in metric tags). For v1, this should be the service name.
// If the service is a connect proxy it will be the name of
// the proxy's destination service, for gateways it will be the gateway
// service's name.
// For v2, this should be the workload identity name.
string identity = 10;
string namespace = 3;
string partition = 4;
string datacenter = 5;
google.protobuf.Struct config = 6;
hashicorp.consul.mesh.v2beta1.BootstrapConfig bootstrap_config = 11;
reserved 7;
string node_name = 8;
repeated string access_logs = 9;
}
service DataplaneService {
2 years ago
rpc GetSupportedDataplaneFeatures(GetSupportedDataplaneFeaturesRequest) returns (GetSupportedDataplaneFeaturesResponse) {
option (hashicorp.consul.internal.ratelimit.spec) = {
operation_type: OPERATION_TYPE_READ,
operation_category: OPERATION_CATEGORY_DATAPLANE
};
2 years ago
}
2 years ago
rpc GetEnvoyBootstrapParams(GetEnvoyBootstrapParamsRequest) returns (GetEnvoyBootstrapParamsResponse) {
option (hashicorp.consul.internal.ratelimit.spec) = {
operation_type: OPERATION_TYPE_READ,
operation_category: OPERATION_CATEGORY_DATAPLANE
};
2 years ago
}
}