Skip to content

Commit 09409f4

Browse files
Support attributes in stateful session cookies (#40084)
<!-- !!!ATTENTION!!! If you are fixing *any* crash or *any* potential security issue, *do not* open a pull request in this repo. Please report the issue via emailing [email protected] where the issue will be triaged appropriately. Thank you in advance for helping to keep Envoy secure. !!!ATTENTION!!! For an explanation of how to fill out the fields, please see the relevant section in [PULL_REQUESTS.md](https://github.com/envoyproxy/envoy/blob/main/PULL_REQUESTS.md) --> Commit Message: support attributes in stateful session cookies Additional Description: Today setting attributes in stateful session cookies is not supported natively. A follow up filter modifies the cookie to add attributes, e.g. a Lua script. This improves UX for this usecase. Risk Level: Minor Testing: Unit testing Docs Changes: TBD Release Notes: TBD Platform Specific Features: N/A Fixes #36846 Signed-off-by: Rudrakh Panigrahi <[email protected]> Mirrored from https://github.com/envoyproxy/envoy @ 39339150a76959fac0ef47b85441f38fe27d061c
1 parent f8b2c26 commit 09409f4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

envoy/type/http/v3/cookie.proto

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,20 @@ message Cookie {
2828
// Path of cookie. This will be used to set the path of a new cookie when it is generated.
2929
// If no path is specified here, no path will be set for the cookie.
3030
string path = 3;
31+
32+
// Additional attributes for the cookie. They will be used when generating a new cookie.
33+
repeated CookieAttribute attributes = 4;
34+
}
35+
36+
// CookieAttribute defines an API for adding additional attributes for a HTTP cookie.
37+
message CookieAttribute {
38+
// The name of the cookie attribute.
39+
string name = 1
40+
[(validate.rules).string =
41+
{min_len: 1 max_bytes: 16384 well_known_regex: HTTP_HEADER_NAME strict: false}];
42+
43+
// The optional value of the cookie attribute.
44+
string value = 2 [
45+
(validate.rules).string = {max_bytes: 16384 well_known_regex: HTTP_HEADER_VALUE strict: false}
46+
];
3147
}

0 commit comments

Comments
 (0)