use envoy_types::ext_authz::v3::pb::CheckRequest; use std::collections::HashMap; use tonic::Request; pub fn create_test_request_with_headers(headers: HashMap) -> Request { use envoy_types::pb::envoy::service::auth::v3::{AttributeContext, attribute_context}; let http_request = attribute_context::HttpRequest { headers, ..Default::default() }; let request_context = attribute_context::Request { http: Some(http_request), ..Default::default() }; let attributes = AttributeContext { request: Some(request_context), ..Default::default() }; let check_request = CheckRequest { attributes: Some(attributes), ..Default::default() }; Request::new(check_request) } pub fn create_headers_with_auth(auth_value: &str) -> HashMap { let mut headers = HashMap::new(); headers.insert("authorization".to_string(), auth_value.to_string()); headers }