From 093c2a626b41f920e6c9fa8efbc6e497761cba10 Mon Sep 17 00:00:00 2001 From: mo khan Date: Fri, 4 Jul 2025 12:46:24 -0600 Subject: feat: allow access to sparkle homepage --- tests/authorization/check_service_test.rs | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'tests') diff --git a/tests/authorization/check_service_test.rs b/tests/authorization/check_service_test.rs index 3f8adec2..0a2997cf 100644 --- a/tests/authorization/check_service_test.rs +++ b/tests/authorization/check_service_test.rs @@ -140,35 +140,29 @@ mod tests { // {status: tonic::Code::PermissionDenied, http: &HTTPRequest{Method: "GET", Path: "/dashboard", Headers: invalidHeaders}}, // {status: tonic::Code::PermissionDenied, http: &HTTPRequest{Method: "POST", Path: "/sparkles"}}, // - // http: Some(HttpRequest { - // id: \"13810813926834082307\", + // http: // method: \"GET\", // headers: { - // \"accept\": \"*/*\", // \":method\": \"GET\", - // \"accept-encoding\": \"gzip, deflate, br, zstd\", - // \"user-agent\": \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36\", - // \"x-request-id\": \"b191fe87-e9b8-458e-b9ec-46d477a62803\", // \":authority\": \"localhost:10000\", // \":path\": \"/sparkles\", - // \"x-forwarded-proto\": \"http\", - // \":scheme\": \"http\", // }, - // header_map: None, // path: \"/sparkles\", // host: \"localhost:10000\", - // scheme: \"http\", - // query: \"\", - // fragment: \"\", - // size: 0, - // protocol: \"HTTP/1.1\", - // body: \"\", - // raw_body: [] let request = tonic::Request::new(build_request(|item: &mut HttpRequest| { let path = String::from("/"); + let method = String::from("GET"); + let host = String::from("sparkle.staging.runway.gitlab.net"); + + item.method = method.clone(); item.path = path.clone(); - item.headers = build_headers(vec![(String::from(":path"), path)]); + item.host = host.clone(); + item.headers = build_headers(vec![ + (String::from(":path"), path), + (String::from(":method"), method), + (String::from(":authority"), host), + ]); })); let response = subject().check(request).await; -- cgit v1.2.3