diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 57f98b9a..8eb7b5ef 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,9 @@ use envoy_types::ext_authz::v3::pb::AuthorizationServer; +use std::sync::Arc; use tonic::transport::Server; pub mod authorization; -use authorization::CheckService; +use authorization::{CedarAuthorizer, CheckService}; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { @@ -10,8 +11,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { let (_health_reporter, health_service) = tonic_health::server::health_reporter(); + let authorizer = Arc::new(CedarAuthorizer::new()); + let check_service = CheckService::new(authorizer); + Server::builder() - .add_service(AuthorizationServer::new(CheckService::default())) + .add_service(AuthorizationServer::new(check_service)) .add_service(health_service) .add_service( tonic_reflection::server::Builder::configure() |
