Task Master 1.0 Code Pull

This commit is contained in:
2018-12-26 23:51:35 +00:00
parent e8d59db292
commit b920f3742b
284 changed files with 22772 additions and 0 deletions

38
Task Master/Pods/FirebaseAuth/CHANGELOG.md generated Executable file
View File

@@ -0,0 +1,38 @@
# 2017-02-06 -- v3.1.1
- Allows handling of additional errors when sending OOB action emails. The
server can respond with the following new error messages:
INVALID_MESSAGE_PAYLOAD,INVALID_SENDER and INVALID_RECIPIENT_EMAIL.
- Removes incorrect reference to FIRAuthErrorCodeCredentialTooOld in FIRUser.h.
- Provides additional error information from server if available.
# 2016-12-13 -- v3.1.0
- Adds FIRAuth methods that enable the app to follow up with user actions
delivered by email, such as verifying email address or reset password.
- No longer applies the keychain workaround introduced in v3.0.5 on iOS 10.2
simulator or above since the issue has been fixed.
- Fixes nullability compilation warnings when used in Swift.
- Better reports missing password error.
# 2016-10-24 -- v3.0.6
- Switches to depend on open sourced GoogleToolboxForMac and GTMSessionFetcher.
- Improves logging of keychain error when initializing.
# 2016-09-14 -- v3.0.5
- Works around a keychain issue in iOS 10 simulator.
- Reports the correct error for invalid email when signing in with email and
password.
# 2016-07-18 -- v3.0.4
- Fixes a race condition bug that could crash the app with an exception from
NSURLSession on iOS 9.
# 2016-06-20 -- v3.0.3
- Adds documentation for all possible errors returned by each method.
- Improves error handling and messages for a variety of error conditions.
- Whether or not an user is considered anonymous is now consistent with other
platforms.
- A saved signed in user is now siloed between different Firebase projects
within the same app.
# 2016-05-18 -- v3.0.2
- Initial public release.

View File

@@ -0,0 +1,488 @@
/** @file FIRAuth.h
@brief Firebase Auth SDK
@copyright Copyright 2015 Google Inc.
@remarks Use of this SDK is subject to the Google APIs Terms of Service:
https://developers.google.com/terms/
*/
#import <Foundation/Foundation.h>
#import "FIRAuthErrors.h"
@class FIRApp;
@class FIRAuth;
@class FIRAuthCredential;
@class FIRUser;
@protocol FIRAuthStateListener;
NS_ASSUME_NONNULL_BEGIN
/** @typedef FIRAuthStateDidChangeListenerHandle
@brief The type of handle returned by @c FIRAuth.addAuthStateDidChangeListener:.
*/
typedef id<NSObject> FIRAuthStateDidChangeListenerHandle;
/** @typedef FIRAuthStateDidChangeListenerBlock
@brief The type of block which can be registered as a listener for auth state did change events.
@param auth The FIRAuth object on which state changes occurred.
@param user Optionally; the current signed in user, if any.
*/
typedef void(^FIRAuthStateDidChangeListenerBlock)(FIRAuth *auth, FIRUser *_Nullable user);
/**
@brief The name of the @c NSNotificationCenter notification which is posted when the auth state
changes (for example, a new token has been produced, a user signs in or signs out). The
object parameter of the notification is the sender @c FIRAuth instance.
*/
extern NSString *const FIRAuthStateDidChangeNotification;
/** @typedef FIRAuthResultCallback
@brief The type of block invoked when sign-in related events complete.
@param user Optionally; the signed in user, if any.
@param error Optionally; if an error occurs, this is the NSError object that describes the
problem. Set to nil otherwise.
*/
typedef void (^FIRAuthResultCallback)(FIRUser *_Nullable user, NSError *_Nullable error);
/** @typedef FIRProviderQueryCallback
@brief The type of block invoked when a list of identity providers for a given email address is
requested.
@param providers Optionally; a list of provider identifiers, if any.
@see FIRGoogleAuthProviderID etc.
@param error Optionally; if an error occurs, this is the NSError object that describes the
problem. Set to nil otherwise.
*/
typedef void (^FIRProviderQueryCallback)(NSArray<NSString *> *_Nullable providers,
NSError *_Nullable error);
/** @typedef FIRSendPasswordResetCallback
@brief The type of block invoked when sending a password reset email.
@param error Optionally; if an error occurs, this is the NSError object that describes the
problem. Set to nil otherwise.
*/
typedef void (^FIRSendPasswordResetCallback)(NSError *_Nullable error);
/** @typedef FIRConfirmPasswordResetCallback
@brief The type of block invoked when performing a password reset.
@param error Optionally; if an error occurs, this is the NSError object that describes the
problem. Set to nil otherwise.
*/
typedef void (^FIRConfirmPasswordResetCallback)(NSError *_Nullable error);
/** @typedef FIRVerifyPasswordResetCodeCallback
@brief The type of block invoked when verifying that an out of band code should be used to
perform password reset.
@param email Optionally; the email address of the user for which the out of band code applies.
@param error Optionally; if an error occurs, this is the NSError object that describes the
problem. Set to nil otherwise.
*/
typedef void (^FIRVerifyPasswordResetCodeCallback)(NSString *_Nullable email,
NSError *_Nullable error);
/** @typedef FIRApplyActionCodeCallback
@brief The type of block invoked when applying an action code.
@param error Optionally; if an error occurs, this is the NSError object that describes the
problem. Set to nil otherwise.
*/
typedef void (^FIRApplyActionCodeCallback)(NSError *_Nullable error);
/**
@brief Keys used to retrieve operation data from a @c FIRActionCodeInfo object by the @c
dataForKey method.
*/
typedef NS_ENUM(NSInteger, FIRActionDataKey) {
/**
* The email address to which the code was sent.
* For FIRActionCodeOperationRecoverEmail, the new email address for the account.
*/
FIRActionCodeEmailKey = 0,
/** For FIRActionCodeOperationRecoverEmail, the current email address for the account. */
FIRActionCodeFromEmailKey = 1
};
/** @class FIRActionCodeInfo
@brief Manages information regarding action codes.
*/
@interface FIRActionCodeInfo : NSObject
/**
@brief Operations which can be performed with action codes.
*/
typedef NS_ENUM(NSInteger, FIRActionCodeOperation) {
/** Action code for unknown operation. */
FIRActionCodeOperationUnknown = 0,
/** Action code for password reset operation. */
FIRActionCodeOperationPasswordReset = 1,
/** Action code for verify email operation. */
FIRActionCodeOperationVerifyEmail = 2
};
/**
@brief The operation being performed.
*/
@property(nonatomic, readonly) FIRActionCodeOperation operation;
/** @fn dataForKey:
@brief The operation being performed.
@param key The FIRActionDataKey value used to retrieve the operation data.
@return The operation data pertaining to the provided action code key.
*/
- (NSString *)dataForKey:(FIRActionDataKey)key;
/** @fn init
@brief please use initWithOperation: instead.
*/
- (instancetype)init NS_UNAVAILABLE;
@end
/** @typedef FIRCheckActionCodeCallBack
@brief The type of block invoked when performing a check action code operation.
@param info Metadata corresponding to the action code.
@param error Optionally; if an error occurs, this is the NSError object that describes the
problem. Set to nil otherwise.
*/
typedef void (^FIRCheckActionCodeCallBack)(FIRActionCodeInfo *_Nullable info,
NSError *_Nullable error);
/** @class FIRAuth
@brief Manages authentication for Firebase apps.
@remarks This class is thread-safe.
*/
@interface FIRAuth : NSObject
/** @fn auth
@brief Gets the auth object for the default Firebase app.
@remarks Thread safe.
*/
+ (nullable FIRAuth *)auth NS_SWIFT_NAME(auth());
/** @fn authWithApp:
@brief Gets the auth object for a @c FIRApp.
@param app The FIRApp for which to retrieve the associated FIRAuth instance.
@return The FIRAuth instance associated with the given FIRApp.
*/
+ (nullable FIRAuth *)authWithApp:(FIRApp *)app;
/** @property app
@brief Gets the @c FIRApp object that this auth object is connected to.
*/
@property(nonatomic, weak, readonly, nullable) FIRApp *app;
/** @property currentUser
@brief Synchronously gets the cached current user, or null if there is none.
*/
@property(nonatomic, strong, readonly, nullable) FIRUser *currentUser;
/** @fn init
@brief Please access auth instances using @c FIRAuth.auth and @c FIRAuth.authForApp:.
*/
- (instancetype)init NS_UNAVAILABLE;
/** @fn fetchProvidersForEmail:completion:
@brief Fetches the list of IdPs that can be used for signing in with the provided email address.
Useful for an "identifier-first" sign-in flow.
@param email The email address for which to obtain a list of identity providers.
@param completion Optionally; a block which is invoked when the list of providers for the
specified email address is ready or an error was encountered. Invoked asynchronously on the
main thread in the future.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeInvalidEmail - Indicates the email address is malformed.</li>
</ul>
@remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods.
*/
- (void)fetchProvidersForEmail:(NSString *)email
completion:(nullable FIRProviderQueryCallback)completion;
/** @fn signInWithEmail:password:completion:
@brief Signs in using an email address and password.
@param email The user's email address.
@param password The user's password.
@param completion Optionally; a block which is invoked when the sign in flow finishes, or is
canceled. Invoked asynchronously on the main thread in the future.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeOperationNotAllowed - Indicates that email and password
accounts are not enabled. Enable them in the Auth section of the
Firebase console.
</li>
<li>@c FIRAuthErrorCodeUserDisabled - Indicates the user's account is disabled.
</li>
<li>@c FIRAuthErrorCodeWrongPassword - Indicates the user attempted
sign in with an incorrect password.
</li>
<li>@c FIRAuthErrorCodeInvalidEmail - Indicates the email address is malformed.
</li>
</ul>
@remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods.
*/
- (void)signInWithEmail:(NSString *)email
password:(NSString *)password
completion:(nullable FIRAuthResultCallback)completion;
/** @fn signInWithCredential:completion:
@brief Asynchronously signs in to Firebase with the given 3rd-party credentials (e.g. a Facebook
login Access Token, a Google ID Token/Access Token pair, etc.)
@param credential The credential supplied by the IdP.
@param completion Optionally; a block which is invoked when the sign in flow finishes, or is
canceled. Invoked asynchronously on the main thread in the future.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeInvalidCredential - Indicates the supplied credential is invalid.
This could happen if it has expired or it is malformed.
</li>
<li>@c FIRAuthErrorCodeOperationNotAllowed - Indicates that accounts
with the identity provider represented by the credential are not enabled.
Enable them in the Auth section of the Firebase console.
</li>
<li>@c FIRAuthErrorCodeEmailAlreadyInUse - Indicates the email asserted by the credential
(e.g. the email in a Facebook access token) is already in use by an existing account,
that cannot be authenticated with this sign-in method. Call fetchProvidersForEmail for
this users email and then prompt them to sign in with any of the sign-in providers
returned. This error will only be thrown if the "One account per email address"
setting is enabled in the Firebase console, under Auth settings. Please note that the
error code raised in this specific situation may not be the same on
Web and Android.
</li>
<li>@c FIRAuthErrorCodeUserDisabled - Indicates the user's account is disabled.
</li>
<li>@c FIRAuthErrorCodeWrongPassword - Indicates the user attempted sign in with an
incorrect password, if credential is of the type EmailPasswordAuthCredential.
</li>
<li>@c FIRAuthErrorCodeInvalidEmail - Indicates the email address is malformed.
</li>
</ul>
@remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods.
*/
- (void)signInWithCredential:(FIRAuthCredential *)credential
completion:(nullable FIRAuthResultCallback)completion;
/** @fn signInAnonymouslyWithCompletion:
@brief Asynchronously creates and becomes an anonymous user.
@param completion Optionally; a block which is invoked when the sign in finishes, or is
canceled. Invoked asynchronously on the main thread in the future.
@remarks If there is already an anonymous user signed in, that user will be returned instead.
If there is any other existing user signed in, that user will be signed out.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeOperationNotAllowed - Indicates that anonymous accounts are
not enabled. Enable them in the Auth section of the Firebase console.
</li>
</ul>
@remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods.
*/
- (void)signInAnonymouslyWithCompletion:(nullable FIRAuthResultCallback)completion;
/** @fn signInWithCustomToken:completion:
@brief Asynchronously signs in to Firebase with the given Auth token.
@param token A self-signed custom auth token.
@param completion Optionally; a block which is invoked when the sign in finishes, or is
canceled. Invoked asynchronously on the main thread in the future.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeInvalidCustomToken - Indicates a validation error with
the custom token.
</li>
<li>@c FIRAuthErrorCodeCustomTokenMismatch - Indicates the service account and the API key
belong to different projects.
</li>
</ul>
@remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods.
*/
- (void)signInWithCustomToken:(NSString *)token
completion:(nullable FIRAuthResultCallback)completion;
/** @fn createUserWithEmail:password:completion:
@brief Creates and, on success, signs in a user with the given email address and password.
@param email The user's email address.
@param password The user's desired password.
@param completion Optionally; a block which is invoked when the sign up flow finishes, or is
canceled. Invoked asynchronously on the main thread in the future.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeInvalidEmail - Indicates the email address is malformed.
</li>
<li>@c FIRAuthErrorCodeEmailAlreadyInUse - Indicates the email used to attempt sign up
already exists. Call fetchProvidersForEmail to check which sign-in mechanisms the user
used, and prompt the user to sign in with one of those.
</li>
<li>@c FIRAuthErrorCodeOperationNotAllowed - Indicates that email and password accounts
are not enabled. Enable them in the Auth section of the Firebase console.
</li>
<li>@c FIRAuthErrorCodeWeakPassword - Indicates an attempt to set a password that is
considered too weak. The NSLocalizedFailureReasonErrorKey field in the NSError.userInfo
dictionary object will contain more detailed explanation that can be shown to the user.
</li>
</ul>
@remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods.
*/
- (void)createUserWithEmail:(NSString *)email
password:(NSString *)password
completion:(nullable FIRAuthResultCallback)completion;
/** @fn confirmPasswordResetWithCode:newPassword:completion:
@brief Resets the password given a code sent to the user outside of the app and a new password
for the user.
@param newPassword The new password.
@param completion Optionally; a block which is invoked when the request finishes. Invoked
asynchronously on the main thread in the future.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeWeakPassword - Indicates an attempt to set a password that is
considered too weak.
</li>
<li>@c FIRAuthErrorCodeOperationNotAllowed - Indicates the administrator disabled sign
in with the specified identity provider.
</li>
<li>@c FIRAuthErrorCodeExpiredActionCode - Indicates the OOB code is expired.
</li>
<li>@c FIRAuthErrorCodeInvalidActionCode - Indicates the OOB code is invalid.
</li>
</ul>
@remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods.
*/
- (void)confirmPasswordResetWithCode:(NSString *)code
newPassword:(NSString *)newPassword
completion:(FIRConfirmPasswordResetCallback)completion;
/** @fn checkActionCode:completion:
@brief Checks the validity of an out of band code.
@param code The out of band code to check validity.
@param completion Optionally; a block which is invoked when the request finishes. Invoked
asynchronously on the main thread in the future.
*/
- (void)checkActionCode:(NSString *)code completion:(FIRCheckActionCodeCallBack)completion;
/** @fn verifyPasswordResetCode:completion:
@brief Checks the validity of a verify password reset code.
@param code The password reset code to be verified.
@param completion Optionally; a block which is invoked when the request finishes. Invoked
asynchronously on the main thread in the future.
*/
- (void)verifyPasswordResetCode:(NSString *)code
completion:(FIRVerifyPasswordResetCodeCallback)completion;
/** @fn applyActionCode:completion:
@brief Applies out of band code.
@param code The out of band code to be applied.
@param completion Optionally; a block which is invoked when the request finishes. Invoked
asynchronously on the main thread in the future.
@remarks This method will not work for out of band codes which require an additional parameter,
such as password reset code.
*/
- (void)applyActionCode:(NSString *)code
completion:(FIRApplyActionCodeCallback)completion;
/** @fn sendPasswordResetWithEmail:completion:
@brief Initiates a password reset for the given email address.
@param email The email address of the user.
@param completion Optionally; a block which is invoked when the request finishes. Invoked
asynchronously on the main thread in the future.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeInvalidRecipientEmail - Indicates an invalid recipient email was
sent in the request.
</li>
<li>@c FIRAuthErrorCodeInvalidSender - Indicates an invalid sender email is set in
the console for this action.
</li>
<li>@c FIRAuthErrorCodeInvalidMessagePayload - Indicates an invalid email template for
sending update email.
</li>
</ul>
*/
- (void)sendPasswordResetWithEmail:(NSString *)email
completion:(nullable FIRSendPasswordResetCallback)completion;
/** @fn signOut:
@brief Signs out the current user.
@param error Optionally; if an error occurs, upon return contains an NSError object that
describes the problem; is nil otherwise.
@return @YES when the sign out request was successful. @NO otherwise.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeKeychainError - Indicates an error occurred when accessing the
keychain. The @c NSLocalizedFailureReasonErrorKey field in the @c NSError.userInfo
dictionary will contain more information about the error encountered.
</li>
</ul>
*/
- (BOOL)signOut:(NSError *_Nullable *_Nullable)error;
/** @fn addAuthStateDidChangeListener:
@brief Registers a block as an "auth state did change" listener. To be invoked when:
+ The block is registered as a listener,
+ The current user changes, or,
+ The current user's access token changes.
@param listener The block to be invoked. The block is always invoked asynchronously on the main
thread, even for it's initial invocation after having been added as a listener.
@remarks The block is invoked immediately after adding it according to it's standard invocation
semantics, asynchronously on the main thread. Users should pay special attention to
making sure the block does not inadvertently retain objects which should not be retained by
the long-lived block. The block itself will be retained by @c FIRAuth until it is
unregistered or until the @c FIRAuth instance is otherwise deallocated.
@return A handle useful for manually unregistering the block as a listener.
*/
- (FIRAuthStateDidChangeListenerHandle)addAuthStateDidChangeListener:
(FIRAuthStateDidChangeListenerBlock)listener;
/** @fn removeAuthStateDidChangeListener:
@brief Unregisters a block as an "auth state did change" listener.
@param listenerHandle The handle for the listener.
*/
- (void)removeAuthStateDidChangeListener:(FIRAuthStateDidChangeListenerHandle)listenerHandle;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,31 @@
/** @file FIRAuthCredential.h
@brief Firebase Auth SDK
@copyright Copyright 2015 Google Inc.
@remarks Use of this SDK is subject to the Google APIs Terms of Service:
https://developers.google.com/terms/
*/
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/** @class FIRAuthCredential
@brief Represents a credential.
*/
@interface FIRAuthCredential : NSObject
/** @property provider
@brief Gets the name of the identity provider for the credential.
*/
@property(nonatomic, copy, readonly) NSString *provider;
/** @fn init
@brief This is an abstract base class. Concrete instances should be created via factory
methods available in the various authentication provider libraries (like the Facebook
provider or the Google provider libraries.)
*/
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,176 @@
/** @file FIRAuthErrors.h
@brief Firebase Auth SDK
@copyright Copyright 2015 Google Inc.
@remarks Use of this SDK is subject to the Google APIs Terms of Service:
https://developers.google.com/terms/
*/
#import <Foundation/Foundation.h>
/** @class FIRAuthErrors
@remarks Error Codes common to all API Methods:
<ul>
<li>@c FIRAuthErrorCodeNetworkError</li>
<li>@c FIRAuthErrorCodeUserNotFound</li>
<li>@c FIRAuthErrorCodeUserTokenExpired</li>
<li>@c FIRAuthErrorCodeTooManyRequests</li>
<li>@c FIRAuthErrorCodeInvalidAPIKey</li>
<li>@c FIRAuthErrorCodeAppNotAuthorized</li>
<li>@c FIRAuthErrorCodeKeychainError</li>
<li>@c FIRAuthErrorCodeInternalError</li>
</ul>
@remarks Common error codes for @c FIRUser operations:
<ul>
<li>@c FIRAuthErrorCodeInvalidUserToken</li>
<li>@c FIRAuthErrorCodeUserDisabled</li>
</ul>
*/
@interface FIRAuthErrors
/**
@brief The Firebase Auth error domain.
*/
extern NSString *const FIRAuthErrorDomain;
/**
@brief The name of the key for the "error_name" string in the NSError userinfo dictionary.
*/
extern NSString *const FIRAuthErrorNameKey;
/**
@brief Error codes used by Firebase Auth.
*/
typedef NS_ENUM(NSInteger, FIRAuthErrorCode) {
/** Indicates a validation error with the custom token.
*/
FIRAuthErrorCodeInvalidCustomToken = 17000,
/** Indicates the service account and the API key belong to different projects.
*/
FIRAuthErrorCodeCustomTokenMismatch = 17002,
/** Indicates the IDP token or requestUri is invalid.
*/
FIRAuthErrorCodeInvalidCredential = 17004,
/** Indicates the user's account is disabled on the server.
*/
FIRAuthErrorCodeUserDisabled = 17005,
/** Indicates the administrator disabled sign in with the specified identity provider.
*/
FIRAuthErrorCodeOperationNotAllowed = 17006,
/** Indicates the email used to attempt a sign up is already in use.
*/
FIRAuthErrorCodeEmailAlreadyInUse = 17007,
/** Indicates the email is invalid.
*/
FIRAuthErrorCodeInvalidEmail = 17008,
/** Indicates the user attempted sign in with a wrong password.
*/
FIRAuthErrorCodeWrongPassword = 17009,
/** Indicates that too many requests were made to a server method.
*/
FIRAuthErrorCodeTooManyRequests = 17010,
/** Indicates the user account was not found.
*/
FIRAuthErrorCodeUserNotFound = 17011,
/** Indicates account linking is required.
*/
FIRAuthErrorCodeAccountExistsWithDifferentCredential = 17012,
/** Same enum as @c FIRAuthErrorCodeAccountExistsWithDifferentCredential ,
but with incorrect spelling. Only exists for backwards compatiblity.
*/
FIRAuthErrrorCodeAccountExistsWithDifferentCredential = 17012,
/** Indicates the user has attemped to change email or password more than 5 minutes after
signing in.
*/
FIRAuthErrorCodeRequiresRecentLogin = 17014,
/** Indicates an attempt to link a provider to which the account is already linked.
*/
FIRAuthErrorCodeProviderAlreadyLinked = 17015,
/** Indicates an attempt to unlink a provider that is not linked.
*/
FIRAuthErrorCodeNoSuchProvider = 17016,
/** Indicates user's saved auth credential is invalid, the user needs to sign in again.
*/
FIRAuthErrorCodeInvalidUserToken = 17017,
/** Indicates a network error occurred (such as a timeout, interrupted connection, or
unreachable host). These types of errors are often recoverable with a retry. The @c
NSUnderlyingError field in the @c NSError.userInfo dictionary will contain the error
encountered.
*/
FIRAuthErrorCodeNetworkError = 17020,
/** Indicates the saved token has expired, for example, the user may have changed account
password on another device. The user needs to sign in again on the device that made this
request.
*/
FIRAuthErrorCodeUserTokenExpired = 17021,
/** Indicates an invalid API key was supplied in the request.
*/
FIRAuthErrorCodeInvalidAPIKey = 17023,
/** Indicates that an attempt was made to reauthenticate with a user which is not the current
user.
*/
FIRAuthErrorCodeUserMismatch = 17024,
/** Indicates an attempt to link with a credential that has already been linked with a
different Firebase account
*/
FIRAuthErrorCodeCredentialAlreadyInUse = 17025,
/** Indicates an attempt to set a password that is considered too weak.
*/
FIRAuthErrorCodeWeakPassword = 17026,
/** Indicates the App is not authorized to use Firebase Authentication with the
provided API Key.
*/
FIRAuthErrorCodeAppNotAuthorized = 17028,
/** Indicates the OOB code is expired.
*/
FIRAuthErrorCodeExpiredActionCode = 17029,
/** Indicates the OOB code is invalid.
*/
FIRAuthErrorCodeInvalidActionCode = 17030,
/** Indicates that there are invalid parameters in the payload during a "send password reset
* email" attempt.
*/
FIRAuthErrorCodeInvalidMessagePayload = 17031,
/** Indicates that the sender email is invalid during a "send password reset email" attempt.
*/
FIRAuthErrorCodeInvalidSender = 17032,
/** Indicates that the recipient email is invalid.
*/
FIRAuthErrorCodeInvalidRecipientEmail = 17033,
/** Indicates an error occurred while attempting to access the keychain.
*/
FIRAuthErrorCodeKeychainError = 17995,
/** Indicates an internal error occurred.
*/
FIRAuthErrorCodeInternalError = 17999,
};
@end

