8000
Skip to content

Define permission lifetimes - #287

Merged
marcoscaceres merged 8 commits into
mainfrom
permission_lifetime
Nov 23, 2021
Merged

Define permission lifetimes#287
marcoscaceres merged 8 commits into
mainfrom
permission_lifetime

Conversation

@marcoscaceres
@marcoscaceres marcoscaceres commented Aug 31, 2021
Copy link
Copy Markdown
Member

closes #233

Exports [=permission/lifetimes=].


Preview | Diff

@tomayac
tomayac commented Aug 31, 2021
Copy link
Copy Markdown
Contributor

Woohoo, thanks for specifying this :-) That's it, that's the comment.

@miketaylr miketaylr left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a couple of editorial notes.

Comment thread index.html Outdated
Comment thread index.html Outdated
Comment thread index.html Outdated
@marcoscaceres
Copy link
Copy Markdown
Member Author

Thanks @tomayac! It's a start 🙏 Any further feedback you can provide is always welcome! You always provide great feedback.

Comment thread index.html Outdated
Comment thread index.html Outdated
Comment thread index.html Outdated
@marcoscaceres
marcoscaceres marked this pull request as ready for review November 11, 2021 07:12
@jyasskin jyasskin left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I think this works for integrating the lifetime into the algorithms.

Comment thread index.html Outdated
Comment thread index.html Outdated
</p>
<p>
When the permission [=permission/lifetime=] expires for an origin, and if there are
[=browsing contexts=] present pertaining to the [=permission=]'s associated origin,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does "pertaining to" have a precise definition?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No... I was hesitant to use that word. I'm open to suggestions as to how to make that association (I'll give that some further thought too).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're trying to say, if you're the top-level browsing context for a given origin and have any ancestor browsing contexts, revoke permission for all browsing contexts? I guess https://html.spec.whatwg.org/#nested-browsing-contexts gives you most of what you need.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be possible to treat it like a map, in that we can just grab all any/all browsing contexts associated with an origin (not really worrying if they are nested or not.)

Comment thread index.html Outdated
Comment thread index.html Outdated
Comment thread index.html Outdated
Comment thread index.html Outdated
Comment thread index.html Outdated
<p>
When the permission [=permission/lifetime=] expires for an origin, and if there are
[=browsing contexts=] present pertaining to the [=permission=]'s associated origin,
the user agent MUST run the [=powerful feature/permission revocation algorithm=].
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run it where? "Queue a task to run the algorithm on each browsing context's event loop"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, something like that could work... will add it.

BTW: I think we need to relook at the "permission revocation algorithm"... it seems to call it self recursively.

Comment thread index.html Outdated
Comment thread index.html Outdated
[=browsing contexts=] present pertaining to the [=permission=]'s associated origin,
the user agent MUST run the [=powerful feature/permission revocation algorithm=].
Alternatively, if there is no [=browsing contexts=] present, the user agent MUST
revoke a permission for the origin by setting it back to its default [=permission
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Setting" a permission state isn't really defined in this spec, in order to give UAs lots of freedom of how to infer what the user wants. I think it's clear enough what you mean here, but it could help to define "setting a descriptor's permission state to X" as something like "as if the UA had returned X when reading the descriptor's permission state for some group of settings objects".

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Setting" a permission state isn't really defined in this spec, in order to give UAs lots of freedom of how to infer what the user wants.

I think that's fine, but conceptually there is still some datastore somewhere that gets updated (that is, a permission is bound to an origin or a realm or whatever). When the update happens, it gets asynchronously propagated.

I think it's clear enough what you mean here, but it could help to define "setting a descriptor's permission state to X" as something like "as if the UA had returned X when reading the descriptor's permission state for some group of settings objects".

Upon reflection, I think we should do this as a followup, because it gets into the problem above about conceptualizing how permissions are actually stored (or how we will pretend they are stored for the purpose of the specification).

Comment thread index.html Outdated
@jyasskin
jyasskin requested a review from miketaylr November 11, 2021 13:22
Co-authored-by: Jeffrey Yasskin <jyasskin@chromium.org>
@miketaylr miketaylr left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good to me, pending @jyasskin's comments.

Comment thread index.html Outdated
</p>
<p>
When the permission [=permission/lifetime=] expires for an origin, and if there are
[=browsing contexts=] present pertaining to the [=permission=]'s associated origin,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're trying to say, if you're the top-level browsing context for a given origin and have any ancestor browsing contexts, revoke permission for all browsing contexts? I guess https://html.spec.whatwg.org/#nested-browsing-contexts gives you most of what you need.

@marcoscaceres
Copy link
Copy Markdown
Member Author

I’m going ahead and merging this as it gives us a good foundation to go off (and it’s blocking geo).

@marcoscaceres
marcoscaceres merged commit 8bf9509 into main Nov 23, 2021
@marcoscaceres
marcoscaceres deleted the permission_lifetime branch November 23, 2021 22:21
github-actions Bot added a commit that referenced this pull request Nov 23, 2021
SHA: 8bf9509
Reason: push, by @marcoscaceres

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Permission lifetimes

4 participants

0