syntax = "proto3";

package envoy.extensions.filters.http.stateful_session.v3;

import "envoy/config/core/v3/extension.proto";

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

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

// [#protodoc-title: Stateful session filter]
// Stateful session :ref:`configuration overview <config_http_filters_stateful_session>`.
// [#extension: envoy.filters.http.stateful_session]

message StatefulSession {
  // Specific implementation of session state. This session state will be used to store and
  // get address of the upstream host to which the session is assigned.
  //
  // [#extension-category: envoy.http.stateful_session]
  config.core.v3.TypedExtensionConfig session_state = 1
      [(validate.rules).message = {required: true}];
}

message StatefulSessionPerRoute {
  oneof override {
    option (validate.required) = true;

    // Disable the stateful session filter for this particular vhost or route. If disabled is
    // specified in multiple per-filter-configs, the most specific one will be used.
    bool disabled = 1 [(validate.rules).bool = {const: true}];

    // Per-route stateful session configuration that can be served by RDS or static route table.
    StatefulSession stateful_session = 2;
  }
}
