mirror of
https://github.com/bitwarden/browser
synced 2026-02-10 13:40:06 +00:00
Fix type errors
This commit is contained in:
@@ -5,10 +5,10 @@ import { BehaviorSubject, of } from "rxjs";
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
import { Account, AccountService } from "@bitwarden/common/auth/abstractions/account.service";
|
||||
import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service";
|
||||
import { EncString } from "@bitwarden/common/key-management/crypto/models/enc-string";
|
||||
import { ProviderId, UserId } from "@bitwarden/common/types/guid";
|
||||
import { newGuid } from "@bitwarden/guid";
|
||||
import { KeyService } from "@bitwarden/key-management";
|
||||
import { UnsignedSharedKey } from "@bitwarden/sdk-internal";
|
||||
import { ProviderUser } from "@bitwarden/web-vault/app/admin-console/common/people-table-data-source";
|
||||
|
||||
import { ProviderActionsService } from "./provider-actions.service";
|
||||
@@ -104,7 +104,7 @@ describe("ProviderActionsService", () => {
|
||||
const activeAccount$ = new BehaviorSubject<Account | null>(mockAccount);
|
||||
accountService.activeAccount$ = activeAccount$;
|
||||
keyService.providerKeys$.mockReturnValue(of({ [providerId]: { key: "mock" } as any }));
|
||||
encryptService.encapsulateKeyUnsigned.mockResolvedValue(new EncString("encrypted"));
|
||||
encryptService.encapsulateKeyUnsigned.mockResolvedValue("4.encrypted" as UnsignedSharedKey);
|
||||
apiService.postProviderUserConfirm.mockResolvedValue(undefined);
|
||||
|
||||
const result = await service.confirmProvider(mockProviderUser, providerId, publicKey);
|
||||
|
||||
@@ -6,6 +6,7 @@ import { IdentityTokenResponse } from "@bitwarden/common/auth/models/response/id
|
||||
import { KeyConnectorUserDecryptionOptionResponse } from "@bitwarden/common/auth/models/response/user-decryption-options/key-connector-user-decryption-option.response";
|
||||
import { TrustedDeviceUserDecryptionOptionResponse } from "@bitwarden/common/auth/models/response/user-decryption-options/trusted-device-user-decryption-option.response";
|
||||
import { WebAuthnPrfDecryptionOptionResponse } from "@bitwarden/common/auth/models/response/user-decryption-options/webauthn-prf-decryption-option.response";
|
||||
import { UnsignedSharedKey } from "@bitwarden/sdk-internal";
|
||||
|
||||
/**
|
||||
* Key Connector decryption options. Intended to be sent to the client for use after authentication.
|
||||
@@ -58,7 +59,7 @@ export class WebAuthnPrfUserDecryptionOption {
|
||||
/** The encrypted private key that can be decrypted with the PRF key. */
|
||||
encryptedPrivateKey: string;
|
||||
/** The encrypted user key that can be decrypted with the private key. */
|
||||
encryptedUserKey: string;
|
||||
encryptedUserKey: UnsignedSharedKey;
|
||||
/** The credential ID for this WebAuthn PRF credential. */
|
||||
credentialId: string;
|
||||
/** The transports supported by this credential. */
|
||||
@@ -80,7 +81,7 @@ export class WebAuthnPrfUserDecryptionOption {
|
||||
}
|
||||
const options = new WebAuthnPrfUserDecryptionOption();
|
||||
options.encryptedPrivateKey = response.encryptedPrivateKey.encryptedString;
|
||||
options.encryptedUserKey = response.encryptedUserKey.encryptedString;
|
||||
options.encryptedUserKey = response.encryptedUserKey;
|
||||
options.credentialId = response.credentialId;
|
||||
options.transports = response.transports || [];
|
||||
return options;
|
||||
|
||||
@@ -123,7 +123,7 @@ export class DefaultWebAuthnPrfUnlockService implements WebAuthnPrfUnlockService
|
||||
|
||||
// Step 2: Use private key to decrypt user key
|
||||
const userKey = await this.encryptService.decapsulateKeyUnsigned(
|
||||
new EncString(prfOption.encryptedUserKey),
|
||||
prfOption.encryptedUserKey,
|
||||
privateKey,
|
||||
);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ import {
|
||||
UserPrivateKey,
|
||||
UserPublicKey,
|
||||
} from "@bitwarden/common/types/key";
|
||||
import { UnsignedSharedKey } from "@bitwarden/sdk-internal";
|
||||
import { UnsignedSharedKey, WrappedAccountCryptographicState } from "@bitwarden/sdk-internal";
|
||||
|
||||
import { KdfConfigService } from "./abstractions/kdf-config.service";
|
||||
import {
|
||||
|
||||
Reference in New Issue
Block a user