![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
A SQLite based version of LWAAuthorizationStorageInterface
.
More...
#include <LWAAuthorizationStorage.h>
Public Member Functions | |
~LWAAuthorizationStorage () | |
LWAAuthorizationStorageInterface method overrides. | |
bool | createDatabase () override |
bool | open () override |
bool | openOrCreate () override |
bool | setRefreshToken (const std::string &refreshToken) override |
bool | clearRefreshToken () override |
bool | getRefreshToken (std::string *refreshToken) override |
bool | setUserId (const std::string &userId) override |
bool | getUserId (std::string *userId) override |
bool | clear () override |
![]() | |
virtual | ~LWAAuthorizationStorageInterface ()=default |
Static Public Member Functions | |
static std::shared_ptr< LWAAuthorizationStorageInterface > | createStorage (const std::shared_ptr< propertiesInterfaces::PropertiesFactoryInterface > &propertiesFactory) |
Create storage interface. More... | |
static std::shared_ptr< acsdkAuthorizationInterfaces::lwa::LWAAuthorizationStorageInterface > | createLWAAuthorizationStorageInterface (const std::shared_ptr< avsCommon::utils::configuration::ConfigurationNode > &configurationRoot, const std::string &storageRootKey, const std::shared_ptr< cryptoInterfaces::CryptoFactoryInterface > &cryptoFactory, const std::shared_ptr< cryptoInterfaces::KeyStoreInterface > &keyStore) |
Create storage interface backed by SQLite. More... | |
A SQLite based version of LWAAuthorizationStorageInterface
.
Storage implementation based on Properties API.
This implementation class adapts properties interface to domain-specific authorization storage interface. Depending on
alexaClientSDK::acsdkAuthorization::lwa::LWAAuthorizationStorage::~LWAAuthorizationStorage | ( | ) |
Destructor.
|
overridevirtual |
A utility function to clear all records from storage. Note that the storage will still exist, it will just have not content.
Implements alexaClientSDK::acsdkAuthorizationInterfaces::lwa::LWAAuthorizationStorageInterface.
|
overridevirtual |
Clear the stored refresh token value.
Implements alexaClientSDK::acsdkAuthorizationInterfaces::lwa::LWAAuthorizationStorageInterface.
|
overridevirtual |
Creates a new database with the given filepath. If the file specified already exists, or if a database is already being handled by this object, then this function returns false.
true
If the database is created ok, or false
if either the file exists or a database is already being handled by this object. Implements alexaClientSDK::acsdkAuthorizationInterfaces::lwa::LWAAuthorizationStorageInterface.
|
static |
Create storage interface backed by SQLite.
Factory method for creating a storage object for creating a storage interface based on an SQLite database. If platform configuration has both cryptography and hardware security module support, all the stored values will be encrypted. If there is no cryptography module and/or HSM support, all values will be stored in unencrypted form.
[in] | configurationRoot | The global config object. |
[in] | storageRootKey | The key to use to find the parent node. |
[in] | cryptoFactory | Crypto factory interface. This interface is required if HSM integration is enabled. |
[in] | keyStore | Key store interface. This interface is required if HSM integration is enabled. |
|
static |
Create storage interface.
Factory method for creating a storage interface using properties API. For certification it is important to use encrypted properties factory.
[in] | propertiesFactory | Properties factory interface. |
|
overridevirtual |
Get the stored refresh token value.
[out] | refreshToken |
Implements alexaClientSDK::acsdkAuthorizationInterfaces::lwa::LWAAuthorizationStorageInterface.
|
overridevirtual |
Retrieves the UserId associated with the account.
[out] | userId |
Implements alexaClientSDK::acsdkAuthorizationInterfaces::lwa::LWAAuthorizationStorageInterface.
|
overridevirtual |
Open a database with the given filepath. If this object is already managing an open database, or the file does not exist, or there is a problem opening the database, this function returns false.
true
If the database is opened ok, false
if either the file does not exist, if this object is already managing an open database, or if there is another internal reason the database could not be opened. Implements alexaClientSDK::acsdkAuthorizationInterfaces::lwa::LWAAuthorizationStorageInterface.
|
overridevirtual |
Open the database with the given filepath or creates it if it does not exist.
true
If the database is opened and usable. false
if this object is already managing an open database, or if there is another internal reason the database is unusable. Implements alexaClientSDK::acsdkAuthorizationInterfaces::lwa::LWAAuthorizationStorageInterface.
|
overridevirtual |
Set the stored refresh token value.
refreshToken | The refresh token to insert into the database. |
Implements alexaClientSDK::acsdkAuthorizationInterfaces::lwa::LWAAuthorizationStorageInterface.
|
overridevirtual |
Stores the UserId associated with the account.
userId | The userId to store. |
Implements alexaClientSDK::acsdkAuthorizationInterfaces::lwa::LWAAuthorizationStorageInterface.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0