Integrating latest 47acbe8

This commit is contained in:
alexpete
2021-03-25 13:57:57 -07:00
parent 448c549698
commit 75dc720198
10312 changed files with 2711566 additions and 671451 deletions
@@ -0,0 +1,42 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <UserManagement/AWSCognitoUserManagementBus.h>
#include <UserManagement/AWSCognitoUserManagementTypes.h>
namespace AWSClientAuth
{
//! Implements AWS Cognito User pool user management.
class AWSCognitoUserManagementController
: public AWSCognitoUserManagementRequestBus::Handler
{
public:
AZ_RTTI(AWSCognitoUserManagementController, "{2645D1CC-EB55-4A8D-8F45-5DFE94032813}", IAWSCognitoUserManagementRequests);
AWSCognitoUserManagementController();
virtual ~AWSCognitoUserManagementController();
// AWSCognitoUserManagementRequestsBus interface methods
bool Initialize(const AZStd::string& settingsRegistryPath);
void EmailSignUpAsync(const AZStd::string& username, const AZStd::string& password, const AZStd::string& email) override;
void PhoneSignUpAsync(const AZStd::string& username, const AZStd::string& password, const AZStd::string& phoneNumber) override;
void ConfirmSignUpAsync(const AZStd::string& username, const AZStd::string& confirmationCode) override;
void ForgotPasswordAsync(const AZStd::string& username) override;
void ConfirmForgotPasswordAsync(const AZStd::string& userName, const AZStd::string& confirmationCode, const AZStd::string& newPassword) override;
void EnableMFAAsync(const AZStd::string& accessToken) override;
protected:
AZStd::unique_ptr<AWSCognitoUserManagementSetting> m_settings;
};
} // namespace AWSClientAuth
@@ -0,0 +1,50 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <AzCore/Serialization/EditContext.h>
namespace AWSClientAuth
{
//! Holds AWS Cognito user management serialized Settings.
class AWSCognitoUserManagementSetting
{
public:
AWSCognitoUserManagementSetting() = default;
~AWSCognitoUserManagementSetting() = default;
AZ_TYPE_INFO(AWSCognitoUserManagementSetting, "{58FC34F1-B84B-4677-B986-45A226F0328D}");
AZStd::string m_appClientId;
static void Reflect(AZ::SerializeContext& context)
{
context.Class<AWSCognitoUserManagementSetting>()
->Field("AppClientId", &AWSCognitoUserManagementSetting::m_appClientId)
;
AZ::EditContext* editContext = context.GetEditContext();
if (editContext)
{
editContext->Class<AWSCognitoUserManagementSetting>("AWSCognitoUserManagementSetting", "AWSCognitoUserManagementSetting Settings")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::Category, "AWSClientAuth")
->Attribute(AZ::Edit::Attributes::AutoExpand, true)
->Attribute(AZ::Edit::Attributes::AppearsInAddComponentMenu, AZ_CRC_CE("Game"))
->DataElement(AZ::Edit::UIHandlers::Default, &AWSCognitoUserManagementSetting::m_appClientId, "ClientId", "Cognito User Pool App Client Id")
;
}
}
};
} // namespace AWSClientAuth
@@ -0,0 +1,93 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <UserManagement/AWSCognitoUserManagementBus.h>
namespace AWSClientAuth
{
//! User management behavior EBus handler
class UserManagementNotificationBusBehaviorHandler
: public AWSCognitoUserManagementNotificationBus::Handler
, public AZ::BehaviorEBusHandler
{
public:
AZ_EBUS_BEHAVIOR_BINDER(UserManagementNotificationBusBehaviorHandler, "{57289595-2CDC-4834-8017-4A96B983E028}", AZ::SystemAllocator,
OnEmailSignUpSuccess, OnEmailSignUpFail,
OnPhoneSignUpSuccess, OnPhoneSignUpFail,
OnConfirmSignUpSuccess, OnConfirmSignUpFail,
OnForgotPasswordSuccess, OnForgotPasswordFail,
OnConfirmForgotPasswordSuccess, OnConfirmForgotPasswordFail,
OnEnableMFASuccess, OnEnableMFAFail
);
void OnEmailSignUpSuccess(const AZStd::string& uuid) override
{
Call(FN_OnEmailSignUpSuccess, uuid);
}
void OnEmailSignUpFail(const AZStd::string& error) override
{
Call(FN_OnEmailSignUpFail, error);
}
void OnPhoneSignUpSuccess(const AZStd::string& uuid) override
{
Call(FN_OnPhoneSignUpSuccess, uuid);
}
void OnPhoneSignUpFail(const AZStd::string& error) override
{
Call(FN_OnPhoneSignUpFail, error);
}
void OnConfirmSignUpSuccess() override
{
Call(FN_OnConfirmSignUpSuccess);
}
void OnConfirmSignUpFail(const AZStd::string& error) override
{
Call(FN_OnConfirmSignUpFail, error);
}
void OnForgotPasswordSuccess() override
{
Call(FN_OnForgotPasswordSuccess);
}
void OnForgotPasswordFail(const AZStd::string& error) override
{
Call(FN_OnForgotPasswordFail, error);
}
void OnConfirmForgotPasswordSuccess() override
{
Call(FN_OnConfirmForgotPasswordSuccess);
}
void OnConfirmForgotPasswordFail(const AZStd::string& error) override
{
Call(FN_OnConfirmForgotPasswordFail, error);
}
void OnEnableMFASuccess() override
{
Call(FN_OnEnableMFASuccess);
}
void OnEnableMFAFail(const AZStd::string& error) override
{
Call(FN_OnEnableMFAFail, error);
}
};
} // namespace AWSClientAuth