Parcourir la source

Post rebase style and other fixes

Paul Beusterien il y a 2 ans
Parent
commit
00bcca2df0
31 fichiers modifiés avec 208 ajouts et 782 suppressions
  1. 11 13
      FirebaseAuth.podspec
  2. 0 34
      FirebaseAuth/Sources/Public/FirebaseAuth/FIRTOTPMultiFactorAssertion.h
  3. 0 68
      FirebaseAuth/Sources/Public/FirebaseAuth/FIRTOTPMultiFactorGenerator.h
  4. 0 55
      FirebaseAuth/Sources/Public/FirebaseAuth/FIRTOTPSecret.h
  5. 17 18
      FirebaseAuth/Sources/Swift/ActionCode/ActionCodeOperation.swift
  6. 10 7
      FirebaseAuth/Sources/Swift/Auth/Auth.swift
  7. 3 3
      FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift
  8. 4 4
      FirebaseAuth/Sources/Swift/Backend/RPC/GetOOBConfirmationCodeRequest.swift
  9. 2 1
      FirebaseAuth/Sources/Swift/Backend/RPC/MultiFactor/Enroll/StartMFAEnrollmentResponse.swift
  10. 2 1
      FirebaseAuth/Sources/Swift/Backend/RPC/MultiFactor/SignIn/StartMFASignInResponse.swift
  11. 2 2
      FirebaseAuth/Sources/Swift/MultiFactor/MultiFactorResolver.swift
  12. 1 1
      FirebaseAuth/Sources/Swift/Storage/AuthKeychainServices.swift
  13. 3 3
      FirebaseAuth/Sources/Swift/SystemService/AuthAPNSTokenManager.swift
  14. 2 2
      FirebaseAuth/Sources/Swift/SystemService/SecureTokenService.swift
  15. 4 4
      FirebaseAuth/Sources/Swift/User/User.swift
  16. 50 26
      FirebaseAuth/Sources/Swift/Utilities/AuthInternalErrors.swift
  17. 2 2
      FirebaseAuth/Sources/Swift/Utilities/AuthWebUtils.swift
  18. 12 13
      FirebaseAuth/Tests/Unit/AuthBackendRPCImplentationTests.swift
  19. 2 2
      FirebaseAuth/Tests/Unit/AuthNotificationManagerTests.swift
  20. 2 1
      FirebaseAuth/Tests/Unit/AuthProviderIDTests.swift
  21. 13 9
      FirebaseAuth/Tests/Unit/AuthTests.swift
  22. 0 154
      FirebaseAuth/Tests/Unit/FIRFinalizeMFAEnrollmentRequestTests.m
  23. 0 137
      FirebaseAuth/Tests/Unit/FIRFinalizeMFASignInRequestTests.m
  24. 0 127
      FirebaseAuth/Tests/Unit/FIRStartMFAEnrollmentRequestTests.m
  25. 1 1
      FirebaseAuth/Tests/Unit/Fakes/FakeBackendRPCIssuer.swift
  26. 2 1
      FirebaseAuth/Tests/Unit/OAuthProviderTests.swift
  27. 1 1
      FirebaseAuth/Tests/Unit/PhoneAuthProviderTests.swift
  28. 24 24
      FirebaseAuth/Tests/Unit/SignInWithGameCenterTests.swift
  29. 22 21
      FirebaseAuth/Tests/Unit/SwiftAPI.swift
  30. 3 2
      FirebaseAuth/Tests/Unit/UserTests.swift
  31. 13 45
      Package.swift

+ 11 - 13
FirebaseAuth.podspec

@@ -60,18 +60,16 @@ supports email and password accounts, as well as several 3rd party authenticatio
   s.dependency 'GoogleUtilities/Environment', '~> 7.8'
   s.dependency 'GTMSessionFetcher/Core', '>= 2.1', '< 4.0'
 
-    s.test_spec 'unit' do |unit_tests|
-      unit_tests.scheme = { :code_coverage => true }
-      # Unit tests can't run on watchOS.
-      unit_tests.platforms = {
-        :ios => ios_deployment_target,
-        :osx => osx_deployment_target,
-        :tvos => tvos_deployment_target
-      }
-      unit_tests.source_files = 'FirebaseAuth/Tests/Unit*/**/*.{m,h,swift}'
-      # app_host is needed for tests with keychain
-      unit_tests.requires_app_host = true
-      unit_tests.dependency 'HeartbeatLoggingTestUtils'
-    end
+  s.test_spec 'unit' do |unit_tests|
+    unit_tests.scheme = { :code_coverage => true }
+    # Unit tests can't run on watchOS.
+    unit_tests.platforms = {
+      :ios => ios_deployment_target,
+      :osx => osx_deployment_target,
+      :tvos => tvos_deployment_target
+    }
+    unit_tests.source_files = 'FirebaseAuth/Tests/Unit*/**/*.{m,h,swift}'
+    # app_host is needed for tests with keychain
+    unit_tests.requires_app_host = true
   end
 end

+ 0 - 34
FirebaseAuth/Sources/Public/FirebaseAuth/FIRTOTPMultiFactorAssertion.h

@@ -1,34 +0,0 @@
-/*
- * Copyright 2023 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-#import "FIRMultiFactorAssertion.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- @class TOTPMultiFactorAssertion
- @brief The subclass of base class MultiFactorAssertion, used to assert ownership of a TOTP
- (Time-based One Time Password) second factor.
- This class is available on iOS only.
- */
-NS_SWIFT_NAME(TOTPMultiFactorAssertion) API_UNAVAILABLE(macos, tvos, watchos)
-    @interface FIRTOTPMultiFactorAssertion : FIRMultiFactorAssertion
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 68
FirebaseAuth/Sources/Public/FirebaseAuth/FIRTOTPMultiFactorGenerator.h

@@ -1,68 +0,0 @@
-/*
- * Copyright 2023 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "FIRMultiFactorSession.h"
-#import "FIRTOTPMultiFactorAssertion.h"
-#import "FIRTOTPSecret.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- @class FIRTOTPMultiFactorGenerator
- @brief The data structure used to help initialize an assertion for a second factor entity to the
- Firebase Auth/CICP server. Depending on the type of second factor, this will help generate
- the assertion.
- This class is available on iOS only.
- */
-NS_SWIFT_NAME(TOTPMultiFactorGenerator) API_UNAVAILABLE(macos, tvos, watchos)
-    @interface FIRTOTPMultiFactorGenerator : NSObject
-
-/**
- @fn generateSecretWithMultiFactorSession
- @brief Creates a TOTP secret as part of enrolling a TOTP second factor. Used for generating a
- QR code URL or inputting into a TOTP app. This method uses the auth instance corresponding to the
- user in the multiFactorSession.
- @param session The multiFactorSession instance.
- @param completion Completion block
- */
-+ (void)generateSecretWithMultiFactorSession:(FIRMultiFactorSession *)session
-                                  completion:(void (^)(FIRTOTPSecret *_Nullable secret,
-                                                       NSError *_Nullable error))completion;
-
-/**
- @fn assertionForEnrollmentWithSecret:
- @brief Initializes the MFA assertion to confirm ownership of the TOTP second factor. This assertion
- is used to complete enrollment of TOTP as a second factor.
- @param secret The TOTP secret.
- @param oneTimePassword one time password string.
- */
-+ (FIRTOTPMultiFactorAssertion *)assertionForEnrollmentWithSecret:(FIRTOTPSecret *)secret
-                                                  oneTimePassword:(NSString *)oneTimePassword;
-
-/**
- @fn assertionForSignInWithenrollmentID:
- @brief Initializes the MFA assertion to confirm ownership of the TOTP second factor. This
- assertion is used to complete signIn with TOTP as a second factor.
- @param enrollmentID The ID that identifies the enrolled TOTP second factor.
- @param oneTimePassword one time password string.
-*/
-+ (FIRTOTPMultiFactorAssertion *)assertionForSignInWithEnrollmentID:(NSString *)enrollmentID
-                                                    oneTimePassword:(NSString *)oneTimePassword;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 55
FirebaseAuth/Sources/Public/FirebaseAuth/FIRTOTPSecret.h

@@ -1,55 +0,0 @@
-/*
- * Copyright 2023 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-#import "FIRMultiFactorInfo.h"
-
-NS_ASSUME_NONNULL_BEGIN
-
-/**
- @class TOTPSecret
- */
-NS_SWIFT_NAME(TOTPSecret)
-@interface FIRTOTPSecret : NSObject
-
-/**
- @brief Returns the shared secret key/seed used to generate time-based one-time passwords.
- */
-- (NSString *)sharedSecretKey;
-
-/**
- @brief Returns a QRCode URL as described in
- https://github.com/google/google-authenticator/wiki/Key-Uri-Format
- This can be displayed to the user as a QRCode to be scanned into a TOTP app like Google
- Authenticator.
-
- @param accountName the name of the account/app.
- @param issuer issuer of the TOTP(likely the app name).
- @returns A QRCode URL string.
- */
-- (NSString *)generateQRCodeURLWithAccountName:(NSString *)accountName issuer:(NSString *)issuer;
-
-/**
- @brief Opens the specified QR Code URL in a password manager like iCloud Keychain.
- * See more details here:
- https://developer.apple.com/documentation/authenticationservices/securing_logins_with_icloud_keychain_verification_codes
- */
-- (void)openInOTPAppWithQRCodeURL:(NSString *)QRCodeURL;
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 17 - 18
FirebaseAuth/Sources/Swift/ActionCode/ActionCodeOperation.swift

