mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
[PM-18046] Implement session storage (#17346)
* feat: add support for IPC client managed session storage * feat: update SDK * fix: using undecorated service in jslib module directly * feat: add test case for web * chore: document why we use any type * fix: `ipc` too short * typo: omg * Revert "typo: omg" This reverts commit559b05eb5a. * Revert "fix: `ipc` too short" This reverts commit35fc99e10b. * fix: use camelCase
This commit is contained in:
@@ -3,7 +3,12 @@ import { inject } from "@angular/core";
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||
import { SdkLoadService } from "@bitwarden/common/platform/abstractions/sdk/sdk-load.service";
|
||||
import { IpcMessage, IpcService, isIpcMessage } from "@bitwarden/common/platform/ipc";
|
||||
import {
|
||||
IpcMessage,
|
||||
IpcService,
|
||||
isIpcMessage,
|
||||
IpcSessionRepository,
|
||||
} from "@bitwarden/common/platform/ipc";
|
||||
import {
|
||||
IncomingMessage,
|
||||
IpcClient,
|
||||
@@ -15,6 +20,7 @@ import {
|
||||
export class WebIpcService extends IpcService {
|
||||
private logService = inject(LogService);
|
||||
private platformUtilsService = inject(PlatformUtilsService);
|
||||
private sessionRepository = inject(IpcSessionRepository);
|
||||
private communicationBackend?: IpcCommunicationBackend;
|
||||
|
||||
override async init() {
|
||||
@@ -70,7 +76,9 @@ export class WebIpcService extends IpcService {
|
||||
);
|
||||
});
|
||||
|
||||
await super.initWithClient(new IpcClient(this.communicationBackend));
|
||||
await super.initWithClient(
|
||||
IpcClient.newWithClientManagedSessions(this.communicationBackend, this.sessionRepository),
|
||||
);
|
||||
|
||||
if (this.platformUtilsService.isDev()) {
|
||||
await ipcRegisterDiscoverHandler(this.client, {
|
||||
|
||||
Reference in New Issue
Block a user