summaryrefslogtreecommitdiff
path: root/src/authorization/cedar_authorizer.rs
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-09 16:28:50 -0600
committermo khan <mo@mokhan.ca>2025-07-09 16:28:50 -0600
commitbb20adc3b469ddbd89a881b188dc50bf32658a81 (patch)
tree2738f6b1ab1fe3fc8f2aa8e54d5376701755a5b0 /src/authorization/cedar_authorizer.rs
parent5abf4b1db876161ef028398c9d600dd5ab9f6f6e (diff)
chore: print error when policies cannot be loaded
Diffstat (limited to 'src/authorization/cedar_authorizer.rs')
-rw-r--r--src/authorization/cedar_authorizer.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/authorization/cedar_authorizer.rs b/src/authorization/cedar_authorizer.rs
index 64287414..51061648 100644
--- a/src/authorization/cedar_authorizer.rs
+++ b/src/authorization/cedar_authorizer.rs
@@ -23,7 +23,14 @@ impl CedarAuthorizer {
pub fn new_from(path: &std::path::Path, entities: cedar_policy::Entities) -> CedarAuthorizer {
Self::new(
- Self::load_from(path).unwrap_or_else(|_| cedar_policy::PolicySet::default()),
+ Self::load_from(path).unwrap_or_else(|e| {
+ tracing::error!(
+ path = ?path,
+ error = %e,
+ "Failed to load Cedar policies, using empty policy set"
+ );
+ cedar_policy::PolicySet::default()
+ }),
entities,
)
}