Repository navigation
Honor AWS_ENDPOINT_URL_STS for web identity and fix STS endpoint for eusc - #126761
Conversation
|
Workflow [PR], commit [6aba61c] Summary: ✅
AI ReviewSummaryThe PR adds Missing context / blind spots
Findings
Final VerdictStatus: |
| aws_client_configuration.scheme = Aws::Http::Scheme::HTTPS; | ||
| aws_client_configuration.region = std::move(tmp_region); | ||
|
|
||
| if (auto sts_endpoint = Aws::Environment::GetEnv("AWS_ENDPOINT_URL_STS"); !sts_endpoint.empty()) |
There was a problem hiding this comment.
[P2] Preserve the configured-endpoint opt-out
With both AWS_ENDPOINT_URL_STS and AWS_IGNORE_CONFIGURED_ENDPOINT_URLS=true set, this code still forwards the web identity token to the custom endpoint. The same happens with ignore_configured_endpoint_urls=true in the active AWS profile. These opt-outs are checked by the bundled SDK's Aws::Config::EndpointResolver::EndpointSource, but reading the environment directly and assigning endpointOverride bypasses that resolver. An upgrade therefore starts sending tokens to an endpoint that the operator explicitly disabled. Please use the SDK resolver for STS, or preserve its opt-out semantics here, and cover the disabled-override cases. See the AWS endpoint configuration contract.
There was a problem hiding this comment.
This doesn't seem necessary IMO. We want to bypass the resolver, actually, I'll leave a comment and add a test to explain why.
| if (auto sts_endpoint = Aws::Environment::GetEnv("AWS_ENDPOINT_URL_STS"); !sts_endpoint.empty()) | ||
| { | ||
| LOG_INFO(logger, "Using STS endpoint {} from AWS_ENDPOINT_URL_STS", sts_endpoint); | ||
| aws_client_configuration.endpointOverride = std::move(sts_endpoint); |
There was a problem hiding this comment.
[P2] Select the proxy resolver from the STS override scheme
An HTTP override still uses the HTTPS proxy configuration. S3CredentialsProviderChain constructs this configuration with the default https protocol, and ClientFactory::createClientConfiguration captures that protocol's proxy resolver in per_request_configuration. Changing endpointOverride here does not update the callback. For example, with AWS_ENDPOINT_URL_STS=http://minio:9000, http_proxy configured, and https_proxy unset, the STS request goes directly to MinIO instead of through the required HTTP proxy, so credential acquisition fails on networks that require that proxy. Resolve the endpoint before choosing the proxy resolver, or rebuild the proxy callbacks for its scheme, and add coverage with different HTTP/HTTPS proxy settings.
There was a problem hiding this comment.
I don't think this is needed.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units98 translation units recompiled, 803 s compile time in total, 98 of them have a recent master baseline. Median compile-time ratio to the baselines is ×1.05 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio. |
Related: ClickHouse/aws-sdk-cpp#42
Closes: #110699
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Support the
AWS_ENDPOINT_URL_STSenvironment variable for S3 web identity credentials, and use the.amazonaws.euSTS endpoint ineusc-*regions.Workflow [PR]
Sync PR [sync-upstream/pr/126761]
Version info
26.11.1.884-master(included in26.11and later)