1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 17:23:37 +00:00
Files
browser/libs/key-management/src/abstractions/user-key-rotation-data-provider.abstraction.ts
Bernd Schoolmann e83dca529b [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
2024-10-26 13:47:40 +02:00

24 lines
890 B
TypeScript

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[]>;
}