Move the header files in the AWS ClientAuth gem based on the latest gem structure guideline" (#5177)

Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com>
This commit is contained in:
Junbo Liang
2021-12-01 15:24:02 -08:00
committed by GitHub
parent d3c50419a0
commit c3461868d9
27 changed files with 39 additions and 42 deletions
@@ -0,0 +1,42 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <UserManagement/AWSCognitoUserManagementBus.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() override;
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;
inline const AZStd::string& GetCognitoAppClientId() const
{
return m_cognitoAppClientId;
}
private:
AZStd::string m_cognitoAppClientId;
};
} // namespace AWSClientAuth
@@ -0,0 +1,114 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <UserManagement/AWSCognitoUserManagementBus.h>
#include <AzCore/Component/TickBus.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
{
AZ::TickBus::QueueFunction([uuid, this]() {
Call(FN_OnEmailSignUpSuccess, uuid);
});
}
void OnEmailSignUpFail(const AZStd::string& error) override
{
AZ::TickBus::QueueFunction([error, this]() {
Call(FN_OnEmailSignUpFail, error);
});
}
void OnPhoneSignUpSuccess(const AZStd::string& uuid) override
{
AZ::TickBus::QueueFunction([uuid, this]() {
Call(FN_OnPhoneSignUpSuccess, uuid);
});
}
void OnPhoneSignUpFail(const AZStd::string& error) override
{
AZ::TickBus::QueueFunction([error, this]() {
Call(FN_OnPhoneSignUpFail, error);
});
}
void OnConfirmSignUpSuccess() override
{
AZ::TickBus::QueueFunction([this]() {
Call(FN_OnConfirmSignUpSuccess);
});
}
void OnConfirmSignUpFail(const AZStd::string& error) override
{
AZ::TickBus::QueueFunction([error, this]() {
Call(FN_OnConfirmSignUpFail, error);
});
}
void OnForgotPasswordSuccess() override
{
AZ::TickBus::QueueFunction([this]() {
Call(FN_OnForgotPasswordSuccess);
});
}
void OnForgotPasswordFail(const AZStd::string& error) override
{
AZ::TickBus::QueueFunction([error, this]() {
Call(FN_OnForgotPasswordFail, error);
});
}
void OnConfirmForgotPasswordSuccess() override
{
AZ::TickBus::QueueFunction([this]() {
Call(FN_OnConfirmForgotPasswordSuccess);
});
}
void OnConfirmForgotPasswordFail(const AZStd::string& error) override
{
AZ::TickBus::QueueFunction([error, this]() {
Call(FN_OnConfirmForgotPasswordFail, error);
});
}
void OnEnableMFASuccess() override
{
AZ::TickBus::QueueFunction([this]() {
Call(FN_OnEnableMFASuccess);
});
}
void OnEnableMFAFail(const AZStd::string& error) override
{
AZ::TickBus::QueueFunction([error, this]() {
Call(FN_OnEnableMFAFail, error);
});
}
};
} // namespace AWSClientAuth