16 #ifndef ACSDKAUTHORIZATION_AUTHORIZATIONMANAGER_H_ 17 #define ACSDKAUTHORIZATION_AUTHORIZATIONMANAGER_H_ 21 #include <unordered_map> 22 #include <unordered_set> 36 namespace acsdkAuthorization {
99 ,
public std::enable_shared_from_this<AuthorizationManager> {
109 static std::shared_ptr<acsdkAuthorization::AuthorizationManager>
create(
110 const std::shared_ptr<avsCommon::sdkInterfaces::storage::MiscStorageInterface>& storage,
111 const std::shared_ptr<registrationManager::CustomerDataManagerInterface>& customerDataManager);
119 void add(
const std::shared_ptr<acsdkAuthorizationInterfaces::AuthorizationAdapterInterface>& adapter)
override;
131 void addAuthObserver(std::shared_ptr<avsCommon::sdkInterfaces::AuthObserverInterface> observer)
override;
132 void removeAuthObserver(std::shared_ptr<avsCommon::sdkInterfaces::AuthObserverInterface> observer)
override;
148 const std::shared_ptr<registrationManager::RegistrationManagerInterface> registrationManager);
163 const std::shared_ptr<AuthorizationManagerStorage>& storage,
164 const std::shared_ptr<registrationManager::CustomerDataManagerInterface>& customerDataManager);
180 void handleTransition(
188 void clearDataLocked();
197 void logoutHelper(std::unique_lock<std::mutex>& lock);
230 std::mutex m_observersMutex;
233 std::unordered_map<std::string, std::shared_ptr<acsdkAuthorizationInterfaces::AuthorizationAdapterInterface>>
237 std::unordered_set<std::shared_ptr<avsCommon::sdkInterfaces::AuthObserverInterface>> m_observers;
240 std::shared_ptr<acsdkAuthorizationInterfaces::AuthorizationAdapterInterface> m_activeAdapter;
252 std::shared_ptr<AuthorizationManagerStorage> m_storage;
255 std::shared_ptr<registrationManager::RegistrationManagerInterface> m_registrationManager;
264 #endif // ACSDKAUTHORIZATION_AUTHORIZATIONMANAGER_H_ std::string getActiveAuthorization() override
void removeAuthObserver(std::shared_ptr< avsCommon::sdkInterfaces::AuthObserverInterface > observer) override
std::string getAuthToken() override
static std::shared_ptr< acsdkAuthorization::AuthorizationManager > create(const std::shared_ptr< avsCommon::sdkInterfaces::storage::MiscStorageInterface > &storage, const std::shared_ptr< registrationManager::CustomerDataManagerInterface > &customerDataManager)
::std::string string
Definition: gtest-port.h:1097
Definition: AuthorizationManagerInterface.h:34
Single-thread executor implementation.
Definition: Executor.h:45
State
The enum State describes the state of authorization.
Definition: AuthObserverInterface.h:34
Definition: RequiresShutdown.h:32
Definition: AuthorizationManager.h:94
void reportStateChange(const avsCommon::sdkInterfaces::AuthObserverInterface::FullState &state, const std::string &authId, const std::string &userId) override
void addAuthObserver(std::shared_ptr< avsCommon::sdkInterfaces::AuthObserverInterface > observer) override
void clearData() override
An aggregated structure to simplify working with State and Error.
Definition: AuthObserverInterface.h:80
void onAuthFailure(const std::string &token) override
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Definition: AuthorizationAuthorityInterface.h:38
avsCommon::sdkInterfaces::AuthObserverInterface::State getState() override
void add(const std::shared_ptr< acsdkAuthorizationInterfaces::AuthorizationAdapterInterface > &adapter) override
void doShutdown() override
Definition: CustomerDataHandler.h:34
void setRegistrationManager(const std::shared_ptr< registrationManager::RegistrationManagerInterface > registrationManager)