Skip to content

Commit

Permalink
Rest of public func's class's, and var's to open
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 committed Jan 6, 2024
1 parent f883a73 commit 045984f
Show file tree
Hide file tree
Showing 31 changed files with 201 additions and 201 deletions.
128 changes: 64 additions & 64 deletions FirebaseAuth/Sources/Swift/Auth/Auth.swift

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions FirebaseAuth/Sources/Swift/Auth/AuthDataResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Foundation
action. It contains references to a `User` instance and a `AdditionalUserInfo` instance.
*/
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
@objc(FIRAuthDataResult) public class AuthDataResult: NSObject, NSSecureCoding {
@objc(FIRAuthDataResult) open class AuthDataResult: NSObject, NSSecureCoding {
/** @property user
@brief The signed in user.
*/
Expand Down Expand Up @@ -59,7 +59,7 @@ import Foundation
return true
}

public func encode(with coder: NSCoder) {
open func encode(with coder: NSCoder) {
coder.encode(user, forKey: kUserCodingKey)
coder.encode(additionalUserInfo, forKey: kAdditionalUserInfoCodingKey)
coder.encode(credential, forKey: kCredentialCodingKey)
Expand Down
8 changes: 4 additions & 4 deletions FirebaseAuth/Sources/Swift/Auth/AuthSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import Foundation
/** @class AuthSettings
@brief Determines settings related to an auth object.
*/
@objc(FIRAuthSettings) public class AuthSettings: NSObject, NSCopying {
@objc(FIRAuthSettings) open class AuthSettings: NSObject, NSCopying {
/** @property appVerificationDisabledForTesting
@brief Flag to determine whether app verification should be disabled for testing or not.
*/
@objc public var appVerificationDisabledForTesting: Bool
@objc public var isAppVerificationDisabledForTesting: Bool {
@objc open var appVerificationDisabledForTesting: Bool
@objc open var isAppVerificationDisabledForTesting: Bool {
get {
return appVerificationDisabledForTesting
}
Expand All @@ -37,7 +37,7 @@ import Foundation

// MARK: NSCopying

public func copy(with zone: NSZone? = nil) -> Any {
open func copy(with zone: NSZone? = nil) -> Any {
let settings = AuthSettings()
settings.appVerificationDisabledForTesting = appVerificationDisabledForTesting
return settings
Expand Down
18 changes: 9 additions & 9 deletions FirebaseAuth/Sources/Swift/Auth/AuthTokenResult.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,52 +54,52 @@ private let kClaimsKey = "claims"
@brief A data class containing the ID token JWT string and other properties associated with the
token including the decoded payload claims.
*/
@objc(FIRAuthTokenResult) public class AuthTokenResult: NSObject {
@objc(FIRAuthTokenResult) open class AuthTokenResult: NSObject {
/** @property token
@brief Stores the JWT string of the ID token.
*/
@objc public var token: String
@objc open var token: String

/** @property expirationDate
@brief Stores the ID token's expiration date.
*/
@objc public var expirationDate: Date
@objc open var expirationDate: Date

/** @property authDate
@brief Stores the ID token's authentication date.
@remarks This is the date the user was signed in and NOT the date the token was refreshed.
*/
@objc public var authDate: Date
@objc open var authDate: Date

/** @property issuedAtDate
@brief Stores the date that the ID token was issued.
@remarks This is the date last refreshed and NOT the last authentication date.
*/
@objc public var issuedAtDate: Date
@objc open var issuedAtDate: Date

/** @property signInProvider
@brief Stores sign-in provider through which the token was obtained.
@remarks This does not necessarily map to provider IDs.
*/
@objc public var signInProvider: String
@objc open var signInProvider: String

/** @property signInSecondFactor
@brief Stores sign-in second factor through which the token was obtained.
*/
@objc public var signInSecondFactor: String
@objc open var signInSecondFactor: String

/** @property claims
@brief Stores the entire payload of claims found on the ID token. This includes the standard
reserved claims as well as custom claims set by the developer via the Admin SDK.
*/
@objc public var claims: [String: Any]
@objc open var claims: [String: Any]

/** @fn tokenResultWithToken:
@brief Parse a token string to a structured token.
@param token The token string to parse.
@return A structured token result.
*/
@objc public class func tokenResult(token: String) -> AuthTokenResult? {
@objc open class func tokenResult(token: String) -> AuthTokenResult? {
let tokenStringArray = token.components(separatedBy: ".")

// The JWT should have three parts, though we only use the second in this method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Foundation
@param password The user's password.
@return An `AuthCredential` containing the email & password credential.
*/
@objc public class func credential(withEmail email: String, password: String) -> AuthCredential {
@objc open class func credential(withEmail email: String, password: String) -> AuthCredential {
return EmailAuthCredential(withEmail: email, password: password)
}

Expand All @@ -39,7 +39,7 @@ import Foundation
@param link The email sign-in link.
@return An `AuthCredential` containing the email & link credential.
*/
@objc public class func credential(withEmail email: String, link: String) -> AuthCredential {
@objc open class func credential(withEmail email: String, link: String) -> AuthCredential {
return EmailAuthCredential(withEmail: email, link: link)
}
}
Expand Down Expand Up @@ -69,7 +69,7 @@ class EmailAuthCredential: AuthCredential, NSSecureCoding {

public static var supportsSecureCoding = true

public func encode(with coder: NSCoder) {
open func encode(with coder: NSCoder) {
coder.encode(email, forKey: "email")
switch emailType {
case let .password(password): coder.encode(password, forKey: "password")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import Foundation
@param accessToken The Access Token from Facebook.
@return An AuthCredential containing the Facebook credentials.
*/
@objc public class func credential(withAccessToken accessToken: String) -> AuthCredential {
@objc open class func credential(withAccessToken accessToken: String) -> AuthCredential {
return FacebookAuthCredential(withAccessToken: accessToken)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
/** @fn
@brief Creates an `AuthCredential` for a Game Center sign in.
*/
@objc public class func getCredential(completion: @escaping (AuthCredential?, Error?) -> Void) {
@objc open class func getCredential(completion: @escaping (AuthCredential?, Error?) -> Void) {
/**
Linking GameKit.framework without using it on macOS results in App Store rejection.
Thus we don't link GameKit.framework to our SDK directly. `optionalLocalPlayer` is used for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import Foundation
@param token The GitHub OAuth access token.
@return An AuthCredential containing the GitHub credentials.
*/
@objc public class func credential(withToken token: String) -> AuthCredential {
@objc open class func credential(withToken token: String) -> AuthCredential {
return GitHubAuthCredential(withToken: token)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Foundation
@param accessToken The Access Token from Google.
@return An AuthCredential containing the Google credentials.
*/
@objc public class func credential(withIDToken IDToken: String,
@objc open class func credential(withIDToken IDToken: String,
accessToken: String) -> AuthCredential {
return GoogleAuthCredential(withIDToken: IDToken, accessToken: accessToken)
}
Expand Down
4 changes: 2 additions & 2 deletions FirebaseAuth/Sources/Swift/AuthProvider/OAuthCredential.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import Foundation

@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
@objc(FIROAuthCredential) public class OAuthCredential: AuthCredential, NSSecureCoding {
@objc(FIROAuthCredential) open class OAuthCredential: AuthCredential, NSSecureCoding {
/** @property IDToken
@brief The ID Token associated with this credential.
*/
Expand Down Expand Up @@ -103,7 +103,7 @@ import Foundation

public static var supportsSecureCoding: Bool = true

public func encode(with coder: NSCoder) {
open func encode(with coder: NSCoder) {
coder.encode(idToken, forKey: "IDToken")
coder.encode(rawNonce, forKey: "rawNonce")
coder.encode(accessToken, forKey: "accessToken")
Expand Down
12 changes: 6 additions & 6 deletions FirebaseAuth/Sources/Swift/AuthProvider/OAuthProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ import Foundation
/** @property scopes
@brief Array used to configure the OAuth scopes.
*/
@objc public var scopes: [String]?
@objc open var scopes: [String]?

/** @property customParameters
@brief Dictionary used to configure the OAuth custom parameters.
*/
@objc public var customParameters: [String: String]?
@objc open var customParameters: [String: String]?

/** @property providerID
@brief The provider ID indicating the specific OAuth provider this OAuthProvider instance
Expand All @@ -43,7 +43,7 @@ import Foundation
configured.
@return An instance of `OAuthProvider` corresponding to the specified provider ID.
*/
@objc(providerWithProviderID:) public class func provider(providerID: String) -> OAuthProvider {
@objc(providerWithProviderID:) open class func provider(providerID: String) -> OAuthProvider {
return OAuthProvider(providerID: providerID, auth: Auth.auth())
}

Expand All @@ -53,7 +53,7 @@ import Foundation
@param auth The auth instance to be associated with the `OAuthProvider` instance.
@return An instance of `OAuthProvider` corresponding to the specified provider ID.
*/
@objc(providerWithProviderID:auth:) public class func provider(providerID: String,
@objc(providerWithProviderID:auth:) open class func provider(providerID: String,
auth: Auth) -> OAuthProvider {
return OAuthProvider(providerID: providerID, auth: auth)
}
Expand Down Expand Up @@ -185,7 +185,7 @@ import Foundation
@param completion Optionally; a block which is invoked asynchronously on the main thread when
the mobile web flow is completed.
*/
public func getCredentialWith(_ uiDelegate: AuthUIDelegate?,
open func getCredentialWith(_ uiDelegate: AuthUIDelegate?,
completion: ((AuthCredential?, Error?) -> Void)? = nil) {
guard let urlTypes = auth.mainBundleUrlTypes,
AuthWebUtils.isCallbackSchemeRegistered(forCustomURLScheme: callbackScheme,
Expand Down Expand Up @@ -259,7 +259,7 @@ import Foundation
*/
@available(iOS 13, tvOS 13, macOS 10.15, watchOS 8, *)
@objc(getCredentialWithUIDelegate:completion:)
public func credential(with uiDelegate: AuthUIDelegate?) async throws -> AuthCredential {
open func credential(with uiDelegate: AuthUIDelegate?) async throws -> AuthCredential {
return try await withCheckedThrowingContinuation { continuation in
getCredentialWith(uiDelegate) { credential, error in
if let credential = credential {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import Foundation
This class is available on iOS only.
*/
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
@objc(FIRPhoneAuthCredential) public class PhoneAuthCredential: AuthCredential, NSSecureCoding {
@objc(FIRPhoneAuthCredential) open class PhoneAuthCredential: AuthCredential, NSSecureCoding {
enum CredentialKind {
case phoneNumber(_ phoneNumber: String, _ temporaryProof: String)
case verification(_ id: String, _ code: String)
Expand All @@ -40,7 +40,7 @@ import Foundation

public static var supportsSecureCoding = true

public func encode(with coder: NSCoder) {
open func encode(with coder: NSCoder) {
switch credentialKind {
case let .phoneNumber(phoneNumber, temporaryProof):
coder.encode(phoneNumber, forKey: "phoneNumber")
Expand Down
16 changes: 8 additions & 8 deletions FirebaseAuth/Sources/Swift/AuthProvider/PhoneAuthProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import Foundation
/**
@brief Returns an instance of `PhoneAuthProvider` for the default `Auth` object.
*/
@objc(provider) public class func provider() -> PhoneAuthProvider {
@objc(provider) open class func provider() -> PhoneAuthProvider {
return PhoneAuthProvider(auth: Auth.auth())
}

Expand All @@ -35,7 +35,7 @@ import Foundation
@param auth The auth object to associate with the phone auth provider instance.
*/
@objc(providerWithAuth:)
public class func provider(auth: Auth) -> PhoneAuthProvider {
open class func provider(auth: Auth) -> PhoneAuthProvider {
return PhoneAuthProvider(auth: auth)
}

Expand All @@ -57,7 +57,7 @@ import Foundation
+ `AuthErrorCodeMissingPhoneNumber` - Indicates that a phone number was not provided.
*/
@objc(verifyPhoneNumber:UIDelegate:completion:)
public func verifyPhoneNumber(_ phoneNumber: String,
open func verifyPhoneNumber(_ phoneNumber: String,
uiDelegate: AuthUIDelegate? = nil,
completion: ((_: String?, _: Error?) -> Void)?) {
verifyPhoneNumber(phoneNumber,
Expand All @@ -77,7 +77,7 @@ import Foundation
@param completion The callback to be invoked when the verification flow is finished.
*/
@objc(verifyPhoneNumber:UIDelegate:multiFactorSession:completion:)
public func verifyPhoneNumber(_ phoneNumber: String,
open func verifyPhoneNumber(_ phoneNumber: String,
uiDelegate: AuthUIDelegate? = nil,
multiFactorSession: MultiFactorSession? = nil,
completion: ((_: String?, _: Error?) -> Void)?) {
Expand Down Expand Up @@ -114,7 +114,7 @@ import Foundation
@returns The verification ID
*/
@available(iOS 13, tvOS 13, macOS 10.15, watchOS 8, *)
public func verifyPhoneNumber(_ phoneNumber: String,
open func verifyPhoneNumber(_ phoneNumber: String,
uiDelegate: AuthUIDelegate? = nil,
multiFactorSession: MultiFactorSession? = nil) async throws
-> String {
Expand Down Expand Up @@ -142,7 +142,7 @@ import Foundation
@param completion The callback to be invoked when the verification flow is finished.
*/
@objc(verifyPhoneNumberWithMultiFactorInfo:UIDelegate:multiFactorSession:completion:)
public func verifyPhoneNumber(with multiFactorInfo: PhoneMultiFactorInfo,
open func verifyPhoneNumber(with multiFactorInfo: PhoneMultiFactorInfo,
uiDelegate: AuthUIDelegate? = nil,
multiFactorSession: MultiFactorSession?,
completion: ((_: String?, _: Error?) -> Void)?) {
Expand All @@ -154,7 +154,7 @@ import Foundation
}

@available(iOS 13, tvOS 13, macOS 10.15, watchOS 8, *)
public func verifyPhoneNumber(with multiFactorInfo: PhoneMultiFactorInfo,
open func verifyPhoneNumber(with multiFactorInfo: PhoneMultiFactorInfo,
uiDelegate: AuthUIDelegate? = nil,
multiFactorSession: MultiFactorSession?) async throws -> String {
return try await withCheckedThrowingContinuation { continuation in
Expand All @@ -181,7 +181,7 @@ import Foundation
provided.
*/
@objc(credentialWithVerificationID:verificationCode:)
public func credential(withVerificationID verificationID: String,
open func credential(withVerificationID verificationID: String,
verificationCode: String) -> PhoneAuthCredential {
return PhoneAuthCredential(withProviderID: PhoneAuthProvider.id,
verificationID: verificationID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import Foundation
@param secret The Twitter OAuth secret.
@return An AuthCredential containing the Twitter credentials.
*/
@objc public class func credential(withToken token: String, secret: String) -> AuthCredential {
@objc open class func credential(withToken token: String, secret: String) -> AuthCredential {
return TwitterAuthCredential(withToken: token, secret: secret)
}

Expand Down
Loading

0 comments on commit 045984f

Please sign in to comment.