From de1f82b30f64a7da1ae16e0b28f1a04475e217d7 Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 16 Jul 2025 08:43:10 -0600 Subject: refactor: move cedar code into a separate module --- tests/authorization/cedar_authorizer_test.rs | 6 ++++-- tests/support/factory_bot.rs | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/authorization/cedar_authorizer_test.rs b/tests/authorization/cedar_authorizer_test.rs index 58563832..b169be7d 100644 --- a/tests/authorization/cedar_authorizer_test.rs +++ b/tests/authorization/cedar_authorizer_test.rs @@ -6,12 +6,14 @@ mod tests { use envoy_types::pb::envoy::service::auth::v3::attribute_context::HttpRequest; use std::collections::HashMap; - fn subject() -> authzd::CedarAuthorizer { + fn subject() -> authzd::authorization::cedar::CedarAuthorizer { common::setup(); subject_with(cedar_policy::Entities::empty()) } - fn subject_with(entities: cedar_policy::Entities) -> authzd::CedarAuthorizer { + fn subject_with( + entities: cedar_policy::Entities, + ) -> authzd::authorization::cedar::CedarAuthorizer { build_cedar_authorizer(entities) } diff --git a/tests/support/factory_bot.rs b/tests/support/factory_bot.rs index ba0d9c38..c3ad781d 100644 --- a/tests/support/factory_bot.rs +++ b/tests/support/factory_bot.rs @@ -37,10 +37,12 @@ pub fn build_headers(headers: Vec<(String, String)>) -> HashMap }) } -pub fn build_cedar_authorizer(entities: cedar_policy::Entities) -> authzd::CedarAuthorizer { +pub fn build_cedar_authorizer( + entities: cedar_policy::Entities, +) -> authzd::authorization::cedar::CedarAuthorizer { let realpath = std::fs::canonicalize("./etc/authzd").unwrap(); let path = realpath.as_path(); - authzd::CedarAuthorizer::new_from(path, entities) + authzd::authorization::cedar::CedarAuthorizer::new_from(path, entities) } pub async fn build_channel(addr: SocketAddr) -> Channel { -- cgit v1.2.3