syntax = "proto3";

package envoy.extensions.transport_sockets.dynamic_modules.v3;

import "envoy/extensions/dynamic_modules/v3/dynamic_modules.proto";

import "google/protobuf/any.proto";

import "udpa/annotations/status.proto";
import "validate/validate.proto";

option java_package = "io.envoyproxy.envoy.extensions.transport_sockets.dynamic_modules.v3";
option java_outer_classname = "DynamicModulesProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/dynamic_modules/v3;dynamic_modulesv3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Dynamic Module Transport Socket]
// [#extension: envoy.transport_sockets.dynamic_modules]

// Configuration for a transport socket implemented by a dynamic module. The transport socket
// performs the raw I/O for a connection and may transform the bytes that flow over it, for example
// to implement a custom encryption scheme.
//
// Example:
//
// .. code-block:: yaml
//
//   transport_socket:
//     name: envoy.transport_sockets.dynamic_modules
//     typed_config:
//       "@type": type.googleapis.com/envoy.extensions.transport_sockets.dynamic_modules.v3.DynamicModuleTransportSocket
//       dynamic_module_config:
//         name: my_module
//       transport_socket_name: my_transport_socket
//
message DynamicModuleTransportSocket {
  // Dynamic module configuration. See :ref:`dynamic module configuration
  // <envoy_v3_api_msg_extensions.dynamic_modules.v3.DynamicModuleConfig>` for details.
  envoy.extensions.dynamic_modules.v3.DynamicModuleConfig dynamic_module_config = 1
      [(validate.rules).message = {required: true}];

  // The name of the transport socket implementation in the dynamic module. This is passed to the
  // module's ``envoy_dynamic_module_on_transport_socket_factory_config_new`` function.
  string transport_socket_name = 2 [(validate.rules).string = {min_len: 1}];

  // Optional configuration for the transport socket. This is passed as bytes to the dynamic module.
  // If not specified, no configuration bytes are passed to the module.
  google.protobuf.Any transport_socket_config = 3;

  // Whether the transport socket implements secure transport. Set this to true for modules that
  // provide encryption so that Envoy treats connections using this transport socket as secure. If
  // not specified, defaults to false.
  bool implements_secure_transport = 4;
}
