// 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.http.kill_request.v3;

import "envoy/type/v3/percent.proto";

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

option java_package = "io.envoyproxy.envoy.extensions.filters.http.kill_request.v3";
option java_outer_classname = "KillRequestProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/kill_request/v3;kill_requestv3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Kill Request]
// Kill Request :ref:`configuration overview <config_http_filters_kill_request>`.
// [#extension: envoy.filters.http.kill_request]

// Configuration for KillRequest filter.
message KillRequest {
  // On which direction should the filter check for the ``kill_request_header``.
  // Default to ``REQUEST`` if unspecified.
  enum Direction {
    REQUEST = 0;
    RESPONSE = 1;
  }

  // The probability that a Kill request will be triggered.
  type.v3.FractionalPercent probability = 1;

  // The name of the kill request header. If this field is not empty, it will override the :ref:`default header <config_http_filters_kill_request_http_header>` name. Otherwise the default header name will be used.
  string kill_request_header = 2
      [(validate.rules).string = {well_known_regex: HTTP_HEADER_VALUE strict: false}];

  Direction direction = 3 [(validate.rules).enum = {defined_only: true}];
}
