diff options
Diffstat (limited to 'tests/authorization')
| -rw-r--r-- | tests/authorization/mod.rs | 1 | ||||
| -rw-r--r-- | tests/authorization/spice/authorizer_test.rs | 18 | ||||
| -rw-r--r-- | tests/authorization/spice/mod.rs | 1 |
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; |
