Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hyperium/tonic
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.9.0
Choose a base ref
...
head repository: hyperium/tonic
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.9.1
Choose a head ref
  • 4 commits
  • 20 files changed
  • 2 contributors

Commits on Apr 3, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    893249e View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    darinpope Darin Pope
    Copy the full SHA
    5bcebaf View commit details
  3. chore: Prepare 0.9.1 release (#1343)

    * Update documentation url in cargo tomls
    
    * Bump versions to 0.9.1
    
    * Update guides
    
    * Add prepare/publish scripts
    
    * Update changelog
    LucioFranco authored Apr 3, 2023
    Copy the full SHA
    01cba49 View commit details
  4. Copy the full SHA
    fa06baf View commit details
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# [v0.9.1](https://github.com/hyperium/tonic/compare/v0.9.0...v0.9.1) (2023-04-03)

### Features

- **transport:** Update `rustls` to `0.21` ([#1340](https://github.com/hyperium/tonic/pull/1340))

# [v0.9.0](https://github.com/hyperium/tonic/compare/v0.8.4...v0.9.0) (2023-03-31)

All tonic-* crates owned by this repository will now be versioned together to
4 changes: 2 additions & 2 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -15,9 +15,9 @@ deny = [
{ name = "term" },
]
skip-tree = [
{ name = "rustls-pemfile" },
{ name = "windows-sys" },
{ name = "hermit-abi" },
{ name = "base64" },
{ name = "syn" },
]

@@ -52,7 +52,7 @@ license-files = [
]

[[licenses.clarify]]
name = "webpki"
name = "rustls-webpki"
expression = "ISC"
license-files = [
{ path = "LICENSE", hash = 0x001c7e6c },
6 changes: 3 additions & 3 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
@@ -302,12 +302,12 @@ prost-types = { version = "0.11", optional = true }
http = { version = "0.2", optional = true }
http-body = { version = "0.4.2", optional = true }
hyper = { version = "0.14", optional = true }
warp = { version = "0.3", default-features = false, optional = true }
warp = { version = "0.3.4", default-features = false, optional = true }
listenfd = { version = "1.0", optional = true }
bytes = { version = "1", optional = true }
h2 = { version = "0.3", optional = true }
tokio-rustls = { version = "0.23", optional = true }
hyper-rustls = { version = "0.23", features = ["http2"], optional = true }
tokio-rustls = { version = "0.24.0", optional = true }
hyper-rustls = { version = "0.24.0", features = ["http2"], optional = true }
rustls-pemfile = { version = "1", optional = true }
tower-http = { version = "0.4", optional = true }

4 changes: 2 additions & 2 deletions examples/helloworld-tutorial.md
Original file line number Diff line number Diff line change
@@ -112,12 +112,12 @@ name = "helloworld-client"
path = "src/client.rs"

[dependencies]
tonic = "0.8"
tonic = "0.9"
prost = "0.11"
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }

[build-dependencies]
tonic-build = "0.8"
tonic-build = "0.9"
```

We include `tonic-build` as a useful way to incorporate the generation of our client and server gRPC code into the build process of our application. We will setup this build process now:
4 changes: 2 additions & 2 deletions examples/routeguide-tutorial.md
Original file line number Diff line number Diff line change
@@ -174,7 +174,7 @@ Edit `Cargo.toml` and add all the dependencies we'll need for this example:

```toml
[dependencies]
tonic = "0.8"
tonic = "0.9"
prost = "0.11"
futures-core = "0.3"
futures-util = "0.3"
@@ -187,7 +187,7 @@ serde_json = "1.0"
rand = "0.7"

[build-dependencies]
tonic-build = "0.8"
tonic-build = "0.9"
```

Create a `build.rs` file at the root of your crate:
47 changes: 47 additions & 0 deletions prepare-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/bin/bash

# Script which automates modifying source version fields, and creating a release
# commit and tag. The commit and tag are not automatically pushed, nor are the
# crates published (see publish-release.sh).

set -ex

if [ "$#" -ne 1 ]
then
echo "Usage: $0 <version>"
exit 1
fi

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
VERSION="$1"
MINOR="$( echo ${VERSION} | cut -d\. -f1-2 )"

VERSION_MATCHER="([a-z0-9\\.-]+)"
TONIC_CRATE_MATCHER="(tonic|tonic-[a-z]+)"

# Update the README.md.
sed -i -E "s/${TONIC_CRATE_MATCHER} = \"${VERSION_MATCHER}\"/\1 = \"${MINOR}\"/" "$DIR/examples/helloworld-tutorial.md"
sed -i -E "s/${TONIC_CRATE_MATCHER} = \"${VERSION_MATCHER}\"/\1 = \"${MINOR}\"/" "$DIR/examples/routeguide-tutorial.md"

CRATES=( \
"tonic" \
"tonic-build" \
"tonic-types" \
"tonic-reflection" \
"tonic-health" \
"tonic-web" \
)

for CRATE in "${CRATES[@]}"; do
# Update html_root_url attributes.
sed -i -E "s~html_root_url = \"https://docs\.rs/${TONIC_CRATE_MATCHER}/$VERSION_MATCHER\"~html_root_url = \"https://docs.rs/\1/${VERSION}\"~" \
"$DIR/$CRATE/src/lib.rs"

# Update documentation url in Cargo.toml
sed -i -E "s~documentation = \"https://docs\.rs/$CRATE/$VERSION_MATCHER\"~documentation = \"https://docs.rs/${CRATE}/${VERSION}\"~" \
"$DIR/$CRATE/Cargo.toml"

# Update Cargo.toml version fields.
sed -i -E "s/^version = \"${VERSION_MATCHER}\"$/version = \"${VERSION}\"/" \
"$DIR/$CRATE/Cargo.toml"
done
32 changes: 32 additions & 0 deletions publish-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# Script which automates publishing a crates.io release of the prost crates.

set -ex

if [ "$#" -ne 0 ]
then
echo "Usage: $0"
exit 1
fi

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

CRATES=( \
"tonic" \
"tonic-build" \
"tonic-types" \
"tonic-reflection" \
"tonic-health" \
"tonic-web" \
)

for CRATE in "${CRATES[@]}"; do
pushd "$DIR/$CRATE"

echo "Publishing $CRATE"

cargo publish

popd
done
4 changes: 2 additions & 2 deletions tonic-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -4,15 +4,15 @@ categories = ["network-programming", "asynchronous"]
description = """
Codegen module of `tonic` gRPC implementation.
"""
documentation = "https://docs.rs/tonic-build/0.9.0/tonic_build/"
documentation = "https://docs.rs/tonic-build/0.9.1"
edition = "2021"
homepage = "https://github.com/hyperium/tonic"
keywords = ["rpc", "grpc", "async", "codegen", "protobuf"]
license = "MIT"
name = "tonic-build"
readme = "README.md"
repository = "https://github.com/hyperium/tonic"
version = "0.9.0"
version = "0.9.1"

[dependencies]
prettyplease = { version = "0.1" }
2 changes: 1 addition & 1 deletion tonic-build/src/lib.rs
Original file line number Diff line number Diff line change
@@ -70,7 +70,7 @@
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg"
)]
#![deny(rustdoc::broken_intra_doc_links)]
#![doc(html_root_url = "https://docs.rs/tonic-build/0.9.0")]
#![doc(html_root_url = "https://docs.rs/tonic-build/0.9.1")]
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
#![cfg_attr(docsrs, feature(doc_cfg))]
4 changes: 2 additions & 2 deletions tonic-health/Cargo.toml
Original file line number Diff line number Diff line change
@@ -4,15 +4,15 @@ categories = ["network-programming", "asynchronous"]
description = """
Health Checking module of `tonic` gRPC implementation.
"""
documentation = "https://docs.rs/tonic-health/0.7.0/tonic-health/"
documentation = "https://docs.rs/tonic-health/0.9.1"
edition = "2021"
homepage = "https://github.com/hyperium/tonic"
keywords = ["rpc", "grpc", "async", "healthcheck"]
license = "MIT"
name = "tonic-health"
readme = "README.md"
repository = "https://github.com/hyperium/tonic"
version = "0.9.0"
version = "0.9.1"

[features]
default = ["transport"]
2 changes: 1 addition & 1 deletion tonic-health/src/lib.rs
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg"
)]
#![deny(rustdoc::broken_intra_doc_links)]
#![doc(html_root_url = "https://docs.rs/tonic-health/0.9.0")]
#![doc(html_root_url = "https://docs.rs/tonic-health/0.9.1")]
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
#![cfg_attr(docsrs, feature(doc_cfg))]
4 changes: 2 additions & 2 deletions tonic-reflection/Cargo.toml
Original file line number Diff line number Diff line change
@@ -9,13 +9,13 @@ Server Reflection module of `tonic` gRPC implementation.
"""
edition = "2021"
homepage = "https://github.com/hyperium/tonic"
documentation = "https://docs.rs/tonic-reflection/0.9.0/tonic-reflection/"
documentation = "https://docs.rs/tonic-reflection/0.9.1"
keywords = ["rpc", "grpc", "async", "reflection"]
license = "MIT"
name = "tonic-reflection"
readme = "README.md"
repository = "https://github.com/hyperium/tonic"
version = "0.9.0"
version = "0.9.1"

[dependencies]
prost = "0.11"
2 changes: 1 addition & 1 deletion tonic-reflection/src/lib.rs
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
html_logo_url = "https://github.com/hyperium/tonic/raw/master/.github/assets/tonic-docs.png"
)]
#![deny(rustdoc::broken_intra_doc_links)]
#![doc(html_root_url = "https://docs.rs/tonic-reflection/0.9.0")]
#![doc(html_root_url = "https://docs.rs/tonic-reflection/0.9.1")]
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
#![cfg_attr(docsrs, feature(doc_cfg))]
4 changes: 2 additions & 2 deletions tonic-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -7,15 +7,15 @@ categories = ["web-programming", "network-programming", "asynchronous"]
description = """
A collection of useful protobuf types that can be used with `tonic`.
"""
documentation = "https://docs.rs/tonic-types/0.9.0/tonic_types/"
documentation = "https://docs.rs/tonic-types/0.9.1"
edition = "2021"
homepage = "https://github.com/hyperium/tonic"
keywords = ["rpc", "grpc", "protobuf"]
license = "MIT"
name = "tonic-types"
readme = "README.md"
repository = "https://github.com/hyperium/tonic"
version = "0.9.0"
version = "0.9.1"

[dependencies]
prost = "0.11"
2 changes: 1 addition & 1 deletion tonic-types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -150,7 +150,7 @@
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg"
)]
#![deny(rustdoc::broken_intra_doc_links)]
#![doc(html_root_url = "https://docs.rs/tonic-types/0.9.0")]
#![doc(html_root_url = "https://docs.rs/tonic-types/0.9.1")]
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]

/// Useful protobuf types
4 changes: 2 additions & 2 deletions tonic-web/Cargo.toml
Original file line number Diff line number Diff line change
@@ -4,15 +4,15 @@ categories = ["network-programming", "asynchronous"]
description = """
grpc-web protocol translation for tonic services.
"""
documentation = "https://docs.rs/tonic-web/0.9.0/tonic-web/"
documentation = "https://docs.rs/tonic-web/0.9.1"
edition = "2021"
homepage = "https://github.com/hyperium/tonic"
keywords = ["rpc", "grpc", "grpc-web"]
license = "MIT"
name = "tonic-web"
readme = "README.md"
repository = "https://github.com/hyperium/tonic"
version = "0.9.0"
version = "0.9.1"

[dependencies]
base64 = "0.21"
2 changes: 1 addition & 1 deletion tonic-web/src/lib.rs
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@
rust_2018_idioms,
unreachable_pub
)]
#![doc(html_root_url = "https://docs.rs/tonic-web/0.9.0")]
#![doc(html_root_url = "https://docs.rs/tonic-web/0.9.1")]
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]

pub use layer::GrpcWebLayer;
8 changes: 4 additions & 4 deletions tonic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -13,14 +13,14 @@ categories = ["web-programming", "network-programming", "asynchronous"]
description = """
A gRPC over HTTP/2 implementation focused on high performance, interoperability, and flexibility.
"""
documentation = "https://docs.rs/tonic/0.9.0/tonic/"
documentation = "https://docs.rs/tonic/0.9.1"
edition = "2021"
homepage = "https://github.com/hyperium/tonic"
keywords = ["rpc", "grpc", "async", "futures", "protobuf"]
license = "MIT"
readme = "../README.md"
repository = "https://github.com/hyperium/tonic"
version = "0.9.0"
version = "0.9.1"

[features]
codegen = ["dep:async-trait"]
@@ -80,8 +80,8 @@ axum = {version = "0.6.9", default_features = false, optional = true}
async-stream = { version = "0.3", optional = true }
rustls-pemfile = { version = "1.0", optional = true }
rustls-native-certs = { version = "0.6.1", optional = true }
tokio-rustls = { version = "0.23.1", optional = true }
webpki-roots = { version = "0.22.1", optional = true }
tokio-rustls = { version = "0.24.0", optional = true }
webpki-roots = { version = "0.23.0", optional = true }

# compression
flate2 = {version = "1.0", optional = true}
2 changes: 1 addition & 1 deletion tonic/src/lib.rs
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@
#![doc(
html_logo_url = "https://raw.githubusercontent.com/tokio-rs/website/master/public/img/icons/tonic.svg"
)]
#![doc(html_root_url = "https://docs.rs/tonic/0.9.0")]
#![doc(html_root_url = "https://docs.rs/tonic/0.9.1")]
#![doc(issue_tracker_base_url = "https://github.com/hyperium/tonic/issues/")]
#![doc(test(no_crate_inject, attr(deny(rust_2018_idioms))))]
#![cfg_attr(docsrs, feature(doc_cfg))]
7 changes: 4 additions & 3 deletions tonic/src/transport/service/tls.rs
Original file line number Diff line number Diff line change
@@ -128,14 +128,15 @@ impl TlsAcceptor {
use tokio_rustls::rustls::server::AllowAnyAnonymousOrAuthenticatedClient;
let mut roots = RootCertStore::empty();
rustls_keys::add_certs_from_pem(std::io::Cursor::new(&cert.pem[..]), &mut roots)?;
builder
.with_client_cert_verifier(AllowAnyAnonymousOrAuthenticatedClient::new(roots))
builder.with_client_cert_verifier(
AllowAnyAnonymousOrAuthenticatedClient::new(roots).boxed(),
)
}
(Some(cert), false) => {
use tokio_rustls::rustls::server::AllowAnyAuthenticatedClient;
let mut roots = RootCertStore::empty();
rustls_keys::add_certs_from_pem(std::io::Cursor::new(&cert.pem[..]), &mut roots)?;
builder.with_client_cert_verifier(AllowAnyAuthenticatedClient::new(roots))
builder.with_client_cert_verifier(AllowAnyAuthenticatedClient::new(roots).boxed())
}
};