Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(endpoint): dedupe clientContext/builtIn params, fix s3 unit test #4051

Merged
merged 3 commits into from Oct 18, 2022

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented Oct 18, 2022

paired with smithy-lang/smithy-typescript#616

  • fix duplication of clientContext and builtIn param names (this is a new bug uncovered by a preview build, previous models did not have duplication).
  • default new parameter names to idiomatic camelCase
  • some test fixes for s3

return Promise.resolve({ output: {} as any, response: {} as any });
};
const client = new S3({ endpoint: "http://localhost:8080/path?foo=bar" });
const client = new S3({ endpoint: "http://localhost:8080/path", forcePathStyle: true });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we no longer test the omission of the query param, because endpoints 2.0 requires that a query param custom endpoint be rejected instead of modified.

"DisableMultiRegionAccessPoints", "disableMultiregionAccessPoints",
"UseArnRegion", "useArnRegion",
"Endpoint", "endpoint",
"UseGlobalEndpoint", "useGlobalEndpoint"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm setting more param names to match our existing param names.
The codegen has also been modified to default to camelCase if this map does not cover future params.

.map(([k, v]) => `${k}=${v}`)
.join("&");
return url;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is to cover deprecated behavior: resolveEndpointConfig.ts changes the endpoint config to return a V1 endpoint for use by Upload and the s3 signer.

Here we convert it back to a URL to enforce consistency in the endpoints 2.0 resolver.

return new URL(value);
} catch (error) {
return null;
}
})();

if (!whatwgURL) {
console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a message here because the endpoints resolved error gives too little info.

@kuhe kuhe merged commit 947c8bc into aws:main Oct 18, 2022
@kuhe kuhe deleted the fix/endpoints-2.0-s3 branch October 18, 2022 19:27
@github-actions
Copy link

github-actions bot commented Nov 2, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants