diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-16 08:43:10 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-16 08:43:10 -0600 |
| commit | de1f82b30f64a7da1ae16e0b28f1a04475e217d7 (patch) | |
| tree | 1fb516f8c6c54a7135946417e894e440d50d1dbb /tests | |
| parent | 2f55a5c8ac137046bc54a57dba33f6887d4ab461 (diff) | |
refactor: move cedar code into a separate module
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/authorization/cedar_authorizer_test.rs | 6 | ||||
| -rw-r--r-- | tests/support/factory_bot.rs | 6 |
2 files changed, 8 insertions, 4 deletions
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<String, String> }) } -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 { |
