Issue-3666: fixes IPv6 loopback handling for EKS Pod Identity agent URLs #3680
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue # 3666
Description of changes:
Optimized IPv6 address handling in
GeneralHTTPCredentialsProvider.cpp.When the authority part of a URI contains IPv6 brackets (e.g.,
[fd00:ec2::23]), brackets are removed safely and normalized before any loopback or allowed-host checks.Single-call construction of
Aws::Stringfrom the normalized authority to avoid temporary assignments.Preserves all existing behavior for IPv4, HTTPS, and already-valid IPv6 URIs.
Added clear comments explaining the bracket removal and why it is necessary for loopback checks.
Verified using existing unit tests in
GeneralHTTPCredentialsProviderTest.cpp, specifically:http loopback(v6) URItesthttp link-local EKS URItestThese tests cover bracketed IPv6 addresses and ensure the provider no longer incorrectly rejects valid URIs.
No functional changes beyond fixing invalid rejection of valid HTTP URIs with bracketed IPv6 addresses.
Check all that applies:
Check which platforms you have built SDK on to verify the correctness of this PR:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.