summaryrefslogtreecommitdiff
path: root/tests/authorization
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-10 14:44:54 -0600
committermo khan <mo@mokhan.ca>2025-07-10 14:44:54 -0600
commite92f15ef82339d4d9dc4a04f8dce2599b6ef10da (patch)
tree276706cfddee5d0871153c64eb53399c7273ed88 /tests/authorization
parent04670ecf10906f90cd50c7ff5d6cdc3e6f1f777e (diff)
test: ensure authenticated users that are not in the entities do not have access
Diffstat (limited to 'tests/authorization')
-rw-r--r--tests/authorization/cedar_authorizer_test.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/authorization/cedar_authorizer_test.rs b/tests/authorization/cedar_authorizer_test.rs
index 1a04b6af..f2dfebd4 100644
--- a/tests/authorization/cedar_authorizer_test.rs
+++ b/tests/authorization/cedar_authorizer_test.rs
@@ -94,6 +94,11 @@ mod tests {
let user = build_user("1675940");
let entities = cedar_policy::Entities::from_entities([user], None).unwrap();
let authorizer = subject_with(entities);
- assert!(authorizer.authorize(request));
+ assert!(authorizer.authorize(request.clone()));
+
+ let user = build_user("1");
+ let entities = cedar_policy::Entities::from_entities([user], None).unwrap();
+ let authorizer = subject_with(entities);
+ assert!(!authorizer.authorize(request.clone()));
}
}