From 9b349f0fe163f24cb699d3cee755a8569b50387f Mon Sep 17 00:00:00 2001 From: Johann Hofmann Date: Fri, 3 Feb 2023 11:14:04 +0100 Subject: [PATCH] Update Storage Access API integration to match latest spec (#133) --- spec.bs | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/spec.bs b/spec.bs index 31cc094..f8d8594 100644 --- a/spec.bs +++ b/spec.bs @@ -11,6 +11,9 @@ Abstract: How user agents should integrate with First-Party Sets, a mechanism to Markup Shorthands: markdown yes Default Biblio Display: inline +
 spec: PSL; urlPrefix: https://publicsuffix.org/list/
     type: dfn
@@ -25,6 +28,10 @@ spec: clear-site-data; urlPrefix: https://www.w3.org/TR/clear-site-data/#
 spec: storage-access; urlPrex: https://privacycg.github.io/storage-access/#
     type: dfn
         text: determine the storage access policy; url: determine-the-storage-access-policy
+
+urlPrefix: https://w3c.github.io/permissions/; spec: permissions
+    text: permissions task source; url: #permissions-task-source; type: dfn
 
 {
@@ -174,18 +181,10 @@ To find a first-party set for a given [=site=] |site|, run the
 
 Note: The [[SUBMISSION-GUIDELINES]] require that each site can only appear in at most one First-Party set, which is validated at submission time. For this reason, user agents do not need to be concerned with the order of the list of first-party sets when performing these steps.
 
-

Integration with the Storage Access API

- Define the limit for associated sites within a single [=first-party set=] to be an [=implementation-defined=] value, which is recommended to be 3. Note: This limit is used when [=determine eligibility for an associated site|determining eligibility for an associated site=] to only consider the sites listed at the top of the associated subset. It is meant to discourage abuse and help users and user agents understand why a particular first-party set needs to exist. User agents may choose a different number based on this goal. -Modify the [=determine the storage access policy=] step to insert the following steps before step 3 (running [=implementation-defined=] steps): - -1. Let |embeddedSite| be the result of [=obtain a site|obtaining a site=] from key’s embedded origin. -2. Let |sameSet| be true if |embeddedSite| is [=eligible for same-party membership when embedded within=] |topLevelSite|. -3. Optionally set implicitly granted or implicitly denied based on the value of |sameSet|. This step is [=implementation-defined=]. - A [=site=] |embeddedSite| is eligible for same-party membership when embedded within a [=site=] |topLevelSite|, if the following steps return true: 1. Let |set| be the result of [=find a first-party set|finding a first-party set=] for |topLevelSite|. @@ -205,6 +204,23 @@ To determine eligibility for an associated site given a [=site=] |sit 3. If |index| is greater than or equal to the [=limit for associated sites=], return false. 4. Return true. +A given [=environment settings object=] |settings| is same-party with its top-level embedder, if the following steps return true: +1. Let |topLevelSite| be the result of [=obtain a site|obtaining a site=] from |settings|' [=environment/top-level origin=]. +1. Let |embeddedSite| be the result of [=obtain a site|obtaining a site=] from |settings|' [=environment settings object/origin=]. +1. Return whether |embeddedSite| is [=eligible for same-party membership when embedded within=] |topLevelSite|. + +

Integration with the Storage Access API

+ +Modify {{Document/requestStorageAccess()}} to insert the following steps before step 13.5 (i.e. before [=requesting permission to use=]): + +1. Let |settings| be doc's [=relevant settings object=]. +1. If |settings| [=is same-party with its top-level embedder=], the user agent may run process permission state with [=permission/granted=] and abort the remaining steps. + +Modify {{Document/requestStorageAccessForOrigin(origin)}} to insert the following steps before step 13.8 (i.e. before [=requesting permission to use=]): + +1. Let |settings| be doc's [=relevant settings object=]. +1. If |settings| [=is same-party with its top-level embedder=], the user agent may [=queue a global task=] on the [=permissions task source=] given global to [=resolve=] p and abort the remaining steps. +

Handling first-party set changes

When a [=site=] |site| leaves a [=first-party set=] as the result of building a new [=list of first-party sets=], user agents must ensure that it does not retain any access to data or shared identifiers held by other sites in the first-party set by running the following steps: