Introduce a new helper function for always partitioned storage to select the correct principal
Categories
(Core :: Privacy: Anti-Tracking, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox95 | --- | fixed |
People
(Reporter: timhuang, Assigned: timhuang)
References
Details
Attachments
(5 files)
To support different cookieBehavior, we need to have a helper function for selecting the correct principal for ServiceWorker. For example, we need to use the partitionPrincipal in the dFPI(CookieBehaivor 5) for the third-party context, but not for the first-party context. Also, we will still use regular principal in ETP(CookieBehavior 4).
Assignee | ||
Comment 1•3 years ago
|
||
As we are going to always partition ServiceWorker in dFPI, there are some adjustments that will be made which are different from the comment 0. I will outline the details that I want to do as following.
First, we will need a general helper function to get the right principal for partitioned third-party storage, such as service workers. And this should not consider the storage access permission because it will be always partitioned even the third party gets the storage access. To achieve this, a new StoragePrincipalHelper::PrincipalType will be added. I plan to call it ForeignPartitionedPrincipal.
A foreign partitioned principal will stay partitioned for third-party contexts regardless of the storage access and will be regular principal if it's a first-party context.
Second, the ForeignPartitionedPrincipal
is dFPI only, meaning that it will still return a regular principal for a third-party context if dFPI is disabled.
Third, I will add a StoragePrincipalHelper::GetPrincipal()
helper function to get the right principal. It will be used by ServiceWorker to get the principal.
Assignee | ||
Comment 2•3 years ago
|
||
In order to support always partitioned third-party storage,
like the service worker, in the future, we need to have another
principal type which uses partitioned principal in a third-party context
and regular principal in a first-party context.
Assignee | ||
Comment 3•3 years ago
|
||
Depends on D127435
Assignee | ||
Comment 4•3 years ago
|
||
This patch implements the StoragePrincipalHelper::GetPrincipal() which
is designed to be used to get the principal from the window/channel
according to the given principal type.
Depends on D127436
Assignee | ||
Comment 5•3 years ago
|
||
This patch adds tests for the StoragePrincipalHelper::GetPrincipal() but
only for the version which accepts a channel. The reason why we don't
add tests for window version is because there is no way to setup window
in gTest.
Depends on D127438
Assignee | ||
Comment 6•3 years ago
|
||
Depends on D127439
Pushed by tihuang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/beb4cde1da17 Part 1: Add a new PrincipalType `eForeignPartitionedPrincipal` for StoragePrincipalHelper. r=dimi https://hg.mozilla.org/integration/autoland/rev/0817d1be30ec Part 2: Support eForeignPartitionedPrincipal for StoragePrincipalHelper::GetOriginAttributes(). r=dimi https://hg.mozilla.org/integration/autoland/rev/4e89e8ed9461 Part 3: Implement StoragePrincipalHelper::GetPrincipal() functions. r=dimi https://hg.mozilla.org/integration/autoland/rev/828ae1384836 Part 4: Add gTest for the StoragePrincipalHelper::GetPrincipal(). r=dimi https://hg.mozilla.org/integration/autoland/rev/ef7b596bb385 Part 5: Updatet the documentation in StoragePrincipalHelper.h r=dimi
Comment 8•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/beb4cde1da17
https://hg.mozilla.org/mozilla-central/rev/0817d1be30ec
https://hg.mozilla.org/mozilla-central/rev/4e89e8ed9461
https://hg.mozilla.org/mozilla-central/rev/828ae1384836
https://hg.mozilla.org/mozilla-central/rev/ef7b596bb385
Updated•3 years ago
|
Description
•