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

[request] Add support for actix_multipart's Field for SdkBody::from #698

Closed
2 tasks
ghost opened this issue Dec 31, 2022 · 2 comments
Closed
2 tasks

[request] Add support for actix_multipart's Field for SdkBody::from #698

ghost opened this issue Dec 31, 2022 · 2 comments
Labels
feature-request A feature should be added or improved. p3 This is a minor priority issue

Comments

@ghost
Copy link

ghost commented Dec 31, 2022

Describe the feature

Add the ability to upload data directly to S3 from an actix_multipart Field via a new From trait implementation in SdkBody.

Use Case

Currently there's no obvious way to transfer data from a Field directly to S3 with the AWS Rust SDK. If we were able to do this, it would speed up file uploads by not requiring the file to be fully uploaded to the server as a temporary file before then being sent to S3.

Proposed Solution

Create a new impl for the From trait to allow a Field to be wrapped in an SdkBody. This could then be consumed from ByteStream, allowing for data to be passed through from the user agent to S3 without going through a local temporary file.

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
@ghost ghost added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Dec 31, 2022
@rcoh
Copy link
Contributor

rcoh commented Jan 3, 2023

To do this, you can use SdkBody::from_dyn.

To do this, you'd need to do something like this:

// possibly some pinning required?
struct ActixWrapper(Field)

impl http_body::Body<Data=Bytes, Error=Box<dyn Error + Send + Sync> for ActixWrapper {
  // use the `Stream` impl on `Field` to implement `data()` on `http_body::Body`
}

let sdk_body = SdkBody::from_dyn(ActixWrapper(field))

If you build this, it would probably be a helpful addition to aws-smithy-types-convert

@rcoh rcoh removed the needs-triage This issue or PR still needs to be triaged. label Jan 3, 2023
@jmklix jmklix added p2 This is a standard priority issue p3 This is a minor priority issue and removed p2 This is a standard priority issue labels Mar 30, 2023
@jmklix jmklix closed this as completed Apr 26, 2024
Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

2 participants