fix(snjs): simplify authenticator api for generating options (#2147)

This commit is contained in:
Karol Sójko
2023-01-11 14:44:31 +01:00
committed by GitHub
parent 2e7302e3c1
commit 5d20a53e6e
12 changed files with 18 additions and 76 deletions

View File

@@ -2,9 +2,7 @@ import { HttpServiceInterface } from '../../Http/HttpServiceInterface'
import {
ListAuthenticatorsRequestParams,
DeleteAuthenticatorRequestParams,
GenerateAuthenticatorRegistrationOptionsRequestParams,
VerifyAuthenticatorRegistrationResponseRequestParams,
GenerateAuthenticatorAuthenticationOptionsRequestParams,
VerifyAuthenticatorAuthenticationResponseRequestParams,
} from '../../Request'
import {
@@ -33,10 +31,8 @@ export class AuthenticatorServer implements AuthenticatorServerInterface {
return response as DeleteAuthenticatorResponse
}
async generateRegistrationOptions(
params: GenerateAuthenticatorRegistrationOptionsRequestParams,
): Promise<GenerateAuthenticatorRegistrationOptionsResponse> {
const response = await this.httpService.get(Paths.v1.generateRegistrationOptions, params)
async generateRegistrationOptions(): Promise<GenerateAuthenticatorRegistrationOptionsResponse> {
const response = await this.httpService.get(Paths.v1.generateRegistrationOptions)
return response as GenerateAuthenticatorRegistrationOptionsResponse
}
@@ -49,10 +45,8 @@ export class AuthenticatorServer implements AuthenticatorServerInterface {
return response as VerifyAuthenticatorRegistrationResponseResponse
}
async generateAuthenticationOptions(
params: GenerateAuthenticatorAuthenticationOptionsRequestParams,
): Promise<GenerateAuthenticatorAuthenticationOptionsResponse> {
const response = await this.httpService.get(Paths.v1.generateAuthenticationOptions, params)
async generateAuthenticationOptions(): Promise<GenerateAuthenticatorAuthenticationOptionsResponse> {
const response = await this.httpService.get(Paths.v1.generateAuthenticationOptions)
return response as GenerateAuthenticatorAuthenticationOptionsResponse
}

View File

@@ -1,9 +1,7 @@
import {
ListAuthenticatorsRequestParams,
DeleteAuthenticatorRequestParams,
GenerateAuthenticatorRegistrationOptionsRequestParams,
VerifyAuthenticatorRegistrationResponseRequestParams,
GenerateAuthenticatorAuthenticationOptionsRequestParams,
VerifyAuthenticatorAuthenticationResponseRequestParams,
} from '../../Request'
import {
@@ -18,15 +16,11 @@ import {
export interface AuthenticatorServerInterface {
list(params: ListAuthenticatorsRequestParams): Promise<ListAuthenticatorsResponse>
delete(params: DeleteAuthenticatorRequestParams): Promise<DeleteAuthenticatorResponse>
generateRegistrationOptions(
params: GenerateAuthenticatorRegistrationOptionsRequestParams,
): Promise<GenerateAuthenticatorRegistrationOptionsResponse>
generateRegistrationOptions(): Promise<GenerateAuthenticatorRegistrationOptionsResponse>
verifyRegistrationResponse(
params: VerifyAuthenticatorRegistrationResponseRequestParams,
): Promise<VerifyAuthenticatorRegistrationResponseResponse>
generateAuthenticationOptions(
params: GenerateAuthenticatorAuthenticationOptionsRequestParams,
): Promise<GenerateAuthenticatorAuthenticationOptionsResponse>
generateAuthenticationOptions(): Promise<GenerateAuthenticatorAuthenticationOptionsResponse>
verifyAuthenticationResponse(
params: VerifyAuthenticatorAuthenticationResponseRequestParams,
): Promise<VerifyAuthenticatorAuthenticationResponseResponse>