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

feat(Response): support Partitioned cookie attribute #2248

Merged
merged 6 commits into from
Jul 16, 2024

Conversation

M-Mueller
Copy link
Contributor

@M-Mueller M-Mueller commented Jul 13, 2024

Summary of Changes

Allow to set the Partitioned attribute in cookies. Default is not setting it.
The changes are very similar to the changes required for the SameSite attribute.

Related Issues

fixes: #2213

Pull Request Checklist

This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once; it will save you a few review cycles!

If an item doesn't apply to your pull request, check it anyway to make it apparent that there's nothing to do.

  • Applied changes to both WSGI and ASGI code paths and interfaces (where applicable).
  • Added tests for changed code.
  • Prefixed code comments with GitHub nick and an appropriate prefix.
  • Coding style is consistent with the rest of the framework.
  • Updated documentation for changed code.
    • Added docstrings for any new classes, functions, or modules.
    • Updated docstrings for any modifications to existing code.
    • Updated both WSGI and ASGI docs (where applicable).
    • Added references to new classes, functions, or modules to the relevant RST file under docs/.
    • Updated all relevant supporting documentation files under docs/.
    • A copyright notice is included at the top of any new modules (using your own name or the name of your organization).
    • Changed/added classes/methods/functions have appropriate versionadded, versionchanged, or deprecated directives.
  • Changes (and possible deprecations) have towncrier news fragments under docs/_newsfragments/, with the file name format {issue_number}.{fragment_type}.rst. (Run towncrier --draft to ensure it renders correctly.)

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

PR template inspired by the attrs project.

Allow to set the Partitioned attribute in cookies.
Default is not setting it.

closes falconry#2213
Copy link

codecov bot commented Jul 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (cd70796) to head (37b29b8).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2248   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           63        63           
  Lines         6847      6852    +5     
  Branches      1258      1260    +2     
=========================================
+ Hits          6847      6852    +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@CaselIT CaselIT left a comment

Choose a reason for hiding this comment

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

great work, thanks!

falcon/response.py Outdated Show resolved Hide resolved
falcon/testing/client.py Outdated Show resolved Hide resolved
@CaselIT
Copy link
Member

CaselIT commented Jul 14, 2024

regarding the too-complex error I think we can suppress it adding # noqa: C901 like in

def add_route(self, uri_template, resource, **kwargs): # noqa: C901

@CaselIT
Copy link
Member

CaselIT commented Jul 14, 2024

regarding the too-complex error I think we can suppress it adding # noqa: C901 like in

def add_route(self, uri_template, resource, **kwargs): # noqa: C901

ok you already did that, great!

The MDN documentation is a lot more helpful than the draft
and also links to the draft specification
CaselIT
CaselIT previously approved these changes Jul 14, 2024
Copy link
Member

@CaselIT CaselIT left a comment

Choose a reason for hiding this comment

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

thanks!

Copy link
Member

@vytas7 vytas7 left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM! 💯
*Bar some small docs tweaks that I would like to make, but I don't think we need to delay this PR just because of that :shipit: (I can address that off-band in a followup PR.)

@vytas7 vytas7 merged commit dc5be34 into falconry:master Jul 16, 2024
37 checks passed
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.

Add support for 'partitioned' attribute to set_cookie()
3 participants