aws-sdk-rust
aws-sdk-rust copied to clipboard
Provide easy way to parse s3://foo/bar URI into (bucket,key) pair
Describe the feature
It is common to receive s3 object locations via a URI such as s3://foo/bar. It would be nice if there was some S3Url object that implements FromStr such that I can easily extract the correct bucket and object strings from such a url.
Use Case
I'm always frustrated when I have to rewrite the same "s3 URI" to (bucket , object) parser for every CLI application I write. This involves importing one of the url or http::Uri crates and splitting hostname and path and providing appropriate error handling. Additional several times I messed up by not removing the initial / from the path.
It would be nice if the s3 SDK provided such tooling to make processing s3 URIs more easy.
Proposed Solution
I think some sort of S3Uri object that implements FromStr would be ideal as this integrates nicely into structopt and other CLI tooling.
Other Information
No response
Acknowledgements
- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change
A note for the community
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue, please leave a comment
Can this also support being bi-directional? Going from (bucket, key) <-> uri?
Hey @jmklix I'm new to rust but looking to contribute to a project and increase my rust knowledge. This seems like a good issue to start, do you think I can work on this? Thanks!