Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Auth] Use native Swift types in Auth backend types #13658

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading