AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
Classes | |
class | LWAAuthorizationAdapterTest |
class | LWAAuthorizationStorageTest |
class | LWAAuthStorageMigrationTest |
class | MockAuthManager |
A mock AuthorizationManager. More... | |
class | MockCBLObserver |
A mock observer. More... | |
class | StubStorage |
Functions | |
TEST_F (LWAAuthorizationAdapterTest, test_create_NullParams_Nullptr) | |
Test create with null ptr. More... | |
TEST_F (LWAAuthorizationAdapterTest, test_id_DefaultValue) | |
Check the default value for the adapter id both directly and via getAuthorizationInterface. More... | |
TEST_F (LWAAuthorizationAdapterTest, test_getAuthTokenNoAuth_Fails) | |
Check that no token is returned when not authorized. More... | |
TEST_F (LWAAuthorizationAdapterTest, test_id_CustomValue) | |
Check the custom value for the adapter id both directly and via getAuthorizationInterface. More... | |
TEST_F (LWAAuthorizationAdapterTest, test_authorize_NoAuthMgr_Fails) | |
Check that authorizing without an AuthManager fails. More... | |
TEST_F (LWAAuthorizationAdapterTest, test_multipleCBLAuthorization_Fails) | |
Check that multiple authorization requests fail. Only one reportStateChange call for each state is expected. More... | |
TEST_F (LWAAuthorizationAdapterTest, test_cblCodePairRetry_Succeeds) | |
Check that the retry logic for CBL code pair requests is successful. More... | |
TEST_F (LWAAuthorizationAdapterTest, test_cblTokenExchangeRetry_Succeeds) | |
Check that the retry logic for CBL token exchange requests is successful. More... | |
TEST_F (LWAAuthorizationAdapterTest, test_authFailure_TriggersRetry) | |
Check that on auth failure, a retry is triggered. More... | |
TEST_F (LWAAuthorizationAdapterTest, test_getState_Succeeds) | |
Check that getState returns the correct state. More... | |
TEST_F (LWAAuthorizationAdapterTest, test_reset_Succeeds) | |
Check that reset operations are successful. More... | |
TEST_F (LWAAuthorizationAdapterTest, test_refreshing_succeeds) | |
Check that the LWA token refreshing logic is successful. More... | |
TEST_F (LWAAuthorizationAdapterTest, test_reset_CodePair) | |
Test resetting while waiting for code pair requests. More... | |
TEST_F (LWAAuthorizationAdapterTest, test_reset_TokenExchange) | |
Test resetting while waiting for token exchange requests. More... | |
INSTANTIATE_TEST_CASE_P (Parameterized, LWAAuthorizationAdapterTest, ::testing::Values(AUTHORIZE_USING_CBL, AUTHORIZE_USING_CBL_WITH_CUSTOMER_PROFILE)) | |
Parameterized Tests Exercising both authorizeUsingCBL and authorizeUsingCBLWithCustomerProfile. More... | |
TEST_P (LWAAuthorizationAdapterTest, test_cblAuthorize_Succeeds) | |
Test that the happy case succeeds. More... | |
TEST_P (LWAAuthorizationAdapterTest, test_cblAuthorize_CorrectScopes) | |
Check that authorizeUsingCBL<WithCustomerProfile> is requesting with the correct scopes. More... | |
TEST_F (LWAAuthorizationStorageTest, test_createFromEmptyStorage) | |
TEST_F (LWAAuthorizationStorageTest, test_createFromNonEmptyStorage) | |
TEST_F (LWAAuthorizationStorageTest, test_createFromEmptyDatabase) | |
TEST_F (LWAAuthorizationStorageTest, test_createsTableAfterPutCloseAndReopen) | |
TEST_F (LWAAuthStorageMigrationTest, test_migrateEmptyDatabase) | |
Tests with creating a string key - string value table. More... | |
TEST_F (LWAAuthStorageMigrationTest, test_migrateRefreshToken) | |
TEST_F (LWAAuthStorageMigrationTest, test_migrateUserId) | |
TEST_F (LWAAuthStorageMigrationTest, test_verifyMigrationForSameDatabase) | |
Variables | |
static const std::string | USER_ID = "test-user-id" |
An example user id that would be returned by the Customer Profile API. More... | |
static const std::string | NAME = "Test User" |
An example name that would be returned by the Customer Profile API. More... | |
static const std::string | EMAIL = "test@user.com" |
An example email that would be returned by the Customer Profile API. More... | |
static const std::string | VERIFICATION_URI = "https://amazon.com/us/code" |
The Veritifcation URI. More... | |
static const std::string | USER_CODE = "ABCDE" |
An example CBL code to be returned from CBL auth. More... | |
static const std::string | DEVICE_CODE = "deviceCode" |
An example device code to be returned from CBL auth. More... | |
static const std::string | ADAPTER_ID = "test-adapter-id" |
A test adapter id. More... | |
const std::string | DEFAULT_ADAPTER_ID = "lwa-adapter" |
Default adapter id. More... | |
std::chrono::seconds | TIMEOUT {2} |
Timeout for test cases that require synchronization. More... | |
std::chrono::seconds | LONG_TIMEOUT {20} |
Long timeout for cases involving waiting for retries. More... | |
static const std::string | CONFIG_ROOT_NODE = "lwaAuthorization" |
The config node for the LWAAuthorizationAdapter. More... | |
static const std::string | AUTHORIZE_USING_CBL = "authorizeUsingCBL" |
The method name for authorizeUsingCBL. More... | |
static const std::string | AUTHORIZE_USING_CBL_WITH_CUSTOMER_PROFILE = "authorizeUsingCBLWithCustomerProfile" |
The method name for authorizeUsingCBLWithCustomerProfile. More... | |
const std::string | EXPIRATION_S = "3600" |
Example responses from LWA. More... | |
const std::string | INTERVAL_S = "3600" |
const std::string | ACCESS_TOKEN = "myaccesstoken" |
const std::string | REFRESH_TOKEN = "myrefreshtoken" |
const std::string | TOKEN_TYPE = "bearer" |
const std::string | EXPIRATION = "3600" |
static const std::string | CONFIG_JSON |
The Config JSON. More... | |
static const HTTPResponse | CODE_PAIR_RESPONSE |
A default successful code pair response. More... | |
static const HTTPResponse | TOKEN_EXCHANGE_RESPONSE |
A default successful token exchange response. More... | |
static const HTTPResponse | CUSTOMER_PROFILE_SHORT_RESPONSE |
A defauilt successful customer profile response containing only the user id. More... | |
static const HTTPResponse | CUSTOMER_PROFILE_RESPONSE |
A defauilt successful customer profile response. More... | |
static const std::string | COMPONENT_NAME = "config" |
Component name for the misc DB tables. More... | |
static const std::string | TABLE_NAME = "LWAAuthorizationStorage" |
Table name for the misc DB tables. More... | |
static const std::string | REFRESH_TOKEN_VALUE = "refreshTokenValue" |
Test value for refresh token. More... | |
static const std::string | USER_ID_VALUE = "userIdValue" |
Test value for user id. More... | |
static const std::string | MISC_DB_CONFIG_JSON |
JSON text for miscDB config. More... | |
static const std::string | TAG = "LWAAuthStorageMigrationTest" |
Logging tag. More... | |
static const std::string | COMPONENT_NAME = "config" |
Component name for the misc DB tables. More... | |
static const std::string | TABLE_NAME = "LWAAuthorizationStorage" |
Table name for the misc DB tables. More... | |
static const std::string | PROPERTIES_URI = COMPONENT_NAME + "/" + TABLE_NAME |
Full table name. More... | |
static const std::string | TABLE_NAME_REFRESH_TOKEN = "refreshToken" |
Full table name for legacy refresh token. More... | |
static const std::string | TABLE_NAME_USER_ID = "userId" |
Full table name for legacy user id. More... | |
alexaClientSDK::acsdkAuthorization::lwa::test::INSTANTIATE_TEST_CASE_P | ( | Parameterized | , |
LWAAuthorizationAdapterTest | , | ||
::testing::Values(AUTHORIZE_USING_CBL, AUTHORIZE_USING_CBL_WITH_CUSTOMER_PROFILE) | |||
) |
Parameterized Tests Exercising both authorizeUsingCBL and authorizeUsingCBLWithCustomerProfile.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationStorageTest | , |
test_createFromEmptyStorage | |||
) |
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationStorageTest | , |
test_createFromNonEmptyStorage | |||
) |
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthStorageMigrationTest | , |
test_migrateEmptyDatabase | |||
) |
Tests with creating a string key - string value table.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthStorageMigrationTest | , |
test_migrateRefreshToken | |||
) |
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationStorageTest | , |
test_createFromEmptyDatabase | |||
) |
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthStorageMigrationTest | , |
test_migrateUserId | |||
) |
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationStorageTest | , |
test_createsTableAfterPutCloseAndReopen | |||
) |
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthStorageMigrationTest | , |
test_verifyMigrationForSameDatabase | |||
) |
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationAdapterTest | , |
test_create_NullParams_Nullptr | |||
) |
Test create with null ptr.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationAdapterTest | , |
test_id_DefaultValue | |||
) |
Check the default value for the adapter id both directly and via getAuthorizationInterface.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationAdapterTest | , |
test_getAuthTokenNoAuth_Fails | |||
) |
Check that no token is returned when not authorized.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationAdapterTest | , |
test_id_CustomValue | |||
) |
Check the custom value for the adapter id both directly and via getAuthorizationInterface.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationAdapterTest | , |
test_authorize_NoAuthMgr_Fails | |||
) |
Check that authorizing without an AuthManager fails.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationAdapterTest | , |
test_multipleCBLAuthorization_Fails | |||
) |
Check that multiple authorization requests fail. Only one reportStateChange call for each state is expected.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationAdapterTest | , |
test_cblCodePairRetry_Succeeds | |||
) |
Check that the retry logic for CBL code pair requests is successful.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationAdapterTest | , |
test_cblTokenExchangeRetry_Succeeds | |||
) |
Check that the retry logic for CBL token exchange requests is successful.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationAdapterTest | , |
test_authFailure_TriggersRetry | |||
) |
Check that on auth failure, a retry is triggered.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationAdapterTest | , |
test_getState_Succeeds | |||
) |
Check that getState returns the correct state.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationAdapterTest | , |
test_reset_Succeeds | |||
) |
Check that reset operations are successful.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationAdapterTest | , |
test_refreshing_succeeds | |||
) |
Check that the LWA token refreshing logic is successful.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationAdapterTest | , |
test_reset_CodePair | |||
) |
Test resetting while waiting for code pair requests.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_F | ( | LWAAuthorizationAdapterTest | , |
test_reset_TokenExchange | |||
) |
Test resetting while waiting for token exchange requests.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_P | ( | LWAAuthorizationAdapterTest | , |
test_cblAuthorize_Succeeds | |||
) |
Test that the happy case succeeds.
alexaClientSDK::acsdkAuthorization::lwa::test::TEST_P | ( | LWAAuthorizationAdapterTest | , |
test_cblAuthorize_CorrectScopes | |||
) |
Check that authorizeUsingCBL<WithCustomerProfile> is requesting with the correct scopes.
const std::string alexaClientSDK::acsdkAuthorization::lwa::test::ACCESS_TOKEN = "myaccesstoken" |
|
static |
A test adapter id.
|
static |
The method name for authorizeUsingCBL.
|
static |
The method name for authorizeUsingCBLWithCustomerProfile.
|
static |
A default successful code pair response.
|
static |
Component name for the misc DB tables.
|
static |
Component name for the misc DB tables.
|
static |
The Config JSON.
|
static |
The config node for the LWAAuthorizationAdapter.
|
static |
A defauilt successful customer profile response.
|
static |
A defauilt successful customer profile response containing only the user id.
const std::string alexaClientSDK::acsdkAuthorization::lwa::test::DEFAULT_ADAPTER_ID = "lwa-adapter" |
Default adapter id.
|
static |
An example device code to be returned from CBL auth.
|
static |
An example email that would be returned by the Customer Profile API.
const std::string alexaClientSDK::acsdkAuthorization::lwa::test::EXPIRATION = "3600" |
const std::string alexaClientSDK::acsdkAuthorization::lwa::test::EXPIRATION_S = "3600" |
Example responses from LWA.
const std::string alexaClientSDK::acsdkAuthorization::lwa::test::INTERVAL_S = "3600" |
std::chrono::seconds alexaClientSDK::acsdkAuthorization::lwa::test::LONG_TIMEOUT {20} |
Long timeout for cases involving waiting for retries.
|
static |
JSON text for miscDB config.
|
static |
An example name that would be returned by the Customer Profile API.
|
static |
Full table name.
const std::string alexaClientSDK::acsdkAuthorization::lwa::test::REFRESH_TOKEN = "myrefreshtoken" |
|
static |
Test value for refresh token.
|
static |
Table name for the misc DB tables.
|
static |
Table name for the misc DB tables.
|
static |
Full table name for legacy refresh token.
|
static |
Full table name for legacy user id.
|
static |
Logging tag.
std::chrono::seconds alexaClientSDK::acsdkAuthorization::lwa::test::TIMEOUT {2} |
Timeout for test cases that require synchronization.
|
static |
A default successful token exchange response.
const std::string alexaClientSDK::acsdkAuthorization::lwa::test::TOKEN_TYPE = "bearer" |
|
static |
An example CBL code to be returned from CBL auth.
|
static |
An example user id that would be returned by the Customer Profile API.
|
static |
Test value for user id.
|
static |
The Veritifcation URI.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0