summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-16 10:45:04 -0600
committermo khan <mo@mokhan.ca>2025-07-16 10:45:04 -0600
commit81c6991616ef0f9cd4134d398c5b7cee2c6665de (patch)
treedef5e984db9cb07dcf55d267d108bfb3228974ec /tests
parent0c75a5dc1f3b76c593035f29b422db8c25356325 (diff)
test: start to flush out test for spice authorizer
Diffstat (limited to 'tests')
-rw-r--r--tests/authorization/mod.rs1
-rw-r--r--tests/authorization/spice/authorizer_test.rs18
-rw-r--r--tests/authorization/spice/mod.rs1
3 files changed, 20 insertions, 0 deletions
diff --git a/tests/authorization/mod.rs b/tests/authorization/mod.rs
index 675247d4..7cad6c25 100644
--- a/tests/authorization/mod.rs
+++ b/tests/authorization/mod.rs
@@ -1,3 +1,4 @@
mod cedar_authorizer_test;
mod check_service_test;
mod server_test;
+mod spice;
diff --git a/tests/authorization/spice/authorizer_test.rs b/tests/authorization/spice/authorizer_test.rs
new file mode 100644
index 00000000..b295b64b
--- /dev/null
+++ b/tests/authorization/spice/authorizer_test.rs
@@ -0,0 +1,18 @@
+#[cfg(test)]
+mod tests {
+ use crate::support::factory_bot::*;
+ use authzd::Authorizer;
+
+ #[test]
+ fn test_example() {
+ let authorizer = authzd::authorization::spice::Authorizer::new();
+ let request = build_request(
+ |item: &mut envoy_types::pb::envoy::service::auth::v3::attribute_context::HttpRequest| {
+ item.method = "GET".to_string();
+ item.path = "/".to_string();
+ },
+ );
+
+ assert!(authorizer.authorize(request))
+ }
+}
diff --git a/tests/authorization/spice/mod.rs b/tests/authorization/spice/mod.rs
new file mode 100644
index 00000000..6aa0bfab
--- /dev/null
+++ b/tests/authorization/spice/mod.rs
@@ -0,0 +1 @@
+mod authorizer_test;