Skip to content

fix(imds): Keep data requests on the configured endpoint - #7483

Open
zoewangg wants to merge 1 commit into
masterfrom
zoewang/imds-data-request-endpoint
Open

zoewangg wants to merge 1 commit into
masterfrom
zoewang/imds-data-request-endpoint

Conversation

@zoewangg

Copy link
Copy Markdown
Contributor

Modifications

Validate that the metadata path passed to Ec2MetadataClient#get and Ec2MetadataAsyncClient#get cannot change the scheme, host, or port of the configured IMDS endpoint.

## Changes

1. `Ec2MetadataClient` and `Ec2MetadataAsyncClient` now throw `SdkClientException` from `get` when the path would change the scheme, authority, host, or port of the configured endpoint.
2. The check runs where both clients build the data request, so it applies to every retry of the sync client and to the async client.
3. A null path now throws the same `SdkClientException`.
4. The error message names the configured endpoint and does not include the path or the token.
5. A bugfix changelog entry is added.
@zoewangg
zoewangg requested a review from a team as a code owner October 23, 2026 22:53

This branch has not been deployed

No deployments
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.

2 participants