Skip to content

Commit

Permalink
[Auth] Ignore concurrency warnings for global vars made for testing (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ncooke3 authored Nov 13, 2024
1 parent 2b10cab commit 4ae9684
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
10 changes: 9 additions & 1 deletion FirebaseAuth/Sources/Swift/Backend/IdentityToolkitRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 9 additions & 2 deletions FirebaseAuth/Sources/Swift/Backend/RPC/SecureTokenRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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, *)
Expand Down

0 comments on commit 4ae9684

Please sign in to comment.