Skip to content

Commit 9b06b3f

Browse files
authored
[Auth] Use native Swift types in Auth backend types (#13658)
1 parent b5e2c18 commit 9b06b3f

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

FirebaseAuth/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
- [Fixed] Restore Firebase 10 behavior by querying with the
33
`kSecAttrSynchronizable` key when auth state is set to be shared across
44
devices. (#13584)
5+
- [Fixed] Prevent a bad memory access crash by using non-ObjC, native Swift
6+
types in the SDK's networking layer, and moving synchronous work off of
7+
the shared Swift concurrency queue. (#13650)
58

69
# 11.2.0
710
- [Fixed] Fixed crashes that could occur in Swift continuation blocks running in the Xcode 16

FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import Foundation
2222
#endif
2323

2424
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
25-
protocol AuthBackendRPCIssuer: NSObjectProtocol {
25+
protocol AuthBackendRPCIssuer {
2626
/// Asynchronously send a HTTP request.
2727
/// - Parameter request: The request to be made.
2828
/// - Parameter body: Request body.
@@ -35,10 +35,10 @@ protocol AuthBackendRPCIssuer: NSObjectProtocol {
3535
}
3636

3737
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
38-
class AuthBackendRPCIssuerImplementation: NSObject, AuthBackendRPCIssuer {
38+
class AuthBackendRPCIssuerImplementation: AuthBackendRPCIssuer {
3939
let fetcherService: GTMSessionFetcherService
4040

41-
override init() {
41+
init() {
4242
fetcherService = GTMSessionFetcherService()
4343
fetcherService.userAgent = AuthBackend.authUserAgent()
4444
fetcherService.callbackQueue = kAuthGlobalWorkQueue
@@ -71,7 +71,7 @@ class AuthBackendRPCIssuerImplementation: NSObject, AuthBackendRPCIssuer {
7171
}
7272

7373
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
74-
class AuthBackend: NSObject {
74+
class AuthBackend {
7575
static func authUserAgent() -> String {
7676
return "FirebaseAuth.iOS/\(FirebaseVersion()) \(GTMFetcherStandardUserAgentString(nil))"
7777
}
@@ -143,11 +143,8 @@ protocol AuthBackendImplementation {
143143
}
144144

145145
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
146-
private class AuthBackendRPCImplementation: NSObject, AuthBackendImplementation {
147-
var rpcIssuer: AuthBackendRPCIssuer
148-
override init() {
149-
rpcIssuer = AuthBackendRPCIssuerImplementation()
150-
}
146+
private class AuthBackendRPCImplementation: AuthBackendImplementation {
147+
var rpcIssuer: AuthBackendRPCIssuer = AuthBackendRPCIssuerImplementation()
151148

152149
/// Calls the RPC using HTTP request.
153150
/// Possible error responses:

FirebaseAuth/Tests/Unit/Fakes/FakeBackendRPCIssuer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import XCTest
2323
response, and glue logic.
2424
*/
2525
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
26-
class FakeBackendRPCIssuer: NSObject, AuthBackendRPCIssuer {
26+
class FakeBackendRPCIssuer: AuthBackendRPCIssuer {
2727
/** @property requestURL
2828
@brief The URL which was requested.
2929
*/

0 commit comments

Comments
 (0)