Skip to content

Commit 45961f9

Browse files
committed
added more overrides for setFromClientConfiguration
1 parent ce0d6e6 commit 45961f9

File tree

13 files changed

+110
-41
lines changed

13 files changed

+110
-41
lines changed

generated/src/aws-cpp-sdk-dynamodb/source/DynamoDBEndpointProvider.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ void DynamoDBBuiltInParameters::SetFromClientConfiguration(const DynamoDBClientC
3333
SetStringParameter("AccountIdEndpointMode", config.accountIdEndpointMode);
3434
}
3535
}
36+
3637
} // namespace Endpoint
3738
} // namespace DynamoDB
3839
} // namespace Aws

generated/src/aws-cpp-sdk-s3-crt/include/aws/s3-crt/S3CrtEndpointProvider.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class AWS_S3CRT_API S3CrtBuiltInParameters : public Aws::Endpoint::BuiltInParame
6161
virtual ~S3CrtBuiltInParameters() {};
6262
using Aws::Endpoint::BuiltInParameters::SetFromClientConfiguration;
6363
virtual void SetFromClientConfiguration(const S3CrtClientConfiguration& config);
64+
virtual void SetFromClientConfiguration(const S3CrtClientConfiguration& config, const Aws::String& serviceName);
6465
};
6566

6667
/**

generated/src/aws-cpp-sdk-s3-crt/source/S3CrtEndpointProvider.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,31 @@ void S3CrtBuiltInParameters::SetFromClientConfiguration(const S3CrtClientConfigu
7575
SetBooleanParameter(AWS_S3_DISABLE_EXPRESS_AUTH, true);
7676
}
7777
}
78+
79+
void S3CrtBuiltInParameters::SetFromClientConfiguration(const S3CrtClientConfiguration& config, const Aws::String& serviceName) {
80+
SetFromClientConfiguration(static_cast<const S3CrtClientConfiguration::BaseClientConfigClass&>(config), serviceName);
81+
82+
static const char* AWS_S3_USE_GLOBAL_ENDPOINT = "UseGlobalEndpoint";
83+
if (config.useUSEast1RegionalEndPointOption == US_EAST_1_REGIONAL_ENDPOINT_OPTION::LEGACY) {
84+
SetBooleanParameter(AWS_S3_USE_GLOBAL_ENDPOINT, true);
85+
}
86+
87+
static const char* AWS_S3_USE_ARN_REGION = "UseArnRegion";
88+
SetBooleanParameter(AWS_S3_USE_ARN_REGION, config.useArnRegion);
89+
90+
static const char* AWS_S3_DISABLE_MRAP = "DisableMultiRegionAccessPoints";
91+
SetBooleanParameter(AWS_S3_DISABLE_MRAP, config.disableMultiRegionAccessPoints);
92+
93+
static const char* AWS_S3_FORCE_PATH_STYLE = "ForcePathStyle";
94+
if (!config.useVirtualAddressing) {
95+
SetBooleanParameter(AWS_S3_FORCE_PATH_STYLE, true);
96+
}
97+
98+
static const char* AWS_S3_DISABLE_EXPRESS_AUTH = "DisableS3ExpressSessionAuth";
99+
if (config.disableS3ExpressAuth) {
100+
SetBooleanParameter(AWS_S3_DISABLE_EXPRESS_AUTH, true);
101+
}
102+
}
78103
} // namespace Endpoint
79104
} // namespace S3Crt
80105
} // namespace Aws

generated/src/aws-cpp-sdk-s3/include/aws/s3/S3EndpointProvider.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class AWS_S3_API S3BuiltInParameters : public Aws::Endpoint::BuiltInParameters {
6161
virtual ~S3BuiltInParameters() {};
6262
using Aws::Endpoint::BuiltInParameters::SetFromClientConfiguration;
6363
virtual void SetFromClientConfiguration(const S3ClientConfiguration& config);
64+
virtual void SetFromClientConfiguration(const S3ClientConfiguration& config, const Aws::String& serviceName);
6465
};
6566

6667
/**

generated/src/aws-cpp-sdk-s3/source/S3EndpointProvider.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,31 @@ void S3BuiltInParameters::SetFromClientConfiguration(const S3ClientConfiguration
7575
SetBooleanParameter(AWS_S3_DISABLE_EXPRESS_AUTH, true);
7676
}
7777
}
78+
79+
void S3BuiltInParameters::SetFromClientConfiguration(const S3ClientConfiguration& config, const Aws::String& serviceName) {
80+
SetFromClientConfiguration(static_cast<const S3ClientConfiguration::BaseClientConfigClass&>(config), serviceName);
81+
82+
static const char* AWS_S3_USE_GLOBAL_ENDPOINT = "UseGlobalEndpoint";
83+
if (config.useUSEast1RegionalEndPointOption == US_EAST_1_REGIONAL_ENDPOINT_OPTION::LEGACY) {
84+
SetBooleanParameter(AWS_S3_USE_GLOBAL_ENDPOINT, true);
85+
}
86+
87+
static const char* AWS_S3_USE_ARN_REGION = "UseArnRegion";
88+
SetBooleanParameter(AWS_S3_USE_ARN_REGION, config.useArnRegion);
89+
90+
static const char* AWS_S3_DISABLE_MRAP = "DisableMultiRegionAccessPoints";
91+
SetBooleanParameter(AWS_S3_DISABLE_MRAP, config.disableMultiRegionAccessPoints);
92+
93+
static const char* AWS_S3_FORCE_PATH_STYLE = "ForcePathStyle";
94+
if (!config.useVirtualAddressing) {
95+
SetBooleanParameter(AWS_S3_FORCE_PATH_STYLE, true);
96+
}
97+
98+
static const char* AWS_S3_DISABLE_EXPRESS_AUTH = "DisableS3ExpressSessionAuth";
99+
if (config.disableS3ExpressAuth) {
100+
SetBooleanParameter(AWS_S3_DISABLE_EXPRESS_AUTH, true);
101+
}
102+
}
78103
} // namespace Endpoint
79104
} // namespace S3
80105
} // namespace Aws

generated/src/aws-cpp-sdk-s3control/source/S3ControlEndpointProvider.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ void S3ControlBuiltInParameters::SetFromClientConfiguration(const S3ControlClien
3737
SetStringParameter("AccountId", config.accountId);
3838
}
3939
}
40+
4041
} // namespace Endpoint
4142
} // namespace S3Control
4243
} // namespace Aws

generated/src/aws-cpp-sdk-timestream-query/source/TimestreamQueryEndpointProvider.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ namespace Endpoint {
2626
void TimestreamQueryBuiltInParameters::SetFromClientConfiguration(const TimestreamQueryClientConfiguration& config) {
2727
SetFromClientConfiguration(static_cast<const TimestreamQueryClientConfiguration::BaseClientConfigClass&>(config));
2828
}
29+
2930
} // namespace Endpoint
3031
} // namespace TimestreamQuery
3132
} // namespace Aws

generated/src/aws-cpp-sdk-timestream-write/source/TimestreamWriteEndpointProvider.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ namespace Endpoint {
2626
void TimestreamWriteBuiltInParameters::SetFromClientConfiguration(const TimestreamWriteClientConfiguration& config) {
2727
SetFromClientConfiguration(static_cast<const TimestreamWriteClientConfiguration::BaseClientConfigClass&>(config));
2828
}
29+
2930
} // namespace Endpoint
3031
} // namespace TimestreamWrite
3132
} // namespace Aws

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <aws/core/platform/Environment.h>
1313
#include <aws/core/utils/StringUtils.h>
1414
#include <aws/core/utils/logging/LogMacros.h>
15+
#include <aws/core/http/Scheme.h>
1516

1617
namespace Aws
1718
{
@@ -34,7 +35,8 @@ namespace Aws
3435
template<typename EndpointProviderT>
3536
static void EndpointSource(const Aws::String& serviceId,
3637
const Aws::String& profileName,
37-
EndpointProviderT& endpointProvider)
38+
EndpointProviderT& endpointProvider,
39+
const Aws::Http::Scheme& scheme)
3840
{
3941
const Aws::String serviceKey = ToEnvSuffix(serviceId);
4042
static const char* LOG_TAG = "EndpointResolver";
@@ -64,7 +66,7 @@ namespace Aws
6466
if (!fromEnv.empty()) {
6567
AWS_LOGSTREAM_DEBUG(LOG_TAG, "Resolved configured endpoint from service-specific environment variable: " << service);
6668
AWS_LOGSTREAM_TRACE(LOG_TAG, "Configured endpoint URL: " << fromEnv);
67-
endpointProvider.OverrideEndpoint(fromEnv);
69+
endpointProvider.OverrideEndpoint(fromEnv, scheme);
6870
return;
6971
}
7072
}
@@ -75,7 +77,7 @@ namespace Aws
7577
if (!fromEnv.empty()) {
7678
AWS_LOGSTREAM_DEBUG(LOG_TAG, "Resolved configured endpoint from global environment variable: AWS_ENDPOINT_URL");
7779
AWS_LOGSTREAM_TRACE(LOG_TAG, "Configured endpoint URL: " << fromEnv);
78-
endpointProvider.OverrideEndpoint(fromEnv);
80+
endpointProvider.OverrideEndpoint(fromEnv, scheme);
7981
return;
8082
}
8183
}
@@ -94,7 +96,7 @@ namespace Aws
9496
if (it != endpoints.end() && !it->second.empty()) {
9597
AWS_LOGSTREAM_DEBUG(LOG_TAG, "Resolved configured endpoint from service-specific profile setting for service: " << serviceKey << " in profile: " << profileName);
9698
AWS_LOGSTREAM_TRACE(LOG_TAG, "Configured endpoint URL: " << it->second);
97-
endpointProvider.OverrideEndpoint(it->second);
99+
endpointProvider.OverrideEndpoint(it->second, scheme);
98100
return;
99101
}
100102

@@ -103,7 +105,7 @@ namespace Aws
103105
if (!endpoint.empty()) {
104106
AWS_LOGSTREAM_DEBUG(LOG_TAG, "Resolved configured endpoint from global profile setting in profile: " << profileName);
105107
AWS_LOGSTREAM_TRACE(LOG_TAG, "Configured endpoint URL: " << endpoint);
106-
endpointProvider.OverrideEndpoint(endpoint);
108+
endpointProvider.OverrideEndpoint(endpoint, scheme);
107109
return;
108110
}
109111

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ namespace Endpoint
110110
if (config.region.empty()) {
111111
AWS_LOGSTREAM_WARN(ENDPOINT_BUILTIN_LOG_TAG,
112112
"Endpoint is overridden but region is not set. "
113-
"Region is required my many endpoint rule sets to resolve the endpoint. "
113+
"Region is required by many endpoint rule sets to resolve the endpoint. "
114114
"And it is required to compute an aws signature.");
115115
SetStringParameter(AWS_REGION, "region-not-set");
116116
}
117117
} else if (!serviceName.empty()) {
118-
Aws::Config::EndpointResolver::EndpointSource(serviceName, config.profileName, *this);
118+
Aws::Config::EndpointResolver::EndpointSource(serviceName, config.profileName, *this, config.scheme);
119119
}
120120
}
121121

0 commit comments

Comments
 (0)