Merge branch 'main' into autofill/pm-6426-create-alarms-manager-and-update-usage-of-long-lived-timeouts-rework
This commit is contained in:
commit
72cc3a3296
|
@ -56,14 +56,16 @@ export class VaultCollectionRowComponent {
|
|||
}
|
||||
|
||||
get permissionText() {
|
||||
if (this.collection.id != Unassigned && !(this.collection as CollectionAdminView).assigned) {
|
||||
return this.i18nService.t("noAccess");
|
||||
} else {
|
||||
if (this.collection.id == Unassigned && this.organization?.canEditUnassignedCiphers()) {
|
||||
return this.i18nService.t("canEdit");
|
||||
}
|
||||
if ((this.collection as CollectionAdminView).assigned) {
|
||||
const permissionList = getPermissionList(this.organization?.flexibleCollections);
|
||||
return this.i18nService.t(
|
||||
permissionList.find((p) => p.perm === convertToPermission(this.collection))?.labelId,
|
||||
);
|
||||
}
|
||||
return this.i18nService.t("noAccess");
|
||||
}
|
||||
|
||||
get permissionTooltip() {
|
||||
|
|
|
@ -263,18 +263,26 @@ export class SendService implements InternalSendServiceAbstraction {
|
|||
throw new Error("New user key is required for rotation.");
|
||||
}
|
||||
|
||||
const originalUserKey = await this.cryptoService.getUserKey();
|
||||
|
||||
const req = await firstValueFrom(
|
||||
this.sends$.pipe(concatMap(async (sends) => this.toRotatedKeyRequestMap(sends, newUserKey))),
|
||||
this.sends$.pipe(
|
||||
concatMap(async (sends) => this.toRotatedKeyRequestMap(sends, originalUserKey, newUserKey)),
|
||||
),
|
||||
);
|
||||
// separate return for easier debugging
|
||||
return req;
|
||||
}
|
||||
|
||||
private async toRotatedKeyRequestMap(sends: Send[], newUserKey: UserKey) {
|
||||
private async toRotatedKeyRequestMap(
|
||||
sends: Send[],
|
||||
originalUserKey: UserKey,
|
||||
rotateUserKey: UserKey,
|
||||
) {
|
||||
const requests = await Promise.all(
|
||||
sends.map(async (send) => {
|
||||
const sendKey = await this.encryptService.decryptToBytes(send.key, newUserKey);
|
||||
send.key = await this.encryptService.encrypt(sendKey, newUserKey);
|
||||
const sendKey = await this.encryptService.decryptToBytes(send.key, originalUserKey);
|
||||
send.key = await this.encryptService.encrypt(sendKey, rotateUserKey);
|
||||
return new SendWithIdRequest(send);
|
||||
}),
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue