From 478898366eb6b3ca0a0815acfe172d087f23166d Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Tue, 8 Feb 2022 09:49:35 -0500 Subject: [PATCH 1/5] Add 'obtain a storage key for non-storage purposes' This commit adds a new algorithm for obtaining a storage key that is suitable for use in non-storage APIs (for instance, BroadcastChannel). Specifically, this algorithm works regardless of whether storage access has been granted and also allows a storage key to be obtained for opaque origins. --- storage.bs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/storage.bs b/storage.bs index 2f983a8..b908189 100644 --- a/storage.bs +++ b/storage.bs @@ -203,6 +203,16 @@ anticipated that some APIs will be applicable to both storage types going

This is expected to change; see Client-Side Storage Partitioning. +

To obtain a storage key for non-storage purposes, given an environment +settings object environment, run these steps: + +

    +
  1. Let key be environment's + origin. + +

  2. Return key. +

+

To obtain a storage key, given an environment settings object environment, run these steps: @@ -214,7 +224,8 @@ anticipated that some APIs will be applicable to both storage types going

  • If the user has disabled storage, then return failure. -

  • Return key. +

  • Return the result of running obtain a storage key for non-storage purposes with + environment. From e4b2f885878a5672cea61db6e7229f4af681e590 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Tue, 8 Feb 2022 13:06:09 -0500 Subject: [PATCH 2/5] Address review feedback --- storage.bs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/storage.bs b/storage.bs index b908189..73c45d6 100644 --- a/storage.bs +++ b/storage.bs @@ -203,24 +203,14 @@ anticipated that some APIs will be applicable to both storage types going

    This is expected to change; see Client-Side Storage Partitioning. -

    To obtain a storage key for non-storage purposes, given an environment -settings object environment, run these steps: - -

      -
    1. Let key be environment's - origin. - -

    2. Return key. -

    -

    To obtain a storage key, given an environment settings object environment, run these steps:

      -
    1. Let key be environment's +

    2. Let origin be environment's origin. -

    3. If key is an opaque origin, then return failure. +

    4. If origin is an opaque origin, then return failure.

    5. If the user has disabled storage, then return failure. @@ -228,6 +218,16 @@ settings object environment, run these steps: environment.

    +

    To obtain a storage key for non-storage purposes, given an environment +settings object environment, run these steps: + +

      +
    1. Let key be environment's + origin. + +

    2. Return key. +

    +

    Storage sheds

    From c7133a570963562456c3e7c04d6a891c3ab65da3 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Tue, 8 Feb 2022 23:30:12 -0500 Subject: [PATCH 3/5] Address review feedback - Make storage key a tuple --- storage.bs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/storage.bs b/storage.bs index 73c45d6..30e3323 100644 --- a/storage.bs +++ b/storage.bs @@ -198,7 +198,8 @@ anticipated that some APIs will be applicable to both storage types going

    Storage keys

    -

    A storage key is an origin. [[!HTML]] +

    A storage key is a tuple consisting of an origin +(an origin). [[!HTML]]

    This is expected to change; see Client-Side Storage Partitioning. @@ -207,22 +208,22 @@ anticipated that some APIs will be applicable to both storage types going environment, run these steps:

      -
    1. Let origin be environment's - origin. +

    2. Let key be the result of running obtain a storage key for non-storage + purposes with environment. -

    3. If origin is an opaque origin, then return failure. +

    4. If key's origin is an opaque origin, then return + failure.

    5. If the user has disabled storage, then return failure. -

    6. Return the result of running obtain a storage key for non-storage purposes with - environment. +

    7. Return key.

    To obtain a storage key for non-storage purposes, given an environment settings object environment, run these steps:

      -
    1. Let key be environment's +

    2. Let key be a tuple consisting of environment's origin.

    3. Return key. From bc6fca8c95ca8558ebd02665dd67d08f7be5ff3e Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 10 Feb 2022 10:17:52 +0100 Subject: [PATCH 4/5] nit --- storage.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/storage.bs b/storage.bs index 30e3323..01d91ef 100644 --- a/storage.bs +++ b/storage.bs @@ -208,8 +208,8 @@ anticipated that some APIs will be applicable to both storage types going environment, run these steps:

        -
      1. Let key be the result of running obtain a storage key for non-storage - purposes with environment. +

      2. Let key be the result of running + obtain a storage key for non-storage purposes with environment.

      3. If key's origin is an opaque origin, then return failure. From df8494f567623196b34fcb81cf887328168a210a Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 10 Feb 2022 10:19:39 +0100 Subject: [PATCH 5/5] oops --- storage.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage.bs b/storage.bs index 01d91ef..63866c5 100644 --- a/storage.bs +++ b/storage.bs @@ -208,7 +208,7 @@ anticipated that some APIs will be applicable to both storage types going environment, run these steps:

          -
        1. Let key be the result of running +

        2. Let key be the result of running obtain a storage key for non-storage purposes with environment.

        3. If key's origin is an opaque origin, then return