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

Add restXml protocol test for http label escaping #1759

Merged

Conversation

milesziemer
Copy link
Contributor

Issue #, if available:

Description of changes:

Adds an httpRequestTests case to restXml protocol tests to verify that httpLabel bindings in the request URI are percent-encoded. restJson1 had an existing test case for this, but was updated to verify the space character is encoded. An operation was also added to the testing S3 service model with httpRequestTests to verify the same thing, but with S3's virtual host addressing. No other protocols had tests added, because restJson1 and restXml are the only protocols that support httpLabel bindings.

Changes were tested by generating and running protocol tests in aws-sdk-go-v2 and aws-sdk-js-v3, confirming the new test case is generated and runs successfully.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@milesziemer milesziemer requested a review from a team as a code owner May 3, 2023 17:41
],
params: {
Bucket: "mybucket",
Key: "my key.txt"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add another test with a path in the key? Something like foo/bar/my key.txt. I'd expect this to be encoded as foo/bar/my%20key.txt and not foo%2Fbar%2Fmy%20key.txt, is that the case?

Copy link
Contributor Author

@milesziemer milesziemer May 4, 2023

Choose a reason for hiding this comment

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

Your expectation is correct and I agree that's a good test to add, thanks for calling it out. I pushed an update including that test.

@milesziemer milesziemer force-pushed the add-restxml-http-label-encoding-test branch from 2609a30 to 674628e Compare May 4, 2023 17:10
Adds an httpRequestTests case to restXml protocol tests to verify
that httpLabel bindings in the request URI are percent-encoded.
restJson1 had an existing test case for this, but was updated to
verify the space character is encoded. An operation was also added
to the testing S3 service model with httpRequestTests to verify the
same thing, but with S3's virtual host addressing. No other protocols
had tests added, because restJson1 and restXml are the only protocols
that support httpLabel bindings.

Changes were tested by generating and running protocol tests in
aws-sdk-go-v2 and aws-sdk-js-v3, confirming the new test case is
generated and runs successfully.
@milesziemer milesziemer merged commit 4124b2e into smithy-lang:main May 22, 2023
david-perez added a commit to smithy-lang/smithy-rs that referenced this pull request Aug 1, 2023
syall pushed a commit to Xtansia/smithy that referenced this pull request Aug 11, 2023
Adds an httpRequestTests case to restXml protocol tests to verify
that httpLabel bindings in the request URI are percent-encoded.
restJson1 had an existing test case for this, but was updated to
verify the space character is encoded. An operation was also added
to the testing S3 service model with httpRequestTests to verify the
same thing, but with S3's virtual host addressing. No other protocols
had tests added, because restJson1 and restXml are the only protocols
that support httpLabel bindings.

Changes were tested by generating and running protocol tests in
aws-sdk-go-v2 and aws-sdk-js-v3, confirming the new test case is
generated and runs successfully.
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.

3 participants