Skip to content
  • Landon James's avatar
    d95cc864
    Add `aws-smithy-wasm` crate with WASI http client (#3409) · d95cc864
    Landon James authored
    ## Motivation and Context
    <!--- Why is this change required? What problem does it solve? -->
    <!--- If it fixes an open issue, please link to the issue here -->
    This change adds a new crate, `aws-smithy-wasm`, that exports a SDK
    compatible WASI http client. This is a continuation of the work in #2520
    using the now stabilized WASI 0.2.0 interfaces from the [wasi
    crate](https://crates.io/crates/wasi). This supports, but does not
    finalize the work for #2087
    
    ## Description
    <!--- Describe your changes in detail -->
    
    Add a new crate, `aws-smithy-wasm` which exports a function
    `wasi_http_client` that will provide the user with a WASI compatible
    http client. This client is implemented by using the
    `wasi::http::outgoing_handler`
    [ref](https://docs.rs/wasi/0.12.0+wasi-0.2.0/wasi/http/outgoing_handler/index.html
    
    )
    along with some utility implementations of `TryFrom` to transform back
    and worth between the types from the `http` crate and the `wasi::http`
    types. It also exports a unit struct `WasmSleep` that impls the
    `AsyncSleep` trait needed by the SDK.
    
    ## Testing
    <!--- Please describe in detail how you tested your changes -->
    <!--- Include details of your testing environment, and the tests you ran
    to -->
    <!--- see how your change affects other areas of the code, etc. -->
    This is tested via an integration test in
    `aws/sdk/integration-tests/webassembly` that uses the wasi http-client
    to vuild a config and an operation (that is not sent). It is further
    tested in a new canary (`wasm_canary`) that calls the S3
    `list_objects_v2` API.
    
    ## Checklist
    <!--- If a checkbox below is not applicable, then please DELETE it
    rather than leaving it unchecked -->
    - [X] I have updated `CHANGELOG.next.toml` if I made changes to the
    smithy-rs codegen or runtime crates
    
    ----
    
    _By submitting this pull request, I confirm that you can use, modify,
    copy, and redistribute this contribution, under the terms of your
    choice._
    
    ---------
    
    Co-authored-by: default avatarEduardo Rodrigues <eduardomourar@users.noreply.github.com>
    Co-authored-by: default avatarEduardo de Moura Rodrigues <16357187+eduardomourar@users.noreply.github.com>
    Co-authored-by: default avatarysaito1001 <awsaito@amazon.com>
    Co-authored-by: default avatarJohn DiSanti <jdisanti@amazon.com>
    Co-authored-by: default avatarRussell Cohen <rcoh@amazon.com>
    Co-authored-by: default avatarJohn DiSanti <john@vinylsquid.com>
    d95cc864
    Add `aws-smithy-wasm` crate with WASI http client (#3409)
    Landon James authored
    ## Motivation and Context
    <!--- Why is this change required? What problem does it solve? -->
    <!--- If it fixes an open issue, please link to the issue here -->
    This change adds a new crate, `aws-smithy-wasm`, that exports a SDK
    compatible WASI http client. This is a continuation of the work in #2520
    using the now stabilized WASI 0.2.0 interfaces from the [wasi
    crate](https://crates.io/crates/wasi). This supports, but does not
    finalize the work for #2087
    
    ## Description
    <!--- Describe your changes in detail -->
    
    Add a new crate, `aws-smithy-wasm` which exports a function
    `wasi_http_client` that will provide the user with a WASI compatible
    http client. This client is implemented by using the
    `wasi::http::outgoing_handler`
    [ref](https://docs.rs/wasi/0.12.0+wasi-0.2.0/wasi/http/outgoing_handler/index.html
    
    )
    along with some utility implementations of `TryFrom` to transform back
    and worth between the types from the `http` crate and the `wasi::http`
    types. It also exports a unit struct `WasmSleep` that impls the
    `AsyncSleep` trait needed by the SDK.
    
    ## Testing
    <!--- Please describe in detail how you tested your changes -->
    <!--- Include details of your testing environment, and the tests you ran
    to -->
    <!--- see how your change affects other areas of the code, etc. -->
    This is tested via an integration test in
    `aws/sdk/integration-tests/webassembly` that uses the wasi http-client
    to vuild a config and an operation (that is not sent). It is further
    tested in a new canary (`wasm_canary`) that calls the S3
    `list_objects_v2` API.
    
    ## Checklist
    <!--- If a checkbox below is not applicable, then please DELETE it
    rather than leaving it unchecked -->
    - [X] I have updated `CHANGELOG.next.toml` if I made changes to the
    smithy-rs codegen or runtime crates
    
    ----
    
    _By submitting this pull request, I confirm that you can use, modify,
    copy, and redistribute this contribution, under the terms of your
    choice._
    
    ---------
    
    Co-authored-by: default avatarEduardo Rodrigues <eduardomourar@users.noreply.github.com>
    Co-authored-by: default avatarEduardo de Moura Rodrigues <16357187+eduardomourar@users.noreply.github.com>
    Co-authored-by: default avatarysaito1001 <awsaito@amazon.com>
    Co-authored-by: default avatarJohn DiSanti <jdisanti@amazon.com>
    Co-authored-by: default avatarRussell Cohen <rcoh@amazon.com>
    Co-authored-by: default avatarJohn DiSanti <john@vinylsquid.com>
This project is licensed under the Other. Learn more
Loading