statehood
statehood copied to clipboard
Add support to cookie partition
Why is this PR necessary?
To support Chrome's CHIPS initiative https://developers.google.com/privacy-sandbox/3pcd/chips
Tests
statehood feature/cookie-partition % npm run test
> @hapi/[email protected] test
> lab -a @hapi/code -t 100 -L
..................................................
..................................................
..........
110 tests complete
Test duration: 48 ms
Assertions count: 162 (verbosity: 1.47)
Leaks: No issues
Coverage: 100.00%
Lint: No issues
Additional properties could be specified using an object:
{
…,
set: {
Partitioned: true,
OtherName: 'TheValue'
}
}
Thanks for this very nice PR.
The only minor implementation issue, is that I would prefer the options validation to fail, if
isPartitioned: truewithoutisSecure: true.However, I'm not sure this is a suitable feature to implement, given the current state (expired) of the spec. Currently it is a Google-only feature, where support could potentially be dropped.
The main problem with not adding it, is that there is no way for users to add this property manually. As such, a better solution might be to add support for custom names and name/value pairs.
Hi @kanongil, thank you for replying. As suggested, I've made Partition conditional to isSecure and SameSite=None.
As for the spec being expired, I don't know if this expiration date is being taken seriously as Google is rolling out this new policy already: https://developers.google.com/privacy-sandbox/3pcd Currently, 1% of our Chrome users are having trouble using our systems, and soon to be 100% of them in Q3 2024.
I like the additional properties suggestion, but I wonder if it's necessary now as I'm not aware of other properties being proposed.
@kanongil , so what are the next steps to move this PR forward? Thanks
Hi @kanongil How can we make this PR ready to move forward? I believe CHIPS support is essential to the well-functioning of Hapi in the future, so I'm following up with you.
Thank you
I'm also interested in having support for the Partitioned attribute. What are our next steps for this, @kanongil?