summaryrefslogtreecommitdiff
path: root/tests/authorization/cedar_authorizer_test.rs
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-07-14 16:29:33 -0600
committermo khan <mo@mokhan.ca>2025-07-14 16:29:33 -0600
commit0432cfbbb07f234dd2cd294cfe7dfa065b113182 (patch)
treecab9f759b7d656dab92eab48694e5924c54b9644 /tests/authorization/cedar_authorizer_test.rs
parent5a74d3988d8a029f1c879da709db623611aa545a (diff)
parente0b38f6ca22b28a0c4fe4192d642fceb48030737 (diff)
Merge branch 'the-spice-must-flow' into 'main'
Add SpiceDB Integration with Service-based Routing See merge request gitlab-org/software-supply-chain-security/authorization/authzd!9
Diffstat (limited to 'tests/authorization/cedar_authorizer_test.rs')
-rw-r--r--tests/authorization/cedar_authorizer_test.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/authorization/cedar_authorizer_test.rs b/tests/authorization/cedar_authorizer_test.rs
index 7a99a7d9..58563832 100644
--- a/tests/authorization/cedar_authorizer_test.rs
+++ b/tests/authorization/cedar_authorizer_test.rs
@@ -128,4 +128,22 @@ mod tests {
let authorizer = subject();
assert_eq!(authorizer.authorize(request), true);
}
+
+ #[test]
+ fn test_sparkle_dashboard() {
+ let request = build_request(|item: &mut HttpRequest| {
+ item.method = "GET".to_string();
+ item.path = "/dashboard".to_string();
+ item.host = "localhost:10000".to_string();
+ item.headers = build_headers(vec![
+ (String::from("x-jwt-claim-sub"), "1".to_string()),
+ (String::from(":path"), item.path.to_string()),
+ (String::from(":method"), item.method.to_string()),
+ (String::from(":authority"), item.host.to_string()),
+ ]);
+ });
+
+ let authorizer = subject();
+ assert_eq!(authorizer.authorize(request), true);
+ }
}