From d3fbad8fc03f51de279e76591caf9a16d3592436 Mon Sep 17 00:00:00 2001 From: Soumava Bera Date: Mon, 9 Sep 2024 21:24:04 +0000 Subject: [PATCH] address comments --- .../smithy/identity/auth/built-in/BearerTokenAuthScheme.h | 2 +- .../identity/auth/built-in/BearerTokenAuthSchemeOption.h | 5 +---- .../smithy/client/SmithyClientTest.cpp | 4 +++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/aws-cpp-sdk-core/include/smithy/identity/auth/built-in/BearerTokenAuthScheme.h b/src/aws-cpp-sdk-core/include/smithy/identity/auth/built-in/BearerTokenAuthScheme.h index 2e940659d30..6d05f280b93 100644 --- a/src/aws-cpp-sdk-core/include/smithy/identity/auth/built-in/BearerTokenAuthScheme.h +++ b/src/aws-cpp-sdk-core/include/smithy/identity/auth/built-in/BearerTokenAuthScheme.h @@ -22,7 +22,7 @@ class BearerTokenAuthScheme : public AuthScheme explicit BearerTokenAuthScheme( std::shared_ptr identityResolver, const Aws::String &serviceName, const Aws::String ®ion) - : AuthScheme(smithy::BearerTokenAuthSchemeOption::BEARER_SCHEME), + : AuthScheme("smithy.api#HTTPBearerAuth"), m_identityResolver{identityResolver}, m_signer{Aws::MakeShared( "BearerTokenAuthScheme", serviceName, region)} diff --git a/src/aws-cpp-sdk-core/include/smithy/identity/auth/built-in/BearerTokenAuthSchemeOption.h b/src/aws-cpp-sdk-core/include/smithy/identity/auth/built-in/BearerTokenAuthSchemeOption.h index 8e274ac8f05..2fbf4bec104 100644 --- a/src/aws-cpp-sdk-core/include/smithy/identity/auth/built-in/BearerTokenAuthSchemeOption.h +++ b/src/aws-cpp-sdk-core/include/smithy/identity/auth/built-in/BearerTokenAuthSchemeOption.h @@ -10,11 +10,8 @@ namespace smithy struct BearerTokenAuthSchemeOption { static AuthSchemeOption bearerTokenAuthSchemeOption; - static char BEARER_SCHEME[]; }; -char BearerTokenAuthSchemeOption::BEARER_SCHEME[] = "smithy.api#HTTPBearerAuth"; - AuthSchemeOption BearerTokenAuthSchemeOption::bearerTokenAuthSchemeOption = - AuthSchemeOption(BEARER_SCHEME); + AuthSchemeOption("smithy.api#HTTPBearerAuth"); } // namespace smithy \ No newline at end of file diff --git a/tests/aws-cpp-sdk-core-tests/smithy/client/SmithyClientTest.cpp b/tests/aws-cpp-sdk-core-tests/smithy/client/SmithyClientTest.cpp index 04cbe87c6a0..24a6a0e61eb 100644 --- a/tests/aws-cpp-sdk-core-tests/smithy/client/SmithyClientTest.cpp +++ b/tests/aws-cpp-sdk-core-tests/smithy/client/SmithyClientTest.cpp @@ -271,7 +271,9 @@ TEST_F(SmithyClientTest, bearer) Aws::UnorderedMap authSchemesMap; - Aws::String key{smithy::BearerTokenAuthSchemeOption::BEARER_SCHEME}; + Aws::String key{ + smithy::BearerTokenAuthSchemeOption::bearerTokenAuthSchemeOption + .schemeId}; std::shared_ptr resolver = Aws::MakeShared(ALLOCATION_TAG);