38 Commits

Author SHA1 Message Date
Lucio Franco 1934825ff5 chore: Fix ci tests 2023-04-24 14:52:25 -04:00
Lucio Franco c09fc23088 chore: Fix cargo deny warnings (#1374) 2023-04-24 17:41:43 +00:00
Lucio Franco f276934d22 chore: Add streaming response limit test (#1363) 2023-04-17 15:19:51 +00:00
YiiSh b54ce2321a feat(transport): Addlocal_addr to Request o (#1327) 2023-03-31 17:09:50 +00:00
Lucio Franco ff331199e4 feat(core): Default encoding/decoding limits (#1335)
* feat(core): Default encoding/decoding limits

This PR adds new defaults for both client and server max
encoding/decoding message size limits. By default, the max message
decoding size is `4MB` and the max message encoding size is
`usize::MAX`.

This is follow up work from https://github.com/hyperium/tonic/pull/1274

BREAKING: Default max message encoding/decoding limits

* update generated code
2023-03-30 16:59:08 +00:00
tottoto 838d91aca3 chore: Update to tower-http 0.4 (#1296)
* chore: Update to tower-http 0.4

* chore(tonic): Update to axum 0.6.9
2023-02-27 14:33:14 +00:00
林玮 (Jade Lin) 7a6b20d8ef feat: add GrpcMethod extension into request for client (#1275)
* feat: add GrpcMethod extension into request for client

* refactor: change GrpcMethod fields into private and expose methods instead

* refactor: hide GrpcMethod::new in doc

---------

Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
2023-02-23 10:06:45 +00:00
tottoto b3567a394f chore: Add cargo-machete to detect unused dependencies (#1259) 2023-02-08 09:08:21 -05:00
tottoto bf22a740c3 chore: Update to 2021 edition (#1188) 2022-12-13 15:16:49 -05:00
tottoto 2dd09c02bd chore: Fix clippy lint (#1181) 2022-12-13 11:29:29 -05:00
Lucio Franco ec359ba35f chore: Prepare 0.8 release (#1044) 2022-07-29 16:45:57 -04:00
Quentin Perez 4388d822c4 tonic: Introduce a new method on Endpoint to override the origin (#1013) 2022-06-20 09:29:11 -04:00
David Pedersen 13b55df1d0 chore: update tower-http (#985)
* Update tower-http

* one more update
2022-04-27 15:14:55 +02:00
Conrad Ludgate 4533a6e20e fix(build): Reduce Default bound requirement (#974)
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-04-20 15:38:38 -04:00
Jesse Szwedko c78274e3fe feat: Update prost to 0.10 (#948) 2022-03-30 10:43:06 -04:00
Lucio Franco a197c20469 fix(transport): connect w/ connector infailable (#922) 2022-02-22 15:33:29 -05:00
Sylwester Rąpała c9e78c4d65 chore: Fulfill MIT license requirments (#916) 2022-02-18 13:56:47 -05:00
Anthony Green dee2ab52ff feat(transport): add unix socket support in server (#861) 2022-02-14 15:00:58 -05:00
tottoto daf406dd2b chore: Update tracing-subscriber to 0.3 (#873) 2021-12-30 09:53:02 +01:00
David Pedersen 101f2f76d4 chore: revert to 2018 edition (#847)
Fixes https://github.com/hyperium/tonic/issues/843
2021-12-07 09:49:07 +01:00
Lucio Franco 23c1392fb7 fix(tonic): Remove Sync requirement for streams (#804) 2021-10-24 21:48:05 -04:00
Lucio Franco 1f3df8db9e chore: Upgrade to 2021 edition (#808) 2021-10-24 21:12:20 -04:00
David Freese 4947b076f5 fix(transport): Correctly map hyper errors (#629)
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
2021-10-20 11:05:27 -04:00
Nisheeth Barthwal 2e471548d8 fix(tonic): change connect_lazy to be infallible (#712)
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
2021-10-20 10:47:17 -04:00
Lucio Franco 4054d61e14 fix(tonic): Status code to set correct source on unkown error (#799) 2021-10-19 11:52:59 -04:00
Eliza Weisman 09805ece45 feat: Update prost and friends to 0.9 (#791) 2021-10-19 10:59:28 -04:00
David Pedersen acdb3273bb chore: update prost, and related crates, to 0.8 (#703)
* chore: update prost, and related crates, to 0.8

Updates prost, prost-derive, prost-build, and prost-types to 0.8.

* Update the last few places
2021-07-08 15:02:02 -04:00
Lucio Franco 737ace393d fix(codec): Fix streaming reponses w/ many status (#689)
Closes #681
2021-07-01 10:25:43 -04:00
David Pedersen e5e311853b feat(transport): provide generic access to connect info (#647) 2021-05-28 13:27:37 +02:00
David Pedersen 4d2667d1cb feat(tonic): make it easier to add tower middleware to servers (#651) 2021-05-19 09:19:58 +02:00
David Pedersen 352b0f584b feat(tonic): add Request and Response extensions (#642)
Adds `tonic::Extensions` which is a newtype around `http::Extensions`.

Request extensions can be set by interceptors with
`Request::extensions_mut` and retrieved from RPCs with
`Request::extensions`. Extensions can also be set in tower middleware
and will be carried through to the RPC.

Since response extensions cannot be set by interceptors the main use
case is to set them in RPCs and retrieve them in tower middlewares.
Figured that might be useful.

Fixes https://github.com/hyperium/tonic/issues/255
2021-05-13 15:54:20 +02:00
David Pedersen 9ff4f7b8e4 feat(transport): Support timeouts with "grpc-timeout" header (#606)
* transport: Support timeouts with "grpc-timeout" header

* Apply suggestions from code review

Co-authored-by: Lucio Franco <luciofranco14@gmail.com>

* Timeout -> GrpcTimeout and export TimeoutExpired

* Clean up imports

* Give header name a more proper home

* Add fuzz tests for parsing header value into `grpc-timeout`

* Map `TimeoutExpired` to `cancelled` status

* Recover from timeout errors in the service

* Refactor tests

* Fix CI

* Fix CI, again

Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
2021-04-29 10:28:16 +02:00
Quentin Perez fdda5ae26a Upgrade to Tokio 1.0.0 ecosystem (#530)
* Upgrade Tonic to Tokio 1.0

Work in progress for updating Tonic to Tokio 1.0. Since tower has not
been released to crates.io, a git dependency is taken instead.

* Upgrade Tonic to Tokio 1.0 phase 2

* tonic: remove tower-* deps

* Apply suggestions from code review

Co-authored-by: Ed Marshall <marshaled@protonmail.com>
Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
2021-01-11 12:18:34 -05:00
Juan Alvarez d4899df832 feat(transport): add user-agent header to client requests. (#457)
* Add a default user-agent header to outgoing requests.
* The user agent can be configured through the `Channel` builder.

fixes #453
2020-09-23 18:58:03 -05:00
Juan Alvarez e9910d10a7 fix(transport): reconnect lazy connections after first failure (#458)
* fix(transport): reconnect lazy connections after first failure

Channels created with lazy connections never try to reconnect if the
first connection attempt fails. This is because `Reconnect` returns
`Poll::Ready(Err)` on poll_ready and the service is considered dead.

This change passes a flag to Reconnect to signal if the connection
is intended to be lazy, in which case reconnect returns the error on
the next call.

fixes #452
2020-09-23 09:35:42 -05:00
Lucio Franco 2ea17b2ecf fix(transport): Return connection error on Channel::connect (#413)
Before this fix, if the connect phase of the transport failed before
ever establishing a connection, we would never return the error until
the first call to send a request. This PR changes that behavior to only
forward the error to the call method if we have ever made a connection
before. If we have never established a connection before then
`Reconnect` will return an error on the call to `poll_ready`.

Fixes #403
2020-07-27 12:44:11 -04:00
Dmitry Shuranov 372da52e96 feat: Add metadata to error responses (#348) 2020-05-10 11:46:45 -04:00
Lucio Franco e683ffef1f fix: base64 encode details header (#345) 2020-05-07 15:31:26 -04:00