1
0
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 commit 559b05eb5a.

* Revert "fix: `ipc` too short"

This reverts commit 35fc99e10b.

* fix: use camelCase
This commit is contained in:
Andreas Coroiu
2025-11-14 08:51:38 +01:00
committed by GitHub
parent a55d0f02f2
commit ed2d8b9549
10 changed files with 140 additions and 15 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, {