Skip to content

Commit 6b99ad1

Browse files
authored
[Auth] Mark AuthRequestConfiguration as final and reduce its mutability (#14147)
1 parent d2ff93c commit 6b99ad1

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ final class AuthBackend: AuthBackendProtocol {
7171

7272
var request = URLRequest(url: url)
7373
request.setValue(contentType, forHTTPHeaderField: "Content-Type")
74-
let additionalFrameworkMarker = requestConfiguration
75-
.additionalFrameworkMarker ?? "FirebaseCore-iOS"
74+
let additionalFrameworkMarker = requestConfiguration.additionalFrameworkMarker
7675
let clientVersion = "iOS/FirebaseSDK/\(FirebaseVersion())/\(additionalFrameworkMarker)"
7776
request.setValue(clientVersion, forHTTPHeaderField: "X-Client-Version")
7877
request.setValue(Bundle.main.bundleIdentifier, forHTTPHeaderField: "X-Ios-Bundle-Identifier")

FirebaseAuth/Sources/Swift/Backend/AuthRequestConfiguration.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import FirebaseCoreExtension
1919

2020
/// Defines configurations to be added to a request to Firebase Auth's backend.
2121
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
22-
class AuthRequestConfiguration {
22+
final class AuthRequestConfiguration {
2323
/// The Firebase Auth API key used in the request.
2424
let apiKey: String
2525

@@ -33,13 +33,13 @@ class AuthRequestConfiguration {
3333
weak var auth: Auth?
3434

3535
/// The heartbeat logger used to add heartbeats to the corresponding request's header.
36-
var heartbeatLogger: FIRHeartbeatLoggerProtocol?
36+
let heartbeatLogger: FIRHeartbeatLoggerProtocol?
3737

3838
/// The appCheck is used to generate a token.
3939
var appCheck: AppCheckInterop?
4040

4141
/// Additional framework marker that will be added as part of the header of every request.
42-
var additionalFrameworkMarker: String?
42+
let additionalFrameworkMarker: String = "FirebaseCore-iOS"
4343

4444
/// If set, the local emulator host and port to point to instead of the remote backend.
4545
var emulatorHostAndPort: String?

0 commit comments

Comments
 (0)