Commit Graph

199 Commits

Author SHA1 Message Date
Phillip Cloud 62101039ce Add rustfmt.toml with edition=2018 (#74)
* Ignore all target/ directories

* Add rustfmt.toml with an edition
2019-10-18 17:30:20 -04:00
James Nugent 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
George Hahn 51ce0b9463 Suggestion: Add edition to example Cargo.toml snippet (#78) 2019-10-17 17:07:54 -04:00
Juan Alvarez 7eda823c9c fix(client): Use Stream instead of TrySteam for client calls (#61) 2019-10-10 11:39:35 -04:00
Lucio Franco 8cddf8a12c chore: Prepare 0.1.0-alpha.3 release (#65) 2019-10-09 17:27:15 -04:00
Phillip Cloud 8ecfd2fc73 chore(transport): Bump hyper and http-body versions (#64) 2019-10-09 17:12:50 -04:00
Adam Jacob 06ff619944 feat(build): Expose prost-build type_attributes and field_attribu… (#60)
* chore: Add tags to .gitignore

When generating ctags/universal-ctags, a 'tags' file is generated. This
commit adds any generted 'tags' file to .gitignore.

* feat(build): Expose type_attribute and field_attribute

This commit exposes the `type_attribute` and `field_attribute`
configuration settings from Prost. These are useful to tweak/extend the
generated types.

For example:

```
tonic_build::configure()
    .out_dir(tmp)
    .format(false)
    .type_attribute(".", "#[derive(Serialize, Deserialize)]")
    .type_attribute(".", "#[serde(rename_all = \"camelCase\")]")
    .field_attribute("in", "#[serde(rename = \"in\")]")
    .compile(&["tests/protos/wellknown.proto"], &["tests/protos"])
    .unwrap();
```

Would add the serde `Serialize` and `Deserialize` traits, while renaming
all the fields to camelCase, and having serde keep fields named `in`
named `in`, rather than Prost's `in_`, to every type generated by Prost.
2019-10-08 18:11:42 -04:00
James Nugent 8db3961491 feat(transport): Expose more granular control of TLS configuration (#48)
This commit reworks TLS configuration of both servers and endpoints in
order to provide a more flexible API. We now add options to configure
the selected TLS library using the appropriate 'native' configuration
structures, as well as retaining the existing simplier interface which
is compatible with both.

The new API can also be easily extended to support simple interfaces for
configuring mTLS and a range of other options without creating sprawl
in the builders for `Server` and `Endpoint`.
2019-10-08 11:49:05 -04:00
Lucio Franco 4628ff0258 chore: Prepare 0.1.0-alpha.2 release (#58)
Signed-off-by: Lucio Franco <luciofranco14@gmail.com>
2019-10-07 22:01:59 -04:00
BradyBromley d13a7b3617 Fixed punctuation in README.md (#55) 2019-10-07 21:56:16 -04:00
Matthew Donoughe 736a537760 add tonic-build to readme (#54) 2019-10-07 21:38:16 -04:00
Dom 412a0bd697 fix(transport): Avoid exit after bad TLS handshake (#51)
* transport: no crash after bad TLS handshake

Prevents the server exiting after a bad TLS handshake / error during
accept(). Instead the connection is dropped and the server continues to
serve new clients.

Previously an error would bubble up from the TLS library (tested with
rustls) and cause hyper to exit with:

	[src/main.rs:85] &e = Error(
		Server,
		Error(
			Accept,
			Custom {
				kind: InvalidData,
				error: CorruptMessage,
			},
		),
	)

* transport: add tracing error for TLS handshake failure

Co-Authored-By: Lucio Franco <luciofranco14@gmail.com>
2019-10-07 21:36:37 -04:00
Lucio Franco 01e72d9a95 chore(build): Fix wrong output type used in replace (#50) 2019-10-05 14:18:13 -04:00
Lucio Franco 4e1fcece15 fix(codegen): Use wellknown types from prost-types (#49)
This change introduces the ability to let prost-build
provide the fully qualifed type path for types that
start with `google.protobuf`.
2019-10-05 13:16:09 -04:00
Lucio Franco ed3e7e95a5 fix(codec): Fix buffer decode panic on full (#43)
* fix(codec): Fix buffer decode panic on full

This is a naive fix for the buffer growing beyond capacity
and producing a panic. Ideally we should do a better job
of not having to allocate for new messages by using
a link list.

* fmt
2019-10-04 19:17:41 -04:00
John Doneth bd2b4e0b77 chore(docs): Documentation corrections (#41) 2019-10-04 16:44:43 -04:00
James Nugent 2c5c3a282a fix(transport): Attempt to load RSA private keys in rustls (#39)
Currently, using an RSA key - or indeed any text which is not a
PEM-encoded PKCS8-format key with RusTLS panics with an index-out-of-
range exception.

This commit introduces two new types of `TlsError` which indicate
problems with loading a certificate or private key:

- `CertificateParseError`, indicating that the certificate cannot be
  parsed

- `PrivateKeyParseError`, indicating that the private key cannot be
  parsed.

Additionally, in the case that reading the private key as PKCS8 fails,
we now try loading it as an RSA key before failing.
2019-10-04 11:31:17 -04:00
John Doneth 2b564aeb06 chore(docs): Add documentation for modified tonic-build output directory (#40)
* improve docs for modified OUT_DIR

* rustfmt
2019-10-04 11:26:53 -04:00
John Doneth 0218d58c28 feat(transport): Expose http/2 settings (#28)
* expose http2 settings

* add client http2 options
2019-10-04 10:08:37 -04:00
Kevin Zhang afa9d9d236 Fix typo in examples readme (#36) 2019-10-03 16:09:39 -04:00
Lucio Franco 4559613c37 feat(codgen): Add default implementations for the generated serve… (#27)
* Rename servce -> server

* Add default impl for server trait
2019-10-02 16:01:44 -04:00
Lucio Franco 2670b349f9 fix(codegen): Fix Empty protobuf type and add unimplemented (#26)
* Add license attribute to tonic-build

* fix(codegen): Fix Empty protobuf type and add unimplemented

* Remove syn full feature
2019-10-01 23:46:54 -04:00
Lucio Franco 2734d3af28 Point tonic to root readme 2019-10-01 22:32:06 -04:00
Lucio Franco c1db64244e Fix spelling of helloworld 2019-10-01 22:15:44 -04:00
Lucio Franco a282b6682d chore(release): Prepare 0.1.0-alpha.1 release (#24) 2019-10-01 22:13:52 -04:00
Lucio Franco 8f80d0f6d1 chore(docs): Update tonic-build docs (#22) 2019-10-01 19:34:45 -04:00
Lucio Franco 09c77d4713 Attempt to make CI work for PRs 2019-10-01 19:27:59 -04:00
Lucio Franco 40973238d6 Add CI workflow (#23)
* Add CI workflow

* Delete interop.yml

* Delete test.yml

* deny warnings

* Fix unused mut
2019-10-01 19:26:17 -04:00
Lucio Franco b8483b92f9 Update logos 2019-10-01 17:53:10 -04:00
Lucio Franco bee8acd8c3 more readme updates 2019-10-01 17:20:22 -04:00
Lucio Franco 8aa4e2a790 Update docs logo 2019-10-01 17:10:00 -04:00
Lucio Franco 08d8795d17 more docs 2019-10-01 17:08:32 -04:00
Lucio Franco ca69b41def more assets and readme cleanup 2019-10-01 16:48:10 -04:00
Lucio Franco e02e814cee more readme cleanup 2019-10-01 16:45:13 -04:00
Lucio Franco 3c1b2e4bb5 more readme updates 2019-10-01 16:40:42 -04:00
Lucio Franco e53fa13457 Update README.md 2019-10-01 16:37:50 -04:00
Lucio Franco 9355292373 add new banner 2019-10-01 16:33:20 -04:00
Lucio Franco 5c3cd1cce4 fm 2019-10-01 16:29:36 -04:00
Juan Alvarez 56e89385b3 Clippy (#20)
* pin all alpha dependencies

* fix some clippy warnings
2019-10-01 15:55:58 -04:00
Juan Alvarez cd0b8424b9 pin all alpha dependencies (#19) 2019-10-01 15:54:32 -04:00
Juan Alvarez d275785c55 Update dependencies (#18)
* update dependencies

* tonic-examples: Lock -> Mutex
2019-10-01 15:04:07 -04:00
Simon Chemouil 02d14da3d6 Fix serde version in examples (#17) 2019-10-01 10:00:29 -04:00
Bhargav 6fe8957fa7 Add note on required dependencies (#16) 2019-09-30 21:55:13 -04:00
Lucio Franco 9af614e5f7 fix examples 2019-09-30 19:36:18 -04:00
Lucio Franco c5042b14c3 Fix tests 2019-09-30 19:13:27 -04:00
Bhargav 1c751d4404 add note on required dependencies (#15)
* add note on required dependencies

* Include build dependencies in codegen
2019-09-30 19:03:07 -04:00
Lucio Franco cb325c69a7 fmt 2019-09-30 14:10:38 -04:00
Lucio Franco 35c2422cf0 Merge branch 'master' of github.com:LucioFranco/tonic 2019-09-30 14:10:33 -04:00
Lucio Franco dd327faee2 add more to cargo toml and fix openssl 2019-09-30 14:10:25 -04:00
John Doneth 3edaa424d9 Include proto macros (#13) 2019-09-30 14:05:37 -04:00