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:
Thomas Rittson 2021-02-10 09:06:18 +10:00 committed by GitHub
parent ee164bebc6
commit d376927e5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -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>;

View File

@ -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');
}
}

View File

@ -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);
}