Skip to content

Commit

Permalink
feat: Add HttpRequestStreamingCallbackAny and change abstractions (#…
Browse files Browse the repository at this point in the history
…325)

* feat: Add `HttpRequestStreamingCallbackAny` and change abstractions
Also while we're breaking stuff, get rid of all the string copies everywhere.

* version bump

* cargo fmt + `HttpRequest` changes

Remove `HttpRequest` struct from public interface.
Replace `headers` with iterator.

* update candid

* clippy

* changelog

* changelog

* updates
Responding to feedback.
Adding more tests for enum issue.
Updating candid to soon to be released version.

* typo

* cargo fmt

* use published candid

Co-authored-by: Linwei Shang <[email protected]>
  • Loading branch information
Daniel-Bloom-dfinity and lwshang authored Mar 31, 2022
1 parent 0bc839c commit ee57f0d
Show file tree
Hide file tree
Showing 11 changed files with 452 additions and 105 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.15.0] - 2022-03-28

Updated `ic_utils::interfaces::http_request` structures to use `&str` to reduce copying.

Removed `Deserialize` from `HttpRequest`.

Changed `HttpResponse` to be generic over entire callback instead of just `ArgToken`.

Added `HttpRequestStreamingCallbackAny` to deserialize any callback, regardless of signature.

Added conversion helpers for `HttpResponse`, `StreamingStrategy` and `CallbackStrategy` across generics.

Changes to `Canister<HttpRequestCanister>` interface.

* Made `http_request`, `http_request_update`, and `http_request_stream_callback` more generic and require fewer string copies.
* Added `_custom` variants to enable custom `token` deserialization.

## [0.14.0] - 2022-03-17

Introduced HttpRequestStreamingCallback to work around https://github.com/dfinity/candid/issues/273.
Expand Down
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions ic-agent/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ic-agent"
version = "0.14.0"
version = "0.15.0"
authors = ["DFINITY Stiftung <[email protected]>"]
edition = "2021"
description = "Agent library to communicate with the Internet Computer, following the Public Specification."
Expand Down Expand Up @@ -46,7 +46,7 @@ version = "1.0"
optional = true

[dev-dependencies]
candid = "0.7.10"
candid = "0.7.14"
mockito = "0.30.0"
proptest = "1.0.0"
serde_json = "1.0.74"
Expand Down
8 changes: 4 additions & 4 deletions ic-asset/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ic-asset"
version = "0.14.0"
version = "0.15.0"
authors = ["DFINITY Stiftung <[email protected]>"]
edition = "2021"
description = "Library for storing files in an asset canister."
Expand All @@ -15,15 +15,15 @@ rust-version = "1.58.1"

[dependencies]
anyhow = "1.0"
candid = "0.7.10"
candid = "0.7.14"
flate2 = "1.0.22"
futures = "0.3.19"
futures-intrusive = "0.4.0"
garcon = { version = "0.2", features = ["async"] }
hex = {version = "0.4.2", features = ["serde"] }
ic-agent = { path = "../ic-agent", version = "0.14", features = [ "pem" ] }
ic-agent = { path = "../ic-agent", version = "0.15", features = [ "pem" ] }
ic-types = "0.3.0"
ic-utils = { path = "../ic-utils", version = "0.14" }
ic-utils = { path = "../ic-utils", version = "0.15" }
mime = "0.3.16"
mime_guess = "2.0.3"
openssl = "0.10.38"
Expand Down
4 changes: 2 additions & 2 deletions ic-identity-hsm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ic-identity-hsm"
version = "0.14.0"
version = "0.15.0"
authors = ["DFINITY Stiftung <[email protected]>"]
description = "Identity implementation for HSM for the ic-agent package."
homepage = "https://docs.rs/ic-identity-hsm"
Expand All @@ -15,7 +15,7 @@ rust-version = "1.58.1"

[dependencies]
hex = "0.4.2"
ic-agent = { path = "../ic-agent", version = "0.14", features = [ "pem" ] }
ic-agent = { path = "../ic-agent", version = "0.15", features = [ "pem" ] }
num-bigint = "0.4.3"
openssl = "0.10.38"
pkcs11 = "0.5.0"
Expand Down
6 changes: 3 additions & 3 deletions ic-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ic-utils"
version = "0.14.0"
version = "0.15.0"
authors = ["DFINITY Stiftung <[email protected]>"]
edition = "2021"
description = "Collection of utilities for Rust, on top of ic-agent, to communicate with the Internet Computer, following the Public Specification."
Expand All @@ -17,9 +17,9 @@ rust-version = "1.58.1"

[dependencies]
async-trait = "0.1.40"
candid = "0.7.12"
candid = "0.7.14"
garcon = { version = "0.2", features = ["async"] }
ic-agent = { path = "../ic-agent", version = "0.14" }
ic-agent = { path = "../ic-agent", version = "0.15" }
serde = "1.0.115"
serde_bytes = "0.11"
strum = "0.23"
Expand Down
Loading

0 comments on commit ee57f0d

Please sign in to comment.