From 2a56b8fa13aef71493959ca9e50b48d806082f33 Mon Sep 17 00:00:00 2001 From: mo khan Date: Sat, 5 Jul 2025 12:49:18 -0600 Subject: refactor: pass the PaC autorizer to the server to allow trying different ones --- src/authorization/server.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/authorization/server.rs') diff --git a/src/authorization/server.rs b/src/authorization/server.rs index feb89d52..759a550d 100644 --- a/src/authorization/server.rs +++ b/src/authorization/server.rs @@ -8,13 +8,13 @@ pub struct Server { } impl Server { - pub fn new() -> Result> { + pub fn new(authorizer: T) -> Result> { let (health_reporter, health_service) = tonic_health::server::health_reporter(); std::mem::drop( health_reporter.set_service_status("", tonic_health::ServingStatus::Serving), ); let authorization_service = - AuthorizationServer::new(CheckService::new(Arc::new(CedarAuthorizer::default()))); + AuthorizationServer::new(CheckService::new(Arc::new(authorizer))); let reflection_service = tonic_reflection::server::Builder::configure() .register_encoded_file_descriptor_set(tonic_health::pb::FILE_DESCRIPTOR_SET) @@ -64,6 +64,6 @@ impl Server { impl Default for Server { fn default() -> Self { - Self::new().unwrap() + Self::new(CedarAuthorizer::default()).unwrap() } } -- cgit v1.2.3