stateful_session: added strict mode to header based stateful session (#30573)

* Implemented API and added code to handle strict routing to a host.

Signed-off-by: Christoph Pakulski <christoph@tetrate.io>

* Adjusted existing tests.

Signed-off-by: Christoph Pakulski <christoph@tetrate.io>

* Added unit and integration tests for header-based stateful session with strict mode.

Signed-off-by: Christoph Pakulski <christoph@tetrate.io>

* Added release notes.

Signed-off-by: Christoph Pakulski <christoph@tetrate.io>

* Fixed proto format.

Signed-off-by: Christoph Pakulski <christoph@tetrate.io>

* Fixed router's test.

Signed-off-by: Christoph Pakulski <christoph@tetrate.io>

* Fixed cluster manager test.

Signed-off-by: Christoph Pakulski <christoph@tetrate.io>

* Moved strict mode to stateful session API. It applies to cookie and header
based stateful sessions.

Signed-off-by: Christoph Pakulski <christoph@tetrate.io>

* refactored setUpstreamOverrideHost method.

Signed-off-by: Christoph Pakulski <christoph@tetrate.io>

* Pass parameter to setUpstreamOverrideHost as value.

Signed-off-by: Christoph Pakulski <christoph@tetrate.io>

* Formatting.

Signed-off-by: Christoph Pakulski <christoph@tetrate.io>

---------

Signed-off-by: Christoph Pakulski <christoph@tetrate.io>

Mirrored from https://github.com/envoyproxy/envoy @ 62f4a14e35b4988dc62ebb51a070875fda59e1fe
main
update-envoy[bot] 12 months ago
parent 63a1c700b9
commit 3ca196f8dc
  1. 4
      envoy/extensions/filters/http/stateful_session/v3/stateful_session.proto
  2. 2
      envoy/extensions/http/stateful_session/header/v3/header.proto

@ -23,6 +23,10 @@ message StatefulSession {
//
// [#extension-category: envoy.http.stateful_session]
config.core.v3.TypedExtensionConfig session_state = 1;
// If set to True, the HTTP request must be routed to the requested destination.
// If the requested destination is not available, Envoy returns 503. Defaults to False.
bool strict = 2;
}
message StatefulSessionPerRoute {

@ -23,7 +23,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// upstream host, this upstream host will be selected first. See :ref:`stateful session filter
// <envoy_v3_api_msg_extensions.filters.http.stateful_session.v3.StatefulSession>`.
//
// For example, if the header name is set to ``session-header``, envoy will prefer ``1.2.3.4:80``
// For example, if the header name is set to ``session-header``, Envoy will prefer ``1.2.3.4:80``
// as the upstream host when the request contains the following header:
//
// .. code-block:: none

Loading…
Cancel
Save