Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package")

licenses(["notice"]) # Apache 2

api_proto_package(
deps = [
"@com_github_cncf_xds//xds/annotations/v3:pkg",
"@com_github_cncf_xds//udpa/annotations:pkg",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
syntax = "proto3";

package envoy.extensions.filters.http.peer_metadata.v3alpha;

import "xds/annotations/v3/status.proto";
import "udpa/annotations/status.proto";

option java_package = "io.envoyproxy.envoy.extensions.filters.http.peer_metadata.v3alpha";
option java_outer_classname = "PeerMetadataProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/contrib/envoy/extensions/filters/http/peer_metadata/v3alpha";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
option (xds.annotations.v3.file_status).work_in_progress = true;

// [#protodoc-title: Peer Metadata HTTP filter]
//
// Peer metadata provider filter. This filter encapsulates the discovery of the
// peer telemetry attributes for consumption by the telemetry filters.
// [#extension: envoy.filters.http.peer_metadata]

message PeerMetadataConfig {
// DEPRECATED.
// This method uses `baggage` header encoding.
message Baggage {
}

// This method uses the workload metadata xDS. Requires that the bootstrap extension is enabled.
// For downstream discovery, the remote address is the lookup key in xDS.
// For upstream discovery:
//
// * If the upstream host address is an IP, this IP is used as the lookup key;
//
// * If the upstream host address is internal, uses the
// "filter_metadata.tunnel.destination" dynamic metadata value as the lookup key.
message WorkloadDiscovery {
}

// This method uses Istio HTTP metadata exchange headers, e.g. `x-envoy-peer-metadata`. Removes these headers if found.
message IstioHeaders {
// Strip x-envoy-peer-metadata and x-envoy-peer-metadata-id headers on HTTP requests to services outside the mesh.
// Detects upstream clusters with `istio` and `external` filter metadata fields
bool skip_external_clusters = 1;
}

// An exhaustive list of the derivation methods.
message DiscoveryMethod {
oneof method_specifier {
Baggage baggage = 1;
WorkloadDiscovery workload_discovery = 2;
IstioHeaders istio_headers = 3;
}
}

// The order of the derivation of the downstream peer metadata, in the precedence order.
// First successful lookup wins.
repeated DiscoveryMethod downstream_discovery = 1;

// The order of the derivation of the upstream peer metadata, in the precedence order.
// First successful lookup wins.
repeated DiscoveryMethod upstream_discovery = 2;

// An exhaustive list of the metadata propagation methods.
message PropagationMethod {
oneof method_specifier {
IstioHeaders istio_headers = 1;
}
}

// Downstream injection of the metadata via a response header.
repeated PropagationMethod downstream_propagation = 3;

// Upstream injection of the metadata via a request header.
repeated PropagationMethod upstream_propagation = 4;

// True to enable sharing with the upstream.
bool shared_with_upstream = 5;

// Additional labels to be added to the peer metadata to help your understand the traffic.
// e.g. `role`, `location` etc.
repeated string additional_labels = 6;
}
25 changes: 25 additions & 0 deletions contrib/common/metadata_object/source/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_library",
"envoy_contrib_package",
)

licenses(["notice"]) # Apache 2

envoy_contrib_package()

envoy_cc_library(
name = "metadata_object_lib",
srcs = ["metadata_object.cc"],
hdrs = ["metadata_object.h"],
visibility = ["//visibility:public"],
deps = [
"//envoy/common:hashable_interface",
"//envoy/registry",
"//envoy/stream_info:filter_state_interface",
"//source/common/common:hash_lib",
"//source/common/protobuf:utility_lib",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:optional",
],
)
Loading