1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-06 00:13:28 +00:00

fix: broken SDK interface (#14959)

This commit is contained in:
Andreas Coroiu
2025-05-27 14:31:27 +02:00
committed by GitHub
parent a6e2012087
commit 45f2104fd8
3 changed files with 16 additions and 6 deletions

View File

@@ -152,7 +152,15 @@ export class DefaultSdkService implements SdkService {
const settings = this.toSettings(env);
const client = await this.sdkClientFactory.createSdkClient(settings);
await this.initializeClient(client, account, kdfParams, privateKey, userKey, orgKeys);
await this.initializeClient(
userId,
client,
account,
kdfParams,
privateKey,
userKey,
orgKeys,
);
return client;
};
@@ -182,6 +190,7 @@ export class DefaultSdkService implements SdkService {
}
private async initializeClient(
userId: UserId,
client: BitwardenClient,
account: AccountInfo,
kdfParams: KdfConfig,
@@ -190,6 +199,7 @@ export class DefaultSdkService implements SdkService {
orgKeys: Record<OrganizationId, EncryptedOrganizationKeyData> | null,
) {
await client.crypto().initialize_user_crypto({
userId,
email: account.email,
method: { decryptedKey: { decrypted_user_key: userKey.keyB64 } },
kdfParams:

8
package-lock.json generated
View File

@@ -24,7 +24,7 @@
"@angular/platform-browser": "18.2.13",
"@angular/platform-browser-dynamic": "18.2.13",
"@angular/router": "18.2.13",
"@bitwarden/sdk-internal": "0.2.0-main.168",
"@bitwarden/sdk-internal": "0.2.0-main.177",
"@electron/fuses": "1.8.0",
"@emotion/css": "11.13.5",
"@koa/multer": "3.1.0",
@@ -4803,9 +4803,9 @@
"link": true
},
"node_modules/@bitwarden/sdk-internal": {
"version": "0.2.0-main.168",
"resolved": "https://registry.npmjs.org/@bitwarden/sdk-internal/-/sdk-internal-0.2.0-main.168.tgz",
"integrity": "sha512-NU10oqw+GI9oHrh8/i/IC8/7oaYmswqC2E/0Zc56xC3jY7uNgFZgpae7JhyMU6UxzrAjiEqdmGnm+AGWFiPG8w==",
"version": "0.2.0-main.177",
"resolved": "https://registry.npmjs.org/@bitwarden/sdk-internal/-/sdk-internal-0.2.0-main.177.tgz",
"integrity": "sha512-2fp/g0WJDPPrIqrU88QrwoJsZTzoi7S7eCf+Qq0/8x3ImqQyoYJEdHdz06YHjUdS0CzucPrwTo5zJ/ZvcLNOmQ==",
"license": "GPL-3.0"
},
"node_modules/@bitwarden/send-ui": {

View File

@@ -159,7 +159,7 @@
"@angular/platform-browser": "18.2.13",
"@angular/platform-browser-dynamic": "18.2.13",
"@angular/router": "18.2.13",
"@bitwarden/sdk-internal": "0.2.0-main.168",
"@bitwarden/sdk-internal": "0.2.0-main.177",
"@electron/fuses": "1.8.0",
"@emotion/css": "11.13.5",
"@koa/multer": "3.1.0",