Skip to content

implement partitioned cookies #4204

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

bound2
Copy link
Contributor

@bound2 bound2 commented Mar 28, 2025

Solves #4202

  • add cookie validation with error logging
  • refactor c.SetCookie to accept option pattern modifications as vararg (does not cause issue of breaking change to v1.6.0 is inappropriate #2299)
  • refactor c.SetSameSite to use option pattern under the hood

Unsure if slog usage is okay within the project. The cookie doesn't get rejected if it is "invalid" when secure is false but partition is true.

  • With pull requests:
    • Open your pull request against master
    • Your pull request should have no more than two commits, if not you should squash them.
    • It should pass all tests in the available continuous integration systems such as GitHub Actions.
    • You should add/modify tests to cover your proposed code changes.
    • If your pull request contains a new feature, please document it on the README.

implement cookie validation with error logging
refactor c.SetCookie to accept option pattern modifications as vararg
refactor c.SetSameSite to use option pattern under the hood
Copy link

codecov bot commented Mar 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.00%. Comparing base (3dc1cd6) to head (4eecebf).
Report is 96 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4204      +/-   ##
==========================================
- Coverage   99.21%   99.00%   -0.21%     
==========================================
  Files          42       44       +2     
  Lines        3182     3420     +238     
==========================================
+ Hits         3157     3386     +229     
- Misses         17       24       +7     
- Partials        8       10       +2     
Flag Coverage Δ
?
--ldflags="-checklinkname=0" -tags "sonic avx" 98.99% <100.00%> (?)
-tags go_json 98.99% <100.00%> (?)
-tags nomsgpack 98.99% <100.00%> (?)
go-1.18 ?
go-1.19 ?
go-1.20 ?
go-1.21 ?
go-1.23 99.00% <100.00%> (?)
go-1.24 99.00% <100.00%> (?)
macos-latest 99.00% <100.00%> (-0.21%) ⬇️
ubuntu-latest 99.00% <100.00%> (-0.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant