Skip to content

Allowing keys with leading slashes for S3 #1264

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

Merged
merged 2 commits into from
May 28, 2019
Merged

Allowing keys with leading slashes for S3 #1264

merged 2 commits into from
May 28, 2019

Conversation

spfink
Copy link
Contributor

@spfink spfink commented May 22, 2019

S3 allows keys to begin with slashes for unknown reasons. This change allows those keys to work with the SDK and our HTTP clients.

Testing

Added integration test

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 read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed
  • A short description of the change has been added to the CHANGELOG
  • 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

@millems
Copy link
Contributor

millems commented May 23, 2019

Changelog?

@@ -37,7 +37,7 @@
* so that it preserves the path structure.
*/
public static final XmlMarshaller<String> GREEDY_STRING =
new SimplePathMarshaller<>(ValueToStringConverter.FROM_STRING, PathMarshaller.GREEDY);
new SimplePathMarshaller<>(ValueToStringConverter.FROM_STRING, PathMarshaller.GREEDY_WITH_SLASHES);
Copy link
Contributor

Choose a reason for hiding this comment

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

What services are affected by this change? How certain are we that they wouldn't be broken by this?

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 only effects XML services of which none of them currently use the greedy path marshaller.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Other than S3 that is.

public class KeysWithLeadingSlashIntegrationTest extends S3IntegrationTestBase {

private static final String BUCKET = temporaryBucketName(KeysWithLeadingSlashIntegrationTest.class);
private static final String KEY = "/stupidkeywithillegalleadingslashthatsucks";
Copy link
Contributor

Choose a reason for hiding this comment

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

No passive aggression here. Nope.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just a random key name I swear.

@spfink
Copy link
Contributor Author

spfink commented May 24, 2019

I don't like to change the protocol tests as I've done here but I think in this case it's fine.

I've confirmed no other XML service uses the greedy path besides S3 and this is the correct behavior for S3. We shouldn't see any new services use XML. It could effect existing services if they add operations with a greedy path in the future. At that point we could switch this to be an S3 only customization but that would introduce a significant amount of additional handwritten S3 code and a bunch of new codegen customizations.

@codecov-io
Copy link

codecov-io commented May 28, 2019

Codecov Report

Merging #1264 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1264      +/-   ##
============================================
+ Coverage     70.13%   70.15%   +0.01%     
  Complexity      188      188              
============================================
  Files           776      776              
  Lines         24122    24129       +7     
  Branches       1799     1799              
============================================
+ Hits          16919    16927       +8     
  Misses         6419     6419              
+ Partials        784      783       -1
Flag Coverage Δ Complexity Δ
#unittests 70.15% <100%> (+0.01%) 188 <0> (ø) ⬇️
Impacted Files Coverage Δ Complexity Δ
...ml/internal/marshall/SimpleTypePathMarshaller.java 100% <ø> (ø) 2 <0> (ø) ⬇️
...e/amazon/awssdk/protocols/core/PathMarshaller.java 100% <100%> (ø) 0 <0> (ø) ⬇️
...apache/internal/impl/ApacheHttpRequestFactory.java 90.69% <100%> (+0.45%) 0 <0> (ø) ⬇️
...o/netty/internal/http2/HttpOrHttp2ChannelPool.java 79.56% <0%> (+1.07%) 0% <0%> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 34850d5...8bf8492. Read the comment docs.

@spfink spfink merged commit 3049cd5 into master May 28, 2019
@spfink spfink deleted the finks/s3-path branch May 28, 2019 20:38
aws-sdk-java-automation pushed a commit that referenced this pull request Apr 5, 2021
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