Skip to content

Conversation

@sbiscigl
Copy link
Contributor

Description of changes:

Adds a check to the region builtin endpoint parameter to make sure the region is a valid host label. This will fail to set the region EP parameter failing endpoints resolution for the client so no call is made.

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sbiscigl sbiscigl force-pushed the region-ep-param-validation branch from 926d384 to 8cb6db0 Compare January 22, 2026 21:33
@sbiscigl sbiscigl marked this pull request as ready for review January 22, 2026 21:33
@sbiscigl sbiscigl force-pushed the region-ep-param-validation branch from 8cb6db0 to a4cdf35 Compare January 22, 2026 21:56
static const char* FIPS_SUFFIX = "-fips";
if (config.region.rfind(FIPS_PREFIX, 0) == 0) {
if (!Aws::Utils::IsValidDnsLabel(config.region)) {
AWS_LOGSTREAM_ERROR(ENDPOINT_BUILTIN_LOG_TAG, "Invalid region name: " << config.region);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sanity check: logstream error causes the function to error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it just logs a failure, since the function returns void, and we have exceptions disabled we cannot return a real "error" from the function. the failure mode is that the region built in parameter region is not set. It fails in endpoint resolution because region is not set. Hypothetically if a endpoints rule set did not require region, resolution would still work.

@sbiscigl sbiscigl force-pushed the region-ep-param-validation branch from 42a9404 to 00d3158 Compare January 23, 2026 18:17
@sbiscigl sbiscigl force-pushed the region-ep-param-validation branch from 00d3158 to 55bb1b9 Compare January 23, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants