Commit Graph
160 Commits
Author SHA1 Message Date
Lucio FrancoandGitHub eba7ec7b32 feat: Add gRPC interceptors (#232)
This change introduces proper gRPC interceptors that are avilable
regardless of the transport used. Each codegen service now produces an
additional method called `with_interceptor` that accepts a
`Interceptor`.

All examples have been updated to use this new style and interop has a
custom `tower::Service` middleware to echo the headers. There is also a
new `interceptor` example that shows basic usage.

BREAKING CHANGE: removed `interceptor_fn` and `intercep_headers_fn` from `transport` in favor of using `tonic::Interceptor`.
2020-01-13 21:26:08 -05:00
Juan AlvarezandLucio Franco 0fa2bf1cea feat(codec): Introduce Decoder/Encoder traits (#208)
BREAKING CHANGE: Add new `Decoder/Encoder` traits and use `EncodeBuf/DecodeBuf` over `BytesMut` directly.
2020-01-13 11:59:19 -05:00
MarcelandLucio Franco dadc8186c2 chore: Upgrade to prost, prost-build and prost-derive 0.6 (#230) (#231) 2020-01-13 09:40:57 -05:00
Lucio FrancoandGitHub af807c3ccd feat(transport): Add server side peer cert support (#228)
* feat(transport): Add server side peer cert support
2020-01-11 14:17:19 -08:00
Lucio FrancoandGitHub 6673f91f1f chore: Remove required bytes dep and clean up deny (#227)
* chore: Remove required bytes dep and clean up deny

* Fix interop test cli args
2020-01-11 12:48:24 -08:00
Lucio FrancoandGitHub 18e944bd28 chore: Update prost codec to not use workaround (#226) 2020-01-11 12:27:00 -08:00
Adam JacobandLucio Franco 8997f47b6d chore: Upgrade to prost master and bytes 0.5 (#224)
This upgrades tonic to prost's master branch, and moves everything to
bytes 0.5.
2020-01-11 11:05:08 -08:00
Lucio FrancoandGitHub a66595bfe3 feat(transport): Add serve_with_incoming_shutdown (#220) 2020-01-08 11:00:57 -05:00
Linus FärnstrandandLucio Franco ec1f37e4b4 fix(transport): Improve Error type (#217) 2020-01-04 14:24:26 -05:00
Juan AlvarezandLucio Franco 49ce265954 chore: Add decode benchmarks (#207)
* disable current benchmarks

* temporarily expose Streaming constructor

* hide Streaming constructor from docs

* remove crossbeam-queue from deny skip list

* add decode benches

* fmt

* use Bytes as MockDecoder Item
2019-12-22 16:51:34 -05:00
Thomas MayandLucio Franco 59d008db7e chore(docs): Fix examples link (#202)
* url is just examples, not tonic-examples

* Change root directory from tonic-examples to examples.  Matches current directory structure.
2019-12-20 22:39:39 -05:00
Lucio FrancoandGitHub 61a770dedf chore: Prepare 0.1.0-beta.1 release (#200)
* chore: Prepare `0.1.0-beta.1` release

* Update changelog

* Fix tower paths
2019-12-19 18:44:25 -05:00
Lucio FrancoandGitHub 8efdbb4631 chore: Use released version of tower (#199)
* chore: Use released version of tower

* Update the rest
2019-12-19 18:31:40 -05:00
Brandon WilliamsandLucio Franco c99d13c6e6 fix(transport): Fix infinite recursion in poll_ready (#192)
b90c340 (feat(transport): Allow custom IO and UDS example (#184),
2019-12-13) changed the Connector type to be more generic instead of
only allowing the HttpConnector type, during this change the
`Service::poll_ready` impl was changed from calling
`MakeConnection::poll_ready` on `self.http` to `self` resulting in
infinite recursion due to the blanket imple of
`MakeConnection::poll_ready` calling `Service::poll_ready`.

This fixes the bug by calling `MakeConnection::poll_ready` on
`self.inner` instead of `self`.

Fixes #191
2019-12-15 18:36:10 -05:00
Lucio FrancoandGitHub 502491a590 fix(transport): Remove with_rustls for tls config (#188) 2019-12-13 20:31:22 -05:00
Lucio FrancoandGitHub 3eb76abf9f feat(transport): Add remote_addr to Request on the server si… (#186) 2019-12-13 20:25:00 -05:00
Lucio FrancoandGitHub 0505dff65a fix(transport): Fix lazily reconnecting (#187)
Closes #167
2019-12-13 20:24:45 -05:00
Lucio FrancoandGitHub b90c340800 feat(transport): Allow custom IO and UDS example (#184)
Closes #136
2019-12-13 17:14:49 -05:00
Lucio FrancoandGitHub 8f1a25278e chore: Remove unused files (#178) 2019-12-11 22:32:48 -05:00
Lucio FrancoandGitHub f46a45401d feat(transport): Add tracing support to server (#175)
* feat(transport): Add tracing to server

* Add tracing example

* Fix duplicate versions of tracing-subscriber
2019-12-11 19:45:11 -05:00
Lucio FrancoandGitHub 1626c2eae0 chore(transport): Clean up server and channel (#174)
* chore(transport): Clean up server and channel

* Fix tls feature compilation
2019-12-11 18:19:11 -05:00
xd009642andLucio Franco 393a57eade feat(transport): Add server graceful shutdown (#169) 2019-12-11 16:07:05 -05:00
Lucio FrancoandGitHub cce550be85 chore: More clean up (#172)
* Clean up client and codec

* Clean up codegen, server and upgrade hyper
2019-12-11 16:05:30 -05:00
Juan AlvarezandLucio Franco 0eb9991b9f feat: expose tcp_nodelay for clients and servers (#145)
* expose tcp_nodelay

* do not depend on difference versions of rand
2019-12-06 17:07:24 -05:00
Philippe GASSMANNandLucio Franco caccfad7e7 feat(transport): Expose tcp keepalive to clients & servers (#151) 2019-12-06 11:56:06 -05:00
Lucio FrancoandGitHub 3387ef900f Upgrade to tokio 0.2 (#163) 2019-12-06 00:09:46 -05:00
Juan AlvarezandLucio Franco f9502dfd7e fix: Sanitize custom metadata (#138) 2019-11-15 13:44:19 +01:00
Juan AlvarezandLucio Franco 997241c43f feat: Add Status constructors (#137)
Co-Authored-By: Lucio Franco <[email protected]>
2019-11-15 13:32:34 +01:00
James NugentandLucio Franco 85060500f3 fix(transport): Remove support for OpenSSL (#141)
BREAKING CHANGE: Remove support for OpenSSL within the transport.
2019-11-15 13:30:42 +01:00
Nicholas BishopandLucio Franco c63c107560 fix(docs): typo in lib.rs (#142) 2019-11-14 23:34:07 +01:00
Juan AlvarezandLucio Franco 85ef18f8b7 fix(transport): Update builders to move self (#132) 2019-11-11 15:27:40 +01:00
Lucio FrancoandGitHub 5fe21f3b24 chore: Prepare alpha.6 release (#130) 2019-11-10 17:40:51 +01:00
Lucio FrancoandGitHub 23e7695800 fix(transport): Load balance connecting panic (#128)
Closes #127
2019-11-10 16:28:05 +01:00
James NugentandLucio Franco ac0e333b39 feat(transport): Add system root anchors for TLS (#114)
As per #101, it is sometimes desirable to use standard web PKI roots for
gRPC clients. This commit adds a method to ClientTlsConfig to add the
trust roots from the system certificate store:

- OpenSSL uses `openssl-probe` to search the system for roots.
- Rustls uses `rustls-native-certs` to load the system roots.

Enabling the `openssl-roots` or `rustls-roots` feature for `tonic` in
`Cargo.toml` will add system roots by default when configuring a gRPC
client.
2019-11-09 16:30:44 +00:00
dominiquelefevreandLucio Franco 029950904a feat(transport): Enable TCP_NODELAY. (#120)
The combination of the Nagle algorithm on a client, and delayed ack on a server
can introduce up to 200ms latency if a small gRPC messages is sent with multiple
writes.

Enable TCP_NODELAY to make sure that neither client, nor server buffer their
messages for too long when exchaning small requests.
2019-11-06 10:55:39 -05:00
Lucio FrancoandGitHub 23f648b517 chore(docs): Add docs about Channel multiplexing (#113)
Signed-off-by: Lucio Franco <[email protected]>
2019-11-03 20:05:21 -05:00
Lucio FrancoandGitHub 3a39b1e7c8 chore: Prepare alpha.5 release (#108)
Signed-off-by: Lucio Franco <[email protected]>
2019-10-31 14:26:35 -04:00
Lucio FrancoandGitHub 5c2f4dba32 feat(transport): Change channel connect to be async (#107)
This makes it so you can check if the initial connection
is established. Before this we used reconnect which would
lazily attempt to connect. So if you were trying to connect
to a non existant Server you wouldn't find out until after
you attempted your first RPC. This simplifies everything
by allowing you connect before creating the RPC client.

BREAKING CHANGE: `Endpoint::channel` was removed in favor of
an async `Endpoint::connect`.
2019-10-31 14:09:40 -04:00
Lucio FrancoandGitHub 3ce61d9860 fix(codec): Enforce encoders/decoders are Sync (#84)
Closes #81
2019-10-30 15:00:31 -04:00
Lucio FrancoandGitHub 5b4f4689a2 feat(transport): Add service multiplexing/routing (#99)
* feat(transport): Add service multiplexing/routing

This change introduces a new "router" built on top of
`transport::Server` that allows one to run multiple
gRPC services on the same socket.

```rust
Server::builder()
    .add_service(greeter)
    .add_service(echo)
    .serve(addr)
    .await?;
```

There is also a new `multiplex` example showcasing
server side service multiplexing and client side
service multiplexing.

BREAKING CHANGES: `Server::serve` is now crate private
and all services must be added via `Server::add_service`.
Codegen also returns just a `Service` now instead of a
`MakeService` pair.

Closes #29

Signed-off-by: Lucio Franco [email protected]
2019-10-29 16:32:04 -04:00
Lucio FrancoandGitHub a17049f1f7 fix(codec): Remove custom content-type (#104)
This removes custom content-types in favor of
just using `application/grpc`. There is some
confusion around the specification but most
grpc implementations ignore the `+` and
anything after.
2019-10-29 16:12:41 -04:00
Juan AlvarezandLucio Franco 4bb087b5ff feat: Add IntoRequest and IntoStreamingRequest traits (#66) 2019-10-29 16:09:08 -04:00
Lucio FrancoandGitHub 77fc74038f chore: Prepare alpha.4 release (#91)
* chore: Prepare alpha.4 release

* Update changelog
2019-10-23 15:09:49 -04:00
John DouglasandLucio Franco 9b0613a16d chore: Add initial benchmarks (#53) 2019-10-22 18:24:25 -04:00
James NugentandLucio Franco 335a373a40 feat(transport): Add support client mTLS (#77)
This commit adds a simple API for specifying the TLS certificate a GRPC
client will present (via the same `Identity` wrapper as a server cert is
configured). It also adds an API to specify which CA certificate client
TLS certificates will be validated against for servers.
2019-10-22 17:00:08 -04:00
Phillip CloudandLucio Franco 9079e0f66b fix(codec): Properly decode partial DATA frames (#83) 2019-10-21 20:01:00 -04:00
James NugentandLucio Franco 2a4bdb24f6 fix(transport): Rename server tls config method (#73)
BREAKING CHANGE: `rustls_client_config` for the server has been renamed to `rustls_server_config`.
2019-10-18 17:28:25 -04:00
Juan AlvarezandLucio Franco 7eda823c9c fix(client): Use Stream instead of TrySteam for client calls (#61) 2019-10-10 11:39:35 -04:00
Lucio FrancoandGitHub 8cddf8a12c chore: Prepare 0.1.0-alpha.3 release (#65) 2019-10-09 17:27:15 -04:00
Phillip CloudandLucio Franco 8ecfd2fc73 chore(transport): Bump hyper and http-body versions (#64) 2019-10-09 17:12:50 -04:00