@@ -6,9 +6,10 @@ through Rust gRPC services.
66Among other use cases, this crate can be used to implement an
77[ Envoy External Authorization] (ExtAuthz) gRPC Server written in Rust.
88
9- [ ![ Crates.io] ( https://img.shields.io/crates/v/envoy-types )] ( https://crates.io/crates/envoy-types )
10- [ ![ Documentation] ( https://docs.rs/envoy-types/badge.svg )] ( https://docs.rs/envoy-types )
11- [ ![ Crates.io] ( https://img.shields.io/crates/l/envoy-types )] ( LICENSE )
9+ [ ![ Crates.io Badge] ( https://img.shields.io/crates/v/envoy-types )] ( https://crates.io/crates/envoy-types )
10+ [ ![ Documentation Badge] ( https://docs.rs/envoy-types/badge.svg )] ( https://docs.rs/envoy-types )
11+ [ ![ License Badge] ( https://img.shields.io/crates/l/envoy-types )] ( LICENSE )
12+ ![ CI Badge] ( https://github.com/flemosr/envoy-types/actions/workflows/ci.yml/badge.svg )
1213
1314[ Examples] | [ Docs]
1415
@@ -37,6 +38,7 @@ including query parameters and header manipulation, can be found at the
3738[ examples] directory.
3839
3940``` rust
41+ use std :: env;
4042use tonic :: {transport :: Server , Request , Response , Status };
4143
4244use envoy_types :: ext_authz :: v3 :: pb :: {
@@ -73,8 +75,9 @@ impl Authorization for MyServer {
7375
7476#[tokio:: main]
7577async fn main () -> Result <(), Box <dyn std :: error :: Error >> {
76- let addr = format! (" 0.0.0.0:50051" ). parse (). unwrap ();
77- let server = MyServer :: default ();
78+ let server_port = env :: var (" SERVER_PORT" ). unwrap_or (" 50051" . into ());
79+ let addr = format! (" 0.0.0.0:{server_port}" ). parse (). unwrap ();
80+ let server = MyServer ;
7881
7982 println! (" AuthorizationServer listening on {addr}" );
8083
@@ -87,9 +90,17 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
8790}
8891```
8992
90- You can check the currently supported version of [ ` tonic ` ] at this crate's
91- [ ` Cargo.toml ` ] file. If you want to work with a previous version, consider
92- using a [ previous version of ` envoy-types ` ] .
93+ ## Compatibility
94+
95+ The table bellow outlines the correspondence between the versions of [ ` tonic ` ]
96+ and the compatible versions of [ ` envoy-types ` ] .
97+
98+ ` tonic ` | ` envoy-types `
99+ :- | :-
100+ v0.12 | [ v0.5] ( https://crates.io/crates/envoy-types/0.5.3 )
101+ v0.11 | [ v0.4] ( https://crates.io/crates/envoy-types/0.4.0 )
102+ v0.10 | [ v0.3] ( https://crates.io/crates/envoy-types/0.3.0 )
103+ v0.9 | [ v0.2] ( https://crates.io/crates/envoy-types/0.2.0 )
93104
94105## License
95106
@@ -104,8 +115,7 @@ terms or conditions.
104115[ Envoy Proxy ] : https://www.envoyproxy.io
105116[ Envoy External Authorization ] : https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/ext_authz_filter
106117[ examples ] : https://github.com/flemosr/envoy-types/tree/main/examples
107- [ `Cargo.toml` ] : https://github.com/flemosr/envoy-types/blob/main/envoy-types/Cargo.toml
108- [ previous version of `envoy-types` ] : https://crates.io/crates/envoy-types/versions
118+ [ `envoy-types` ] : https://crates.io/crates/envoy-types
109119[ Docs ] : https://docs.rs/envoy-types/latest/envoy_types
110120[ protoc-install ] : https://grpc.io/docs/protoc-installation/
111121[ `tonic` ] : https://github.com/hyperium/tonic
0 commit comments