Skip to content

Commit

Permalink
[Auth] Use native Swift types in Auth backend types (#13658)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncooke3 authored Sep 17, 2024
1 parent b5e2c18 commit 9b06b3f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
3 changes: 3 additions & 0 deletions FirebaseAuth/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
- [Fixed] Restore Firebase 10 behavior by querying with the
`kSecAttrSynchronizable` key when auth state is set to be shared across
devices. (#13584)
- [Fixed] Prevent a bad memory access crash by using non-ObjC, native Swift
types in the SDK's networking layer, and moving synchronous work off of
the shared Swift concurrency queue. (#13650)

# 11.2.0
- [Fixed] Fixed crashes that could occur in Swift continuation blocks running in the Xcode 16
Expand Down
15 changes: 6 additions & 9 deletions FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import Foundation
#endif

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

@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
class AuthBackendRPCIssuerImplementation: NSObject, AuthBackendRPCIssuer {
class AuthBackendRPCIssuerImplementation: AuthBackendRPCIssuer {
let fetcherService: GTMSessionFetcherService

override init() {
init() {
fetcherService = GTMSessionFetcherService()
fetcherService.userAgent = AuthBackend.authUserAgent()
fetcherService.callbackQueue = kAuthGlobalWorkQueue
Expand Down Expand Up @@ -71,7 +71,7 @@ class AuthBackendRPCIssuerImplementation: NSObject, AuthBackendRPCIssuer {
}

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

@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
private class AuthBackendRPCImplementation: NSObject, AuthBackendImplementation {
var rpcIssuer: AuthBackendRPCIssuer
override init() {
rpcIssuer = AuthBackendRPCIssuerImplementation()
}
private class AuthBackendRPCImplementation: AuthBackendImplementation {
var rpcIssuer: AuthBackendRPCIssuer = AuthBackendRPCIssuerImplementation()

/// Calls the RPC using HTTP request.
/// Possible error responses:
Expand Down
2 changes: 1 addition & 1 deletion FirebaseAuth/Tests/Unit/Fakes/FakeBackendRPCIssuer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import XCTest
response, and glue logic.
*/
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
class FakeBackendRPCIssuer: NSObject, AuthBackendRPCIssuer {
class FakeBackendRPCIssuer: AuthBackendRPCIssuer {
/** @property requestURL
@brief The URL which was requested.
*/
Expand Down

0 comments on commit 9b06b3f

Please sign in to comment.