Repository navigation
AwsSmithyClientT does not pass in m_serviceName param when initialising endpointProvider #3907
Description
Describe the bug
We are trying to upgrade from SDK version 1.11.352 to 1.11.800 and noticed the following:
STS moved to AwsSmithyClientT; its generic initialization omitted m_serviceName, here: m_endpointProvider->InitBuiltInParameters(m_clientConfiguration);.
Endpoint configuration only consults AWS_ENDPOINT_URL_STS and global AWS_ENDPOINT_URL when a service name is supplied.
It looks like
- PR #3236 [release 1.11.483] introduced the Smithy Client initialising without service name.
- PR #3597 [release 1.11.685] added service-aware endpoint initialization and updated ordinary generated clients to pass SERVICE_NAME, but did not update the shared AwsSmithyClientT call.
- PR #3793 [release 1.11.790] Migrated STS from the legacy client to AwsSmithyClientT, making STS inherit the omission. This is where the observable STS regression began.
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
STS clients created through AwsSmithyClientT should honor the standard AWS endpoint override configuration, including the
service-specific AWS_ENDPOINT_URL_STS environment variable and the global AWS_ENDPOINT_URL environment variable.
AwsSmithyClientT should pass its stored service name to the endpoint provider during initialization:
m_endpointProvider->InitBuiltInParameters(
m_clientConfiguration,
m_serviceName
);
This should make STS endpoint resolution behave consistently with the legacy STS client and other generated AWS service
clients.
Current Behavior
AwsSmithyClientT::initClient() calls the one-argument overload:
m_endpointProvider->InitBuiltInParameters(m_clientConfiguration);
Because the stored service name is not supplied, the endpoint provider does not resolve AWS_ENDPOINT_URL_STS or the
global AWS_ENDPOINT_URL.
Starting with 1.11.790, STS uses AwsSmithyClientT, so STS requests ignore these environment-configured endpoint overrides
and instead use the normal AWS STS endpoint. Explicitly setting ClientConfiguration::endpointOverride is unaffected.
Reproduction Steps
#include <memory>
#include <string>
#include <aws/core/Aws.h>
#include <aws/core/auth/AWSCredentials.h>
#include <aws/core/client/GenericClientConfiguration.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/sts/STSClient.h>
#include <aws/sts/STSEndpointProvider.h>
#include <gtest/gtest.h>
namespace {
class AwsApi final {
public:
AwsApi() {
Aws::InitAPI(options);
}
~AwsApi() {
Aws::ShutdownAPI(options);
}
private:
Aws::SDKOptions options;
};
class RecordingStsEndpointProvider final
: public Aws::STS::Endpoint::STSEndpointProvider {
public:
void InitBuiltInParameters(
const Aws::Client::GenericClientConfiguration& config
) override {
++generic_init_calls;
Aws::STS::Endpoint::STSEndpointProvider::
InitBuiltInParameters(config);
}
void InitBuiltInParameters(
const Aws::Client::GenericClientConfiguration& config,
const Aws::String& service_name
) override {
++service_init_calls;
initialized_service_name = service_name.c_str();
Aws::STS::Endpoint::STSEndpointProvider::
InitBuiltInParameters(config, service_name);
}
int generic_init_calls = 0;
int service_init_calls = 0;
std::string initialized_service_name;
};
TEST(
AwsStsEndpointInitializationTest,
SmithyClientPassesServiceNameToEndpointProvider
) {
AwsApi aws_api;
auto endpoint_provider =
std::make_shared<RecordingStsEndpointProvider>();
const Aws::Auth::AWSCredentials credentials(
"test-access-key",
"test-secret-key"
);
const Aws::Client::GenericClientConfiguration config;
const Aws::STS::STSClient client(
credentials,
endpoint_provider,
config
);
EXPECT_EQ(endpoint_provider->service_init_calls, 1);
EXPECT_EQ(endpoint_provider->generic_init_calls, 0);
EXPECT_EQ(endpoint_provider->initialized_service_name, "sts");
}
} // namespace
Possible Solution
Would changing the call in AwsSmithyClientT::initClient() to the following be the intended fix?
m_endpointProvider->InitBuiltInParameters(
m_clientConfiguration,
m_serviceName
Additional Information/Context
No response
AWS CPP SDK version used
1.11.800
Compiler and Version used
GCC/G++ 12.3.0
Operating System and version
Debian GNU/Linux 12 (bookworm)
Activity
Pass service name to Smithy endpoint providers
sbiscigl commentedon Aug 31, 2026
Hey @Renz456 thanks for opening the issue, and i think you are completely correct, running a simple test
with
AWS_ENDPOINT_URL_STS=foobari see it not working/working before and after your change. it seems that when we added support for service specific endpoints we missed smithy based clients. saw you opened a PR lemme take a look at it.sbiscigl commentedon Sep 1, 2026
just as a heads up where we're with it, from running your suggested change on CI it tugged at a thread that showed a lot more was broken then previously thought, so updated your PR with a commit that will address that, after a successful CI run we should be able to merge it
Pass service name to Smithy endpoint providers
Pass service name to Smithy endpoint providers
Renz456 commentedon Sep 1, 2026
Thank you for the quick response + fix :)
sbiscigl commentedon Sep 2, 2026
fix is merged now, should be released today in version
1.11.885, thanks for bringing this up and helping us push a fix!Pass service name to Smithy endpoint providers (aws#3909)
sbiscigl commentedon Sep 2, 2026
its been released as 1.11.885 today, resolving this issue, feel free to open a new one if you find anything!
github-actions commentedon Sep 2, 2026
This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.