Fix https container-credentials endpoints #3584
Open
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.
Description of changes:
I discovered that the Container Credential Provider options behave differently in
aws-sdk-go-v2compared to in boto when supplying anAWS_CONTAINER_CREDENTIALS_FULL_URIendpoint. In golang, the url is allowed to be anyhttpsaddress, whereas in this library, it is constrained to only allowing the special addresses (loopback and metadata ips for ECS/EKS)https://github.com/aws/aws-sdk-go-v2/blob/4bd7f5481eebe1c422fa85d1956f7ea34d93cf76/config/resolve_credentials.go#L318
Note: the golang code specifically checks for
if scheme == http, however the urllib.parse functionality looked like it would happily yield an empty scheme on a url likewww.example.com, whereas in go omitting the scheme is an error. So to be safe I explicitly allow onlyhttps, rather than preserving the logic from the go sdk in a more verbatim way(edit: this is also consistent with aws-sdk-java-v2 and aws-sdk-rust)