1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +00:00

add org 2fa apis

This commit is contained in:
Kyle Spearrin
2018-07-18 17:07:59 -04:00
parent f4ed6a5566
commit e555536f24
2 changed files with 32 additions and 0 deletions

View File

@@ -560,6 +560,11 @@ export class ApiService implements ApiServiceAbstraction {
return new ListResponse(r, TwoFactorProviderResponse);
}
async getTwoFactorOrganizationProviders(organizationId: string): Promise<ListResponse<TwoFactorProviderResponse>> {
const r = await this.send('GET', '/organizations/' + organizationId + '/two-factor', null, true, true);
return new ListResponse(r, TwoFactorProviderResponse);
}
async getTwoFactorAuthenticator(request: PasswordVerificationRequest): Promise<TwoFactorAuthenticatorResponse> {
const r = await this.send('POST', '/two-factor/get-authenticator', request, true, true);
return new TwoFactorAuthenticatorResponse(r);
@@ -575,6 +580,13 @@ export class ApiService implements ApiServiceAbstraction {
return new TwoFactorDuoResponse(r);
}
async getTwoFactorOrganizationDuo(organizationId: string,
request: PasswordVerificationRequest): Promise<TwoFactorDuoResponse> {
const r = await this.send('POST', '/organizations/' + organizationId + '/two-factor/get-duo',
request, true, true);
return new TwoFactorDuoResponse(r);
}
async getTwoFactorYubiKey(request: PasswordVerificationRequest): Promise<TwoFactorYubiKeyResponse> {
const r = await this.send('POST', '/two-factor/get-yubikey', request, true, true);
return new TwoFactorYubiKeyResponse(r);
@@ -606,6 +618,12 @@ export class ApiService implements ApiServiceAbstraction {
return new TwoFactorDuoResponse(r);
}
async putTwoFactorOrganizationDuo(organizationId: string,
request: UpdateTwoFactorDuoRequest): Promise<TwoFactorDuoResponse> {
const r = await this.send('PUT', '/organizations/' + organizationId + '/two-factor/duo', request, true, true);
return new TwoFactorDuoResponse(r);
}
async putTwoFactorYubiKey(request: UpdateTwoFactorYubioOtpRequest): Promise<TwoFactorYubiKeyResponse> {
const r = await this.send('PUT', '/two-factor/yubikey', request, true, true);
return new TwoFactorYubiKeyResponse(r);
@@ -621,6 +639,13 @@ export class ApiService implements ApiServiceAbstraction {
return new TwoFactorProviderResponse(r);
}
async putTwoFactorOrganizationDisable(organizationId: string,
request: TwoFactorProviderRequest): Promise<TwoFactorProviderResponse> {
const r = await this.send('PUT', '/organizations/' + organizationId + '/two-factor/disable',
request, true, true);
return new TwoFactorProviderResponse(r);
}
postTwoFactorRecover(request: TwoFactorRecoveryRequest): Promise<any> {
return this.send('POST', '/two-factor/recover', request, false, false);
}