|
| 1 | +syntax = "proto3"; |
| 2 | + |
| 3 | +package envoy.extensions.http.stateful_session.cookie.v3; |
| 4 | + |
| 5 | +import "envoy/type/http/v3/cookie.proto"; |
| 6 | + |
| 7 | +import "udpa/annotations/status.proto"; |
| 8 | +import "validate/validate.proto"; |
| 9 | + |
| 10 | +option java_package = "io.envoyproxy.envoy.extensions.http.stateful_session.cookie.v3"; |
| 11 | +option java_outer_classname = "CookieProto"; |
| 12 | +option java_multiple_files = true; |
| 13 | +option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/http/stateful_session/cookie/v3;cookiev3"; |
| 14 | +option (udpa.annotations.file_status).package_version_status = ACTIVE; |
| 15 | + |
| 16 | +// [#protodoc-title: Cookie based stateful session extension] |
| 17 | + |
| 18 | +// This extension allows the session state to be tracked via cookies. |
| 19 | +// |
| 20 | +// This extension first encodes the address of the upstream host selected by the load balancer |
| 21 | +// into a `set-cookie` response header with the :ref:`cookie configuration |
| 22 | +// <envoy_v3_api_field_extensions.http.stateful_session.cookie.v3.CookieBasedSessionState.cookie>`. |
| 23 | +// when new requests are incoming, this extension will try to parse the specific upstream host |
| 24 | +// address by the cookie name. If the address parsed from the cookie corresponds to a valid |
| 25 | +// upstream host, this upstream host will be selected first. See :ref:`stateful session filter |
| 26 | +// <envoy_v3_api_msg_extensions.filters.http.stateful_session.v3.StatefulSession>`. |
| 27 | +// |
| 28 | +// For example, if the cookie name is set to `sticky-host`, envoy will prefer `1.2.3.4:80` |
| 29 | +// as the upstream host when the request contains the following header: |
| 30 | +// |
| 31 | +// .. code-block:: none |
| 32 | +// |
| 33 | +// cookie: sticky-host="MS4yLjMuNDo4MA==" |
| 34 | +// |
| 35 | +// When processing the upstream response, if `1.2.3.4:80` is indeed the final choice the extension |
| 36 | +// does nothing. If `1.2.3.4:80` is not the final choice, the new selected host will be used to |
| 37 | +// update the cookie (via the `set-cookie` response header). |
| 38 | +// |
| 39 | +// [#extension: envoy.http.stateful_session.cookie] |
| 40 | +message CookieBasedSessionState { |
| 41 | + // The cookie configuration used to track session state. |
| 42 | + type.http.v3.Cookie cookie = 1 [(validate.rules).message = {required: true}]; |
| 43 | +} |
0 commit comments