From 4ae96849cf1560428df5aaa08350097107a93291 Mon Sep 17 00:00:00 2001 From: Nick Cooke <36927374+ncooke3@users.noreply.github.com> Date: Tue, 12 Nov 2024 19:23:59 -0500 Subject: [PATCH] [Auth] Ignore concurrency warnings for global vars made for testing (#14101) --- .../Swift/Backend/IdentityToolkitRequest.swift | 10 +++++++++- .../Swift/Backend/RPC/SecureTokenRequest.swift | 11 +++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/FirebaseAuth/Sources/Swift/Backend/IdentityToolkitRequest.swift b/FirebaseAuth/Sources/Swift/Backend/IdentityToolkitRequest.swift index 3ee424459a5..3a5d5a3b18a 100644 --- a/FirebaseAuth/Sources/Swift/Backend/IdentityToolkitRequest.swift +++ b/FirebaseAuth/Sources/Swift/Backend/IdentityToolkitRequest.swift @@ -19,7 +19,15 @@ private let kHttpProtocol = "http:" private let kEmulatorHostAndPrefixFormat = "%@/%@" -private var gAPIHost = "www.googleapis.com" +#if compiler(>=6) + /// Host for server API calls. This should be changed via + /// `IdentityToolkitRequest.setHost(_ host:)` for testing purposes only. + private nonisolated(unsafe) var gAPIHost = "www.googleapis.com" +#else + /// Host for server API calls. This should be changed via + /// `IdentityToolkitRequest.setHost(_ host:)` for testing purposes only. + private var gAPIHost = "www.googleapis.com" +#endif // compiler(>=6) private let kFirebaseAuthAPIHost = "www.googleapis.com" private let kIdentityPlatformAPIHost = "identitytoolkit.googleapis.com" diff --git a/FirebaseAuth/Sources/Swift/Backend/RPC/SecureTokenRequest.swift b/FirebaseAuth/Sources/Swift/Backend/RPC/SecureTokenRequest.swift index e7fa5ee57e5..d11275dcf29 100644 --- a/FirebaseAuth/Sources/Swift/Backend/RPC/SecureTokenRequest.swift +++ b/FirebaseAuth/Sources/Swift/Backend/RPC/SecureTokenRequest.swift @@ -54,8 +54,15 @@ private let kRefreshTokenKey = "refreshToken" /// The key for the "code" parameter in the request. private let kCodeKey = "code" -/// Host for server API calls. -private var gAPIHost = "securetoken.googleapis.com" +#if compiler(>=6) + /// Host for server API calls. This should be changed via + /// `SecureTokenRequest.setHost(_ host:)` for testing purposes only. + private nonisolated(unsafe) var gAPIHost = "securetoken.googleapis.com" +#else + /// Host for server API calls. This should be changed via + /// `SecureTokenRequest.setHost(_ host:)` for testing purposes only. + private var gAPIHost = "securetoken.googleapis.com" +#endif // compiler(>=6) /// Represents the parameters for the token endpoint. @available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)