From b164fdda54c1289488b47a46136e6214f2fb221d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Cjalonthomas=E2=80=9D?=
Date: Tue, 12 Aug 2025 14:09:46 -0400
Subject: [PATCH 1/4] Add embedding origin to set permission command
---
index.html | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/index.html b/index.html
index ae14061..b945713 100644
--- a/index.html
+++ b/index.html
@@ -1235,15 +1235,21 @@
To set a permission given a {{PermissionDescriptor}}
|descriptor:PermissionDescriptor|, a {{PermissionState}} |state:PermissionState|, an
- optional |origin|, and an optional |user agent|:
+ optional |origin|, an optional |embedding origin|, and an optional |user agent|:
- Let |target origin| be [=current settings object=]'s [=environment settings
object/origin=] if |origin| is null, or |origin| otherwise.
+ - Let |target embedding origin| be |target origin| if |embedding origin| is null,
+ or |embedding origin| otherwise.
+
- Let |targets| be a list containing all [=environment settings objects=] whose
- [=environment settings object/origin=] is [=same origin=] with |target origin|, and which
- belong to the |user agent| if provided, or all user agents otherwise.
+ [=environment settings object/origin=] is [=same origin=] with |target origin| and whose
+ [=environment/top-level origin=] is [=same origin=] with |target embedding origin|.
+
+ - If |user agent| is provided, filter |targets| to include only those that belong to
+ the provided |user agent|.
- Let |tasks| be an empty list.
@@ -1437,6 +1443,7 @@
descriptor: permissions.PermissionDescriptor,
state: permissions.PermissionState,
origin: text,
+ ? embeddingOrigin: text,
? userContext: text,
}
@@ -1476,11 +1483,14 @@
- Let |origin| be the value of the `origin` field of |command parameters|.
+ - Let |embedding origin| be the value of the `embeddingOrigin` field of
+ |command parameters|, if present, and `default` otherwise.
+
- Let |user agent| be the [=user agent=] that represents the [=user context=]
with the id |user context id|.
- - [=Set a permission=] with |typedDescriptor|, |state|, |origin|, and |user
- agent|.
+
- [=Set a permission=] with |typedDescriptor|, |state|, |origin|, |embedding
+ origin|, and |user agent|.
- Return [=success=] with data `null`.
From bad0c1a726cbc7e34fd48187376447ddb9a58f58 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Cjalonthomas=E2=80=9D?=
Date: Thu, 14 Aug 2025 10:52:12 -0400
Subject: [PATCH 2/4] Change the key generation algorithm to use an origin and
top level origin instead of an ESO
---
index.html | 53 +++++++++++++++++++++++++++++++++++------------------
1 file changed, 35 insertions(+), 18 deletions(-)
diff --git a/index.html b/index.html
index b945713..2322764 100644
--- a/index.html
+++ b/index.html
@@ -630,7 +630,7 @@
-
- Takes an [=environment settings object=], and returns a new [=permission key=]. If
+ Takes an |origin| and a |top level origin|, and returns a new [=permission key=]. If
unspecified, this defaults to the [=default permission key generation algorithm=]. A
feature that specifies a custom [=powerful feature/permission key generation
algorithm=] MUST also specify a [=powerful feature/permission key comparison
@@ -639,10 +639,10 @@
The default permission key generation algorithm, given an
- [=environment settings object=] |settings|, runs the following steps:
+ |origin| and a |top level origin|, runs the following steps:
- - Return |settings|'s [=environment/top-level origin=].
+
- Return |top level origin|.
@@ -805,7 +805,8 @@
Let |key| be the result of [=powerful feature/permission key generation
- algorithm|generating a permission key=] for |descriptor| with |settings|.
+ algorithm|generating a permission key=] with |settings|'s [=origin=] and |settings|'s
+ [=environment/top-level origin=].
Let |entry| be the result of [=get a permission store entry|getting a permission
store entry=] with |descriptor| and |key|.
@@ -855,8 +856,11 @@
this framework.
+ Let |settings| be the [=current settings object=].
+
Let |key| be the result of [=powerful feature/permission key generation
- algorithm|generating a permission key=] with the [=current settings object=].
+ algorithm|generating a permission key=] with |settings|'s [=origin=] and
+ |settings|'s [=environment/top-level origin=].
[=Queue a task=] on the [=current settings object=]'s [=environment settings
object/responsible event loop=] to [=set a permission store entry=] with |descriptor|,
@@ -1235,21 +1239,31 @@
To set a permission given a {{PermissionDescriptor}}
|descriptor:PermissionDescriptor|, a {{PermissionState}} |state:PermissionState|, an
- optional |origin|, an optional |embedding origin|, and an optional |user agent|:
+ optional [=permission key=] |key|, and an optional |user agent|:
- - Let |target origin| be [=current settings object=]'s [=environment settings
- object/origin=] if |origin| is null, or |origin| otherwise.
+
- Let |target key| be the result of [=powerful feature/permission key generation
+ algorithm|generating a permission key=] with [=current settings object=]'s [=environment
+ settings object/origin=] and [=current settings object=]'s [=environment/top-level
+ origin=] if |key| is null, or |key| otherwise.
- - Let |target embedding origin| be |target origin| if |embedding origin| is null,
- or |embedding origin| otherwise.
+
- Let |settings list| be a list containing all [=environment settings objects=]
+ which belong to the |user agent| if provided, or all user agents otherwise.
- - Let |targets| be a list containing all [=environment settings objects=] whose
- [=environment settings object/origin=] is [=same origin=] with |target origin| and whose
- [=environment/top-level origin=] is [=same origin=] with |target embedding origin|.
+
- Let |targets| be an empty list.
+
+ - For each [=environment settings object=] |settings| in |settings list|:
+
+ - Let |settings key| be be the result of [=powerful feature/permission key generation
+ algorithm|generating a permission key=] with |settings|'s [=origin=] and |settings|'s
+ [=environment/top-level origin=].
+
+ - [=list/Append=] |settings| to |targets| if |settings key| matches
+ |target key| according to the [=powerful feature/permission key comparison
+ algorithm=].
+
+
- - If |user agent| is provided, filter |targets| to include only those that belong to
- the provided |user agent|.
- Let |tasks| be an empty list.
@@ -1484,13 +1498,16 @@
- Let |origin| be the value of the `origin` field of |command parameters|.
- Let |embedding origin| be the value of the `embeddingOrigin` field of
- |command parameters|, if present, and `default` otherwise.
+ |command parameters|, if present, and |origin| otherwise.
+
+ - Let |key| be the result of [=powerful feature/permission key generation
+ algorithm|generating a permission key=] with |origin| and |embedding origin|.
- Let |user agent| be the [=user agent=] that represents the [=user context=]
with the id |user context id|.
- - [=Set a permission=] with |typedDescriptor|, |state|, |origin|, |embedding
- origin|, and |user agent|.
+
- [=Set a permission=] with |typedDescriptor|, |state|, |key|, and |user
+ agent|.
- Return [=success=] with data `null`.
From 957021bcf4f0f5f509b54b2f5cc6196bf04ceaf4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Cjalonthomas=E2=80=9D?=
Date: Thu, 14 Aug 2025 15:55:18 -0400
Subject: [PATCH 3/4] Use topLevelOrigin, add descriptor to key generation, and
use the ESO origin link
---
index.html | 49 ++++++++++++++++++++++++++-----------------------
1 file changed, 26 insertions(+), 23 deletions(-)
diff --git a/index.html b/index.html
index 2322764..9455600 100644
--- a/index.html
+++ b/index.html
@@ -630,16 +630,16 @@
-
- Takes an |origin| and a |top level origin|, and returns a new [=permission key=]. If
- unspecified, this defaults to the [=default permission key generation algorithm=]. A
- feature that specifies a custom [=powerful feature/permission key generation
- algorithm=] MUST also specify a [=powerful feature/permission key comparison
- algorithm=].
+ Takes an [=origin=] |origin| and an [=origin=] |top level origin|, and returns a new
+ [=permission key=]. If unspecified, this defaults to the [=default permission key
+ generation algorithm=]. A feature that specifies a custom [=powerful feature/permission
+ key generation algorithm=] MUST also specify a [=powerful feature/permission key
+ comparison algorithm=].
The default permission key generation algorithm, given an
- |origin| and a |top level origin|, runs the following steps:
+ [=origin=] |origin| and an [=origin=] |top level origin|, runs the following steps:
- Return |top level origin|.
@@ -805,7 +805,8 @@
- Let |key| be the result of [=powerful feature/permission key generation
- algorithm|generating a permission key=] with |settings|'s [=origin=] and |settings|'s
+ algorithm|generating a permission key=] for |descriptor| with |settings|'s
+ [=environment settings object/origin=] and |settings|'s
[=environment/top-level origin=].
- Let |entry| be the result of [=get a permission store entry|getting a permission
@@ -859,8 +860,9 @@
- Let |settings| be the [=current settings object=].
- Let |key| be the result of [=powerful feature/permission key generation
- algorithm|generating a permission key=] with |settings|'s [=origin=] and
- |settings|'s [=environment/top-level origin=].
+ algorithm|generating a permission key=] for |descriptor| with |settings|'s
+ [=environment settings object/origin=] and |settings|'s [=environment/top-level
+ origin=].
- [=Queue a task=] on the [=current settings object=]'s [=environment settings
object/responsible event loop=] to [=set a permission store entry=] with |descriptor|,
@@ -1243,31 +1245,31 @@
- Let |target key| be the result of [=powerful feature/permission key generation
- algorithm|generating a permission key=] with [=current settings object=]'s [=environment
- settings object/origin=] and [=current settings object=]'s [=environment/top-level
- origin=] if |key| is null, or |key| otherwise.
+ algorithm|generating a permission key=] for |descriptor| with [=current settings
+ object=]'s [=environment settings object/origin=] and [=current settings object=]'s
+ [=environment/top-level origin=] if |key| is null, or |key| otherwise.
- Let |settings list| be a list containing all [=environment settings objects=]
which belong to the |user agent| if provided, or all user agents otherwise.
- Let |targets| be an empty list.
- - For each [=environment settings object=] |settings| in |settings list|:
+
- [=list/For each=] [=environment settings object=] |settings| in |settings list|:
- - Let |settings key| be be the result of [=powerful feature/permission key generation
- algorithm|generating a permission key=] with |settings|'s [=origin=] and |settings|'s
- [=environment/top-level origin=].
+
- Let |settings key| be be the result of [=powerful feature/permission key
+ generation algorithm|generating a permission key=] for |descriptor| with |settings|'s
+ [=origin=] and |settings|'s [=environment/top-level origin=].
- - [=list/Append=] |settings| to |targets| if |settings key| matches
- |target key| according to the [=powerful feature/permission key comparison
- algorithm=].
+
- Let |matches| be the result of running the [=powerful feature/permission key
+ comparison algorithm=] for |descriptor|, given |settings key| and |key|.
+ - If |matches|, then [=list/append=] |settings| to |targets|.
- Let |tasks| be an empty list.
-
- For each [=environment settings object=] |target| in |targets|:
+
- [=list/For each=] [=environment settings object=] |target| in |targets|:
- [=Queue a task=] |task| on the [=permissions task source=] of |target|'s
[=relevant settings object=]'s [=environment settings object/global object=]'s
@@ -1457,7 +1459,7 @@
descriptor: permissions.PermissionDescriptor,
state: permissions.PermissionState,
origin: text,
- ? embeddingOrigin: text,
+ ? topLevelOrigin: text,
? userContext: text,
}
@@ -1497,11 +1499,12 @@
- Let |origin| be the value of the `origin` field of |command parameters|.
- - Let |embedding origin| be the value of the `embeddingOrigin` field of
+
- Let |top level origin| be the value of the `topLevelOrigin` field of
|command parameters|, if present, and |origin| otherwise.
- Let |key| be the result of [=powerful feature/permission key generation
- algorithm|generating a permission key=] with |origin| and |embedding origin|.
+ algorithm|generating a permission key=] for |descriptor| with |origin| and
+ |top level origin|.
- Let |user agent| be the [=user agent=] that represents the [=user context=]
with the id |user context id|.
From 48416938dcc56c99f8e09a2c668334ec16738742 Mon Sep 17 00:00:00 2001
From: jalonthomas <64996364+jalonthomas@users.noreply.github.com>
Date: Fri, 15 Aug 2025 09:44:52 -0400
Subject: [PATCH 4/4] Update index.html
Co-authored-by: Chris Fredrickson
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index 9455600..ef0c27d 100644
--- a/index.html
+++ b/index.html
@@ -1258,7 +1258,7 @@
- Let |settings key| be be the result of [=powerful feature/permission key
generation algorithm|generating a permission key=] for |descriptor| with |settings|'s
- [=origin=] and |settings|'s [=environment/top-level origin=].
+ [=environment settings object/origin=] and |settings|'s [=environment/top-level origin=].
- Let |matches| be the result of running the [=powerful feature/permission key
comparison algorithm=] for |descriptor|, given |settings key| and |key|.