@@ -15,28 +15,27 @@
 import Foundation
 
 /**
-    @brief Operations which can be performed with action codes.
-  */
-@objc(FIRActionCodeOperation) public enum ActionCodeOperation : Int, @unchecked Sendable {
+   @brief Operations which can be performed with action codes.
+ */
+@objc(FIRActionCodeOperation) public enum ActionCodeOperation: Int, @unchecked Sendable {
+  /** Action code for unknown operation. */
+  case unknown = 0
 
-    /** Action code for unknown operation. */
-    case unknown = 0
+  /** Action code for password reset operation. */
+  case passwordReset = 1
 
-    /** Action code for password reset operation. */
-    case passwordReset = 1
+  /** Action code for verify email operation. */
+  case verifyEmail = 2
 
-    /** Action code for verify email operation. */
-    case verifyEmail = 2
+  /** Action code for recover email operation. */
+  case recoverEmail = 3
 
-    /** Action code for recover email operation. */
-    case recoverEmail = 3
+  /** Action code for email link operation. */
+  case emailLink = 4
 
-    /** Action code for email link operation. */
-    case emailLink = 4
+  /** Action code for verifying and changing email */
+  case verifyAndChangeEmail = 5
 
-    /** Action code for verifying and changing email */
-    case verifyAndChangeEmail = 5
-
-    /** Action code for reverting second factor addition */
-    case revertSecondFactorAddition = 6
+  /** Action code for reverting second factor addition */
+  case revertSecondFactorAddition = 6
 }

+ 10 - 7
FirebaseAuth/Sources/Swift/Auth/Auth.swift

@@ -32,8 +32,10 @@ import FirebaseAuthInterop
 // TODO: What should this be?
 // extension NSNotification.Name {
 //    /**
-//        @brief The name of the `NSNotificationCenter` notification which is posted when the auth state
-//            changes (for example, a new token has been produced, a user signs in or signs out). The
+//        @brief The name of the `NSNotificationCenter` notification which is posted when the auth
+//        state
+//            changes (for example, a new token has been produced, a user signs in or signs out).
+//            The
 //            object parameter of the notification is the sender `Auth` instance.
 //     */
 //    public static let AuthStateDidChange: NSNotification.Name
@@ -1667,7 +1669,8 @@ extension Auth: AuthInterop {
   #endif
 
   // TODO: Need to manage breaking change for
-  // const NSNotificationName FIRAuthStateDidChangeNotification = @"FIRAuthStateDidChangeNotification";
+  // const NSNotificationName FIRAuthStateDidChangeNotification =
+  // @"FIRAuthStateDidChangeNotification";
   // Move to FIRApp with other Auth notifications?
   public static let authStateDidChangeNotification =
     NSNotification.Name(rawValue: "FIRAuthStateDidChangeNotification")
@@ -1747,8 +1750,8 @@ extension Auth: AuthInterop {
 
       #if os(iOS)
         if GULAppEnvironmentUtil.isAppExtension() {
-          // iOS App extensions should not call [UIApplication sharedApplication], even if UIApplication
-          // responds to it.
+          // iOS App extensions should not call [UIApplication sharedApplication], even if
+          // UIApplication responds to it.
           return
         }
         let application = UIApplication.shared
@@ -1981,8 +1984,8 @@ extension Auth: AuthInterop {
           return
         }
         if error != nil {
-          // Kicks off exponential back off logic to retry failed attempt. Starts with one minute delay
-          // (60 seconds) if this is the first failed attempt.
+          // Kicks off exponential back off logic to retry failed attempt. Starts with one minute
+          // delay (60 seconds) if this is the first failed attempt.
           let rescheduleDelay = retry ? min(delay * 2, 16 * 60) : 60
           strongSelf.scheduleAutoTokenRefresh(withDelay: rescheduleDelay, retry: true)
         }

+ 3 - 3
FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift

@@ -93,7 +93,7 @@ class AuthBackendRPCIssuerImplementation: NSObject, AuthBackendRPCIssuer {
     if gBackendImplementation == nil {
       gBackendImplementation = AuthBackendRPCImplementation()
     }
-    return (gBackendImplementation)!
+    return gBackendImplementation!
   }
 
   /// Calls the RPC using HTTP POST.
@@ -425,8 +425,8 @@ private class AuthBackendRPCImplementation: NSObject, AuthBackendImplementation
     case "MISSING_CONTINUE_URI": return AuthErrorUtils
       .missingContinueURIError(message: serverDetailErrorMessage)
     // "INVALID_IDENTIFIER" can be returned by createAuthURI RPC. Considering email addresses are
-    //  currently the only identifiers, we surface the FIRAuthErrorCodeInvalidEmail error code in this
-    //  case.
+    // currently the only identifiers, we surface the FIRAuthErrorCodeInvalidEmail error code in
+    // this case.
     case "INVALID_IDENTIFIER": return AuthErrorUtils
       .invalidEmailError(message: serverDetailErrorMessage)
     case "INVALID_ID_TOKEN": return AuthErrorUtils

+ 4 - 4
FirebaseAuth/Sources/Swift/Backend/RPC/GetOOBConfirmationCodeRequest.swift

@@ -285,14 +285,14 @@ public class GetOOBConfirmationCodeRequest: IdentityToolkitRequest, AuthRPCReque
       kRequestTypeKey: requestType.value,
     ]
 
-    // For password reset requests, we only need an email address in addition to the already required
-    // fields.
+    // For password reset requests, we only need an email address in addition to the already
+    // required fields.
     if case .passwordReset = requestType {
       body[kEmailKey] = email
     }
 
-    // For verify email requests, we only need an STS Access Token in addition to the already required
-    // fields.
+    // For verify email requests, we only need an STS Access Token in addition to the already
+    // required fields.
     if case .verifyEmail = requestType {
       body[kIDTokenKey] = accessToken
     }

+ 2 - 1
FirebaseAuth/Sources/Swift/Backend/RPC/MultiFactor/Enroll/StartMFAEnrollmentResponse.swift

@@ -24,7 +24,8 @@ class StartMFAEnrollmentResponse: AuthRPCResponse {
       fatalError()
       // XXX TODO: throw something. original code does not strictly follow
       // obj-c error conventions. returning 'false' should be accompanied by an error, but
-      // in the code there was none. importing this into swift would throw a built-in 'error missing' error
+      // in the code there was none. importing this into swift would throw a built-in 'error
+      // missing' error
       // throw xxx
     }
   }

+ 2 - 1
FirebaseAuth/Sources/Swift/Backend/RPC/MultiFactor/SignIn/StartMFASignInResponse.swift

@@ -26,7 +26,8 @@ class StartMFASignInResponse: AuthRPCResponse {
       fatalError()
       // XXX TODO: throw something. original code does not strictly follow
       // obj-c error conventions. returning 'false' should be accompanied by an error, but
-      // in the code there was none. importing this into swift would throw a built-in 'error missing' error
+      // in the code there was none. importing this into swift would throw a built-in
+      // 'error missing' error
       // throw xxx
     }
   }

+ 2 - 2
FirebaseAuth/Sources/Swift/MultiFactor/MultiFactorResolver.swift

@@ -62,12 +62,12 @@ import Foundation
           verificationInfo: finalizeMFAPhoneRequestInfo,
           requestConfiguration: auth.requestConfiguration
         )
