Re: [whatwg/storage] Add 'obtain a storage key for non-storage purposes' (PR #132)

@recvfrom commented on this pull request.



> @@ -203,6 +203,16 @@ anticipated that some APIs will be applicable to both <a>storage types</a> going
 <p class=XXX>This is expected to change; see
 <a href="https://privacycg.github.io/storage-partitioning/">Client-Side Storage Partitioning</a>.
 
+<p>To <dfn export>obtain a storage key for non-storage purposes</dfn>, given an <a>environment
+settings object</a> <var>environment</var>, run these steps:
+
+<ol>
+ <li><p>Let <var>key</var> be <var>environment</var>'s
+ <a for="environment settings object">origin</a>.

> In the future key will be at least (site, origin) + implementation-defined fields. Now if site is an opaque origin the algorithm below will need to return failure as well. So I think it does want to operate on the eventual key.

The `environment` object has the [`top-level-origin`](https://html.spec.whatwg.org/multipage/webappapis.html#concept-environment-top-level-origin) field, so for determining whether the top-level origin is opaque it might be easier to use that (in either algorithm, as appropriate) than to define a way to extract `site` from the storage key (IIUC).

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/storage/pull/132#discussion_r801940056
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/storage/pull/132/review/876486159@github.com>

Received on Tuesday, 8 February 2022 18:30:00 UTC