From ef943ab593f6c3cfcdf3b18bb17dcc24714208bc Mon Sep 17 00:00:00 2001 From: Johann Hofmann Date: Tue, 31 Jan 2023 20:27:54 +0000 Subject: [PATCH 1/3] Update Storage Access API integration to match latest spec --- spec.bs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/spec.bs b/spec.bs index 31cc094..cab94ec 100644 --- a/spec.bs +++ b/spec.bs @@ -174,18 +174,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 +197,16 @@ 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. +

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. 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=]. +2. Let |sameSet| be true if |embeddedSite| is [=eligible for same-party membership when embedded within=] |topLevelSite|. +3. If |sameSet| is true, the user agent may run process permission state with [=permission/granted=] or [=permission/denied=] . This step is [=implementation-defined=]. +

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: From edcca70a235db5bf889689b1082791c3c3fadeb6 Mon Sep 17 00:00:00 2001 From: Johann Hofmann Date: Thu, 2 Feb 2023 21:14:51 +0000 Subject: [PATCH 2/3] Also update for rSAFor --- spec.bs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/spec.bs b/spec.bs index cab94ec..27a24f7 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,8 @@ 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
 
 {
@@ -205,7 +210,15 @@ Modify {{Document/requestStorageAccess()}} to insert the following steps before
 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=].
 2. Let |sameSet| be true if |embeddedSite| is [=eligible for same-party membership when embedded within=] |topLevelSite|.
-3. If |sameSet| is true, the user agent may run process permission state with [=permission/granted=] or [=permission/denied=] . This step is [=implementation-defined=].
+3. If |sameSet| is true, the user agent may run process permission state with [=permission/granted=]. This step is [=implementation-defined=].
+
+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. 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=].
+2. Let |sameSet| be true if |embeddedSite| is [=eligible for same-party membership when embedded within=] |topLevelSite|.
+3. If |sameSet| is true, the user agent may [=queue a global task=] on the [=permissions task source=] given global to [=resolve=] p. This step is [=implementation-defined=].
 
 

Handling first-party set changes

From 76ad37eb3f59c9697f98a58f3b4e23ff9513a8ad Mon Sep 17 00:00:00 2001 From: Johann Hofmann Date: Fri, 3 Feb 2023 10:12:16 +0000 Subject: [PATCH 3/3] Address review comments --- spec.bs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/spec.bs b/spec.bs index 27a24f7..f8d8594 100644 --- a/spec.bs +++ b/spec.bs @@ -28,6 +28,8 @@ 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
@@ -202,23 +204,22 @@ 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. 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=]. -2. Let |sameSet| be true if |embeddedSite| is [=eligible for same-party membership when embedded within=] |topLevelSite|. -3. If |sameSet| is true, the user agent may run process permission state with [=permission/granted=]. This step is [=implementation-defined=]. +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. 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=]. -2. Let |sameSet| be true if |embeddedSite| is [=eligible for same-party membership when embedded within=] |topLevelSite|. -3. If |sameSet| is true, the user agent may [=queue a global task=] on the [=permissions task source=] given global to [=resolve=] p. This step is [=implementation-defined=]. +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