1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-22 03:03:43 +00:00

feat: add support for IPC client managed session storage

This commit is contained in:
Andreas Coroiu
2025-11-06 09:27:22 +01:00
parent a66227638e
commit b125c7e680
7 changed files with 70 additions and 5 deletions

View File

@@ -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, {