Skip to content

Deprecate IS_DISCOVERED_ENDPOINT, add SKIP_ENDPOINT_RESOLUTION attribute#7061

Open
jencymaryjoseph wants to merge 1 commit into
feature/master/pre-signed-url-getobjectfrom
jencyjos/pre-signed-url-getobject/deprecate-sdk-internal-attribute
Open

Deprecate IS_DISCOVERED_ENDPOINT, add SKIP_ENDPOINT_RESOLUTION attribute#7061
jencymaryjoseph wants to merge 1 commit into
feature/master/pre-signed-url-getobjectfrom
jencyjos/pre-signed-url-getobject/deprecate-sdk-internal-attribute

Conversation

@jencymaryjoseph

Copy link
Copy Markdown
Contributor

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.

  • SdkInternalExecutionAttribute — Deprecated IS_DISCOVERED_ENDPOINT, added SKIP_ENDPOINT_RESOLUTION with clear semantics: "do not invoke the endpoint provider, use the endpoint already set on the request."
  • BaseClientHandler — Migrated endpoint discovery path to set SKIP_ENDPOINT_RESOLUTION instead of IS_DISCOVERED_ENDPOINT.
  • AwsEndpointProviderUtils.java.resource (codegen template) — Deprecated endpointIsDiscovered(), added skipEndpointResolution() which checks both SKIP_ENDPOINT_RESOLUTION and IS_DISCOVERED_ENDPOINT (OR logic for backward compatibility with any external consumer still setting the old attribute).
  • EndpointResolverInterceptorSpec / RequestEndpointInterceptorSpec — Updated codegen to generate calls to skipEndpointResolution() instead of endpointIsDiscovered().
  • DefaultAsyncPresignedUrlExtension — Replaced IS_DISCOVERED_ENDPOINT with SKIP_ENDPOINT_RESOLUTION, removed TODO.
  • 6 codegen golden test files — Updated to match new generated interceptor code.
  • AwsEndpointProviderUtilsTest — Added test for skipEndpointResolution().

Testing

  • sdk-core — all tests pass
  • codegen — all tests pass (including golden file comparisons for interceptor specs)
  • codegen-generated-classes-test — all tests pass including new skipEndpointResolution test
  • s3 — all tests pass

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

…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
@jencymaryjoseph jencymaryjoseph requested a review from a team as a code owner June 22, 2026 16:42
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: this comment reads a bit funny

ClientExecutionParams executionParams) {
if (executionParams.discoveredEndpoint() != null) {
URI discoveredEndpoint = executionParams.discoveredEndpoint();
executionParams.putExecutionAttribute(SdkInternalExecutionAttribute.IS_DISCOVERED_ENDPOINT, true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we add a test for missing attributes for this?

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