From c9a15ccfba0f78ee3de77536ce9286d4cdbc2443 Mon Sep 17 00:00:00 2001
From: Johann Hofmann
reset because its [=permission/lifetime=] has expired.
+ The user agent maintains a single global permission store which is a list of [=permission store entries=]. + The user agent removes [=entries=] from the list when their respective [=permission=]'s [=permission/lifetime=] has expired. +
++ We should still allow UAs flexibility in giving out permissions with smaller scope and lifetime (e.g. per-tab) in some form. There should generally still be enough room for exploration here. +
++ A permission store entry is a [=tuple=] of [=powerful feature/name=] name, [=permission store key=] key, {{PermissionDescriptor}} descriptor, and [=permission/state=] state. +
++ To get a permission store entry from the [=global permission store=] given a |name|, [=permission store key=] key and descriptor, run these steps: +
+ To set a permission store entry in the [=global permission store=] given a [=powerful feature/name=] |name|, a [=permission store key=] |key|, a {{PermissionDescriptor}} |descriptor|, and a [=permission/state=] |state|, run these steps: +
+ To remove a permission store entry from the [=global permission store=] given a name, key and descriptor, run these steps: +
+ A permission store key is a [=tuple=] of ([=origin=] top-level origin, [=origin=] embedded origin). +
+ ++ To generate a permission store key `key` given [=environment settings object=] |settings|, run these steps: +
+ How do we ensure that other specs can override this? Should we add all key deviations as new steps to this algorithm or have a different override mechanism? +
++ Most permissions will want to key on the top-level origin and delegate access via Permissions Policy. + However, others, like the Storage Access API, explicitly describe a embeddee relationship and need to use the + embedded origin field. +
++ This assumes that passed in settings is from the embedded document. +
++ To compare [=permission store keys=] |key1| and |key2|, run these steps: +
+ Do we have to define this? If we can compare origins we can probably implicitly compare a tuple of origins? +
+ + + +Takes no arguments. Updates any other parts of the implementation that need to be kept in sync with changes in the results of permission states or [=powerful - feature/extra permission data=], and then [=react to the user revoking permission=]. + feature/extra permission data=].
If unspecified, this defaults to running [=react to the user revoking permission=]. @@ -628,9 +715,11 @@
@@ -672,6 +761,16 @@
As a shorthand, requesting permission to use a {{DOMString}} |name|, is the same @@ -741,6 +840,12 @@
- The user agent maintains a single global permission store which is a list of [=permission store entries=]. + The user agent maintains a single permission store which is a [=/list=] of [=permission store entries=]. The user agent removes [=entries=] from the list when their respective [=permission=]'s [=permission/lifetime=] has expired.
@@ -330,13 +330,13 @@
- To generate a permission store key `key` given [=environment settings object=] |settings|, run these steps: + To generate a permission store key given [=environment settings object=] |settings|, run these steps:
How do we ensure that other specs can override this? Should we add all key deviations as new steps to this algorithm or have a different override mechanism?
From 0c9cfa5def7468b12154fdf1e2a024c55c1fec5c Mon Sep 17 00:00:00 2001
From: Johann Hofmann
- The user agent maintains a single permission store which is a [=/list=] of [=permission store entries=].
- The user agent removes [=entries=] from the list when their respective [=permission=]'s [=permission/lifetime=] has expired.
+ The user agent maintains a single permission store which is a [=/list=] of [=permission store entries=].
- We should still allow UAs flexibility in giving out permissions with smaller scope and lifetime (e.g. per-tab) in some form. There should generally still be enough room for exploration here.
+
+ The user agent MAY remove [=entries=] from the [=permission store=] when their respective [=permission=]'s [=permission/lifetime=] has expired.
- A permission store entry is a [=tuple=] of [=powerful feature/name=] name, [=permission store key=] key, {{PermissionDescriptor}} descriptor, and [=permission/state=] state.
+ The user agent MAY maintain additional permission stores with [=implementation-defined=] scope and eviction rules. Which permission store is adressed in a given moment is [=implementation-defined=].
+
+ This is intended to allow a user agent to experiment with user-friendly permission concepts such as per-tab grants.
+
Permission Store
- To get a permission store entry from the [=global permission store=] given a |name|, [=permission store key=] key and descriptor, run these steps: + A permission store entry is a [=tuple=] of [=powerful feature/name=] name, [=permission store key=] key, {{PermissionDescriptor}} descriptor, and [=permission/state=] state. +
++ To get a permission store entry from the user agent's permission store given a |name|, [=permission store key=] key and descriptor, run these steps:
- To set a permission store entry in the [=global permission store=] given a [=powerful feature/name=] |name|, a [=permission store key=] |key|, a {{PermissionDescriptor}} |descriptor|, and a [=permission/state=] |state|, run these steps: + To set a permission store entry in the user agent's permission store given a [=powerful feature/name=] |name|, a [=permission store key=] |key|, a {{PermissionDescriptor}} |descriptor|, and a [=permission/state=] |state|, run these steps:
- To remove a permission store entry from the [=global permission store=] given a name, key and descriptor, run these steps: + To remove a permission store entry from the permission store given a name, key and descriptor, run these steps:
- A permission store key is a [=tuple=] of ([=origin=] top-level origin, [=origin=] embedded origin). + A permission store key is a [=tuple=] of ([=origin=] top-level origin, [=origin=] granted origin).
To generate a permission store key given [=environment settings object=] |settings|, run these steps:
- How do we ensure that other specs can override this? Should we add all key deviations as new steps to this algorithm or have a different override mechanism? -
- Most permissions will want to key on the top-level origin and delegate access via Permissions Policy. - However, others, like the Storage Access API, explicitly describe a embeddee relationship and need to use the - embedded origin field. -
-- This assumes that passed in settings is from the embedded document. + Most permissions will want to set the permission grant on the top-level origin and delegate access via Permissions Policy. + However, others, like the Storage Access API, explicitly describe an embeddee relationship and could set a different granted origin.
- Do we have to define this? If we can compare origins we can probably implicitly compare a tuple of origins? -
From e3285ed7485b6d7e49a93c72288e00c17257fa30 Mon Sep 17 00:00:00 2001 From: Johann HofmannThe user agent MAY maintain additional permission stores with [=implementation-defined=] scope and eviction rules. Which permission store is adressed in a given moment is [=implementation-defined=]. -
+
- A permission store entry is a [=tuple=] of [=powerful feature/name=] name, [=permission store key=] key, {{PermissionDescriptor}} descriptor, and [=permission/state=] state. + A permission store entry is a [=tuple=] of [=powerful feature/name=] name, [=permission store key=] key, {{PermissionDescriptor}} descriptor, and [=permission/state=] state.
- To get a permission store entry from the user agent's permission store given a |name|, [=permission store key=] key and descriptor, run these steps: -
- To set a permission store entry in the user agent's permission store given a [=powerful feature/name=] |name|, a [=permission store key=] |key|, a {{PermissionDescriptor}} |descriptor|, and a [=permission/state=] |state|, run these steps: -
- To remove a permission store entry from the permission store given a name, key and descriptor, run these steps: -
- A permission store key is a [=tuple=] of ([=origin=] top-level origin, [=origin=] granted origin). + A permission store key is a [=tuple=] of ([=origin=] top-level origin, [=origin=] granted origin).
- To generate a permission store key given [=environment settings object=] |settings|, run these steps: -
+ To generate a permission store key given [=environment settings object=] |settings|, run these steps: +
- To compare [=permission store keys=] |key1| and |key2|, run these steps: -
A permission store entry is a [=tuple=] of [=powerful feature/name=] name, [=permission store key=] key, {{PermissionDescriptor}} descriptor, and [=permission/state=] state.
From 37915a65a7d64e82bd3e9319f16ae18dc3066e73 Mon Sep 17 00:00:00 2001
From: Johann Hofmann
- A permission store key is a [=tuple=] of ([=origin=] top-level origin, [=origin=] granted origin). -
- -- To generate a permission store key given [=environment settings object=] |settings|, run these steps: -
- To compare [=permission store keys=] |key1| and |key2|, run these steps: -
+ Takes an [=environment settings object=], and returns a new [=permission store 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 [=environment settings object=] |settings|, runs the following steps: +
++ Takes two [=permission store keys=] and returns a boolean that shows whether the two keys are equal. + If unspecified, this defaults to the default permission key comparison algorithm. +
++ The default permission key comparison algorithm, + given [=permission store keys=] |key1| and |key2| (both [=origins=]), runs the following steps: +
+- The user agent MAY maintain additional permission stores with [=implementation-defined=] scope and eviction rules. Which permission store is adressed in a given moment is [=implementation-defined=]. - -
-- A permission store entry is a [=tuple=] of [=powerful feature/name=] name, [=permission store key=] key, {{PermissionDescriptor}} descriptor, and [=permission/state=] state. + A permission store entry is a [=tuple=] of {{PermissionDescriptor}} descriptor, [=permission key=] key, and [=permission/state=] state.
- To get a permission store entry from the user agent's permission store given a |name|, [=permission store key=] key and descriptor, run these steps: + To get a permission store entry given a {{PermissionDescriptor}} |descriptor| and [=permission key=] |key|, run these steps:
- To set a permission store entry in the user agent's permission store given a [=powerful feature/name=] |name|, a [=permission store key=] |key|, a {{PermissionDescriptor}} |descriptor|, and a [=permission/state=] |state|, run these steps: + To set a permission store entry given a {{PermissionDescriptor}} |descriptor|, a [=permission key=] |key|, and a [=permission/state=] |state|, run these steps:
- To remove a permission store entry from the permission store given a name, key and descriptor, run these steps: + To remove a permission store entry given a {{PermissionDescriptor}} |descriptor| and [=permission key=] |key|, run these steps:
- A permission store key has the type returned by the feature's [=powerful feature/permission key generation algorithm=]. + A permission key has the type returned by the feature's [=powerful feature/permission key generation algorithm=].
++ To determine whether a [=permission key=] |key1| is equal to a [=permission key=] |key2|, given a {{PermissionDescriptor}} |descriptor|, run the following steps: +
- Takes an [=environment settings object=], and returns a new [=permission store key=]. + Takes an [=environment settings object=], 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, + The default permission key generation algorithm, given an [=environment settings object=] |settings|, runs the following steps:
- Takes two [=permission store keys=] and returns a boolean that shows whether the two keys are equal. + Takes two [=permission keys=] and returns a boolean that shows whether the two keys are equal. If unspecified, this defaults to the default permission key comparison algorithm.
- The default permission key comparison algorithm, - given [=permission store keys=] |key1| and |key2| (both [=origins=]), runs the following steps: + The default permission key comparison algorithm, + given [=permission keys=] |key1| and |key2|, runs the following steps:
When the user agent learns that the user no longer intends to grant permission to use a - feature, react to the user revoking permission by running these steps: + feature described by the {{PermissionDescriptor}} |descriptor| in the context + described by the [=permission key=] |key|, react to the user revoking permission + by running these steps:
- A permission key has the type returned by the feature's [=powerful feature/permission key generation algorithm=]. + A permission key has its type defined by a feature's [=powerful feature/permission key type=].
To determine whether a [=permission key=] |key1| is equal to a [=permission key=] |key2|, given a {{PermissionDescriptor}} |descriptor|, run the following steps:
+ The type of [=permission key=] used by the feature. Defaults to [=origin=]. + A feature that specifies a custom [=powerful feature/permission key type=] MUST also specify a + [=powerful feature/permission key generation algorithm=]. +
+- To determine whether a [=permission key=] |key1| is equal to a [=permission key=] |key2|, given a {{PermissionDescriptor}} |descriptor|, run the following steps: + To determine whether a [=permission key=] |key1| is equal to a [=permission key=] |key2|, given a {{PermissionDescriptor}} |descriptor|, run the following steps:
- A permission store entry is a [=tuple=] of {{PermissionDescriptor}} descriptor, [=permission key=] key, and [=permission/state=] state. + A permission store entry is a [=tuple=] of {{PermissionDescriptor}} descriptor, an instance key of the [=permission key type=] of the feature named by [=permission store entry/descriptor=].name, and [=permission/state=] state.
To get a permission store entry given a {{PermissionDescriptor}} |descriptor| and [=permission key=] |key|, run these steps:
From 8bffedb08e4ba5d5fd5d87cd4bc4ecb5839af54c Mon Sep 17 00:00:00 2001
From: Johann Hofmann
- The user agent maintains a single permission store which is a [=/list=] of [=permission store entries=].
+ The user agent maintains a single permission store which is a [=/list=] of [=permission store entries=]. Each particular [=entry=] denoted by its [=permission store entry/descriptor=] and [=permission store entry/key=] can only appear at most once in this list.
The user agent MAY remove [=entries=] from the [=permission store=] when their respective [=permission=]'s [=permission/lifetime=] has expired.
- A permission store entry is a [=tuple=] of {{PermissionDescriptor}} descriptor, an instance key of the [=permission key type=] of the feature named by [=permission store entry/descriptor=].name, and [=permission/state=] state.
+ A permission store entry is a [=tuple=] of {{PermissionDescriptor}} descriptor, an instance key of the [=powerful feature/permission key type=] of the feature named by [=permission store entry/descriptor=].name, and [=permission/state=] state.
To get a permission store entry given a {{PermissionDescriptor}} |descriptor| and [=permission key=] |key|, run these steps:
@@ -340,12 +340,10 @@
Permission Store
If |key1| is not of |descriptor|'s [=powerful feature/permission key type=] or |key2| is not of |descriptor|'s [=powerful feature/permission key type=], return false.
- To get a permission store entry given a {{PermissionDescriptor}} |descriptor| and [=permission key=] |key|, run these steps: + To get a permission store entry given a {{PermissionDescriptor}} |descriptor| and [=permission key=] |key|:
- A permission store entry is a [=tuple=] of {{PermissionDescriptor}} descriptor, an instance key of the [=powerful feature/permission key type=] of the feature named by [=permission store entry/descriptor=].name, and [=permission/state=] state. + A permission store entry is a [=tuple=] of {{PermissionDescriptor}} descriptor, [=permission key=] key, and [=permission/state=] state.
To get a permission store entry given a {{PermissionDescriptor}} |descriptor| and [=permission key=] |key|:
- Takes two [=permission keys=] and returns a boolean that shows whether the two keys are equal. + Takes two [=permission keys=] and returns a [=boolean=] that shows whether the two keys are equal. If unspecified, this defaults to the default permission key comparison algorithm.
From 66434eb592d4700c3b5a1a324927d281a9305828 Mon Sep 17 00:00:00 2001
From: Johann Hofmann