mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-31 17:57:43 +01:00
Improved handling of grantor access to organizations after takeover (refactored) (#267)
* Revert "Add policy property to TakeoverResponse" This reverts commit 31da5081e6833cf8a9d5bb869c14600f25ca3f39. * Add getEmergencyGrantorPolicies to api service
This commit is contained in:
parent
ee164bebc6
commit
d376927e5e
@ -292,6 +292,7 @@ export abstract class ApiService {
|
||||
getEmergencyAccessTrusted: () => Promise<ListResponse<EmergencyAccessGranteeDetailsResponse>>;
|
||||
getEmergencyAccessGranted: () => Promise<ListResponse<EmergencyAccessGrantorDetailsResponse>>;
|
||||
getEmergencyAccess: (id: string) => Promise<EmergencyAccessGranteeDetailsResponse>;
|
||||
getEmergencyGrantorPolicies: (id: string) => Promise<ListResponse<PolicyResponse>>;
|
||||
putEmergencyAccess: (id: string, request: EmergencyAccessUpdateRequest) => Promise<any>;
|
||||
deleteEmergencyAccess: (id: string) => Promise<any>;
|
||||
postEmergencyAccessInvite: (request: EmergencyAccessInviteRequest) => Promise<any>;
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { EmergencyAccessStatusType } from '../../enums/emergencyAccessStatusType';
|
||||
import { EmergencyAccessType } from '../../enums/emergencyAccessType';
|
||||
import { KdfType } from '../../enums/kdfType';
|
||||
|
||||
import { BaseResponse } from './baseResponse';
|
||||
import { CipherResponse } from './cipherResponse';
|
||||
import { PolicyResponse } from './policyResponse';
|
||||
|
||||
export class EmergencyAccessGranteeDetailsResponse extends BaseResponse {
|
||||
id: string;
|
||||
@ -56,7 +54,6 @@ export class EmergencyAccessTakeoverResponse extends BaseResponse {
|
||||
keyEncrypted: string;
|
||||
kdf: KdfType;
|
||||
kdfIterations: number;
|
||||
policy: PolicyResponse[];
|
||||
|
||||
constructor(response: any) {
|
||||
super(response);
|
||||
@ -64,7 +61,6 @@ export class EmergencyAccessTakeoverResponse extends BaseResponse {
|
||||
this.keyEncrypted = this.getResponseProperty('KeyEncrypted');
|
||||
this.kdf = this.getResponseProperty('Kdf');
|
||||
this.kdfIterations = this.getResponseProperty('KdfIterations');
|
||||
this.policy = this.getResponseProperty('policy');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -933,6 +933,11 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
return new EmergencyAccessGranteeDetailsResponse(r);
|
||||
}
|
||||
|
||||
async getEmergencyGrantorPolicies(id: string): Promise<ListResponse<PolicyResponse>> {
|
||||
const r = await this.send('GET', '/emergency-access/' + id + '/policies', null, true, true);
|
||||
return new ListResponse(r, PolicyResponse);
|
||||
}
|
||||
|
||||
putEmergencyAccess(id: string, request: EmergencyAccessUpdateRequest): Promise<any> {
|
||||
return this.send('PUT', '/emergency-access/' + id, request, true, false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user