mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 13:23:34 +00:00
* Move Encstring to KM ownership * Fix wrong import * Fix build * Fix remaining imports * Fix tests
42 lines
1.5 KiB
TypeScript
42 lines
1.5 KiB
TypeScript
// FIXME: Update this file to be type safe and remove this and next line
|
|
// @ts-strict-ignore
|
|
import { EncString } from "../../../../key-management/crypto/models/enc-string";
|
|
import { BaseResponse } from "../../../../models/response/base.response";
|
|
|
|
export interface ITrustedDeviceUserDecryptionOptionServerResponse {
|
|
HasAdminApproval: boolean;
|
|
HasLoginApprovingDevice: boolean;
|
|
HasManageResetPasswordPermission: boolean;
|
|
IsTdeOffboarding: boolean;
|
|
EncryptedPrivateKey?: string;
|
|
EncryptedUserKey?: string;
|
|
}
|
|
|
|
export class TrustedDeviceUserDecryptionOptionResponse extends BaseResponse {
|
|
hasAdminApproval: boolean;
|
|
hasLoginApprovingDevice: boolean;
|
|
hasManageResetPasswordPermission: boolean;
|
|
isTdeOffboarding: boolean;
|
|
encryptedPrivateKey: EncString;
|
|
encryptedUserKey: EncString;
|
|
|
|
constructor(response: any) {
|
|
super(response);
|
|
this.hasAdminApproval = this.getResponseProperty("HasAdminApproval");
|
|
|
|
this.hasLoginApprovingDevice = this.getResponseProperty("HasLoginApprovingDevice");
|
|
this.hasManageResetPasswordPermission = this.getResponseProperty(
|
|
"HasManageResetPasswordPermission",
|
|
);
|
|
|
|
this.isTdeOffboarding = this.getResponseProperty("IsTdeOffboarding");
|
|
|
|
if (response.EncryptedPrivateKey) {
|
|
this.encryptedPrivateKey = new EncString(this.getResponseProperty("EncryptedPrivateKey"));
|
|
}
|
|
if (response.EncryptedUserKey) {
|
|
this.encryptedUserKey = new EncString(this.getResponseProperty("EncryptedUserKey"));
|
|
}
|
|
}
|
|
}
|