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

Age Out Of Granted Storage Access #5

Open
johnwilander opened this issue Feb 5, 2020 · 9 comments
Open

Age Out Of Granted Storage Access #5

johnwilander opened this issue Feb 5, 2020 · 9 comments
Labels
blocked Blocked on something interop Tracking differences in existing implementations resolve before graduation These issues need to be resolved before the spec graduates from the CG

Comments

@johnwilander
Copy link
Collaborator

Mozilla's documentation on differences between Safari's and Firefox's implementation covers the difference explained below albeit with a slightly incorrect description of Safari's behavior.

Safari: Granted storage access is aged out when website data is deleted by the tracking prevention feature itself which triggers after 30 days of Safari use without user interaction. Successful use of the Storage Access API resets that counter.

Firefox: Granted storage access is aged out after 30 calendar days regardless of usage patterns.

I don't think the age out is a crucial part of the API so I'm fine leaving it as a browser choice in the spec.

@johnwilander johnwilander added the interop Tracking differences in existing implementations label Feb 5, 2020
@Brandr0id
Copy link
Member

Agreed, leaving this specifiable by the implementer makes sense to me. Even within Chromium there may be different embedders that wish to have different time constraints on these grants.

@ehsan
Copy link

ehsan commented Feb 12, 2020

That sounds fine to me as well. BTW I updated that wiki page to fix the description of Safari's behaviour, apologies for our mistake!

@johnwilander
Copy link
Collaborator Author

I added a section called "Scope of Storage Access" in 32e1d3f. As noted there, if storage is frame-specific, it's not clear how age-out beyond the lifetime of the page (or iframe) could work.

@johnwilander johnwilander added the agenda+ Request to add this issue to the agenda of our next telcon or F2F label Mar 10, 2020
@jameshartig
Copy link

Resetting the expiration based on successful usage seems like it would solve #8 and would prevent people from having to login every 30 days. Would we be willing to add something to the spec about that or would that also be up to the implementation?

@johnwilander
Copy link
Collaborator Author

Resetting the expiration based on successful usage seems like it would solve #8 and would prevent people from having to login every 30 days. Would we be willing to add something to the spec about that or would that also be up to the implementation?

WebKit’s implementation already does this, for that reason. Granted storage access through the Storage Access API counts as user interaction as first party (=renews the time stamp) in the eyes of ITP.

Since I don’t think any other browser is deleting website data based on user interaction like ITP (true?), I’ve been reluctant to add such details. I’ll add such a section if there is interest from other implementers.

@hober hober removed the agenda+ Request to add this issue to the agenda of our next telcon or F2F label Mar 24, 2020
@hober hober added the explainer Issue or PR for the explainer. label Apr 29, 2020
hober added a commit that referenced this issue Apr 29, 2020
@hober hober removed the explainer Issue or PR for the explainer. label Apr 29, 2020
@johannhof
Copy link
Member

On Firefox side we would like to suggest automatically renewing storage access in any of the following cases:

  • On successful use of the storage access API (in a cross-origin iframe)
  • On any user interaction with a cross-origin iframe that already has storage access granted (this is to avoid developers hanging storage access requests onto unrelated button clicks as a hack to renew storage access, or having to show interstitial "yes I want to keep the site working" buttons)

We could standardize on these (the renewal mechanism) and leave the expiry mechanism (after x days of y kind of usage) implementor-specific.

Note that in Firefox "losing storage access" is technically a different thing than getting storage "purged" through the deletion mechanisms that both Firefox and Safari implement. However, the criteria for the two events are essentially the same (no user interaction in 45 days) and they are somewhat coupled in our code base. So this is very similar to Safari now, to the point where it might make for a good developer experience to call out the deletion mechanism explicitly.

@johnwilander
Copy link
Collaborator Author

On Firefox side we would like to suggest automatically renewing storage access in any of the following cases:

  • On successful use of the storage access API (in a cross-origin iframe)
  • On any user interaction with a cross-origin iframe that already has storage access granted (this is to avoid developers hanging storage access requests onto unrelated button clicks as a hack to renew storage access, or having to show interstitial "yes I want to keep the site working" buttons)

I think this is good. Two notes:

  • I assume that "successful use of the storage access API" means "being granted storage access through the API." Being denied could also be "successful use." :)
  • "Any user interaction with a cross-origin iframe" should be an alternative to the above point, so that user agents don't have to do both.

That should ensure that interaction in a cross-site iframe counts as first party interaction if the interaction either results in storage access or happens during storage access.

We could standardize on these (the renewal mechanism) and leave the expiry mechanism (after x days of y kind of usage) implementor-specific.

Note that in Firefox "losing storage access" is technically a different thing than getting storage "purged" through the deletion mechanisms that both Firefox and Safari implement. However, the criteria for the two events are essentially the same (no user interaction in 45 days) and they are somewhat coupled in our code base. So this is very similar to Safari now, to the point where it might make for a good developer experience to call out the deletion mechanism explicitly.

@johannhof johannhof assigned johannhof and unassigned johnwilander Feb 8, 2022
@bvandersloot-mozilla
Copy link
Collaborator

I assume that "successful use of the storage access API" means "being granted storage access through the API." Being denied could also be "successful use." :)

Your assumption is correct. A user deny will not count here.

"Any user interaction with a cross-origin iframe" should be an alternative to the above point, so that user agents don't have to do both.

I don't see how this alternative is different. If you are renewing a permission, isn't it required that the iframe already has the storage access granted?

We added the changes suggested by @johannhof to our implementation in Firefox, shipped in Firefox 97.

@johannhof johannhof added the resolve before graduation These issues need to be resolved before the spec graduates from the CG label Sep 26, 2022
@johannhof
Copy link
Member

Standardizing the "renewal" mechanism (which we should still do) is somewhat blocked on #121 as that would tell us how to tell the browser to renew the permission or storage access map.

@johannhof johannhof added the blocked Blocked on something label Oct 10, 2022
@johannhof johannhof removed their assignment Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked on something interop Tracking differences in existing implementations resolve before graduation These issues need to be resolved before the spec graduates from the CG
Projects
None yet
Development

No branches or pull requests

7 participants