Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for additional cookie attributes #27529

Merged
merged 21 commits into from
Jun 7, 2023

Conversation

ramaraochavali
Copy link
Contributor

Commit Message: implement additional attribute support for cookies
Additional Description:
Risk Level: Low
Testing: Updated
Docs Changes: Added
Release Notes: Added
Fixes #27234

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @mattklein123
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #27529 was opened by ramaraochavali.

see: more, trace.

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one question about schema checking, thank you.

Comment on lines 838 to 842
// The name of the cookie attribute.
string name = 1 [(validate.rules).string = {min_len: 1}];

// The optional value of the cookie attribute.
string value = 2;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the characters allowed in here be limited by PGV and/or config checking?

cc @RyanTheOptimist @yanavlasov

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Not sure what is the max length we can go up to. Would be open to ideas.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not just the length, the actual characters as specified by the HTTP spec. We limit header names, etc. for similar reasons.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Changed. See if this makes sense

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
@ramaraochavali
Copy link
Contributor Author

/retest

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Comment on lines +839 to +841
string name = 1
[(validate.rules).string =
{min_len: 1 max_bytes: 16384 well_known_regex: HTTP_HEADER_NAME strict: false}];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the HTTP header name format is appropriate for the cookie attributes. If there are only some enumatable values, maybe in could be used here rather than well_known_regex.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea of it is make this generic rather than adding the specific list. But If you prefer list, can you please propose what that list would be a good default?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wbpcode @mattklein123 any suggestions to take this forward?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you figure out where in the RFC it specifies valid characters in cookie names? cc @RyanTheOptimist

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cookie names follow token I guess same as Http Header names as per https://www.rfc-editor.org/rfc/rfc6265#section-4.1 and https://www.rfc-editor.org/rfc/rfc2616#section-2.2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK sounds good then seems like this is fine for now. Thanks for looking.

@phlax
Copy link
Member

phlax commented May 30, 2023

@wbpcode i think this is waiting on some feedback

/wait-any

@mattklein123
Copy link
Member

Can you merge main and I can take a final look? Thanks.

/wait

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
@ramaraochavali
Copy link
Contributor Author

@mattklein123 done. PTAL.

@ramaraochavali
Copy link
Contributor Author

/retest

1 similar comment
@ramaraochavali
Copy link
Contributor Author

/retest

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@repokitteh-read-only repokitteh-read-only bot removed the api label Jun 7, 2023
@mattklein123 mattklein123 merged commit 6b99feb into envoyproxy:main Jun 7, 2023
@ramaraochavali ramaraochavali deleted the fix/cookie_attributes branch June 7, 2023 03:26
asheryerm pushed a commit to asheryerm/envoy that referenced this pull request Jul 5, 2023
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: asheryer <asheryer@amazon.com>
reskin89 pushed a commit to reskin89/envoy that referenced this pull request Jul 11, 2023
Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Ryan Eskin <ryan.eskin89@protonmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provide generic ability to set additional attributes for generated cookies
4 participants