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|:

  1. Let |target origin| be [=current settings object=]'s [=environment settings object/origin=] if |origin| is null, or |origin| otherwise.
  2. +
  3. Let |target embedding origin| be |target origin| if |embedding origin| is null, + or |embedding origin| otherwise. +
  4. 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|. +
  5. +
  6. If |user agent| is provided, filter |targets| to include only those that belong to + the provided |user agent|.
  7. Let |tasks| be an empty list.
  8. @@ -1437,6 +1443,7 @@
    descriptor: permissions.PermissionDescriptor, state: permissions.PermissionState, origin: text, + ? embeddingOrigin: text, ? userContext: text, } @@ -1476,11 +1483,14 @@
  9. Let |origin| be the value of the `origin` field of |command parameters|.
  10. +
  11. Let |embedding origin| be the value of the `embeddingOrigin` field of + |command parameters|, if present, and `default` otherwise. +
  12. Let |user agent| be the [=user agent=] that represents the [=user context=] with the id |user context id|.
  13. -
  14. [=Set a permission=] with |typedDescriptor|, |state|, |origin|, and |user - agent|. +
  15. [=Set a permission=] with |typedDescriptor|, |state|, |origin|, |embedding + origin|, and |user agent|.
  16. Return [=success=] with data `null`.
  17. 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:

      -
    1. Return |settings|'s [=environment/top-level origin=]. +
    2. 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|:

      -
    1. Let |target origin| be [=current settings object=]'s [=environment settings - object/origin=] if |origin| is null, or |origin| otherwise. +
    2. 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.
    3. -
    4. Let |target embedding origin| be |target origin| if |embedding origin| is null, - or |embedding origin| otherwise. +
    5. Let |settings list| be a list containing all [=environment settings objects=] + which belong to the |user agent| if provided, or all user agents otherwise.
    6. -
    7. 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|. +
    8. Let |targets| be an empty list. +
    9. +
    10. For each [=environment settings object=] |settings| in |settings list|: +
        +
      1. 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=]. +
      2. +
      3. [=list/Append=] |settings| to |targets| if |settings key| matches + |target key| according to the [=powerful feature/permission key comparison + algorithm=]. +
      4. +
    11. -
    12. If |user agent| is provided, filter |targets| to include only those that belong to - the provided |user agent|.
    13. Let |tasks| be an empty list.
    14. @@ -1484,13 +1498,16 @@
    15. Let |origin| be the value of the `origin` field of |command parameters|.
    16. 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. +
    17. +
    18. Let |key| be the result of [=powerful feature/permission key generation + algorithm|generating a permission key=] with |origin| and |embedding origin|.
    19. Let |user agent| be the [=user agent=] that represents the [=user context=] with the id |user context id|.
    20. -
    21. [=Set a permission=] with |typedDescriptor|, |state|, |origin|, |embedding - origin|, and |user agent|. +
    22. [=Set a permission=] with |typedDescriptor|, |state|, |key|, and |user + agent|.
    23. Return [=success=] with data `null`.
    24. 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:

      1. Return |top level origin|. @@ -805,7 +805,8 @@

    25. 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=].
    26. Let |entry| be the result of [=get a permission store entry|getting a permission @@ -859,8 +860,9 @@

    27. Let |settings| be the [=current settings object=].
    28. 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=].
    29. [=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 @@

      1. 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.
      2. Let |settings list| be a list containing all [=environment settings objects=] which belong to the |user agent| if provided, or all user agents otherwise.
      3. Let |targets| be an empty list.
      4. -
      5. For each [=environment settings object=] |settings| in |settings list|: +
      6. [=list/For each=] [=environment settings object=] |settings| in |settings list|:
          -
        1. 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=]. +
        2. 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=].
        3. -
        4. [=list/Append=] |settings| to |targets| if |settings key| matches - |target key| according to the [=powerful feature/permission key comparison - algorithm=]. +
        5. Let |matches| be the result of running the [=powerful feature/permission key + comparison algorithm=] for |descriptor|, given |settings key| and |key|.
        6. +
        7. If |matches|, then [=list/append=] |settings| to |targets|.
      7. Let |tasks| be an empty list.
      8. -
      9. For each [=environment settings object=] |target| in |targets|: +
      10. [=list/For each=] [=environment settings object=] |target| in |targets|:
        1. [=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 @@
        2. Let |origin| be the value of the `origin` field of |command parameters|.
        3. -
        4. Let |embedding origin| be the value of the `embeddingOrigin` field of +
        5. Let |top level origin| be the value of the `topLevelOrigin` field of |command parameters|, if present, and |origin| otherwise.
        6. 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|.
        7. 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 @@

          1. 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=].
          2. Let |matches| be the result of running the [=powerful feature/permission key comparison algorithm=] for |descriptor|, given |settings key| and |key|.