Skip to content

Commit fcedc24

Browse files
committed
Remove extra publics
1 parent 051cc6e commit fcedc24

29 files changed

+82
-89
lines changed

FirebaseAuth/Sources/Swift/Auth/AuthComponent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import FirebaseCore
1818
import FirebaseCoreExtension
1919

2020
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
21-
@objc(FIRAuthProvider) public protocol AuthProvider {
21+
@objc(FIRAuthProvider) protocol AuthProvider {
2222
@objc func auth() -> Auth
2323
}
2424

FirebaseAuth/Sources/Swift/Auth/AuthOperationType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Foundation
1717
@brief Indicates the type of operation performed for RPCs that support the operation
1818
parameter.
1919
*/
20-
@objc(FIRAuthOperationType) public enum AuthOperationType: Int {
20+
enum AuthOperationType: Int {
2121
/** Indicates that the operation type is uspecified.
2222
*/
2323
case unspecified = 0

FirebaseAuth/Sources/Swift/Auth/AuthSerialTaskQueue.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,21 @@
1414

1515
import Foundation
1616

17-
typealias FIRAuthSerialTaskCompletionBlock = () -> Void
18-
typealias FIRAuthSerialTask = (_ complete: @escaping FIRAuthSerialTaskCompletionBlock)
19-
-> Void
17+
typealias AuthSerialTaskCompletionBlock = () -> Void
2018

2119
class AuthSerialTaskQueue: NSObject {
2220
private let dispatchQueue: DispatchQueue
2321

24-
@objc override public init() {
22+
override init() {
2523
dispatchQueue = DispatchQueue(
2624
label: "com.google.firebase.auth.serialTaskQueue",
2725
target: kAuthGlobalWorkQueue
2826
)
2927
super.init()
3028
}
3129

32-
func enqueueTask(_ task: @escaping FIRAuthSerialTask) {
30+
func enqueueTask(_ task: @escaping ((_ complete: @escaping AuthSerialTaskCompletionBlock)
31+
-> Void)) {
3332
dispatchQueue.async {
3433
self.dispatchQueue.suspend()
3534
task {

FirebaseAuth/Sources/Swift/Backend/AuthRPCResponse.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import Foundation
1616

17-
public protocol AuthRPCResponse {
17+
protocol AuthRPCResponse {
1818
/// Bare initializer for a response.
1919
init()
2020

@@ -36,7 +36,7 @@ public protocol AuthRPCResponse {
3636
func clientError(shortErrorMessage: String, detailedErrorMessage: String?) -> Error?
3737
}
3838

39-
public extension AuthRPCResponse {
39+
extension AuthRPCResponse {
4040
// Default implementation.
4141
func clientError(shortErrorMessage: String, detailedErrorMessage: String? = nil) -> Error? {
4242
return nil

FirebaseAuth/Sources/Swift/Backend/RPC/CreateAuthURIResponse.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,41 +19,41 @@ import Foundation
1919
@see https://developers.google.com/identity/toolkit/web/reference/relyingparty/createAuthUri
2020
*/
2121

22-
public class CreateAuthURIResponse: AuthRPCResponse {
22+
class CreateAuthURIResponse: AuthRPCResponse {
2323
/** @property authUri
2424
@brief The URI used by the IDP to authenticate the user.
2525
*/
26-
public var authURI: String?
26+
var authURI: String?
2727

2828
/** @property registered
2929
@brief Whether the user is registered if the identifier is an email.
3030
*/
31-
public var registered: Bool = false
31+
var registered: Bool = false
3232

3333
/** @property providerId
3434
@brief The provider ID of the auth URI.
3535
*/
36-
public var providerID: String?
36+
var providerID: String?
3737

3838
/** @property forExistingProvider
3939
@brief True if the authUri is for user's existing provider.
4040
*/
41-
public var forExistingProvider: Bool = false
41+
var forExistingProvider: Bool = false
4242

4343
/** @property allProviders
4444
@brief A list of provider IDs the passed @c identifier could use to sign in with.
4545
*/
46-
public var allProviders: [String]?
46+
var allProviders: [String]?
4747

4848
/** @property signinMethods
4949
@brief A list of sign-in methods available for the passed @c identifier.
5050
*/
51-
public var signinMethods: [String]?
51+
var signinMethods: [String]?
5252

5353
/// Bare initializer.
54-
public required init() {}
54+
required init() {}
5555

56-
public func setFields(dictionary: [String: AnyHashable]) throws {
56+
func setFields(dictionary: [String: AnyHashable]) throws {
5757
providerID = dictionary["providerId"] as? String
5858
authURI = dictionary["authUri"] as? String
5959
registered = dictionary["registered"] as? Bool ?? false

FirebaseAuth/Sources/Swift/Backend/RPC/DeleteAccountResponse.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import Foundation
1818
@brief Represents the response from the deleteAccount endpoint.
1919
@see https://developers.google.com/identity/toolkit/web/reference/relyingparty/deleteAccount
2020
*/
21-
public class DeleteAccountResponse: NSObject, AuthRPCResponse {
22-
override public required init() {}
21+
class DeleteAccountResponse: NSObject, AuthRPCResponse {
22+
override required init() {}
2323

24-
public func setFields(dictionary: [String: AnyHashable]) throws {}
24+
func setFields(dictionary: [String: AnyHashable]) throws {}
2525
}

FirebaseAuth/Sources/Swift/Backend/RPC/EmailLinkSignInResponse.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Foundation
1818
@brief Represents the response from the emailLinkSignin endpoint.
1919
*/
2020
class EmailLinkSignInResponse: NSObject, AuthRPCResponse {
21-
override public required init() {}
21+
override required init() {}
2222

2323
/** @property IDToken
2424
@brief The ID token in the email link sign-in response.
@@ -56,7 +56,7 @@ class EmailLinkSignInResponse: NSObject, AuthRPCResponse {
5656
*/
5757
var mfaInfo: [AuthProtoMFAEnrollment]?
5858

59-
public func setFields(dictionary: [String: AnyHashable]) throws {
59+
func setFields(dictionary: [String: AnyHashable]) throws {
6060
email = dictionary["email"] as? String
6161
idToken = dictionary["idToken"] as? String
6262
isNewUser = dictionary["isNewUser"] as? Bool ?? false

FirebaseAuth/Sources/Swift/Backend/RPC/GetAccountInfoResponse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class GetAccountInfoResponseUser: NSObject {
185185
*/
186186
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
187187
class GetAccountInfoResponse: AuthRPCResponse {
188-
public required init() {}
188+
required init() {}
189189

190190
/** @property providerUserInfo
191191
@brief The requested users' profiles.

FirebaseAuth/Sources/Swift/Backend/RPC/MultiFactor/Enroll/FinalizeMFAEnrollmentRequest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class FinalizeMFAEnrollmentRequest: IdentityToolkitRequest, AuthRPCRequest {
5959
)
6060
}
6161

62-
public func unencodedHTTPRequestBody() throws -> [String: AnyHashable] {
62+
func unencodedHTTPRequestBody() throws -> [String: AnyHashable] {
6363
var body: [String: AnyHashable] = [:]
6464
if let idToken = idToken {
6565
body["idToken"] = idToken

FirebaseAuth/Sources/Swift/Backend/RPC/MultiFactor/Enroll/FinalizeMFAEnrollmentResponse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Foundation
1616

1717
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
1818
class FinalizeMFAEnrollmentResponse: AuthRPCResponse {
19-
public required init() {}
19+
required init() {}
2020

2121
private(set) var idToken: String?
2222
private(set) var refreshToken: String?

FirebaseAuth/Sources/Swift/Backend/RPC/MultiFactor/Unenroll/WithdrawMFAResponse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class WithdrawMFAResponse: AuthRPCResponse {
2020
var idToken: String?
2121
var refreshToken: String?
2222

23-
public func setFields(dictionary: [String: AnyHashable]) throws {
23+
func setFields(dictionary: [String: AnyHashable]) throws {
2424
idToken = dictionary["idToken"] as? String
2525
refreshToken = dictionary["refreshToken"] as? String
2626
}

FirebaseAuth/Sources/Swift/Backend/RPC/Proto/AuthProto.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import Foundation
1616

17-
@objc(FIRAuthProto) public protocol AuthProto: NSObjectProtocol {
18-
@objc init(dictionary: [String: AnyHashable])
17+
@objc protocol AuthProto: NSObjectProtocol {
18+
init(dictionary: [String: AnyHashable])
1919
@objc optional var dictionary: [String: AnyHashable] { get }
2020
}

FirebaseAuth/Sources/Swift/Backend/RPC/Proto/AuthProtoMFAEnrollment.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class AuthProtoMFAEnrollment: NSObject, AuthProto {
2121
let displayName: String?
2222
let enrolledAt: Date?
2323

24-
public required init(dictionary: [String: AnyHashable]) {
24+
required init(dictionary: [String: AnyHashable]) {
2525
phoneInfo = dictionary["phoneInfo"] as? String
2626
totpInfo = dictionary["totpInfo"] as? NSObject
2727
mfaEnrollmentID = dictionary["mfaEnrollmentId"] as? String

FirebaseAuth/Sources/Swift/Backend/RPC/Proto/Phone/AuthProtoFinalizeMFAPhoneRequestInfo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class AuthProtoFinalizeMFAPhoneRequestInfo: NSObject, AuthProto {
2121

2222
var sessionInfo: String?
2323
var code: String?
24-
@objc public init(sessionInfo: String?, verificationCode: String?) {
24+
init(sessionInfo: String?, verificationCode: String?) {
2525
self.sessionInfo = sessionInfo
2626
code = verificationCode
2727
}

FirebaseAuth/Sources/Swift/Backend/RPC/Proto/TOTP/AuthProtoFinalizeMFATOTPEnrollmentRequestInfo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import Foundation
1616

1717
class AuthProtoStartMFATOTPEnrollmentRequestInfo: NSObject, AuthProto {
18-
public required init(dictionary: [String: AnyHashable]) {
18+
required init(dictionary: [String: AnyHashable]) {
1919
fatalError()
2020
}
2121

FirebaseAuth/Sources/Swift/Backend/RPC/SecureTokenRequest.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import Foundation
1616

17-
@objc(FIRSecureTokenRequestGrantType) enum SecureTokenRequestGrantType: Int {
17+
enum SecureTokenRequestGrantType: Int {
1818
case authorizationCode
1919
case refreshToken
2020

@@ -96,7 +96,7 @@ class SecureTokenRequest: AuthRPCRequest {
9696
/** @property refreshToken
9797
@brief The client's refresh token.
9898
*/
99-
public var refreshToken: String?
99+
var refreshToken: String?
100100

101101
/** @property code
102102
@brief The client's authorization code (legacy Gitkit "ID Token").
@@ -106,15 +106,15 @@ class SecureTokenRequest: AuthRPCRequest {
106106
/** @property APIKey
107107
@brief The client's API Key.
108108
*/
109-
public let apiKey: String
109+
let apiKey: String
110110

111111
let _requestConfiguration: AuthRequestConfiguration
112-
public func requestConfiguration() -> AuthRequestConfiguration {
112+
func requestConfiguration() -> AuthRequestConfiguration {
113113
_requestConfiguration
114114
}
115115

116-
public static func authCodeRequest(code: String,
117-
requestConfiguration: AuthRequestConfiguration)
116+
static func authCodeRequest(code: String,
117+
requestConfiguration: AuthRequestConfiguration)
118118
-> SecureTokenRequest {
119119
SecureTokenRequest(
120120
grantType: .authorizationCode,
@@ -125,8 +125,8 @@ class SecureTokenRequest: AuthRPCRequest {
125125
)
126126
}
127127

128-
public static func refreshRequest(refreshToken: String,
129-
requestConfiguration: AuthRequestConfiguration)
128+
static func refreshRequest(refreshToken: String,
129+
requestConfiguration: AuthRequestConfiguration)
130130
-> SecureTokenRequest {
131131
SecureTokenRequest(
132132
grantType: .refreshToken,
@@ -147,7 +147,7 @@ class SecureTokenRequest: AuthRPCRequest {
147147
_requestConfiguration = requestConfiguration
148148
}
149149

150-
public func requestURL() -> URL {
150+
func requestURL() -> URL {
151151
let urlString: String
152152
if let emulatorHostAndPort = _requestConfiguration.emulatorHostAndPort {
153153
urlString = "http://\(emulatorHostAndPort)/\(gAPIHost)/v1/token?key=\(apiKey)"
@@ -157,9 +157,9 @@ class SecureTokenRequest: AuthRPCRequest {
157157
return URL(string: urlString)!
158158
}
159159

160-
public func containsPostBody() -> Bool { true }
160+
func containsPostBody() -> Bool { true }
161161

162-
public func unencodedHTTPRequestBody() throws -> [String: AnyHashable] {
162+
func unencodedHTTPRequestBody() throws -> [String: AnyHashable] {
163163
var postBody: [String: AnyHashable] = [
164164
kGrantTypeKey: grantType.value,
165165
]

FirebaseAuth/Sources/Swift/Backend/RPC/SetAccountInfoResponse.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,27 @@ import Foundation
1818
@brief Represents the provider user info part of the response from the setAccountInfo endpoint.
1919
@see https://developers.google.com/identity/toolkit/web/reference/relyingparty/setAccountInfo
2020
*/
21-
@objc(FIRSetAccountInfoResponseProviderUserInfo)
22-
public class SetAccountInfoResponseProviderUserInfo: NSObject {
21+
class SetAccountInfoResponseProviderUserInfo: NSObject {
2322
/** @property providerID
2423
@brief The ID of the identity provider.
2524
*/
26-
@objc public var providerID: String?
25+
var providerID: String?
2726

2827
/** @property displayName
2928
@brief The user's display name at the identity provider.
3029
*/
31-
@objc public var displayName: String?
30+
var displayName: String?
3231

3332
/** @property photoURL
3433
@brief The user's photo URL at the identity provider.
3534
*/
36-
@objc public var photoURL: URL?
35+
var photoURL: URL?
3736

3837
/** @fn initWithAPIKey:
3938
@brief Designated initializer.
4039
@param dictionary The provider user info data from endpoint.
4140
*/
42-
@objc public init(dictionary: [String: Any]) {
41+
init(dictionary: [String: Any]) {
4342
providerID = dictionary["providerId"] as? String
4443
displayName = dictionary["displayName"] as? String
4544
if let photoURL = dictionary["photoUrl"] as? String {

FirebaseAuth/Sources/Swift/Backend/RPC/VerifyAssertionResponse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class VerifyAssertionResponse: AuthRPCResponse {
9797
access token from Secure Token Service, depending on whether @c returnSecureToken is set
9898
on the request.
9999
*/
100-
@objc(IDToken) var idToken: String?
100+
var idToken: String?
101101

102102
/** @property approximateExpirationDate
103103
@brief The approximate expiration date of the access token.

FirebaseAuth/Sources/Swift/MultiFactor/TOTP/TOTPMultiFactorInfo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import Foundation
3939
}
4040

4141
@available(*, unavailable)
42-
public required init?(coder: NSCoder) {
42+
required init?(coder: NSCoder) {
4343
fatalError("init(coder:) has not been implemented")
4444
}
4545
}

FirebaseAuth/Sources/Swift/SystemService/AuthAPNSToken.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515
#if !os(macOS)
1616
import Foundation
1717

18-
// TODO: Eliminate objc public after Sample app port.
19-
2018
/** @class AuthAPNSToken
2119
@brief A data structure for an APNs token.
2220
*/
23-
@objc(FIRAuthAPNSToken) public class AuthAPNSToken: NSObject {
24-
@objc public let data: Data
25-
@objc public let type: AuthAPNSTokenType
21+
class AuthAPNSToken: NSObject {
22+
let data: Data
23+
let type: AuthAPNSTokenType
2624

2725
/** @fn initWithData:type:
2826
@brief Initializes the instance.
@@ -38,7 +36,7 @@
3836
/** @property string
3937
@brief The uppercase hexadecimal string form of the APNs token data.
4038
*/
41-
@objc public lazy var string: String = {
39+
lazy var string: String = {
4240
let byteArray = [UInt8](data)
4341
var s = ""
4442
for byte in byteArray {

FirebaseAuth/Sources/Swift/SystemService/AuthAPNSTokenManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#endif // SWIFT_PACKAGE
2727

2828
// Protocol to help with unit tests.
29-
public protocol AuthAPNSTokenApplication {
29+
protocol AuthAPNSTokenApplication {
3030
func registerForRemoteNotifications()
3131
}
3232

FirebaseAuth/Sources/Swift/SystemService/AuthNotificationManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
@param notification The notification in question.
160160
@return Whether or the notification has been handled.
161161
*/
162-
@objc(canHandleNotification:) public func canHandle(notification: [AnyHashable: Any]) -> Bool {
162+
func canHandle(notification: [AnyHashable: Any]) -> Bool {
163163
var stringDictionary: [String: Any]?
164164
let data = notification[kNotificationDataKey]
165165
if let jsonString = data as? String {

0 commit comments

Comments
 (0)