1// Copyright 2022 gRPC authors. 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15// Local copy of Envoy xDS proto file, used for testing only. 16 17syntax = "proto3"; 18 19package envoy.extensions.http.stateful_session.cookie.v3; 20 21import "src/proto/grpc/testing/xds/v3/cookie.proto"; 22 23// [#protodoc-title: Cookie based stateful session extension] 24 25// This extension allows the session state to be tracked via cookies. 26// 27// This extension first encodes the address of the upstream host selected by the load balancer 28// into a ``set-cookie`` response header with the :ref:`cookie configuration 29// <envoy_v3_api_field_extensions.http.stateful_session.cookie.v3.CookieBasedSessionState.cookie>`. 30// when new requests are incoming, this extension will try to parse the specific upstream host 31// address by the cookie name. If the address parsed from the cookie corresponds to a valid 32// upstream host, this upstream host will be selected first. See :ref:`stateful session filter 33// <envoy_v3_api_msg_extensions.filters.http.stateful_session.v3.StatefulSession>`. 34// 35// For example, if the cookie name is set to ``sticky-host``, envoy will prefer ``1.2.3.4:80`` 36// as the upstream host when the request contains the following header: 37// 38// .. code-block:: none 39// 40// cookie: sticky-host="MS4yLjMuNDo4MA==" 41// 42// When processing the upstream response, if ``1.2.3.4:80`` is indeed the final choice the extension 43// does nothing. If ``1.2.3.4:80`` is not the final choice, the new selected host will be used to 44// update the cookie (via the ``set-cookie`` response header). 45// 46// [#extension: envoy.http.stateful_session.cookie] 47message CookieBasedSessionState { 48 // The cookie configuration used to track session state. 49 type.http.v3.Cookie cookie = 1; 50} 51