Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3353684
D8120.id27762.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D8120.id27762.diff
View Options
diff --git a/web/database/database-module-provider.js b/web/database/database-module-provider.js
--- a/web/database/database-module-provider.js
+++ b/web/database/database-module-provider.js
@@ -41,7 +41,7 @@
}
}
- init() {
+ init(encryptionKey?: ?SubtleCrypto$JsonWebKey) {
this.status = databaseStatuses.initInProgress;
this.worker = new SharedWorker(DATABASE_WORKER_PATH);
this.worker.onerror = console.error;
@@ -58,6 +58,7 @@
type: workerRequestMessageTypes.INIT,
sqljsFilePath: `${origin}${SQLJS_FILE_PATH}`,
sqljsFilename,
+ encryptionKey,
});
this.status = databaseStatuses.initSuccess;
console.info('Database initialization success');
@@ -68,7 +69,10 @@
})();
}
- initDBForLoggedInUser(currentLoggedInUserID: ?string) {
+ initDBForLoggedInUser(
+ currentLoggedInUserID: ?string,
+ encryptionKey?: ?SubtleCrypto$JsonWebKey,
+ ) {
if (this.status === databaseStatuses.initSuccess) {
return;
}
@@ -77,7 +81,7 @@
this.status === databaseStatuses.notSupported &&
isSQLiteSupported(currentLoggedInUserID)
) {
- this.init();
+ this.init(encryptionKey);
}
}
diff --git a/web/types/worker-types.js b/web/types/worker-types.js
--- a/web/types/worker-types.js
+++ b/web/types/worker-types.js
@@ -36,6 +36,7 @@
+type: 1,
+sqljsFilePath: string,
+sqljsFilename: ?string,
+ +encryptionKey?: ?SubtleCrypto$JsonWebKey,
};
export type GenerateDatabaseEncryptionKeyRequestMessage = {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 10:54 AM (21 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2574629
Default Alt Text
D8120.id27762.diff (1 KB)
Attached To
Mode
D8120: [web-db] add optional encryption key param while initializing database on web
Attached
Detach File
Event Timeline
Log In to Comment