MCPcopy Create free account
hub / github.com/Louisym/MiniCC / auth_source_applies_headers

Function auth_source_applies_headers

rust/crates/api/src/client.rs:975–993  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

973
974 #[test]
975 fn auth_source_applies_headers() {
976 let auth = AuthSource::ApiKeyAndBearer {
977 api_key: "test-key".to_string(),
978 bearer_token: "proxy-token".to_string(),
979 };
980 let request = auth
981 .apply(reqwest::Client::new().post("https://example.test"))
982 .build()
983 .expect("request build");
984 let headers = request.headers();
985 assert_eq!(
986 headers.get("x-api-key").and_then(|v| v.to_str().ok()),
987 Some("test-key")
988 );
989 assert_eq!(
990 headers.get("authorization").and_then(|v| v.to_str().ok()),
991 Some("Bearer proxy-token")
992 );
993 }
994}

Callers

nothing calls this directly

Calls 3

expectMethod · 0.80
applyMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected