Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define permission lifetimes #287

Merged
merged 8 commits into from
Nov 23, 2021
Merged

Define permission lifetimes #287

merged 8 commits into from
Nov 23, 2021

Conversation

marcoscaceres
Copy link
Member

@marcoscaceres marcoscaceres commented Aug 31, 2021

closes #233

Exports [=permission/lifetimes=].


Preview | Diff

@tomayac
Copy link
Contributor

tomayac commented Aug 31, 2021

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

Copy link
Member

@miketaylr miketaylr left a comment

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.

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
@marcoscaceres
Copy link
Member Author

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

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
@marcoscaceres marcoscaceres marked this pull request as ready for review November 11, 2021 07:12
Copy link
Member

@jyasskin jyasskin left a comment

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.

index.html Outdated Show resolved Hide resolved
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
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
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
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
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.)

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
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
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
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.

index.html Outdated Show resolved Hide resolved
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
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
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
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).

index.html Outdated Show resolved Hide resolved
Copy link
Member

@miketaylr miketaylr left a comment

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.

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