-        AuthBackend.post(with: request) { rawResponse, error in
+        AuthBackend.post(with: request) { response, error in
           if let error {
             if let completion {
               completion(nil, error)
             }
-          } else if let response = rawResponse as? FinalizeMFAEnrollmentResponse {
+          } else if let response {
             self.auth.completeSignIn(withAccessToken: response.idToken,
                                      accessTokenExpirationDate: nil,
                                      refreshToken: response.refreshToken,

+ 1 - 1
FirebaseAuth/Sources/Swift/Storage/AuthKeychainServices.swift

@@ -80,7 +80,7 @@ final class AuthKeychainServices {
   func setItem(_ item: Data, withQuery query: [String: Any]) throws {
     let status: OSStatus
     let function: String
-    if (try getItem(query: query)) != nil {
+    if try (getItem(query: query)) != nil {
       let attributes: [String: Any] = [kSecValueData as String: item]
       status = keychainStorage.update(query: query, attributes: attributes)
       function = "SecItemUpdate"

+ 3 - 3
FirebaseAuth/Sources/Swift/SystemService/AuthAPNSTokenManager.swift

@@ -161,9 +161,9 @@
       do {
         let profileData = try Data(contentsOf: url)
 
-        // The "embedded.mobileprovision" sometimes contains characters with value 0, which signals the
-        // end of a c-string and halts the ASCII parser, or with value > 127, which violates strict 7-bit
-        // ASCII. Replace any 0s or invalid characters in the input.
+        // The "embedded.mobileprovision" sometimes contains characters with value 0, which signals
+        // the end of a c-string and halts the ASCII parser, or with value > 127, which violates
+        // strict 7-bit ASCII. Replace any 0s or invalid characters in the input.
         let byteArray = [UInt8](profileData)
         var outBytes: [UInt8] = []
         for byte in byteArray {

+ 2 - 2
FirebaseAuth/Sources/Swift/SystemService/SecureTokenService.swift

@@ -128,8 +128,8 @@ private let kFiveMinutes = 5 * 60.0
   }
 
   public func encode(with coder: NSCoder) {
-    // The API key is encoded even it is not used in decoding to be compatible with previous versions
-    // of the library.
+    // The API key is encoded even it is not used in decoding to be compatible with previous
+    // versions of the library.
     coder.encode(requestConfiguration?.apiKey, forKey: kAPIKeyCodingKey)
     // Authorization code is not encoded because it is not long-lived.
     coder.encode(refreshToken, forKey: SecureTokenService.kRefreshTokenKey)

+ 4 - 4
FirebaseAuth/Sources/Swift/User/User.swift

@@ -1976,10 +1976,10 @@ extension User: NSSecureCoding {}
    */
   private class func callInMainThreadWithAuthDataResultAndError(callback: ((AuthDataResult?,
                                                                             Error?) -> Void)?,
-  complete: FIRAuthSerialTaskCompletionBlock? =
-    nil,
-  result: AuthDataResult? = nil,
-  error: Error? = nil) {
+                                                                complete: FIRAuthSerialTaskCompletionBlock? =
+                                                                  nil,
+                                                                result: AuthDataResult? = nil,
+                                                                error: Error? = nil) {
     if let callback {
       DispatchQueue.main.async {
         if let complete {

+ 50 - 26
FirebaseAuth/Sources/Swift/Utilities/AuthInternalErrors.swift

@@ -105,10 +105,11 @@ enum SharedErrorCode {
 //           unreachable host.)
 //       @remarks These types of errors are often recoverable with a retry.
 //
-//           See the @c NSUnderlyingError value in the @c NSError.userInfo dictionary for details about
-//           the network error which occurred.
+//           See the @c NSUnderlyingError value in the @c NSError.userInfo dictionary for details
+//           about the network error which occurred.
 //    */
-//   FIRAuthInternalErrorCodeNetworkError = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeNetworkError,
+//   FIRAuthInternalErrorCodeNetworkError = FIRAuthPublicErrorCodeFlag |
+//   FIRAuthErrorCodeNetworkError,
 //
 //   /** @var FIRAuthInternalErrorCodeEmailAlreadyInUse
 //       @brief The email used to attempt a sign-up already exists.
@@ -119,7 +120,8 @@ enum SharedErrorCode {
 //   /** @var FIRAuthInternalErrorCodeUserDisabled
 //       @brief Indicates the user's account is disabled on the server side.
 //    */
-//   FIRAuthInternalErrorCodeUserDisabled = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeUserDisabled,
+//   FIRAuthInternalErrorCodeUserDisabled = FIRAuthPublicErrorCodeFlag |
+//   FIRAuthErrorCodeUserDisabled,
 //
 //   /** @var FIRAuthInternalErrorCodeWrongPassword
 //       @brief Indicates the user attempted sign in with a wrong password
@@ -129,7 +131,8 @@ enum SharedErrorCode {
 //
 //   /** @var FIRAuthInternalErrorCodeKeychainError
 //       @brief Indicates an error occurred accessing the keychain.
-//       @remarks The @c NSLocalizedFailureReasonErrorKey field in the @c NSError.userInfo dictionary
+//       @remarks The @c NSLocalizedFailureReasonErrorKey field in the @c NSError.userInfo
+//       dictionary
 //           will contain more information about the error encountered.
 //    */
 //   FIRAuthInternalErrorCodeKeychainError = FIRAuthPublicErrorCodeFlag |
@@ -174,7 +177,8 @@ enum SharedErrorCode {
 //                                               FIRAuthErrorCodeInvalidCredential,
 //
 //   /** @var FIRAuthInternalErrorCodeRequiresRecentLogin
-//       @brief Indicates the user has attemped to change email or password more than 5 minutes after
+//       @brief Indicates the user has attemped to change email or password more than 5 minutes
+//       after
 //           signing in.
 //    */
 //   FIRAuthInternalErrorCodeRequiresRecentLogin = FIRAuthPublicErrorCodeFlag |
@@ -189,7 +193,8 @@ enum SharedErrorCode {
 //   /** @var FIRAuthInternalErrorCodeInvalidEmail
 //      @brief Indicates the email identifier is invalid.
 //   */
-//   FIRAuthInternalErrorCodeInvalidEmail = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeInvalidEmail,
+//   FIRAuthInternalErrorCodeInvalidEmail = FIRAuthPublicErrorCodeFlag |
+//   FIRAuthErrorCodeInvalidEmail,
 //
 //   /** @var FIRAuthInternalErrorCodeAccountExistsWithDifferentCredential
 //       @brief Indicates account linking is needed.
@@ -218,7 +223,8 @@ enum SharedErrorCode {
 //   /** @var FIRAuthInternalErrorCodeUserNotFound
 //       @brief Indicates the user account was been found.
 //    */
-//   FIRAuthInternalErrorCodeUserNotFound = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeUserNotFound,
+//   FIRAuthInternalErrorCodeUserNotFound = FIRAuthPublicErrorCodeFlag |
+//   FIRAuthErrorCodeUserNotFound,
 //
 //   /** @var FIRAuthInternalErrorCodeInvalidAPIKey
 //       @brief Indicates an invalid API Key was supplied in the request.
@@ -236,7 +242,8 @@ enum SharedErrorCode {
 //       @brief Indicates that user attempted to reauthenticate with a user other than the current
 //           user.
 //    */
-//   FIRAuthInternalErrorCodeUserMismatch = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeUserMismatch,
+//   FIRAuthInternalErrorCodeUserMismatch = FIRAuthPublicErrorCodeFlag |
+//   FIRAuthErrorCodeUserMismatch,
 //
 //   /** @var FIRAuthInternalErrorCodeCredentialAlreadyInUse
 //       @brief Indicates an attempt to link with a credential that has already been linked with a
@@ -248,7 +255,8 @@ enum SharedErrorCode {
 //   /** @var FIRAuthInternalErrorCodeWeakPassword
 //       @brief Indicates an attempt to set a password that is considered too weak.
 //    */
-//   FIRAuthInternalErrorCodeWeakPassword = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeWeakPassword,
+//   FIRAuthInternalErrorCodeWeakPassword = FIRAuthPublicErrorCodeFlag |
+//   FIRAuthErrorCodeWeakPassword,
 //
 //   /** @var FIRAuthInternalErrorCodeAppNotAuthorized
 //       @brief Indicates the App is not authorized to use Firebase Authentication with the
@@ -269,7 +277,8 @@ enum SharedErrorCode {
 //   FIRAuthInternalErrorCodeInvalidActionCode = FIRAuthPublicErrorCodeFlag |
 //                                               FIRAuthErrorCodeInvalidActionCode,
 //
-//   /** Indicates that there are invalid parameters in the payload during a "send password reset email
+//   /** Indicates that there are invalid parameters in the payload during a "send password reset
+//   /email
 //    *  " attempt.
 //    */
 //   FIRAuthInternalErrorCodeInvalidMessagePayload = FIRAuthPublicErrorCodeFlag |
@@ -290,7 +299,8 @@ enum SharedErrorCode {
 //   FIRAuthinternalErrorCodeMissingIosBundleID = FIRAuthPublicErrorCodeFlag |
 //                                                FIRAuthErrorCodeMissingIosBundleID,
 //
-//   /** Indicates that the android package name is missing when the @c androidInstallApp flag is set
+//   /** Indicates that the android package name is missing when the @c androidInstallApp flag is
+//   /set
 //         to true.
 //    */
 //   FIRAuthInternalErrorCodeMissingAndroidPackageName = FIRAuthPublicErrorCodeFlag |
@@ -315,9 +325,11 @@ enum SharedErrorCode {
 //
 //   /** Indicates that an email address was expected but one was not provided.
 //    */
-//   FIRAuthInternalErrorCodeMissingEmail = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeMissingEmail,
+//   FIRAuthInternalErrorCodeMissingEmail = FIRAuthPublicErrorCodeFlag |
+//   FIRAuthErrorCodeMissingEmail,
 //
-//   /** Indicates that a phone number was not provided in a call to @c verifyPhoneNumber:completion:.
+//   /** Indicates that a phone number was not provided in a call to @c
+//   /verifyPhoneNumber:completion:.
 //    */
 //   FIRAuthInternalErrorCodeMissingPhoneNumber = FIRAuthPublicErrorCodeFlag |
 //                                                FIRAuthErrorCodeMissingPhoneNumber,
@@ -502,14 +514,16 @@ enum SharedErrorCode {
 //                                               FIRAuthErrorCodeInvalidProviderID,
 //
 //   /** @var FIRAuthInternalErrorCodeTenantIDMismatch
-//       @brief Indicates an error occurred when an attempt is made to update the current user with a
+//       @brief Indicates an error occurred when an attempt is made to update the current user with
+//       a
 //           tenantId that differs from the current FirebaseAuth instance's tenantId.
 //    */
 //   FIRAuthInternalErrorCodeTenantIDMismatch = FIRAuthPublicErrorCodeFlag |
 //                                              FIRAuthErrorCodeTenantIDMismatch,
 //
 //   /** @var FIRAuthInternalErrorCodeUnsupportedTenantOperation
-//       @brief Indicates an error occurred when operation is not supported in a multi-tenant context.
+//       @brief Indicates an error occurred when operation is not supported in a multi-tenant
+//       context.
 //    */
 //   FIRAuthInternalErrorCodeUnsupportedTenantOperation = FIRAuthPublicErrorCodeFlag |
 //                                                        FIRAuthErrorCodeUnsupportedTenantOperation,
@@ -520,7 +534,8 @@ enum SharedErrorCode {
 //   FIRAuthInternalErrorCodeInvalidDynamicLinkDomain = FIRAuthPublicErrorCodeFlag |
 //                                                      FIRAuthErrorCodeInvalidDynamicLinkDomain,
 //
-//   FIRAuthInternalErrorCodeMalformedJWT = FIRAuthPublicErrorCodeFlag | FIRAuthErrorCodeMalformedJWT,
+//   FIRAuthInternalErrorCodeMalformedJWT = FIRAuthPublicErrorCodeFlag |
+//   FIRAuthErrorCodeMalformedJWT,
 //
 //   /** @var FIRAuthInternalErrorCodeRPCRequestEncodingError
 //       @brief Indicates an error encoding the RPC request.
@@ -543,16 +558,20 @@ enum SharedErrorCode {
 //   FIRAuthInternalErrorCodeJSONSerializationError = 2,
 //
 //   /** @var FIRAuthInternalErrorCodeUnexpectedErrorResponse
-//       @brief Indicates an HTTP error occurred and the data returned either couldn't be deserialized
+//       @brief Indicates an HTTP error occurred and the data returned either couldn't be
+//       deserialized
 //           or couldn't be decoded.
-//       @remarks See the @c NSUnderlyingError value in the @c NSError.userInfo dictionary for details
+//       @remarks See the @c NSUnderlyingError value in the @c NSError.userInfo dictionary for
+//       details
 //           about the HTTP error which occurred.
 //
-//           If the response could be deserialized as JSON then the @c NSError.userInfo dictionary will
+//           If the response could be deserialized as JSON then the @c NSError.userInfo dictionary
+//           will
 //           contain a value for the key @c FIRAuthErrorUserInfoDeserializedResponseKey which is the
 //           deserialized response value.
 //
-//           If the response could not be deserialized as JSON then the @c NSError.userInfo dictionary
+//           If the response could not be deserialized as JSON then the @c NSError.userInfo
+//           dictionary
 //           will contain values for the @c NSUnderlyingErrorKey and @c FIRAuthErrorUserInfoDataKey
 //           keys.
 //    */
@@ -560,7 +579,8 @@ enum SharedErrorCode {
 //
 //   /** @var FIRAuthInternalErrorCodeUnexpectedResponse
 //       @brief Indicates the HTTP response indicated the request was a successes, but the response
-//           contains something other than a JSON-encoded dictionary, or the data type of the response
+//           contains something other than a JSON-encoded dictionary, or the data type of the
+//           response
 //           indicated it is different from the type of response we expected.
 //       @remarks See the @c NSUnderlyingError value in the @c NSError.userInfo dictionary.
 //           If this key is present in the dictionary, it may contain an error from
@@ -568,8 +588,10 @@ enum SharedErrorCode {
 //               type).
 //
 //           See the @c FIRAuthErrorUserInfoDeserializedResponseKey value in the @c NSError.userInfo
-//           dictionary. If the response could be deserialized, it's deserialized representation will
-//           be associated with this key. If the @c NSUnderlyingError value in the @c NSError.userInfo
+//           dictionary. If the response could be deserialized, it's deserialized representation
+//           will
+//           be associated with this key. If the @c NSUnderlyingError value in the @c
+//           NSError.userInfo
 //           dictionary is @c nil, this indicates the JSON didn't represent a dictionary.
 //    */
 //   FIRAuthInternalErrorCodeUnexpectedResponse = 4,
@@ -577,9 +599,11 @@ enum SharedErrorCode {
 //   /** @var FIRAuthInternalErrorCodeRPCResponseDecodingError
 //       @brief Indicates an error decoding the RPC response.
 //           This is typically due to some sort of unexpected response value from the server.
-//       @remarks See the @c NSUnderlyingError value in the @c NSError.userInfo dictionary for details.
+//       @remarks See the @c NSUnderlyingError value in the @c NSError.userInfo dictionary for
+//       details.
 //
-//           See the @c FIRErrorUserInfoDecodedResponseKey value in the @c NSError.userInfo dictionary.
+//           See the @c FIRErrorUserInfoDecodedResponseKey value in the @c NSError.userInfo
+//           dictionary.
 //           The deserialized representation of the response will be associated with this key.
 //    */
 //   FIRAuthInternalErrorCodeRPCResponseDecodingError = 5,

+ 2 - 2
FirebaseAuth/Sources/Swift/Utilities/AuthWebUtils.swift

@@ -87,8 +87,8 @@ typealias FIRFetchAuthDomainCallback = (String?, Error?) -> Void
   static func fetchAuthDomain(withRequestConfiguration requestConfiguration: AuthRequestConfiguration,
                               completion: @escaping FIRFetchAuthDomainCallback) {
     if let emulatorHostAndPort = requestConfiguration.emulatorHostAndPort {
-      // If we are using the auth emulator, we do not want to call the GetProjectConfig endpoint. The
-      // widget is hosted on the emulator host and port, so we can return that directly.
+      // If we are using the auth emulator, we do not want to call the GetProjectConfig endpoint.
+      // The widget is hosted on the emulator host and port, so we can return that directly.
       completion(emulatorHostAndPort, nil)
       return
     }

+ 12 - 13
FirebaseAuth/Tests/Unit/AuthBackendRPCImplentationTests.swift

@@ -18,7 +18,6 @@ import XCTest
 @testable import FirebaseAuth
 import FirebaseCoreExtension
 import FirebaseCoreInternal
-import HeartbeatLoggingTestUtils
 
 private let kFakeAPIKey = "kTestAPIKey"
 private let kFakeAppID = "kTestFirebaseAppID"
@@ -226,10 +225,10 @@ class AuthBackendRPCImplementationTests: RPCBaseTests {
       rpcResponse = response
       rpcError = error as? NSError
     }
-    // We are responding with a JSON-encoded string value representing an array - which is unexpected.
-    // It should normally be a dictionary, and we need to check for this sort of thing. Because we can
-    // successfully decode this value, however, we do return it in the error results. We check for
-    // this array later in the test.
+    // We are responding with a JSON-encoded string value representing an array - which is
+    // unexpected. It should normally be a dictionary, and we need to check for this sort
+    // of thing. Because we can successfully decode this value, however, we do return it
+    // in the error results. We check for this array later in the test.
     let data = "[]".data(using: .utf8)
     let responseError = NSError(domain: kFakeErrorDomain, code: kFakeErrorCode)
     try rpcIssuer?.respond(withData: data, error: responseError)
@@ -273,10 +272,10 @@ class AuthBackendRPCImplementationTests: RPCBaseTests {
       rpcResponse = response
       rpcError = error as? NSError
     }
-    // We are responding with a JSON-encoded string value representing an array - which is unexpected.
-    // It should normally be a dictionary, and we need to check for this sort of thing. Because we can
-    // successfully decode this value, however, we do return it in the error results. We check for
-    // this array later in the test.
+    // We are responding with a JSON-encoded string value representing an array - which is
+    // unexpected. It should normally be a dictionary, and we need to check for this sort
+    // of thing. Because we can successfully decode this value, however, we do return it
+    // in the error results. We check for this array later in the test.
     let data = "[]".data(using: .utf8)
     try rpcIssuer?.respond(withData: data, error: nil)
 
@@ -435,8 +434,8 @@ class AuthBackendRPCImplementationTests: RPCBaseTests {
       rpcResponse = response
       rpcError = error as? NSError
     }
-    // We need to return a valid "error" response here, but we are going to intentionally use a bogus
-    // error message.
+    // We need to return a valid "error" response here, but we are going to intentionally use a
+    // bogus error message.
     let responseError = NSError(domain: kFakeErrorDomain, code: kFakeErrorCode)
     try rpcIssuer?.respond(serverErrorMessage: kUnknownServerErrorMessage, error: responseError)
 
@@ -592,8 +591,8 @@ class AuthBackendRPCImplementationTests: RPCBaseTests {
       rpcError = error as? NSError
     }
     // It doesn't matter what we respond with here, as long as it's not an error response. The fake
-    // response will deterministicly simulate a decoding error regardless of the response value it was
-    // given.
+    // response will deterministicly simulate a decoding error regardless of the response value it
+    // was given.
     try rpcIssuer?.respond(withJSON: [kTestKey: kTestValue])
 
     XCTAssert(callbackInvoked)

+ 2 - 2
FirebaseAuth/Tests/Unit/AuthNotificationManagerTests.swift

@@ -62,14 +62,14 @@
         @brief Tests checking notification forwarding on modern fake delegate.
      */
     func testForwardingModernDelegate() throws {
-      try verify(forwarding: true, delegate: try XCTUnwrap(modernDelegate))
+      try verify(forwarding: true, delegate: XCTUnwrap(modernDelegate))
     }
 
     /** @fn testNotForwardingModernDelegate
         @brief Tests checking notification not forwarding on modern fake delegate.
      */
     func testNotForwardingModernDelegate() throws {
-      try verify(forwarding: false, delegate: try XCTUnwrap(modernDelegate))
+      try verify(forwarding: false, delegate: XCTUnwrap(modernDelegate))
     }
 
     private func verify(forwarding: Bool, delegate: FakeForwardingDelegate) throws {

+ 2 - 1
FirebaseAuth/Tests/Unit/AuthProviderIDTests.swift

@@ -18,7 +18,8 @@ import FirebaseAuth
 
 @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
 final class AuthProviderIDTests: XCTestCase {
-  // Verify that AuthProviderID enum values match the class values published for Objective C compatibility.
+  // Verify that AuthProviderID enum values match the class values published for Objective C
+  // compatibility.
   func testAuthProviderIDEnumRawValue() {
     XCTAssertEqual(AuthProviderString.apple.rawValue, "apple.com")
     XCTAssertEqual(AuthProviderString.email.rawValue, EmailAuthProvider.id)

+ 13 - 9
FirebaseAuth/Tests/Unit/AuthTests.swift

@@ -75,7 +75,8 @@ class AuthTests: RPCBaseTests {
     let allSignInMethods = ["emailLink", "facebook.com"]
     let expectation = self.expectation(description: #function)
 
-    // 1. Create a group to synchronize request creation by the fake rpcIssuer in `fetchSignInMethods`.
+    // 1. Create a group to synchronize request creation by the fake rpcIssuer in
+    // `fetchSignInMethods`.
     let group = createGroup()
 
     auth?.fetchSignInMethods(forEmail: kEmail) { signInMethods, error in
@@ -1159,7 +1160,7 @@ class AuthTests: RPCBaseTests {
                                       "isNewUser": true,
                                       "refreshToken": kRefreshToken])
     waitForExpectations(timeout: 5)
-    assertUserAnonymous(try XCTUnwrap(auth?.currentUser))
+    try assertUserAnonymous(XCTUnwrap(auth?.currentUser))
   }
 
   /** @fn testSignInAnonymouslyFailure
@@ -1370,7 +1371,8 @@ class AuthTests: RPCBaseTests {
   func testSendPasswordResetEmailSuccess() throws {
     let expectation = self.expectation(description: #function)
 
-    // 1. Create a group to synchronize request creation by the fake rpcIssuer in `fetchSignInMethods`.
+    // 1. Create a group to synchronize request creation by the fake rpcIssuer in
+    // `fetchSignInMethods`.
     let group = createGroup()
 
     auth?.sendPasswordReset(withEmail: kEmail) { error in
@@ -1419,7 +1421,8 @@ class AuthTests: RPCBaseTests {
   func testSendSignInLinkToEmailSuccess() throws {
     let expectation = self.expectation(description: #function)
 
-    // 1. Create a group to synchronize request creation by the fake rpcIssuer in `fetchSignInMethods`.
+    // 1. Create a group to synchronize request creation by the fake rpcIssuer in
+    // `fetchSignInMethods`.
     let group = createGroup()
 
     auth?.sendSignInLink(toEmail: kEmail,
@@ -1767,7 +1770,8 @@ class AuthTests: RPCBaseTests {
     waitForExpectations(timeout: 5)
     expectation = nil
 
-    // Listener should fire for signing in. Expectation is waited on in waitForSignInWithAccessToken.
+    // Listener should fire for signing in. Expectation is waited on in
+    // waitForSignInWithAccessToken.
     expectation = self.expectation(description: "sign-in")
     shouldHaveUser = true
     try waitForSignInWithAccessToken()
@@ -1964,8 +1968,8 @@ class AuthTests: RPCBaseTests {
 
       setFakeSecureTokenService(fakeAccessToken: AuthTests.kNewAccessToken)
 
-      // Verify that the current user's access token is the "old" access token before automatic token
-      // refresh.
+      // Verify that the current user's access token is the "old" access token before automatic
+      // token refresh.
       XCTAssertEqual(AuthTests.kAccessToken, auth.currentUser?.rawAccessToken())
 
       // Execute saved token refresh task.
@@ -1978,8 +1982,8 @@ class AuthTests: RPCBaseTests {
       waitForExpectations(timeout: 5)
       waitForAuthGlobalWorkQueueDrain()
 
-      // Verify that current user's access token is the "new" access token provided in the mock secure
-      // token response during automatic token refresh.
+      // Verify that current user's access token is the "new" access token provided in the mock
+      // secure token response during automatic token refresh.
       XCTAssertEqual(AuthTests.kNewAccessToken, auth.currentUser?.rawAccessToken())
     }
   #endif

+ 0 - 154
FirebaseAuth/Tests/Unit/FIRFinalizeMFAEnrollmentRequestTests.m

@@ -1,154 +0,0 @@
-/*
- * Copyright 2023 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import <TargetConditionals.h>
-#if TARGET_OS_IOS
-
-#import <XCTest/XCTest.h>
-
-#import "FirebaseAuth/Sources/Backend/FIRAuthBackend+MultiFactor.h"
-#import "FirebaseAuth/Sources/Backend/RPC/MultiFactor/Enroll/FIRFinalizeMFAEnrollmentRequest.h"
-#import "FirebaseAuth/Sources/Backend/RPC/MultiFactor/Enroll/FIRFinalizeMFAEnrollmentResponse.h"
-#import "FirebaseAuth/Sources/Backend/RPC/Proto/TOTP/FIRAuthProtoFinalizeMFATOTPEnrollmentRequestInfo.h"
-#import "FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuthErrors.h"
-#import "FirebaseAuth/Tests/Unit/FIRFakeBackendRPCIssuer.h"
-
-/**
- @var kTestAPIKey
- @brief Fake API key used for testing.
- */
-static NSString *const kTestAPIKey = @"APIKey";
-
-/**
- @var kTestFirebaseAppID
- @brief Fake Firebase app ID used for testing.
- */
-static NSString *const kTestFirebaseAppID = @"appID";
-
-/**
- @var kExpectedAPIURL
- @brief The expected URL for the test calls.
- */
-static NSString *const kExpectedAPIURL =
-    @"https://identitytoolkit.googleapis.com/v2/accounts/mfaEnrollment:finalize?key=APIKey";
-
-/**
- @var kIDToken
- @brief Token representing the user's identity.
- */
-static NSString *const kIDToken = @"idToken";
-
-/**
- @var kSessionInfo
- @brief Information about the session.
- */
-static NSString *const kSessionInfo = @"sessionInfo";
-
-/**
- @var kDisplayName
- @brief Display name for enrolled factor
- */
-static NSString *const kDisplayName = @"displayName";
-
-/**
- @var kVerificationCode
- @brief Verification code for TOTP
- */
-static NSString *kVerificationCode = @"verificationCode";
-
-/**
- @var kTOTPVerificationInfo
- @brief Information about the TOTP (Time-Based One-Time Password) MFA session.
- */
-static NSString *const kTOTPVerificationInfo = @"totpVerificationInfo";
-
-/**
- @var kPhoneVerificationInfo
- @brief Information about the Phone MFA session
- */
-static NSString *const kPhoneVerificationInfo = @"phoneVerificationInfo";
-
-/**
- @class FIRFinalizeMFAEnrollmentRequestTests
- @brief Tests for @c FIRFinalizeMFAEnrollmentRequest.
- */
-@interface FIRFinalizeMFAEnrollmentRequestTests : XCTestCase
-@end
-
-@implementation FIRFinalizeMFAEnrollmentRequestTests {
-  /**
-   @brief This backend RPC issuer is used to fake network responses for each test in the suite.
-   In the @c setUp method we initialize this and set @c FIRAuthBackend's RPC issuer to it.
-   */
-  FIRFakeBackendRPCIssuer *_RPCIssuer;
-
-  /**
-   @brief This is the request configuration used for testing.
-   */
-  FIRAuthRequestConfiguration *_requestConfiguration;
-}
-
-- (void)setUp {
-  [super setUp];
-  FIRFakeBackendRPCIssuer *RPCIssuer = [[FIRFakeBackendRPCIssuer alloc] init];
-  [FIRAuthBackend setDefaultBackendImplementationWithRPCIssuer:RPCIssuer];
-  _RPCIssuer = RPCIssuer;
-  _requestConfiguration = [[FIRAuthRequestConfiguration alloc] initWithAPIKey:kTestAPIKey
-                                                                        appID:kTestFirebaseAppID];
-}
-
-- (void)tearDown {
-  _RPCIssuer = nil;
-  _requestConfiguration = nil;
-  [FIRAuthBackend setDefaultBackendImplementationWithRPCIssuer:nil];
-  [super tearDown];
-}
-
-/**
- @fn testTOTPFinalizeMFAEnrollmentRequest
- @brief Tests the Finalize MFA Enrollment using TOTP request.
- */
-- (void)testTOTPFinalizeMFAEnrollmentRequest {
-  FIRAuthProtoFinalizeMFATOTPEnrollmentRequestInfo *requestInfo =
-      [[FIRAuthProtoFinalizeMFATOTPEnrollmentRequestInfo alloc]
-          initWithSessionInfo:kSessionInfo
-             verificationCode:kVerificationCode];
-  FIRFinalizeMFAEnrollmentRequest *request =
-      [[FIRFinalizeMFAEnrollmentRequest alloc] initWithIDToken:kIDToken
-                                                   displayName:kDisplayName
-                                          TOTPVerificationInfo:requestInfo
-                                          requestConfiguration:_requestConfiguration];
-
-  [FIRAuthBackend
-      finalizeMultiFactorEnrollment:request
-                           callback:^(FIRFinalizeMFAEnrollmentResponse *_Nullable response,
-                                      NSError *_Nullable error){
-                           }];
-
-  XCTAssertEqualObjects(_RPCIssuer.requestURL.absoluteString, kExpectedAPIURL);
-  XCTAssertNotNil(_RPCIssuer.decodedRequest);
-  XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kIDToken], kIDToken);
-  XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kDisplayName], kDisplayName);
-  XCTAssertNotNil(_RPCIssuer.decodedRequest[kTOTPVerificationInfo]);
-  XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kTOTPVerificationInfo][kVerificationCode],
-                        kVerificationCode);
-  XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kTOTPVerificationInfo][kSessionInfo],
-                        kSessionInfo);
-  XCTAssertNil(_RPCIssuer.decodedRequest[kPhoneVerificationInfo]);
-}
-
-@end
-#endif

+ 0 - 137
FirebaseAuth/Tests/Unit/FIRFinalizeMFASignInRequestTests.m

@@ -1,137 +0,0 @@
-/*
- * Copyright 2023 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import <TargetConditionals.h>
-#if TARGET_OS_IOS
-
-#import <XCTest/XCTest.h>
-
-#import "FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuthErrors.h"
-
-#import "FirebaseAuth/Sources/Backend/FIRAuthBackend+MultiFactor.h"
-#import "FirebaseAuth/Sources/Backend/RPC/MultiFactor/SignIn/FIRFinalizeMFASignInRequest.h"
-#import "FirebaseAuth/Sources/Backend/RPC/MultiFactor/SignIn/FIRFinalizeMFASignInResponse.h"
-#import "FirebaseAuth/Sources/Backend/RPC/Proto/TOTP/FIRAuthProtoFinalizeMFATOTPSignInRequestInfo.h"
-#import "FirebaseAuth/Tests/Unit/FIRFakeBackendRPCIssuer.h"
-
-/**
- @var kTestAPIKey
- @brief Fake API key used for testing.
- */
-static NSString *const kTestAPIKey = @"APIKey";
-
-/**
- @var kTestFirebaseAppID
- @brief Fake Firebase app ID used for testing.
- */
-static NSString *const kTestFirebaseAppID = @"appID";
-
-/**
- @var kExpectedAPIURL
- @brief The expected URL for the test calls.
- */
-static NSString *const kExpectedAPIURL =
-    @"https://identitytoolkit.googleapis.com/v2/accounts/mfaSignIn:finalize?key=APIKey";
-
-/**
- @var kMfaPendingCredential
- @brief Fake MFA Pending Credential for tesing.
- */
-static NSString *const kMfaPendingCredential = @"mfaPendingCredential";
-
-/**
- @var kVerificationCode
- @brief Fake totp verification code for tesing.
- */
-static NSString *const kVerificationCode = @"verificationCode";
-
-/**
- @var kMfaEnrollmentID
- @brief Fake MFA Enrollment ID for tesing.
- */
-static NSString *const kMfaEnrollmentID = @"mfaEnrollmentId";
-
-/**
- @var kTotpVerificationInfo
- @brief Fake TOTP verification info for tesing.
- */
-static NSString *const kTotpVerificationInfo = @"totpVerificationInfo";
-
-/**
- @class FIRFinalizeMFASignInRequestTests
- @brief Tests for @c FIRFinalizeMFASignInRequest.
- */
-@interface FIRFinalizeMFASignInRequestTests : XCTestCase
-@end
-
-@implementation FIRFinalizeMFASignInRequestTests {
-  /**
-   @brief This backend RPC issuer is used to fake network responses for each test in the suite.
-   In the @c setUp method we initialize this and set @c FIRAuthBackend's RPC issuer to it.
-   */
-  FIRFakeBackendRPCIssuer *_RPCIssuer;
-
-  /**
-   @brief This is the request configuration used for testing.
-   */
-  FIRAuthRequestConfiguration *_requestConfiguration;
-}
-
-- (void)setUp {
-  [super setUp];
-  FIRFakeBackendRPCIssuer *RPCIssuer = [[FIRFakeBackendRPCIssuer alloc] init];
-  [FIRAuthBackend setDefaultBackendImplementationWithRPCIssuer:RPCIssuer];
-  _RPCIssuer = RPCIssuer;
-  _requestConfiguration = [[FIRAuthRequestConfiguration alloc] initWithAPIKey:kTestAPIKey
-                                                                        appID:kTestFirebaseAppID];
-}
-
-- (void)tearDown {
-  _RPCIssuer = nil;
-  _requestConfiguration = nil;
-  [FIRAuthBackend setDefaultBackendImplementationWithRPCIssuer:nil];
-  [super tearDown];
-}
-
-/**
- @fn testTOTPFinalizeMFASignInRequest
- @brief Tests the Finalize MFA Sign in using TOTP request.
- */
-- (void)testTOTPFinalizeMFASignInRequest {
-  FIRAuthProtoFinalizeMFATOTPSignInRequestInfo *requestInfo =
-      [[FIRAuthProtoFinalizeMFATOTPSignInRequestInfo alloc]
-          initWithMfaEnrollmentID:kMfaEnrollmentID
-                 verificationCode:kVerificationCode];
-  FIRFinalizeMFASignInRequest *request =
-      [[FIRFinalizeMFASignInRequest alloc] initWithMFAPendingCredential:kMfaPendingCredential
-                                                       verificationInfo:requestInfo
-                                                   requestConfiguration:_requestConfiguration];
-
-  [FIRAuthBackend finalizeMultiFactorSignIn:request
-                                   callback:^(FIRFinalizeMFASignInResponse *_Nullable response,
-                                              NSError *_Nullable error){
-                                   }];
-
-  XCTAssertEqualObjects(_RPCIssuer.requestURL.absoluteString, kExpectedAPIURL);
-  XCTAssertNotNil(_RPCIssuer.decodedRequest);
-  XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kMfaPendingCredential], kMfaPendingCredential);
-  XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kMfaEnrollmentID], kMfaEnrollmentID);
-  XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kTotpVerificationInfo][kVerificationCode],
-                        kVerificationCode);
-}
-
-@end
-#endif

+ 0 - 127
FirebaseAuth/Tests/Unit/FIRStartMFAEnrollmentRequestTests.m

@@ -1,127 +0,0 @@
-/*
- * Copyright 2023 Google LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#import <TargetConditionals.h>
-#if TARGET_OS_IOS
-
-#import <XCTest/XCTest.h>
-
-#import "FirebaseAuth/Sources/Backend/FIRAuthBackend+MultiFactor.h"
-#import "FirebaseAuth/Sources/Backend/RPC/MultiFactor/Enroll/FIRStartMFAEnrollmentRequest.h"
-#import "FirebaseAuth/Sources/Backend/RPC/MultiFactor/Enroll/FIRStartMFAEnrollmentResponse.h"
-#import "FirebaseAuth/Sources/Backend/RPC/Proto/TOTP/FIRAuthProtoStartMFATOTPEnrollmentRequestInfo.h"
-#import "FirebaseAuth/Sources/Public/FirebaseAuth/FIRAuthErrors.h"
-#import "FirebaseAuth/Tests/Unit/FIRFakeBackendRPCIssuer.h"
-
-/**
- @var kTestAPIKey
- @brief Fake API key used for testing.
- */
-static NSString *const kTestAPIKey = @"APIKey";
-
-/**
- @var kTestFirebaseAppID
- @brief Fake Firebase app ID used for testing.
- */
-static NSString *const kTestFirebaseAppID = @"appID";
-
-/**
- @var kExpectedAPIURL
- @brief The expected URL for the test calls.
- */
-static NSString *const kExpectedAPIURL =
-    @"https://identitytoolkit.googleapis.com/v2/accounts/mfaEnrollment:start?key=APIKey";
-
-/**
- @var kIDToken
- @brief Token representing the user's identity.
- */
-static NSString *const kIDToken = @"idToken";
-
-/**
- @var kTOTPSessionInfo
- @brief Information about the TOTP (Time-Based One-Time Password) Enrollment.
- */
-static NSString *const kTOTPEnrollmentInfo = @"totpEnrollmentInfo";
-
-/**
- @var kPhoneSessionInfo
- @brief Information about the Phone Enrollment.
- */
-static NSString *const kPhoneEnrollmentInfo = @"enrollmentInfo";
-
-/**
- @class FIRStartMFAEnrollmentRequestTests
- @brief Tests for @c FIRStartMFAEnrollmentRequest.
- */
-@interface FIRStartMFAEnrollmentRequestTests : XCTestCase
-@end
-
-@implementation FIRStartMFAEnrollmentRequestTests {
-  /**
-   @brief This backend RPC issuer is used to fake network responses for each test in the suite.
-   In the @c setUp method we initialize this and set @c FIRAuthBackend's RPC issuer to it.
-   */
-  FIRFakeBackendRPCIssuer *_RPCIssuer;
-
-  /**
-   @brief This is the request configuration used for testing.
-   */
-  FIRAuthRequestConfiguration *_requestConfiguration;
-}
-
-- (void)setUp {
-  [super setUp];
-  FIRFakeBackendRPCIssuer *RPCIssuer = [[FIRFakeBackendRPCIssuer alloc] init];
-  [FIRAuthBackend setDefaultBackendImplementationWithRPCIssuer:RPCIssuer];
-  _RPCIssuer = RPCIssuer;
-  _requestConfiguration = [[FIRAuthRequestConfiguration alloc] initWithAPIKey:kTestAPIKey
-                                                                        appID:kTestFirebaseAppID];
-}
-
-- (void)tearDown {
-  _RPCIssuer = nil;
-  _requestConfiguration = nil;
-  [FIRAuthBackend setDefaultBackendImplementationWithRPCIssuer:nil];
-  [super tearDown];
-}
-
-/**
- @fn testTOTPStartMFAEnrollmentRequest
- @brief Tests the Start MFA Enrollment using TOTP request.
- */
-- (void)testTOTPStartMFAEnrollmentRequest {
-  FIRAuthProtoStartMFATOTPEnrollmentRequestInfo *requestInfo =
-      [[FIRAuthProtoStartMFATOTPEnrollmentRequestInfo alloc] init];
-  FIRStartMFAEnrollmentRequest *request =
-      [[FIRStartMFAEnrollmentRequest alloc] initWithIDToken:kIDToken
-                                         TOTPEnrollmentInfo:requestInfo
-                                       requestConfiguration:_requestConfiguration];
-
-  [FIRAuthBackend startMultiFactorEnrollment:request
-                                    callback:^(FIRStartMFAEnrollmentResponse *_Nullable response,
-                                               NSError *_Nullable error){
-                                    }];
-
-  XCTAssertEqualObjects(_RPCIssuer.requestURL.absoluteString, kExpectedAPIURL);
-  XCTAssertNotNil(_RPCIssuer.decodedRequest);
-  XCTAssertEqualObjects(_RPCIssuer.decodedRequest[kIDToken], kIDToken);
-  XCTAssertNotNil(_RPCIssuer.decodedRequest[kTOTPEnrollmentInfo]);
-  XCTAssertNil(_RPCIssuer.decodedRequest[kPhoneEnrollmentInfo]);
-}
-
-@end
-#endif

+ 1 - 1
FirebaseAuth/Tests/Unit/Fakes/FakeBackendRPCIssuer.swift

@@ -161,7 +161,7 @@ class FakeBackendRPCIssuer: NSObject, AuthBackendRPCIssuer {
     let error = NSError(domain: NSCocoaErrorDomain, code: 0)
     return try respond(withJSON: ["error": ["message": message,
                                             "errors": [["reason": errorMessage]]] as [String: Any]],
-    error: error)
+                       error: error)
   }
 
   @discardableResult func respond(withJSON json: [String: Any],

+ 2 - 1
FirebaseAuth/Tests/Unit/OAuthProviderTests.swift

@@ -115,7 +115,8 @@ import FirebaseCore
     func testGetCredentialWithUIDelegateWithTenantID() throws {
       initApp(#function)
 
-      // Update tenantID on workqueue to enable _protectedDataDidBecomeAvailableObserver to finish init.
+      // Update tenantID on workqueue to enable _protectedDataDidBecomeAvailableObserver to finish
+      // init.
       kAuthGlobalWorkQueue.sync {
         OAuthProviderTests.auth?.tenantID = OAuthProviderTests.kFakeTenantID
       }

+ 1 - 1
FirebaseAuth/Tests/Unit/PhoneAuthProviderTests.swift

@@ -660,7 +660,7 @@
           settings.appVerificationDisabledForTesting = true
           auth.settings = settings
         }
-        auth.notificationManager.immediateCallbackForTestFaking = { return forwardingNotification }
+        auth.notificationManager.immediateCallbackForTestFaking = { forwardingNotification }
         auth.mainBundleUrlTypes = [["CFBundleURLSchemes": [scheme]]]
 
         if fakeToken {

+ 24 - 24
FirebaseAuth/Tests/Unit/SignInWithGameCenterTests.swift

@@ -61,17 +61,17 @@ class SignInWithGameCenterTests: RPCBaseTests {
 
     let signature = try XCTUnwrap(Data(base64Encoded: kSignature))
     let salt = try XCTUnwrap(Data(base64URLEncoded: kSalt))
-    let request = SignInWithGameCenterRequest(playerID: kPlayerID,
-                                              teamPlayerID: kTeamPlayerID,
-                                              gamePlayerID: kGamePlayerID,
-                                              publicKeyURL: try XCTUnwrap(
-                                                URL(string: kPublicKeyURL)
-                                              ),
-                                              signature: signature,
-                                              salt: salt,
-                                              timestamp: kTimestamp,
-                                              displayName: kDisplayName,
-                                              requestConfiguration: makeRequestConfiguration())
+    let request = try SignInWithGameCenterRequest(playerID: kPlayerID,
+                                                  teamPlayerID: kTeamPlayerID,
+                                                  gamePlayerID: kGamePlayerID,
+                                                  publicKeyURL: XCTUnwrap(
+                                                    URL(string: kPublicKeyURL)
+                                                  ),
+                                                  signature: signature,
+                                                  salt: salt,
+                                                  timestamp: kTimestamp,
+                                                  displayName: kDisplayName,
+                                                  requestConfiguration: makeRequestConfiguration())
     request.accessToken = kAccessToken
     let issuer = try checkRequest(
       request: request,
@@ -137,9 +137,9 @@ class SignInWithGameCenterTests: RPCBaseTests {
       XCTAssertEqual(unarchivedCredential.teamPlayerID, kTeamPlayerID)
       XCTAssertEqual(unarchivedCredential.gamePlayerID, kGamePlayerID)
       XCTAssertEqual(unarchivedCredential.publicKeyURL, URL(string: kPublicKeyURL))
-      XCTAssertEqual(String(data: try XCTUnwrap(unarchivedCredential.signature),
-                            encoding: .utf8), kSignature)
-      XCTAssertEqual(String(data: try XCTUnwrap(unarchivedCredential.salt), encoding: .utf8), kSalt)
+      XCTAssertEqual(try String(data: XCTUnwrap(unarchivedCredential.signature),
+                                encoding: .utf8), kSignature)
+      XCTAssertEqual(try String(data: XCTUnwrap(unarchivedCredential.salt), encoding: .utf8), kSalt)
       XCTAssertEqual(unarchivedCredential.timestamp, kTimestamp)
       XCTAssertEqual(unarchivedCredential.displayName, kDisplayName)
     }
@@ -147,16 +147,16 @@ class SignInWithGameCenterTests: RPCBaseTests {
     private func makeGameCenterCredential() throws -> GameCenterAuthCredential {
       let signature = try XCTUnwrap(kSignature.data(using: .utf8))
       let salt = try XCTUnwrap(kSalt.data(using: .utf8))
-      return GameCenterAuthCredential(withPlayerID: kPlayerID,
-                                      teamPlayerID: kTeamPlayerID,
-                                      gamePlayerID: kGamePlayerID,
-                                      publicKeyURL: try XCTUnwrap(
-                                        URL(string: kPublicKeyURL)
-                                      ),
-                                      signature: signature,
-                                      salt: salt,
-                                      timestamp: kTimestamp,
-                                      displayName: kDisplayName)
+      return try GameCenterAuthCredential(withPlayerID: kPlayerID,
+                                          teamPlayerID: kTeamPlayerID,
+                                          gamePlayerID: kGamePlayerID,
+                                          publicKeyURL: XCTUnwrap(
+                                            URL(string: kPublicKeyURL)
+                                          ),
+                                          signature: signature,
+                                          salt: salt,
+                                          timestamp: kTimestamp,
+                                          displayName: kDisplayName)
     }
   #endif
 }

+ 22 - 21
FirebaseAuth/Tests/Unit/SwiftAPI.swift

@@ -413,27 +413,28 @@ class AuthAPI_hOnlyTests: XCTestCase {
     }
   #endif
 
-  func FIRTOTPSecret_h() {
-    let obj = TOTPSecret()
-    obj.sharedSecretKey()
-    obj.generateQRCodeURL(withAccountName: "name", issuer: "issuer")
-    obj.openInOTPApp(withQRCodeURL: "url")
-  }
-
-  func FIRTOTPMultiFactorGenerator_h() {
-    TOTPMultiFactorGenerator.generateSecret(with: MultiFactorSession()) { _, _ in
-    }
-    TOTPMultiFactorGenerator.assertionForEnrollment(with: TOTPSecret(), oneTimePassword: "code")
-    TOTPMultiFactorGenerator.assertionForSignIn(withEnrollmentID: "id",
-                                                oneTimePassword: "code")
-  }
-
-  #if compiler(>=5.5.2) && canImport(_Concurrency)
-    @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
-    func FIRTOTPMultiFactorGenerator_hAsync() async throws {
-      try await TOTPMultiFactorGenerator.generateSecret(with: MultiFactorSession())
-    }
-  #endif
+  // TODO: reenable with TOTP
+//  func FIRTOTPSecret_h() {
+//    let obj = TOTPSecret()
+//    obj.sharedSecretKey()
+//    obj.generateQRCodeURL(withAccountName: "name", issuer: "issuer")
+//    obj.openInOTPApp(withQRCodeURL: "url")
+//  }
+//
+//  func FIRTOTPMultiFactorGenerator_h() {
+//    TOTPMultiFactorGenerator.generateSecret(with: MultiFactorSession()) { _, _ in
+//    }
+//    TOTPMultiFactorGenerator.assertionForEnrollment(with: TOTPSecret(), oneTimePassword: "code")
+//    TOTPMultiFactorGenerator.assertionForSignIn(withEnrollmentID: "id",
+//                                                oneTimePassword: "code")
+//  }
+//
+//  #if compiler(>=5.5.2) && canImport(_Concurrency)
+//    @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
+//    func FIRTOTPMultiFactorGenerator_hAsync() async throws {
+//      try await TOTPMultiFactorGenerator.generateSecret(with: MultiFactorSession())
+//    }
+//  #endif
 
   func FIRTwitterAuthProvider_h() {
     _ = TwitterAuthProvider.credential(withToken: "token", secret: "secret")

+ 3 - 2
FirebaseAuth/Tests/Unit/UserTests.swift

@@ -1650,7 +1650,8 @@ class UserTests: RPCBaseTests {
         XCTAssertNotNil(tokenResult.expirationDate)
         XCTAssertNotNil(tokenResult.signInProvider)
 
-        // The lowercased is for the base64 test which seems to be an erroneously uppercased "Password"?
+        // The lowercased is for the base64 test which seems to be an erroneously uppercased
+        // "Password"?
         XCTAssertEqual(tokenResult.signInProvider.lowercased(), EmailAuthProvider.id)
         XCTAssertEqual(tokenResult.claims["email"] as! String, emailMatch)
         XCTAssertEqual(tokenResult.claims["aud"] as! String, audMatch)
@@ -1808,7 +1809,7 @@ class UserTests: RPCBaseTests {
       group.wait()
 
       // 2. After the fake rpcIssuer leaves the group, validate the created Request instance.
-      verifyGoogleAssertionRequest(try XCTUnwrap(rpcIssuer?.request as? VerifyAssertionRequest))
+      try verifyGoogleAssertionRequest(XCTUnwrap(rpcIssuer?.request as? VerifyAssertionRequest))
 
       // 3. Send the response from the fake backend.
       try rpcIssuer?.respond(withJSON: ["idToken": RPCBaseTests.kFakeAccessToken,

+ 13 - 45
Package.swift

@@ -162,14 +162,8 @@ let package = Package(
       url: "https://github.com/firebase/nanopb.git",
       "2.30909.0" ..< "2.30910.0"
     ),
-    .package(
-      url: "https://github.com/google/abseil-cpp-binary.git",
-      "1.2022062300.0" ..< "1.2022062400.0"
-    ),
-    .package(
-      url: "https://github.com/google/grpc-binary.git",
-      "1.50.1" ..< "1.51.0"
-    ),
+    abseilDependency(),
+    grpcDependency(),
     .package(
       url: "https://github.com/erikdoe/ocmock.git",
       revision: "c5eeaa6dde7c308a5ce48ae4d4530462dd3a1110"
@@ -214,7 +208,6 @@ let package = Package(
       dependencies: [
         "FirebaseCore",
         "SharedTestUtilities",
-        "HeartbeatLoggingTestUtils",
         .product(name: "OCMock", package: "ocmock"),
       ],
       path: "FirebaseCore/Tests/Unit",
@@ -248,16 +241,10 @@ let package = Package(
       ],
       path: "FirebaseCore/Internal/Sources"
     ),
-    .target(
-      name: "HeartbeatLoggingTestUtils",
-      dependencies: ["FirebaseCoreInternal"],
-      path: "HeartbeatLoggingTestUtils/Sources"
-    ),
     .testTarget(
       name: "FirebaseCoreInternalTests",
       dependencies: [
         "FirebaseCoreInternal",
-        "HeartbeatLoggingTestUtils",
       ],
       path: "FirebaseCore/Internal/Tests"
     ),
@@ -316,8 +303,8 @@ let package = Package(
     ),
     .binaryTarget(
       name: "FirebaseAnalytics",
-      url: "https://dl.google.com/firebase/ios/swiftpm/10.9.0/FirebaseAnalytics.zip",
-      checksum: "b0a16eef8caf30eadc496ab24fef5216798c8ec360addb6af53806957950c300"
+      url: "https://dl.google.com/firebase/ios/swiftpm/10.12.0/FirebaseAnalytics.zip",
+      checksum: "46bf2b6cd96fb84aafe80c96087384fd60e4944c970fe2f465d96ffb524ac324"
     ),
     .target(
       name: "FirebaseAnalyticsSwiftTarget",
@@ -459,7 +446,6 @@ let package = Package(
       name: "AuthUnit",
       dependencies: [
         "FirebaseAuth",
-        "HeartbeatLoggingTestUtils",
       ],
       path: "FirebaseAuth/Tests/Unit"
     ),
@@ -500,6 +486,7 @@ let package = Package(
         "UnitTests/",
         "generate_project.sh",
         "upload-symbols",
+        "CrashlyticsInputFiles.xcfilelist",
         "third_party/libunwind/LICENSE",
       ],
       sources: [
@@ -645,32 +632,14 @@ let package = Package(
       ]
     ),
 
-    .target(
-      name: "FirebaseFirestoreTarget",
-      dependencies: [
-        .target(
-          name: "FirebaseFirestore",
-          condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS])
-        ),
-        .product(name: "abseil", package: "abseil-cpp-binary"),
-        .product(name: "gRPC-C++", package: "grpc-binary"),
-        .product(name: "nanopb", package: "nanopb"),
-        "FirebaseCore",
-        "leveldb",
-      ],
-      path: "SwiftPM-PlatformExclude/FirebaseFirestoreWrap"
-    ),
-
-    .binaryTarget(
-      name: "FirebaseFirestore",
-      url: "https://dl.google.com/firebase/ios/bin/firestore/10.10.0/FirebaseFirestore.zip",
-      checksum: "4a0070c4bf7e5ab59359dd8a0e68f402f3ec6c1e189fc39cc44ca88418f26ac4"
-    ),
+    firestoreWrapperTarget(),
+    firestoreTarget(),
 
     .target(
       name: "FirebaseFirestoreSwiftTarget",
       dependencies: [.target(name: "FirebaseFirestoreSwift",
-                             condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS]))],
+                             condition: .when(platforms: [.iOS, .macCatalyst, .tvOS, .macOS,
+                                                          .firebaseVisionOS]))],
       path: "SwiftPM-PlatformExclude/FirebaseFirestoreSwiftWrap"
     ),
 
@@ -695,7 +664,6 @@ let package = Package(
         "fuzzing/",
         "test.sh",
         "Swift/CHANGELOG.md",
-        "Swift/README.md",
         "Swift/Tests/",
         "third_party/nlohmann_json",
       ],
@@ -1262,16 +1230,16 @@ let package = Package(
       ]
     ),
     .testTarget(
-      name: "AppCheckUnit",
+      name: "FirebaseAppCheckUnit",
       dependencies: [
         "FirebaseAppCheck",
         "SharedTestUtilities",
-        "HeartbeatLoggingTestUtils",
         .product(name: "OCMock", package: "ocmock"),
       ],
       path: "FirebaseAppCheck/Tests",
       exclude: [
-        // Disable Swift tests as mixed targets are not supported (Xcode 12.3).
+        // Swift tests are in the target `FirebaseAppCheckUnitSwift` since mixed language targets
+        // are not supported (as of Xcode 14.3).
         "Unit/Swift",
       ],
       resources: [
@@ -1282,7 +1250,7 @@ let package = Package(
       ]
     ),
     .testTarget(
-      name: "AppCheckUnitSwift",
+      name: "FirebaseAppCheckUnitSwift",
       dependencies: ["FirebaseAppCheck"],
       path: "FirebaseAppCheck/Tests/Unit/Swift",
       cSettings: [