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: hack: support the "Partitioned" flag on VCAP_ID cookies #396

Merged

Conversation

peanball
Copy link
Contributor

  • A short explanation of the proposed change:

The Partitioned flag is used for cookies that are set on web sites embedded via iframes. The cookie is then available only in combination of the host site and the embedded site.

Golang's http.Cookie type does not yet support the Partitioned flag, but Google Chrome is already testing mandatory support and rejecting/omitting cookies without it for 1% of users via A/B roll-out.

The implementation wraps the http.Cookie and extends it with the Partitioned field. This field is then used to forward the raw cookie string when creating the derived VCAP_ID cookies for sticky sessions.

Once the Golang standard library supports the Partitioned flag, this wrapper can just be removed.

A test that checks the Unparsed section of the http.Cookie will ensure that the tests will fail once the Partitioned flag is supported by the Golang standard library.

  • An explanation of the use cases your change solves

Users of Safari and Google Chrome (currently 1% via A/B test, soon 100% of users) and websites that use iframes.

  • Instructions to functionally test the behavior change using operator interfaces (BOSH manifest, logs, curl, and metrics)

  • Expected result after the change

  • Current result before the change

  • Links to any other associated PRs

  • I have viewed signed and have submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests.

  • (Optional) I have run Routing Acceptance Tests and Routing Smoke Tests

  • (Optional) I have run CF Acceptance Tests

@peanball peanball marked this pull request as ready for review February 20, 2024 14:15
@peanball peanball requested a review from a team as a code owner February 20, 2024 14:15
maxmoehl
maxmoehl previously approved these changes Feb 20, 2024
Copy link
Member

@maxmoehl maxmoehl left a comment

Choose a reason for hiding this comment

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

Change looks good! Just one minor comment.

The `Partitioned` flag is used for cookies that are set on web sites
embedded via iframes. The cookie is then available only in combination
of the host site and the embedded site.

Golang's `http.Cookie` type does not yet support the `Partitioned`
flag, but Google Chrome is already testing mandatory support and
rejecting/omitting cookies without it for 1% of users via A/B roll-out.

The implementation wraps the `http.Cookie` and extends it with the
`Partitioned` field. This field is then used to forward the raw
cookie string when creating the derived VCAP_ID cookies for sticky
sessions.

Once the Golang standard library supports the `Partitioned` flag, this
wrapper can just be removed.

A test that checks the `Unparsed` section of the `http.Cookie` will
ensure that the tests will fail once the `Partitioned` flag is
supported by the Golang standard library.
@maxmoehl maxmoehl merged commit 9015251 into cloudfoundry:main Feb 20, 2024
1 check passed
@peanball peanball deleted the support-partitioned-cookies branch March 6, 2024 12:00
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.

Gorouter is not Ready for Chromes Restriction of 3rd Party Cookies
2 participants