From 752df8c616f19fb48cb0700e7337330d3784a635 Mon Sep 17 00:00:00 2001 From: Liubin Jiang Date: Tue, 17 Oct 2023 09:47:03 -0700 Subject: [PATCH] update passkey related proto naming change --- .../Backend/RPC/FIRFinalizePasskeyEnrollmentRequest.m | 7 ++++--- .../Sources/Backend/RPC/FIRFinalizePasskeySignInRequest.m | 7 ++++--- .../Sources/Backend/RPC/FIRStartPasskeyEnrollmentRequest.m | 1 + .../Sources/Backend/RPC/FIRStartPasskeySignInRequest.m | 1 + .../Tests/Unit/FIRFinalizePasskeyEnrollmentRequestTests.m | 6 +++--- .../Tests/Unit/FIRFinalizePasskeySignInRequestTests.m | 6 +++--- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRFinalizePasskeyEnrollmentRequest.m b/FirebaseAuth/Sources/Backend/RPC/FIRFinalizePasskeyEnrollmentRequest.m index 3d5cb794310..1e610919882 100644 --- a/FirebaseAuth/Sources/Backend/RPC/FIRFinalizePasskeyEnrollmentRequest.m +++ b/FirebaseAuth/Sources/Backend/RPC/FIRFinalizePasskeyEnrollmentRequest.m @@ -51,19 +51,19 @@ @var kCredentialIDKey @brief The key for registered credential identifier. */ -static NSString *const kCredentialIDKey = @"credentialId"; +static NSString *const kCredentialIDKey = @"id"; /** @var kAuthAttestationRespKey @brief The key for attestation response from a FIDO authenticator. */ -static NSString *const kAuthAttestationRespKey = @"authenticatorAttestationResponse"; +static NSString *const kAuthAttestationRespKey = @"response"; /** @var kClientDataJsonKey @brief The key for CollectedClientData object from the authenticator. */ -static NSString *const kClientDataJsonKey = @"clientDataJson"; +static NSString *const kClientDataJsonKey = @"clientDataJSON"; /** @var kAttestationObject @@ -83,6 +83,7 @@ - (nullable instancetype)initWithIDToken:(NSString *)IDToken requestConfiguration:requestConfiguration]; if (self) { self.useIdentityPlatform = YES; + self.useStaging = NO; _IDToken = IDToken; _name = name; _credentialID = credentialID; diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRFinalizePasskeySignInRequest.m b/FirebaseAuth/Sources/Backend/RPC/FIRFinalizePasskeySignInRequest.m index 865b5f00983..9ca41279285 100644 --- a/FirebaseAuth/Sources/Backend/RPC/FIRFinalizePasskeySignInRequest.m +++ b/FirebaseAuth/Sources/Backend/RPC/FIRFinalizePasskeySignInRequest.m @@ -39,19 +39,19 @@ @var kCredentialIDKey @brief The key for registered credential identifier. */ -static NSString *const kCredentialIDKey = @"credentialId"; +static NSString *const kCredentialIDKey = @"id"; /** @var kAuthAssertionRespKey @brief The key for authentication assertion from the authenticator. */ -static NSString *const kAuthAssertionRespKey = @"authenticatorAssertionResponse"; +static NSString *const kAuthAssertionRespKey = @"response"; /** @var kClientDataJsonKey @brief The key for CollectedClientData object from the authenticator. */ -static NSString *const kClientDataJsonKey = @"clientDataJson"; +static NSString *const kClientDataJsonKey = @"clientDataJSON"; /** @var kAuthenticatorDataKey @@ -83,6 +83,7 @@ - (nullable instancetype)initWithCredentialID:(NSString *)credentialID requestConfiguration:requestConfiguration]; if (self) { self.useIdentityPlatform = YES; + self.useStaging = NO; _credentialID = credentialID; _clientDataJson = clientDataJson; _authenticatorData = authenticatorData; diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRStartPasskeyEnrollmentRequest.m b/FirebaseAuth/Sources/Backend/RPC/FIRStartPasskeyEnrollmentRequest.m index 17051fcb639..35877750426 100644 --- a/FirebaseAuth/Sources/Backend/RPC/FIRStartPasskeyEnrollmentRequest.m +++ b/FirebaseAuth/Sources/Backend/RPC/FIRStartPasskeyEnrollmentRequest.m @@ -46,6 +46,7 @@ - (nullable instancetype)initWithIDToken:(NSString *)IDToken if (self) { _IDToken = IDToken; self.useIdentityPlatform = YES; + self.useStaging = NO; } return self; diff --git a/FirebaseAuth/Sources/Backend/RPC/FIRStartPasskeySignInRequest.m b/FirebaseAuth/Sources/Backend/RPC/FIRStartPasskeySignInRequest.m index 47fadf53f9e..7b8bb91fbfb 100644 --- a/FirebaseAuth/Sources/Backend/RPC/FIRStartPasskeySignInRequest.m +++ b/FirebaseAuth/Sources/Backend/RPC/FIRStartPasskeySignInRequest.m @@ -39,6 +39,7 @@ - (nullable instancetype)initWithRequestConfiguration: if (self) { self.useIdentityPlatform = YES; + self.useStaging = NO; } return self; diff --git a/FirebaseAuth/Tests/Unit/FIRFinalizePasskeyEnrollmentRequestTests.m b/FirebaseAuth/Tests/Unit/FIRFinalizePasskeyEnrollmentRequestTests.m index 3b3b78f0dd8..2269e1145fc 100644 --- a/FirebaseAuth/Tests/Unit/FIRFinalizePasskeyEnrollmentRequestTests.m +++ b/FirebaseAuth/Tests/Unit/FIRFinalizePasskeyEnrollmentRequestTests.m @@ -77,7 +77,7 @@ @var kCredentialIDKey @brief credential ID field. */ -static NSString *const kCredentialIDKey = @"credentialId"; +static NSString *const kCredentialIDKey = @"id"; /** @var kRawAttestationObject @@ -101,7 +101,7 @@ @var kRawClientDataJSONKey @brief The key for the attestation object from the authenticator. */ -static NSString *const kRawClientDataJSONKey = @"clientDataJson"; +static NSString *const kRawClientDataJSONKey = @"clientDataJSON"; /** @var kAuthRegistrationRespKey @@ -113,7 +113,7 @@ @var kAuthAttestationRespKey @brief The key for attestation response from a FIDO authenticator. */ -static NSString *const kAuthAttestationRespKey = @"authenticatorAttestationResponse"; +static NSString *const kAuthAttestationRespKey = @"response"; /** @class FIRFinalizePasskeyEnrollmentRequestTests diff --git a/FirebaseAuth/Tests/Unit/FIRFinalizePasskeySignInRequestTests.m b/FirebaseAuth/Tests/Unit/FIRFinalizePasskeySignInRequestTests.m index 6c99343d843..148ce7357b5 100644 --- a/FirebaseAuth/Tests/Unit/FIRFinalizePasskeySignInRequestTests.m +++ b/FirebaseAuth/Tests/Unit/FIRFinalizePasskeySignInRequestTests.m @@ -53,7 +53,7 @@ @var kAuthAssertionRespKey @brief The key for authentication assertion from the authenticator. */ -static NSString *const kAuthAssertionRespKey = @"authenticatorAssertionResponse"; +static NSString *const kAuthAssertionRespKey = @"response"; /** @var kCredentialID @@ -65,7 +65,7 @@ @var kCredentialIDKey @brief credential ID field. */ -static NSString *const kCredentialIDKey = @"credentialId"; +static NSString *const kCredentialIDKey = @"id"; /** @var kRawClientDataJSON @@ -77,7 +77,7 @@ @var kRawClientDataJSONKey @brief The key for the attestation object from the authenticator. */ -static NSString *const kRawClientDataJSONKey = @"clientDataJson"; +static NSString *const kRawClientDataJSONKey = @"clientDataJSON"; /** @var kAuthenticatorData