Skip to content

Commit d500713

Browse files
committed
changed log tag
1 parent eef4a3e commit d500713

File tree

5 files changed

+17
-18
lines changed

5 files changed

+17
-18
lines changed

src/aws-cpp-sdk-core/include/aws/core/config/EndpointResolver.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ namespace Aws
3737
template<typename EndpointProviderT>
3838
static void EndpointSource(const Aws::String& serviceId,
3939
const Aws::String& profileName,
40-
EndpointProviderT& endpointProvider,
41-
const Aws::Http::Scheme& scheme)
40+
const Aws::Http::Scheme& scheme,
41+
EndpointProviderT& endpointProvider)
4242
{
4343
const Aws::String serviceKey = ToEnvSuffix(serviceId);
4444

src/aws-cpp-sdk-core/include/aws/core/endpoint/EndpointProviderBase.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ namespace Aws
5252
/**
5353
* Initialize client context parameters from a ClientConfiguration with service name
5454
*/
55-
virtual void InitBuiltInParameters(const ClientConfigurationT& config, const Aws::String&)
56-
{
57-
InitBuiltInParameters(config);
58-
}
55+
virtual void InitBuiltInParameters(const ClientConfigurationT& config, const Aws::String& serviceName) = 0;
5956

6057
/**
6158
* Function to override endpoint, i.e. to set built-in parameter "AWS::Endpoint"

src/aws-cpp-sdk-core/source/endpoint/BuiltInParameters.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ namespace Endpoint
115115
SetStringParameter(AWS_REGION, "region-not-set");
116116
}
117117
} else if (!serviceName.empty()) {
118-
Aws::Config::EndpointResolver::EndpointSource(serviceName, config.profileName, *this, config.scheme);
118+
Aws::Config::EndpointResolver::EndpointSource(serviceName, config.profileName, config.scheme, *this);
119119
}
120120
}
121121

tests/aws-cpp-sdk-core-tests/aws/config/EndpointResolverTest.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ TEST_F(EndpointResolverTest, ServiceSpecificEnvironmentVariable)
4444
}};
4545

4646
MockEndpointProvider provider;
47-
EndpointResolver::EndpointSource("s3", "default", provider, Aws::Http::Scheme::HTTPS);
47+
EndpointResolver::EndpointSource("s3", "default", Aws::Http::Scheme::HTTPS, provider);
4848
EXPECT_EQ("https://s3.example.com", provider.GetOverriddenEndpoint());
4949
}
5050

@@ -55,7 +55,7 @@ TEST_F(EndpointResolverTest, GlobalEnvironmentVariable)
5555
}};
5656

5757
MockEndpointProvider provider;
58-
EndpointResolver::EndpointSource("s3", "default", provider, Aws::Http::Scheme::HTTPS);
58+
EndpointResolver::EndpointSource("s3", "default", Aws::Http::Scheme::HTTPS, provider);
5959
EXPECT_EQ("https://global.example.com", provider.GetOverriddenEndpoint());
6060
}
6161

@@ -67,7 +67,7 @@ TEST_F(EndpointResolverTest, EnvironmentTakesPrecedenceOverGlobal)
6767
}};
6868

6969
MockEndpointProvider provider;
70-
EndpointResolver::EndpointSource("s3", "default", provider, Aws::Http::Scheme::HTTPS);
70+
EndpointResolver::EndpointSource("s3", "default", Aws::Http::Scheme::HTTPS, provider);
7171
EXPECT_EQ("https://s3.example.com", provider.GetOverriddenEndpoint());
7272
}
7373

@@ -94,7 +94,7 @@ TEST_F(EndpointResolverTest, GlobalEnvOverServiceProfile)
9494

9595
// Test that global env takes precedence over service profile
9696
MockEndpointProvider provider;
97-
EndpointResolver::EndpointSource("s3", "test-profile", provider, Aws::Http::Scheme::HTTPS);
97+
EndpointResolver::EndpointSource("s3", "test-profile", Aws::Http::Scheme::HTTPS, provider);
9898
EXPECT_EQ("https://global-env.example.com", provider.GetOverriddenEndpoint());
9999
}
100100

@@ -121,7 +121,7 @@ TEST_F(EndpointResolverTest, ServiceProfileOverGlobalProfile)
121121

122122
// Test that service-specific profile takes precedence over global profile
123123
MockEndpointProvider provider;
124-
EndpointResolver::EndpointSource("s3", "test-profile", provider, Aws::Http::Scheme::HTTPS);
124+
EndpointResolver::EndpointSource("s3", "test-profile", Aws::Http::Scheme::HTTPS, provider);
125125
EXPECT_EQ("https://s3-profile.example.com", provider.GetOverriddenEndpoint());
126126
}
127127

@@ -133,14 +133,14 @@ TEST_F(EndpointResolverTest, BlankValueContinuesResolution)
133133
}};
134134

135135
MockEndpointProvider provider;
136-
EndpointResolver::EndpointSource("s3", "default", provider, Aws::Http::Scheme::HTTPS);
136+
EndpointResolver::EndpointSource("s3", "default", Aws::Http::Scheme::HTTPS, provider);
137137
EXPECT_EQ("https://global.example.com", provider.GetOverriddenEndpoint());
138138
}
139139

140140
TEST_F(EndpointResolverTest, NoEndpointConfigured)
141141
{
142142
MockEndpointProvider provider;
143-
EndpointResolver::EndpointSource("s3", "default", provider, Aws::Http::Scheme::HTTPS);
143+
EndpointResolver::EndpointSource("s3", "default", Aws::Http::Scheme::HTTPS, provider);
144144
EXPECT_TRUE(provider.GetOverriddenEndpoint().empty());
145145
}
146146

@@ -169,7 +169,7 @@ TEST_F(EndpointResolverTest, CodeProvidedEndpointTakesPrecedenceOverAll)
169169

170170
// Verify that if EndpointSource is called, it would use env vars
171171
MockEndpointProvider resolverProvider;
172-
EndpointResolver::EndpointSource("s3", "test-profile", resolverProvider, Aws::Http::Scheme::HTTPS);
172+
EndpointResolver::EndpointSource("s3", "test-profile", Aws::Http::Scheme::HTTPS, resolverProvider);
173173
EXPECT_EQ("https://s3-env.example.com", resolverProvider.GetOverriddenEndpoint());
174174

175175
// But the original provider retains the code-provided endpoint
@@ -198,7 +198,7 @@ TEST_F(EndpointResolverTest, IgnoreConfiguredEndpointUrlsEnvironmentVariable)
198198

199199
// Test that all configured endpoints are ignored
200200
MockEndpointProvider provider;
201-
EndpointResolver::EndpointSource("s3", "test-profile", provider, Aws::Http::Scheme::HTTPS);
201+
EndpointResolver::EndpointSource("s3", "test-profile", Aws::Http::Scheme::HTTPS, provider);
202202
EXPECT_TRUE(provider.GetOverriddenEndpoint().empty());
203203
}
204204

@@ -224,7 +224,7 @@ TEST_F(EndpointResolverTest, IgnoreConfiguredEndpointUrlsProfileSetting)
224224

225225
// Test that all configured endpoints are ignored due to profile setting
226226
MockEndpointProvider provider;
227-
EndpointResolver::EndpointSource("s3", "test-profile", provider, Aws::Http::Scheme::HTTPS);
227+
EndpointResolver::EndpointSource("s3", "test-profile", Aws::Http::Scheme::HTTPS, provider);
228228
EXPECT_TRUE(provider.GetOverriddenEndpoint().empty());
229229
}
230230

@@ -246,6 +246,6 @@ TEST_F(EndpointResolverTest, IgnoreConfiguredEndpointUrlsCaseInsensitive)
246246

247247
// Test that endpoints are ignored with case-insensitive "TRUE"
248248
MockEndpointProvider provider;
249-
EndpointResolver::EndpointSource("s3", "test-profile", provider, Aws::Http::Scheme::HTTPS);
249+
EndpointResolver::EndpointSource("s3", "test-profile", Aws::Http::Scheme::HTTPS, provider);
250250
EXPECT_TRUE(provider.GetOverriddenEndpoint().empty());
251251
}

tests/aws-cpp-sdk-core-tests/smithy/client/SmithyClientTest.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ struct TestEndPointProvider : public Aws::Endpoint::EndpointProviderBase<>
3232
{
3333
public:
3434
void InitBuiltInParameters(const Aws::Client::GenericClientConfiguration& config) override { AWS_UNREFERENCED_PARAM(config); }
35+
void InitBuiltInParameters(const Aws::Client::GenericClientConfiguration& config, const Aws::String& serviceName) override { AWS_UNREFERENCED_PARAM(config); AWS_UNREFERENCED_PARAM(serviceName); }
3536

3637
void OverrideEndpoint(const Aws::String& endpoint) override { AWS_UNREFERENCED_PARAM(endpoint); }
3738

@@ -387,6 +388,7 @@ struct SampleEndpointProvider : public Aws::Endpoint::EndpointProviderBase<>
387388
{
388389
public:
389390
void InitBuiltInParameters(const Aws::Client::GenericClientConfiguration& config) override { AWS_UNREFERENCED_PARAM(config); }
391+
void InitBuiltInParameters(const Aws::Client::GenericClientConfiguration& config, const Aws::String& serviceName) override { AWS_UNREFERENCED_PARAM(config); AWS_UNREFERENCED_PARAM(serviceName); }
390392

391393
void OverrideEndpoint(const Aws::String& endpoint) override { AWS_UNREFERENCED_PARAM(endpoint); }
392394

0 commit comments

Comments
 (0)