mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 00:03:56 +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:
@@ -0,0 +1,23 @@
|
||||
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[]>;
|
||||
}
|
||||
Reference in New Issue
Block a user