Skip to content

Commit 3a9e04c

Browse files
committed
client lib domain sync
1 parent 8a81a6e commit 3a9e04c

File tree

1 file changed

+90
-81
lines changed

1 file changed

+90
-81
lines changed

Diff for: src/FusionAuthClient.ts

+90-81
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,10 @@ export class FusionAuthClient {
245245
* Complete a WebAuthn authentication ceremony by validating the signature against the previously generated challenge without logging the user in
246246
*
247247
* @param {WebAuthnLoginRequest} request An object containing data necessary for completing the authentication ceremony
248-
* @returns {Promise<ClientResponse<WebAuthnCompleteResponse>>}
248+
* @returns {Promise<ClientResponse<WebAuthnAssertResponse>>}
249249
*/
250-
completeWebAuthnAssertion(request: WebAuthnLoginRequest): Promise<ClientResponse<WebAuthnCompleteResponse>> {
251-
return this.startAnonymous<WebAuthnCompleteResponse, Errors>()
250+
completeWebAuthnAssertion(request: WebAuthnLoginRequest): Promise<ClientResponse<WebAuthnAssertResponse>> {
251+
return this.startAnonymous<WebAuthnAssertResponse, Errors>()
252252
.withUri('/api/webauthn/assert')
253253
.withJSONBody(request)
254254
.withMethod("POST")
@@ -272,11 +272,11 @@ export class FusionAuthClient {
272272
/**
273273
* Complete a WebAuthn registration ceremony by validating the client request and saving the new credential
274274
*
275-
* @param {WebAuthnCompleteRequest} request An object containing data necessary for completing the registration ceremony
276-
* @returns {Promise<ClientResponse<WebAuthnCompleteResponse>>}
275+
* @param {WebAuthnRegisterCompleteRequest} request An object containing data necessary for completing the registration ceremony
276+
* @returns {Promise<ClientResponse<WebAuthnRegisterCompleteResponse>>}
277277
*/
278-
completeWebAuthnRegistration(request: WebAuthnCompleteRequest): Promise<ClientResponse<WebAuthnCompleteResponse>> {
279-
return this.start<WebAuthnCompleteResponse, Errors>()
278+
completeWebAuthnRegistration(request: WebAuthnRegisterCompleteRequest): Promise<ClientResponse<WebAuthnRegisterCompleteResponse>> {
279+
return this.start<WebAuthnRegisterCompleteResponse, Errors>()
280280
.withUri('/api/webauthn/register/complete')
281281
.withJSONBody(request)
282282
.withMethod("POST")
@@ -1728,10 +1728,10 @@ export class FusionAuthClient {
17281728
/**
17291729
* Import a WebAuthn credential
17301730
*
1731-
* @param {WebAuthnImportRequest} request An object containing data necessary for importing the credential
1731+
* @param {WebAuthnCredentialImportRequest} request An object containing data necessary for importing the credential
17321732
* @returns {Promise<ClientResponse<void>>}
17331733
*/
1734-
importWebAuthnCredential(request: WebAuthnImportRequest): Promise<ClientResponse<void>> {
1734+
importWebAuthnCredential(request: WebAuthnCredentialImportRequest): Promise<ClientResponse<void>> {
17351735
return this.start<void, Errors>()
17361736
.withUri('/api/webauthn/import')
17371737
.withJSONBody(request)
@@ -4382,11 +4382,11 @@ export class FusionAuthClient {
43824382
/**
43834383
* Start a WebAuthn registration ceremony by generating a new challenge for the user
43844384
*
4385-
* @param {WebAuthnRegisterRequest} request An object containing data necessary for starting the registration ceremony
4386-
* @returns {Promise<ClientResponse<WebAuthnRegisterResponse>>}
4385+
* @param {WebAuthnRegisterStartRequest} request An object containing data necessary for starting the registration ceremony
4386+
* @returns {Promise<ClientResponse<WebAuthnRegisterStartResponse>>}
43874387
*/
4388-
startWebAuthnRegistration(request: WebAuthnRegisterRequest): Promise<ClientResponse<WebAuthnRegisterResponse>> {
4389-
return this.start<WebAuthnRegisterResponse, Errors>()
4388+
startWebAuthnRegistration(request: WebAuthnRegisterStartRequest): Promise<ClientResponse<WebAuthnRegisterStartResponse>> {
4389+
return this.start<WebAuthnRegisterStartResponse, Errors>()
43904390
.withUri('/api/webauthn/register/start')
43914391
.withJSONBody(request)
43924392
.withMethod("POST")
@@ -5526,18 +5526,6 @@ export enum AuthenticatorAttachmentPreference {
55265526
crossPlatform = "crossPlatform"
55275527
}
55285528

5529-
/**
5530-
* The <i>authenticator's</i> response for the authentication ceremony in its encoded format
5531-
*
5532-
* @author Spencer Witt
5533-
*/
5534-
export interface AuthenticatorAuthenticationResponse {
5535-
authenticatorData?: string;
5536-
clientDataJSON?: string;
5537-
signature?: string;
5538-
userHandle?: string;
5539-
}
5540-
55415529
/**
55425530
* @author Daniel DeGroff
55435531
*/
@@ -5547,16 +5535,6 @@ export interface AuthenticatorConfiguration {
55475535
timeStep?: number;
55485536
}
55495537

5550-
/**
5551-
* The <i>authenticator's</i> response for the registration ceremony in its encoded format
5552-
*
5553-
* @author Spencer Witt
5554-
*/
5555-
export interface AuthenticatorRegistrationResponse {
5556-
attestationObject?: string;
5557-
clientDataJSON?: string;
5558-
}
5559-
55605538
/**
55615539
* Used by the Relying Party to specify their requirements for authenticator attributes. Fields use the deprecated "resident key" terminology to refer
55625540
* to client-side discoverable credentials to maintain backwards compatibility with WebAuthn Level 1.
@@ -8694,19 +8672,6 @@ export enum ProofKeyForCodeExchangePolicy {
86948672
NotRequiredWhenUsingClientAuthentication = "NotRequiredWhenUsingClientAuthentication"
86958673
}
86968674

8697-
/**
8698-
* Request to authenticate with WebAuthn
8699-
*
8700-
* @author Spencer Witt
8701-
*/
8702-
export interface PublicKeyAuthenticationRequest {
8703-
clientExtensionResults?: WebAuthnExtensionsClientOutputs;
8704-
id?: string;
8705-
response?: AuthenticatorAuthenticationResponse;
8706-
rpId?: string;
8707-
type?: string;
8708-
}
8709-
87108675
/**
87118676
* Allows the Relying Party to specify desired attributes of a new credential.
87128677
*
@@ -8793,20 +8758,6 @@ export interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity
87938758
id?: string;
87948759
}
87958760

8796-
/**
8797-
* Request to register a new public key with WebAuthn
8798-
*
8799-
* @author Spencer Witt
8800-
*/
8801-
export interface PublicKeyRegistrationRequest {
8802-
clientExtensionResults?: WebAuthnExtensionsClientOutputs;
8803-
id?: string;
8804-
response?: AuthenticatorRegistrationResponse;
8805-
rpId?: string;
8806-
transports?: Array<string>;
8807-
type?: string;
8808-
}
8809-
88108761
/**
88118762
* JWT Public Key Response Object
88128763
*
@@ -10789,24 +10740,34 @@ export interface VersionResponse {
1078910740
}
1079010741

1079110742
/**
10792-
* Request to complete the WebAuthn registration ceremony for a new credential
10743+
* API response for completing WebAuthn assertion
1079310744
*
1079410745
* @author Spencer Witt
1079510746
*/
10796-
export interface WebAuthnCompleteRequest {
10797-
credential?: PublicKeyRegistrationRequest;
10798-
origin?: string;
10799-
rpId?: string;
10800-
userId?: UUID;
10747+
export interface WebAuthnAssertResponse {
10748+
credential?: WebAuthnCredential;
1080110749
}
1080210750

1080310751
/**
10804-
* API response for completing WebAuthn credential registration or assertion
10752+
* The <i>authenticator's</i> response for the authentication ceremony in its encoded format
1080510753
*
1080610754
* @author Spencer Witt
1080710755
*/
10808-
export interface WebAuthnCompleteResponse {
10809-
credential?: WebAuthnCredential;
10756+
export interface WebAuthnAuthenticatorAuthenticationResponse {
10757+
authenticatorData?: string;
10758+
clientDataJSON?: string;
10759+
signature?: string;
10760+
userHandle?: string;
10761+
}
10762+
10763+
/**
10764+
* The <i>authenticator's</i> response for the registration ceremony in its encoded format
10765+
*
10766+
* @author Spencer Witt
10767+
*/
10768+
export interface WebAuthnAuthenticatorRegistrationResponse {
10769+
attestationObject?: string;
10770+
clientDataJSON?: string;
1081010771
}
1081110772

1081210773
/**
@@ -10835,6 +10796,16 @@ export interface WebAuthnCredential {
1083510796
userId?: UUID;
1083610797
}
1083710798

10799+
/**
10800+
* API request to import an existing WebAuthn credential(s)
10801+
*
10802+
* @author Spencer Witt
10803+
*/
10804+
export interface WebAuthnCredentialImportRequest {
10805+
credentials?: Array<WebAuthnCredential>;
10806+
validateDbConstraints?: boolean;
10807+
}
10808+
1083810809
/**
1083910810
* WebAuthn Credential API response
1084010811
*
@@ -10855,33 +10826,71 @@ export interface WebAuthnExtensionsClientOutputs {
1085510826
}
1085610827

1085710828
/**
10858-
* API request to import an existing WebAuthn credential(s)
10829+
* Request to complete the WebAuthn registration ceremony
1085910830
*
1086010831
* @author Spencer Witt
1086110832
*/
10862-
export interface WebAuthnImportRequest {
10863-
credentials?: Array<WebAuthnCredential>;
10864-
validateDbConstraints?: boolean;
10833+
export interface WebAuthnLoginRequest extends BaseLoginRequest {
10834+
credential?: WebAuthnPublicKeyAuthenticationRequest;
10835+
origin?: string;
10836+
rpId?: string;
10837+
twoFactorTrustId?: string;
1086510838
}
1086610839

1086710840
/**
10868-
* Request to complete the WebAuthn registration ceremony
10841+
* Request to authenticate with WebAuthn
1086910842
*
1087010843
* @author Spencer Witt
1087110844
*/
10872-
export interface WebAuthnLoginRequest extends BaseLoginRequest {
10873-
credential?: PublicKeyAuthenticationRequest;
10845+
export interface WebAuthnPublicKeyAuthenticationRequest {
10846+
clientExtensionResults?: WebAuthnExtensionsClientOutputs;
10847+
id?: string;
10848+
response?: WebAuthnAuthenticatorAuthenticationResponse;
10849+
rpId?: string;
10850+
type?: string;
10851+
}
10852+
10853+
/**
10854+
* Request to register a new public key with WebAuthn
10855+
*
10856+
* @author Spencer Witt
10857+
*/
10858+
export interface WebAuthnPublicKeyRegistrationRequest {
10859+
clientExtensionResults?: WebAuthnExtensionsClientOutputs;
10860+
id?: string;
10861+
response?: WebAuthnAuthenticatorRegistrationResponse;
10862+
rpId?: string;
10863+
transports?: Array<string>;
10864+
type?: string;
10865+
}
10866+
10867+
/**
10868+
* Request to complete the WebAuthn registration ceremony for a new credential,.
10869+
*
10870+
* @author Spencer Witt
10871+
*/
10872+
export interface WebAuthnRegisterCompleteRequest {
10873+
credential?: WebAuthnPublicKeyRegistrationRequest;
1087410874
origin?: string;
1087510875
rpId?: string;
10876-
twoFactorTrustId?: string;
10876+
userId?: UUID;
10877+
}
10878+
10879+
/**
10880+
* API response for completing WebAuthn credential registration or assertion
10881+
*
10882+
* @author Spencer Witt
10883+
*/
10884+
export interface WebAuthnRegisterCompleteResponse {
10885+
credential?: WebAuthnCredential;
1087710886
}
1087810887

1087910888
/**
1088010889
* API request to start a WebAuthn registration ceremony
1088110890
*
1088210891
* @author Spencer Witt
1088310892
*/
10884-
export interface WebAuthnRegisterRequest {
10893+
export interface WebAuthnRegisterStartRequest {
1088510894
displayName?: string;
1088610895
name?: string;
1088710896
userAgent?: string;
@@ -10894,7 +10903,7 @@ export interface WebAuthnRegisterRequest {
1089410903
*
1089510904
* @author Spencer Witt
1089610905
*/
10897-
export interface WebAuthnRegisterResponse {
10906+
export interface WebAuthnRegisterStartResponse {
1089810907
options?: PublicKeyCredentialCreationOptions;
1089910908
}
1090010909

0 commit comments

Comments
 (0)