statehood icon indicating copy to clipboard operation
statehood copied to clipboard

Add support to cookie partition

Open leandrohlsilva opened this issue 1 year ago • 5 comments
trafficstars

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

leandrohlsilva avatar Feb 14 '24 15:02 leandrohlsilva

Additional properties could be specified using an object:

{
    …,
    set: {
        Partitioned: true,
        OtherName: 'TheValue'
    }
}

kanongil avatar Feb 15 '24 10:02 kanongil

Thanks for this very nice PR.

The only minor implementation issue, is that I would prefer the options validation to fail, if isPartitioned: true without isSecure: 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.

leandrohlsilva avatar Feb 15 '24 12:02 leandrohlsilva

@kanongil , so what are the next steps to move this PR forward? Thanks

leandrohlsilva avatar Mar 01 '24 11:03 leandrohlsilva

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

leandrohlsilva avatar Mar 28 '24 10:03 leandrohlsilva

I'm also interested in having support for the Partitioned attribute. What are our next steps for this, @kanongil?

legrego avatar May 13 '24 14:05 legrego