View File

@@ -0,0 +1,40 @@
/** @file FIREmailPasswordAuthProvider.h
@brief Firebase Auth SDK
@copyright Copyright 2016 Google Inc.
@remarks Use of this SDK is subject to the Google APIs Terms of Service:
https://developers.google.com/terms/
*/
#import <Foundation/Foundation.h>
@class FIRAuthCredential;
NS_ASSUME_NONNULL_BEGIN
/**
@brief A string constant identifying the email & password identity provider.
*/
extern NSString *const FIREmailPasswordAuthProviderID;
/** @class FIREmailPasswordAuthProvider
@brief A concrete implementation of @c FIRAuthProvider for Email & Password Sign In.
*/
@interface FIREmailPasswordAuthProvider : NSObject
/** @fn credentialWithEmail:password:
@brief Creates an @c FIRAuthCredential for an email & password sign in.
@param email The user's email address.
@param password The user's password.
@return A FIRAuthCredential containing the email & password credential.
*/
+ (FIRAuthCredential *)credentialWithEmail:(NSString *)email password:(NSString *)password;
/** @fn init
@brief This class is not meant to be initialized.
*/
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,39 @@
/** @file FIRFacebookAuthProvider.h
@brief Firebase Auth SDK
@copyright Copyright 2016 Google Inc.
@remarks Use of this SDK is subject to the Google APIs Terms of Service:
https://developers.google.com/terms/
*/
#import <Foundation/Foundation.h>
@class FIRAuthCredential;
NS_ASSUME_NONNULL_BEGIN
/**
@brief A string constant identifying the Facebook identity provider.
*/
extern NSString *const FIRFacebookAuthProviderID;
/** @class FIRFacebookAuthProvider
@brief Utility class for constructing Facebook credentials.
*/
@interface FIRFacebookAuthProvider : NSObject
/** @fn credentialWithAccessToken:
@brief Creates an @c FIRAuthCredential for a Facebook sign in.
@param accessToken The Access Token from Facebook.
@return A FIRAuthCredential containing the Facebook credentials.
*/
+ (FIRAuthCredential *)credentialWithAccessToken:(NSString *)accessToken;
/** @fn init
@brief This class should not be initialized.
*/
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,39 @@
/** @file FIRGitHubAuthProvider.h
@brief Firebase Auth SDK
@copyright Copyright 2016 Google Inc.
@remarks Use of this SDK is subject to the Google APIs Terms of Service:
https://developers.google.com/terms/
*/
#import <Foundation/Foundation.h>
@class FIRAuthCredential;
NS_ASSUME_NONNULL_BEGIN
/**
@brief A string constant identifying the GitHub identity provider.
*/
extern NSString *const FIRGitHubAuthProviderID;
/** @class FIRGitHubAuthProvider
@brief Utility class for constructing GitHub credentials.
*/
@interface FIRGitHubAuthProvider : NSObject
/** @fn credentialWithToken:
@brief Creates an @c FIRAuthCredential for a GitHub sign in.
@param token The GitHub OAuth access token.
@return A FIRAuthCredential containing the GitHub credential.
*/
+ (FIRAuthCredential *)credentialWithToken:(NSString *)token;
/** @fn init
@brief This class is not meant to be initialized.
*/
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,41 @@
/** @file FIRGoogleAuthProvider.h
@brief Firebase Auth SDK
@copyright Copyright 2016 Google Inc.
@remarks Use of this SDK is subject to the Google APIs Terms of Service:
https://developers.google.com/terms/
*/
#import <Foundation/Foundation.h>
@class FIRAuthCredential;
NS_ASSUME_NONNULL_BEGIN
/**
@brief A string constant identifying the Google identity provider.
*/
extern NSString *const FIRGoogleAuthProviderID;
/** @class FIRGoogleAuthProvider
@brief Utility class for constructing Google Sign In credentials.
*/
@interface FIRGoogleAuthProvider : NSObject
/** @fn credentialWithIDToken:accessToken:
@brief Creates an @c FIRAuthCredential for a Google sign in.
@param IDToken The ID Token from Google.
@param accessToken The Access Token from Google.
@return A FIRAuthCredential containing the Google credentials.
*/
+ (FIRAuthCredential *)credentialWithIDToken:(NSString *)IDToken
accessToken:(NSString *)accessToken;
/** @fn init
@brief This class should not be initialized.
*/
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,40 @@
/** @file FIRTwitterAuthProvider.h
@brief Firebase Auth SDK
@copyright Copyright 2016 Google Inc.
@remarks Use of this SDK is subject to the Google APIs Terms of Service:
https://developers.google.com/terms/
*/
#import <Foundation/Foundation.h>
@class FIRAuthCredential;
NS_ASSUME_NONNULL_BEGIN
/**
@brief A string constant identifying the Twitter identity provider.
*/
extern NSString *const FIRTwitterAuthProviderID;
/** @class FIRTwitterAuthProvider
@brief Utility class for constructing Twitter credentials.
*/
@interface FIRTwitterAuthProvider : NSObject
/** @fn credentialWithToken:secret:
@brief Creates an @c FIRAuthCredential for a Twitter sign in.
@param token The Twitter OAuth token.
@param secret The Twitter OAuth secret.
@return A FIRAuthCredential containing the Twitter credential.
*/
+ (FIRAuthCredential *)credentialWithToken:(NSString *)token secret:(NSString *)secret;
/** @fn init
@brief This class is not meant to be initialized.
*/
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,376 @@
/** @file FIRUser.h
@brief Firebase Auth SDK
@copyright Copyright 2015 Google Inc.
@remarks Use of this SDK is subject to the Google APIs Terms of Service:
https://developers.google.com/terms/
*/
#import <Foundation/Foundation.h>
#import "FIRAuth.h"
#import "FIRUserInfo.h"
@class FIRUserProfileChangeRequest;
NS_ASSUME_NONNULL_BEGIN
/** @typedef FIRAuthTokenCallback
@brief The type of block called when a token is ready for use.
@see FIRUser.getTokenWithCompletion:
@see FIRUser.getTokenForcingRefresh:withCompletion:
@param token Optionally; an access token if the request was successful.
@param error Optionally; the error which occurred - or nil if the request was successful.
@remarks One of: @c token or @c error will always be non-nil.
*/
typedef void (^FIRAuthTokenCallback)(NSString *_Nullable token, NSError *_Nullable error);
/** @typedef FIRUserProfileChangeCallback
@brief The type of block called when a user profile change has finished.
@param error Optionally; the error which occurred - or nil if the request was successful.
*/
typedef void (^FIRUserProfileChangeCallback)(NSError *_Nullable error);
/** @typedef FIRSendEmailVerificationCallback
@brief The type of block called when a request to send an email verification has finished.
@param error Optionally; the error which occurred - or nil if the request was successful.
*/
typedef void (^FIRSendEmailVerificationCallback)(NSError *_Nullable error);
/** @class FIRUser
@brief Represents a user.
@remarks This class is thread-safe.
*/
@interface FIRUser : NSObject <FIRUserInfo>
/** @property anonymous
@brief Indicates the user represents an anonymous user.
*/
@property(nonatomic, readonly, getter=isAnonymous) BOOL anonymous;
/** @property emailVerified
@brief Indicates the email address associated with this user has been verified.
*/
@property(nonatomic, readonly, getter=isEmailVerified) BOOL emailVerified;
/** @property refreshToken
@brief A refresh token; useful for obtaining new access tokens independently.
@remarks This property should only be used for advanced scenarios, and is not typically needed.
*/
@property(nonatomic, readonly, nullable) NSString *refreshToken;
/** @property providerData
@brief Profile data for each identity provider, if any.
@remarks This data is cached on sign-in and updated when linking or unlinking.
*/
@property(nonatomic, readonly, nonnull) NSArray<id<FIRUserInfo>> *providerData;
/** @fn init
@brief This class should not be instantiated.
@remarks To retrieve the current user, use @c FIRAuth.currentUser. To sign a user
in or out, use the methods on @c FIRAuth.
*/
- (instancetype)init NS_UNAVAILABLE;
/** @fn updateEmail:completion:
@brief Updates the email address for the user. On success, the cached user profile data is
updated.
@remarks May fail if there is already an account with this email address that was created using
email and password authentication.
@param email The email address for the user.
@param completion Optionally; the block invoked when the user profile change has finished.
Invoked asynchronously on the main thread in the future.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeInvalidRecipientEmail - Indicates an invalid recipient email was
sent in the request.
</li>
<li>@c FIRAuthErrorCodeInvalidSender - Indicates an invalid sender email is set in
the console for this action.
</li>
<li>@c FIRAuthErrorCodeInvalidMessagePayload - Indicates an invalid email template for
sending update email.
</li>
<li>@c FIRAuthErrorCodeEmailAlreadyInUse - Indicates the email is already in use by another
account.
</li>
<li>@c FIRAuthErrorCodeInvalidEmail - Indicates the email address is malformed.
</li>
<li>@c FIRAuthErrorCodeRequiresRecentLogin - Updating a users email is a security
sensitive operation that requires a recent login from the user. This error indicates
the user has not signed in recently enough. To resolve, reauthenticate the user by
invoking reauthenticateWithCredential:completion: on FIRUser.
</li>
</ul>
@remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods.
*/
- (void)updateEmail:(NSString *)email completion:(nullable FIRUserProfileChangeCallback)completion;
/** @fn updatePassword:completion:
@brief Updates the password for the user. On success, the cached user profile data is updated.
@param password The new password for the user.
@param completion Optionally; the block invoked when the user profile change has finished.
Invoked asynchronously on the main thread in the future.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeOperationNotAllowed - Indicates the administrator disabled
sign in with the specified identity provider.
</li>
<li>@c FIRAuthErrorCodeRequiresRecentLogin - Updating a users password is a security
sensitive operation that requires a recent login from the user. This error indicates
the user has not signed in recently enough. To resolve, reauthenticate the user by
invoking reauthenticateWithCredential:completion: on FIRUser.
</li>
<li>@c FIRAuthErrorCodeWeakPassword - Indicates an attempt to set a password that is
considered too weak. The NSLocalizedFailureReasonErrorKey field in the NSError.userInfo
dictionary object will contain more detailed explanation that can be shown to the user.
</li>
</ul>
@remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods.
*/
- (void)updatePassword:(NSString *)password
completion:(nullable FIRUserProfileChangeCallback)completion;
/** @fn profileChangeRequest
@brief Creates an object which may be used to change the user's profile data.
@remarks Set the properties of the returned object, then call
@c FIRUserProfileChangeRequest.commitChangesWithCallback: to perform the updates atomically.
@return An object which may be used to change the user's profile data atomically.
*/
- (FIRUserProfileChangeRequest *)profileChangeRequest;
/** @fn reloadWithCompletion:
@brief Reloads the user's profile data from the server.
@param completion Optionally; the block invoked when the reload has finished. Invoked
asynchronously on the main thread in the future.
@remarks May fail with a @c FIRAuthErrorCodeRequiresRecentLogin error code. In this case
you should call @c FIRUser.reauthenticateWithCredential:completion: before re-invoking
@c FIRUser.updateEmail:completion:.
@remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods.
*/
- (void)reloadWithCompletion:(nullable FIRUserProfileChangeCallback)completion;
/** @fn reauthenticateWithCredential:completion:
@brief Renews the user's authentication tokens by validating a fresh set of credentials supplied
by the user.
@param credential A user-supplied credential, which will be validated by the server. This can be
a successful third-party identity provider sign-in, or an email address and password.
@param completion Optionally; the block invoked when the re-authentication operation has
finished. Invoked asynchronously on the main thread in the future.
@remarks If the user associated with the supplied credential is different from the current user,
or if the validation of the supplied credentials fails; an error is returned and the current
user remains signed in.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeInvalidCredential - Indicates the supplied credential is invalid.
This could happen if it has expired or it is malformed.
</li>
<li>@c FIRAuthErrorCodeOperationNotAllowed - Indicates that accounts with the
identity provider represented by the credential are not enabled. Enable them in the
Auth section of the Firebase console.
</li>
<li>@c FIRAuthErrorCodeEmailAlreadyInUse - Indicates the email asserted by the credential
(e.g. the email in a Facebook access token) is already in use by an existing account,
that cannot be authenticated with this method. Call fetchProvidersForEmail for
this users email and then prompt them to sign in with any of the sign-in providers
returned. This error will only be thrown if the "One account per email address"
setting is enabled in the Firebase console, under Auth settings. Please note that the
error code raised in this specific situation may not be the same on Web and Android.
</li>
<li>@c FIRAuthErrorCodeUserDisabled - Indicates the user's account is disabled.
</li>
<li>@c FIRAuthErrorCodeWrongPassword - Indicates the user attempted reauthentication with
an incorrect password, if credential is of the type EmailPasswordAuthCredential.
</li>
<li>@c FIRAuthErrorCodeUserMismatch - Indicates that an attempt was made to
reauthenticate with a user which is not the current user.
</li>
<li>@c FIRAuthErrorCodeInvalidEmail - Indicates the email address is malformed.</li>
</ul>
@remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods.
*/
- (void)reauthenticateWithCredential:(FIRAuthCredential *)credential
completion:(nullable FIRUserProfileChangeCallback)completion;
/** @fn getTokenWithCompletion:
@brief Retrieves the Firebase authentication token, possibly refreshing it if it has expired.
@param completion Optionally; the block invoked when the token is available. Invoked
asynchronously on the main thread in the future.
@remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods.
*/
- (void)getTokenWithCompletion:(nullable FIRAuthTokenCallback)completion;
/** @fn getTokenForcingRefresh:completion:
@brief Retrieves the Firebase authentication token, possibly refreshing it if it has expired.
@param forceRefresh Forces a token refresh. Useful if the token becomes invalid for some reason
other than an expiration.
@param completion Optionally; the block invoked when the token is available. Invoked
asynchronously on the main thread in the future.
@remarks The authentication token will be refreshed (by making a network request) if it has
expired, or if @c forceRefresh is YES.
@remarks See @c FIRAuthErrors for a list of error codes that are common to all API methods.
*/
- (void)getTokenForcingRefresh:(BOOL)forceRefresh
completion:(nullable FIRAuthTokenCallback)completion;
/** @fn linkWithCredential:completion:
@brief Associates a user account from a third-party identity provider with this user.
@param credential The credential for the identity provider.
@param completion Optionally; the block invoked when the unlinking is complete, or fails.
Invoked asynchronously on the main thread in the future.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeProviderAlreadyLinked - Indicates an attempt to link a provider of a
type already linked to this account.
</li>
<li>@c FIRAuthErrorCodeCredentialAlreadyInUse - Indicates an attempt to link with a
credential
that has already been linked with a different Firebase account.
</li>
<li>@c FIRAuthErrorCodeOperationNotAllowed - Indicates that accounts with the identity
provider represented by the credential are not enabled. Enable them in the Auth section
of the Firebase console.
</li>
</ul>
@remarks This method may also return error codes associated with updateEmail:completion: and
updatePassword:completion: on FIRUser.
@remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods.
*/
- (void)linkWithCredential:(FIRAuthCredential *)credential
completion:(nullable FIRAuthResultCallback)completion;
/** @fn unlinkFromProvider:completion:
@brief Disassociates a user account from a third-party identity provider with this user.
@param provider The provider ID of the provider to unlink.
@param completion Optionally; the block invoked when the unlinking is complete, or fails.
Invoked asynchronously on the main thread in the future.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeNoSuchProvider - Indicates an attempt to unlink a provider
that is not linked to the account.
</li>
<li>@c FIRAuthErrorCodeRequiresRecentLogin - Updating email is a security sensitive
operation that requires a recent login from the user. This error indicates the user
has not signed in recently enough. To resolve, reauthenticate the user by invoking
reauthenticateWithCredential:completion: on FIRUser.
</li>
</ul>
@remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods.
*/
- (void)unlinkFromProvider:(NSString *)provider
completion:(nullable FIRAuthResultCallback)completion;
/** @fn sendEmailVerificationWithCompletion:
@brief Initiates email verification for the user.
@param completion Optionally; the block invoked when the request to send an email verification
is complete, or fails. Invoked asynchronously on the main thread in the future.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeInvalidRecipientEmail - Indicates an invalid recipient email was
sent in the request.
</li>
<li>@c FIRAuthErrorCodeInvalidSender - Indicates an invalid sender email is set in
the console for this action.
</li>
<li>@c FIRAuthErrorCodeInvalidMessagePayload - Indicates an invalid email template for
sending update email.
</li>
<li>@c FIRAuthErrorCodeUserNotFound - Indicates the user account was not found.</li>
</ul>
@remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods.
*/
- (void)sendEmailVerificationWithCompletion:(nullable FIRSendEmailVerificationCallback)completion;
/** @fn deleteWithCompletion:
@brief Deletes the user account (also signs out the user, if this was the current user).
@param completion Optionally; the block invoked when the request to delete the account is
complete, or fails. Invoked asynchronously on the main thread in the future.
@remarks Possible error codes:
<ul>
<li>@c FIRAuthErrorCodeRequiresRecentLogin - Updating email is a security sensitive
operation that requires a recent login from the user. This error indicates the user
has not signed in recently enough. To resolve, reauthenticate the user by invoking
reauthenticateWithCredential:completion: on FIRUser.
</li>
</ul>
@remarks See @c FIRAuthErrors for a list of error codes that are common to all FIRUser methods.
*/
- (void)deleteWithCompletion:(nullable FIRUserProfileChangeCallback)completion;
@end
/** @class FIRUserProfileChangeRequest
@brief Represents an object capable of updating a user's profile data.
@remarks Properties are marked as being part of a profile update when they are set. Setting a
property value to nil is not the same as leaving the property unassigned.
*/
@interface FIRUserProfileChangeRequest : NSObject
/** @fn init
@brief Please use @c FIRUser.profileChangeRequest
*/
- (instancetype)init NS_UNAVAILABLE;
/** @property displayName
@brief The user's display name.
@remarks It is an error to set this property after calling
@c FIRUserProfileChangeRequest.commitChangesWithCallback:
*/
@property(nonatomic, copy, nullable) NSString *displayName;
/** @property photoURL
@brief The user's photo URL.
@remarks It is an error to set this property after calling
@c FIRUserProfileChangeRequest.commitChangesWithCallback:
*/
@property(nonatomic, copy, nullable) NSURL *photoURL;
/** @fn commitChangesWithCompletion:
@brief Commits any pending changes.
@remarks This method should only be called once. Once called, property values should not be
changed.
@param completion Optionally; the block invoked when the user profile change has been applied.
Invoked asynchronously on the main thread in the future.
*/
- (void)commitChangesWithCompletion:(nullable FIRUserProfileChangeCallback)completion;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,44 @@
/** @file FIRUserInfo.h
@brief Firebase Auth SDK
@copyright Copyright 2015 Google Inc.
@remarks Use of this SDK is subject to the Google APIs Terms of Service:
https://developers.google.com/terms/
*/
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
@brief Represents user data returned from an identity provider.
*/
@protocol FIRUserInfo <NSObject>
/** @property providerID
@brief The provider identifier.
*/
@property(nonatomic, copy, readonly) NSString *providerID;
/** @property uid
@brief The provider's user ID for the user.
*/
@property(nonatomic, copy, readonly) NSString *uid;
/** @property displayName
@brief The name of the user.
*/
@property(nonatomic, copy, readonly, nullable) NSString *displayName;
/** @property photoURL
@brief The URL of the user's profile photo.
*/
@property(nonatomic, copy, readonly, nullable) NSURL *photoURL;
/** @property email
@brief The user's email address.
*/
@property(nonatomic, copy, readonly, nullable) NSString *email;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,11 @@
#import "FIREmailPasswordAuthProvider.h"
#import "FIRFacebookAuthProvider.h"
#import "FIRGitHubAuthProvider.h"
#import "FIRGoogleAuthProvider.h"
#import "FIRTwitterAuthProvider.h"
#import "FIRAuth.h"
#import "FIRAuthCredential.h"
#import "FIRAuthErrors.h"
#import "FIRUser.h"
#import "FIRUserInfo.h"
#import "FirebaseAuthVersion.h"

View File

@@ -0,0 +1,18 @@
/*! @file FirebaseAuthVersion.h
@brief Firebase SDK
@copyright Copyright 2016 Google Inc.
@remarks Use of this SDK is subject to the Google APIs Terms of Service:
https://developers.google.com/terms/
*/
#import <Foundation/Foundation.h>
/**
Version number for FirebaseAuth.
*/
extern const double FirebaseAuthVersionNumber;
/**
Version string for FirebaseAuth.
*/
extern const unsigned char *const FirebaseAuthVersionString;

View File

@@ -0,0 +1,10 @@
framework module FirebaseAuth {
umbrella header "FirebaseAuth.h"
export *
module * { export *}
link "z"
link framework "CoreGraphics"
link framework "Foundation"
link framework "Security"
link framework "UIKit"
}

8
Task Master/Pods/FirebaseAuth/README.md generated Executable file
View File

@@ -0,0 +1,8 @@
# Firebase Auth for iOS
Firebase Auth enables apps to easily support multiple authentication options
for their end users.
Please visit [our developer site](https://developers.google.com/) for
integration instructions, documentation, support information, and terms of
service.