1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

[PM-12607] Move key rotation to km ownership (#11709)

* Move key rotation to km ownership

* Fix build

* Move userkey rotation data provider abstraction to km ownership

* Move userkey rotation data provider abstraction to km ownership

* Fix linting

* Fix CODEOWNERS for key-management web

* Remove incorrect export

* Fix import error
This commit is contained in:
Bernd Schoolmann
2024-10-26 13:47:40 +02:00
committed by GitHub
parent c780cbc77e
commit e83dca529b
20 changed files with 15 additions and 16 deletions

View File

@@ -3,4 +3,3 @@ export * from "./login-email.service";
export * from "./login-strategy.service";
export * from "./user-decryption-options.service.abstraction";
export * from "./auth-request.service.abstraction";
export * from "./user-key-rotation-data-provider.abstraction";

View File

@@ -1,23 +0,0 @@
import { UserId } from "@bitwarden/common/types/guid";
import { UserKey } from "@bitwarden/common/types/key";
/**
* Constructs key rotation requests for data encryption by the user key.
* @typeparam TRequest A request model that contains re-encrypted data, must have an id property
*/
export interface UserKeyRotationDataProvider<
TRequest extends { id: string } | { organizationId: string },
> {
/**
* Provides re-encrypted data for the user key rotation process
* @param originalUserKey The original user key, useful for decrypting data
* @param newUserKey The new user key to use for re-encryption
* @param userId The owner of the data, useful for fetching data
* @returns A list of data that has been re-encrypted with the new user key
*/
getRotatedData(
originalUserKey: UserKey,
newUserKey: UserKey,
userId: UserId,
): Promise<TRequest[]>;
}