// Copyright 2025 Envoy Project Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package envoy.extensions.filters.listener.tls_inspector.v3;

import "google/protobuf/wrappers.proto";

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

option java_package = "io.envoyproxy.envoy.extensions.filters.listener.tls_inspector.v3";
option java_outer_classname = "TlsInspectorProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/listener/tls_inspector/v3;tls_inspectorv3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: TLS Inspector Filter]
// Allows detecting whether the transport appears to be TLS or plaintext.
// [#extension: envoy.filters.listener.tls_inspector]

message TlsInspector {
  option (udpa.annotations.versioning).previous_message_type =
      "envoy.config.filter.listener.tls_inspector.v2.TlsInspector";

  // Populate ``JA3`` fingerprint hash using data from the TLS Client Hello packet. Default is false.
  google.protobuf.BoolValue enable_ja3_fingerprinting = 1;

  // Populate ``JA4`` fingerprint hash using data from the TLS Client Hello packet.
  // ``JA4`` is an improved version of ``JA3`` that includes TLS version, ciphers, extensions,
  // and ALPN information in a hex format. Default is false.
  google.protobuf.BoolValue enable_ja4_fingerprinting = 3;

  // The size in bytes of the initial buffer requested by the tls_inspector.
  // If the filter needs to read additional bytes from the socket, the
  // filter will double the buffer up to it's default maximum of 64KiB.
  // If this size is not defined, defaults to maximum 64KiB that the
  // tls inspector will consume.
  google.protobuf.UInt32Value initial_read_buffer_size = 2
      [(validate.rules).uint32 = {lt: 65537 gt: 255}];
}
