|
| 1 | +syntax = "proto3"; |
| 2 | + |
| 3 | +package envoy.extensions.reverse_tunnel_reporters.v3alpha.clients.grpc_client; |
| 4 | + |
| 5 | +import "envoy/config/core/v3/base.proto"; |
| 6 | + |
| 7 | +import "google/protobuf/duration.proto"; |
| 8 | +import "google/protobuf/struct.proto"; |
| 9 | +import "google/protobuf/timestamp.proto"; |
| 10 | +import "google/rpc/status.proto"; |
| 11 | + |
| 12 | +import "udpa/annotations/status.proto"; |
| 13 | +import "validate/validate.proto"; |
| 14 | + |
| 15 | +option java_package = "io.envoyproxy.envoy.extensions.reverse_tunnel_reporters.v3alpha.clients.grpc_client"; |
| 16 | +option java_outer_classname = "StreamReverseTunnelsProto"; |
| 17 | +option java_multiple_files = true; |
| 18 | +option go_package = "github.com/envoyproxy/go-control-plane/contrib/envoy/extensions/reverse_tunnel_reporters/v3alpha/clients/grpc_client"; |
| 19 | +option (udpa.annotations.file_status).package_version_status = ACTIVE; |
| 20 | + |
| 21 | +// [#protodoc-title: Reverse Tunnel Reporting Service] |
| 22 | + |
| 23 | +// ReverseTunnelReportingService allows Envoy instances to report reverse tunnel |
| 24 | +// connection state changes to a management server for monitoring and coordination. |
| 25 | +service ReverseTunnelReportingService { |
| 26 | + // Bidirectional stream for reporting reverse tunnel connection state changes. |
| 27 | + // The management server can control reporting intervals and acknowledge received reports. |
| 28 | + rpc StreamReverseTunnels(stream StreamReverseTunnelsRequest) |
| 29 | + returns (stream StreamReverseTunnelsResponse) { |
| 30 | + } |
| 31 | +} |
| 32 | + |
| 33 | +// Request message sent by Envoy to report reverse tunnel state changes. |
| 34 | +// [#next-free-field: 7] |
| 35 | +message StreamReverseTunnelsRequest { |
| 36 | + // Node identifier for the reporting Envoy instance. |
| 37 | + // This identifies which Envoy instance is sending the report. |
| 38 | + config.core.v3.Node node = 1 [(validate.rules).message = {required: true}]; |
| 39 | + |
| 40 | + // List of reverse tunnels that were established since the last report. |
| 41 | + // Each tunnel represents a new connection from a downstream Envoy. |
| 42 | + repeated ReverseTunnel added_tunnels = 2; |
| 43 | + |
| 44 | + // List of tunnel names that were disconnected since the last report. |
| 45 | + // Only the tunnel name is needed for removal notifications. |
| 46 | + repeated string removed_tunnel_names = 3 |
| 47 | + [(validate.rules).repeated = {items {string {min_len: 1}}}]; |
| 48 | + |
| 49 | + // Optional metadata for additional context or debugging information. |
| 50 | + // Can include deployment information, version details, etc. |
| 51 | + google.protobuf.Struct metadata = 4; |
| 52 | + |
| 53 | + // Indicates whether this report contains all active tunnels (true) or |
| 54 | + // only changes since the last report (false). Usually invoked only on server disconnects. |
| 55 | + bool full_push = 5; |
| 56 | + |
| 57 | + // Unique nonce for this request to enable proper ACK/NACK handling. |
| 58 | + // Must be non-negative and should increment for each request. |
| 59 | + // This can also be modified to be used for checksum and tracking in the future.a |
| 60 | + int64 nonce = 6 [(validate.rules).int64 = {gte: 0}]; |
| 61 | +} |
| 62 | + |
| 63 | +// Response message sent by the management server to control reporting behavior. |
| 64 | +message StreamReverseTunnelsResponse { |
| 65 | + // Node identifier acknowledging which Envoy instance this response is for. |
| 66 | + // Should match the node from the corresponding request. |
| 67 | + config.core.v3.Node node = 1; |
| 68 | + |
| 69 | + // Interval at which Envoy should send tunnel state reports. |
| 70 | + // This is used to change the reporting_interval -> no need to repeat the same value. |
| 71 | + google.protobuf.Duration report_interval = 2 [(validate.rules).duration = {lte {seconds: 3600}}]; |
| 72 | + |
| 73 | + // Nonce from the request being acknowledged or rejected. |
| 74 | + // Must match the nonce from the corresponding request. |
| 75 | + int64 request_nonce = 3 [(validate.rules).int64 = {gte: 0}]; |
| 76 | + |
| 77 | + // Error details if the previous request failed processing. |
| 78 | + // If populated, indicates the request was rejected (NACK). |
| 79 | + // If empty, indicates successful processing (ACK). |
| 80 | + // NACK will terminate the connection -> useful for logging rather than just some disconnect. |
| 81 | + // So basically -> NACK then terminate. |
| 82 | + google.rpc.Status error_detail = 4; |
| 83 | +} |
| 84 | + |
| 85 | +// Represents a single reverse tunnel connection with its metadata. |
| 86 | +message ReverseTunnel { |
| 87 | + // Unique name to identify this tunnel connection. |
| 88 | + // Typically formatted as "{node_id}|{cluster_id}" or similar. |
| 89 | + // Must be unique within the reporting Envoy instance. |
| 90 | + // This is also used for the reporting the disconnection with the associated tunnel initiator. |
| 91 | + string name = 1 [(validate.rules).string = {min_len: 1}]; |
| 92 | + |
| 93 | + // Detailed information about the tunnel connection. |
| 94 | + ReverseTunnelInfo tunnel_info = 2 [(validate.rules).message = {required: true}]; |
| 95 | +} |
| 96 | + |
| 97 | +// Detailed information about a reverse tunnel connection. |
| 98 | +message ReverseTunnelInfo { |
| 99 | + // Identity information of the tunnel initiator (downstream Envoy). |
| 100 | + // Contains node_id, cluster_id, and tenant_id for proper identification. |
| 101 | + TunnelInitiatorIdentity identity = 1 [(validate.rules).message = {required: true}]; |
| 102 | + |
| 103 | + // Timestamp when this tunnel connection was created. |
| 104 | + // Used for ordering events and debugging connection timing issues. |
| 105 | + google.protobuf.Timestamp created_at = 2 [(validate.rules).timestamp = {required: true}]; |
| 106 | +} |
| 107 | + |
| 108 | +message TunnelInitiatorIdentity { |
| 109 | + // Required: Tenant identifier of the initiating Envoy instance. |
| 110 | + string tenant_id = 1 [(validate.rules).string = {min_len: 1 max_len: 128}]; |
| 111 | + |
| 112 | + // Required: Cluster identifier of the initiating Envoy instance. |
| 113 | + string cluster_id = 2 [(validate.rules).string = {min_len: 1 max_len: 128}]; |
| 114 | + |
| 115 | + // Required: Node identifier of the initiating Envoy instance. |
| 116 | + string node_id = 3 [(validate.rules).string = {min_len: 1 max_len: 128}]; |
| 117 | +} |
0 commit comments