summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-06-24 14:36:58 -0600
committermo khan <mo@mokhan.ca>2025-06-24 14:36:58 -0600
commit85490a4cfa7f3836d3d2f1e7cbfe48b668aa484b (patch)
tree3fb62e5566ef838187b8568f9e71d0495f24d812 /src/main.rs
parenta0537b163037a92652ec92c1f47945e0572bb76e (diff)
feat: connect check service to a minimal cedar policy
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
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()