mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 21:33:27 +00:00
[PM-19728] Device bulk get keys during key rotation (#14216)
* Add support for device list endpoint keys during key rotation * Update libs/common/src/auth/abstractions/devices/responses/device.response.ts Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com> --------- Co-authored-by: Thomas Avery <43214426+Thomas-Avery@users.noreply.github.com>
This commit is contained in:
@@ -15,6 +15,9 @@ export class DeviceResponse extends BaseResponse {
|
|||||||
creationDate: string;
|
creationDate: string;
|
||||||
revisionDate: string;
|
revisionDate: string;
|
||||||
isTrusted: boolean;
|
isTrusted: boolean;
|
||||||
|
encryptedUserKey: string | null;
|
||||||
|
encryptedPublicKey: string | null;
|
||||||
|
|
||||||
devicePendingAuthRequest: DevicePendingAuthRequest | null;
|
devicePendingAuthRequest: DevicePendingAuthRequest | null;
|
||||||
|
|
||||||
constructor(response: any) {
|
constructor(response: any) {
|
||||||
@@ -27,6 +30,8 @@ export class DeviceResponse extends BaseResponse {
|
|||||||
this.creationDate = this.getResponseProperty("CreationDate");
|
this.creationDate = this.getResponseProperty("CreationDate");
|
||||||
this.revisionDate = this.getResponseProperty("RevisionDate");
|
this.revisionDate = this.getResponseProperty("RevisionDate");
|
||||||
this.isTrusted = this.getResponseProperty("IsTrusted");
|
this.isTrusted = this.getResponseProperty("IsTrusted");
|
||||||
|
this.encryptedUserKey = this.getResponseProperty("EncryptedUserKey");
|
||||||
|
this.encryptedPublicKey = this.getResponseProperty("EncryptedPublicKey");
|
||||||
this.devicePendingAuthRequest = this.getResponseProperty("DevicePendingAuthRequest");
|
this.devicePendingAuthRequest = this.getResponseProperty("DevicePendingAuthRequest");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,9 +209,8 @@ export class DeviceTrustService implements DeviceTrustServiceAbstraction {
|
|||||||
devices.data
|
devices.data
|
||||||
.filter((device) => device.isTrusted)
|
.filter((device) => device.isTrusted)
|
||||||
.map(async (device) => {
|
.map(async (device) => {
|
||||||
const deviceWithKeys = await this.devicesApiService.getDeviceKeys(device.identifier);
|
|
||||||
const publicKey = await this.encryptService.decryptToBytes(
|
const publicKey = await this.encryptService.decryptToBytes(
|
||||||
deviceWithKeys.encryptedPublicKey,
|
new EncString(device.encryptedPublicKey),
|
||||||
oldUserKey,
|
oldUserKey,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user