diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-04 17:44:34 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-04 17:44:34 -0600 |
| commit | e821b395783f2494f48ad941c606bec615e3b44e (patch) | |
| tree | 1432723b38f979f1bd73a82bc0e16eb972654e32 /tests | |
| parent | c27093125aed8434c16655af7e7f415d84859dc7 (diff) | |
refactor: extract method to convert http request to cedar context
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/authorization/check_service_test.rs | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/tests/authorization/check_service_test.rs b/tests/authorization/check_service_test.rs index 4ff7a89b..73812fa1 100644 --- a/tests/authorization/check_service_test.rs +++ b/tests/authorization/check_service_test.rs @@ -125,7 +125,6 @@ mod tests { #[tokio::test] async fn test_public_sparkle_endpoints() { - // {status: tonic::Code::Ok, http: &HTTPRequest{Method: "GET", Path: "/"}}, // {status: tonic::Code::Ok, http: &HTTPRequest{Method: "GET", Path: "/application.js"}}, // {status: tonic::Code::Ok, http: &HTTPRequest{Method: "GET", Path: "/callback"}}, // {status: tonic::Code::Ok, http: &HTTPRequest{Method: "GET", Path: "/dashboard", Headers: loggedInHeaders}}, @@ -147,12 +146,26 @@ mod tests { // {status: tonic::Code::PermissionDenied, http: &HTTPRequest{Method: "GET", Path: "/dashboard", Headers: invalidHeaders}}, // {status: tonic::Code::PermissionDenied, http: &HTTPRequest{Method: "POST", Path: "/sparkles"}}, - let test_cases = vec![( - "GET", - "/", - "sparkle.staging.runway.gitlab.net", - tonic::Code::Ok, - )]; + let test_cases = vec![ + ( + "GET", + "/", + "sparkle.staging.runway.gitlab.net", + tonic::Code::Ok, + ), + ( + "GET", + "/application.js", + "sparkle.staging.runway.gitlab.net", + tonic::Code::Ok, + ), + ( + "GET", + "/callback", + "sparkle.staging.runway.gitlab.net", + tonic::Code::Ok, + ), + ]; for (method, path, host, expected_status_code) in test_cases { let request = tonic::Request::new(build_request(|item: &mut HttpRequest| { |
