mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-05 18:47:52 +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>>;
|
getEmergencyAccessTrusted: () => Promise<ListResponse<EmergencyAccessGranteeDetailsResponse>>;
|
||||||
getEmergencyAccessGranted: () => Promise<ListResponse<EmergencyAccessGrantorDetailsResponse>>;
|
getEmergencyAccessGranted: () => Promise<ListResponse<EmergencyAccessGrantorDetailsResponse>>;
|
||||||
getEmergencyAccess: (id: string) => Promise<EmergencyAccessGranteeDetailsResponse>;
|
getEmergencyAccess: (id: string) => Promise<EmergencyAccessGranteeDetailsResponse>;
|
||||||
|
getEmergencyGrantorPolicies: (id: string) => Promise<ListResponse<PolicyResponse>>;
|
||||||
putEmergencyAccess: (id: string, request: EmergencyAccessUpdateRequest) => Promise<any>;
|
putEmergencyAccess: (id: string, request: EmergencyAccessUpdateRequest) => Promise<any>;
|
||||||
deleteEmergencyAccess: (id: string) => Promise<any>;
|
deleteEmergencyAccess: (id: string) => Promise<any>;
|
||||||
postEmergencyAccessInvite: (request: EmergencyAccessInviteRequest) => Promise<any>;
|
postEmergencyAccessInvite: (request: EmergencyAccessInviteRequest) => Promise<any>;
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import { EmergencyAccessStatusType } from '../../enums/emergencyAccessStatusType';
|
import { EmergencyAccessStatusType } from '../../enums/emergencyAccessStatusType';
|
||||||
import { EmergencyAccessType } from '../../enums/emergencyAccessType';
|
import { EmergencyAccessType } from '../../enums/emergencyAccessType';
|
||||||
import { KdfType } from '../../enums/kdfType';
|
import { KdfType } from '../../enums/kdfType';
|
||||||
|
|
||||||
import { BaseResponse } from './baseResponse';
|
import { BaseResponse } from './baseResponse';
|
||||||
import { CipherResponse } from './cipherResponse';
|
import { CipherResponse } from './cipherResponse';
|
||||||
import { PolicyResponse } from './policyResponse';
|
|
||||||
|
|
||||||
export class EmergencyAccessGranteeDetailsResponse extends BaseResponse {
|
export class EmergencyAccessGranteeDetailsResponse extends BaseResponse {
|
||||||
id: string;
|
id: string;
|
||||||
@ -56,7 +54,6 @@ export class EmergencyAccessTakeoverResponse extends BaseResponse {
|
|||||||
keyEncrypted: string;
|
keyEncrypted: string;
|
||||||
kdf: KdfType;
|
kdf: KdfType;
|
||||||
kdfIterations: number;
|
kdfIterations: number;
|
||||||
policy: PolicyResponse[];
|
|
||||||
|
|
||||||
constructor(response: any) {
|
constructor(response: any) {
|
||||||
super(response);
|
super(response);
|
||||||
@ -64,7 +61,6 @@ export class EmergencyAccessTakeoverResponse extends BaseResponse {
|
|||||||
this.keyEncrypted = this.getResponseProperty('KeyEncrypted');
|
this.keyEncrypted = this.getResponseProperty('KeyEncrypted');
|
||||||
this.kdf = this.getResponseProperty('Kdf');
|
this.kdf = this.getResponseProperty('Kdf');
|
||||||
this.kdfIterations = this.getResponseProperty('KdfIterations');
|
this.kdfIterations = this.getResponseProperty('KdfIterations');
|
||||||
this.policy = this.getResponseProperty('policy');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -933,6 +933,11 @@ export class ApiService implements ApiServiceAbstraction {
|
|||||||
return new EmergencyAccessGranteeDetailsResponse(r);
|
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> {
|
putEmergencyAccess(id: string, request: EmergencyAccessUpdateRequest): Promise<any> {
|
||||||
return this.send('PUT', '/emergency-access/' + id, request, true, false);
|
return this.send('PUT', '/emergency-access/' + id, request, true, false);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user