Bug 183517 - Feature Request: Include IndexedDB into Storage Access API
Summary: Feature Request: Include IndexedDB into Storage Access API
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-03-09 09:43 PST by Stefan Sechelmann
Modified: 2021-08-11 14:08 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Sechelmann 2018-03-09 09:43:14 PST
We develop a web app that handles sensitive user date. We have a security mechanism in place that is based on origin separation between frontend (top-level context) and data storage (iframe on a different origin via postMessage api). Currently we support Chrome and Firefox which allow for 3rd party storage access. 

We respect the policy of the WebKit team to protect the privacy of the user and prevent tracking by employing partitioning on all 3rd party storage systems. At the same time this is a blocker for us when implementing our system for Safari on Mac and iOS. The Storage Access API (https://github.com/whatwg/html/issues/3338) seems like the right idea if applied to all storage types, i.e., Cookies, LocalStorage, and IndexedDB.

As the discussion points in the direction of having no user interaction to grant the permission I wanted to stress that we are in favour of a system that goes along the lines of other permissions like camera or microphones, i.e., the user is prompted for consent via browser UI and the choice is persisted across browser sessions.
Comment 1 Brady Eidson 2018-03-12 09:42:16 PDT
I'm *pretty sure* the plan is for StorageAccess to cover literally every local storage type eventually.

I'll let John comment, though.
Comment 2 Brady Eidson 2018-03-12 09:43:41 PDT
(In reply to Brady Eidson from comment #1)
> I'm *pretty sure* the plan is for StorageAccess to cover literally every
> local storage type eventually.

Yah, I see in the issues thread Maciej asked you file this bug and then you did.

Again, cookies being the primary and "automatic" tracking vector is why v1 focused on them, but there are plans to cover the whole platform.
Comment 3 John Wilander 2018-03-12 10:17:54 PDT
Brady is correct — Storage Access API is intended to cover all partitioned storage. We just need to get adoption of v1 and get feedback on it.

We already got an important enhancement request in how the API plays together with the popup blocker.

I imagine something similar might go for when a cross-origin iframe tries to navigate the top frame. There's movement in that space right now. We don't want to end up with well-behaved third-parties having to convince first-parties to execute their JavaScript in the first-party context to be able to navigate the user to a login page. And we want the embedding page to have appropriate control through iframe sandbox tokens.
Comment 4 Stefan Sechelmann 2018-03-12 15:35:09 PDT
Ok, so then we may use this thread to gather ideas on how to extend the API to include IndexedDB. I mean there are a few questions that immediately come to my mind:

* What happens to database instances that are already active when the a storage access request resolves?
* If service workers are affected by partitioning too, what happens to the database connections that are active within a service worker?
* What is going on if there is more that one tab, is there some kind of event that makes other tabs aware of the change?

Greetings
Stefan
Comment 5 youenn fablet 2018-03-12 15:54:27 PDT
> * What happens to database instances that are already active when the a
> storage access request resolves?
> * If service workers are affected by partitioning too, what happens to the
> database connections that are active within a service worker?

Note that a service worker may be used to keep some state.
It might make sense to change the controlling service worker of such an iframe when using the storage access API.
Comment 6 Radar WebKit Bug Importer 2021-08-11 14:08:57 PDT
<rdar://problem/81812694>