Deprecate IS_DISCOVERED_ENDPOINT, add SKIP_ENDPOINT_RESOLUTION attribute#7061
Open
jencymaryjoseph wants to merge 1 commit into
Conversation
…ESOLUTION Introduce SKIP_ENDPOINT_RESOLUTION execution attribute with proper semantics for skipping endpoint resolution. The existing IS_DISCOVERED_ENDPOINT attribute was tied to the endpoint discovery feature and was being misused for pre-signed URL operations. - Deprecate IS_DISCOVERED_ENDPOINT in SdkInternalExecutionAttribute - Add SKIP_ENDPOINT_RESOLUTION attribute - Migrate BaseClientHandler to use new attribute - Add skipEndpointResolution() utility with OR fallback for backward compatibility with external consumers of the old attribute - Update codegen interceptors to use skipEndpointResolution() - Update DefaultAsyncPresignedUrlExtension to use new attribute sim: https://taskei.amazon.dev/tasks/JAVA-8374
Fred1155
reviewed
Jun 22, 2026
| b.addStatement("$T result = context.request()", SdkRequest.class); | ||
| // We skip resolution if the source of the endpoint is the endpoint discovery call | ||
| b.beginControlFlow("if ($1T.endpointIsDiscovered(executionAttributes))", | ||
| // We skip resolution if endpoint resolution should be skipped (e.g., endpoint discovery or pre-signed URLs) |
Contributor
There was a problem hiding this comment.
nit: this comment reads a bit funny
| ClientExecutionParams executionParams) { | ||
| if (executionParams.discoveredEndpoint() != null) { | ||
| URI discoveredEndpoint = executionParams.discoveredEndpoint(); | ||
| executionParams.putExecutionAttribute(SdkInternalExecutionAttribute.IS_DISCOVERED_ENDPOINT, true); |
Contributor
There was a problem hiding this comment.
Should we also keep the IS_DISCOVERED_ENDPOINT write for cross-module compatibility? If a customer pins new sdk-core with an older service module, that module's generated endpointIsDiscovered() only checks the old attribute, which would cause unexpected behavior.
| } | ||
|
|
||
| @Test | ||
| public void skipEndpointResolution_skipAttrIsTrue_returnsTrue() { |
Contributor
There was a problem hiding this comment.
Can we add a test for missing attributes for this?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation and Context
The pre-signed URL GET feature needs to skip endpoint resolution for requests where the URL is already fully resolved. The existing SdkInternalExecutionAttribute.IS_DISCOVERED_ENDPOINT was being reused for this purpose, but its semantics are tied to the endpoint discovery feature (cellular routing for services like DynamoDB). Using it for pre-signed URLs is semantically incorrect and confusing.
Modifications
Added SKIP_ENDPOINT_RESOLUTION execution attribute with proper semantics for skipping endpoint resolution, deprecated IS_DISCOVERED_ENDPOINT, and migrated all internal usages to use the new attribute while maintaining backward compatibility via OR fallback.
Testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License