From 3f62c494b29193c0c3eaddf7657db26108590ed9 Mon Sep 17 00:00:00 2001 From: ZhongFuze Date: Thu, 18 Apr 2024 16:41:02 +0800 Subject: [PATCH] [!] add `x-api-key` for proof_client --- config/main.sample.toml | 1 + src/config/mod.rs | 1 + src/upstream/proof_client/mod.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/config/main.sample.toml b/config/main.sample.toml index 61f49e72..908f194c 100644 --- a/config/main.sample.toml +++ b/config/main.sample.toml @@ -11,6 +11,7 @@ port = 3722 [upstream.proof_service] url = "https://proof-service.next.id" +api_key = "x-api-key" [upstream.aggregation_service] url = "https://7x16bogxfb.execute-api.us-east-1.amazonaws.com/v1/identity/search" diff --git a/src/config/mod.rs b/src/config/mod.rs index 0499b415..90ceb59b 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -67,6 +67,7 @@ pub struct ConfigWeb { #[derive(Clone, Deserialize, Default)] pub struct ConfigProofService { pub url: String, + pub api_key: String, } #[derive(Clone, Deserialize, Default)] diff --git a/src/upstream/proof_client/mod.rs b/src/upstream/proof_client/mod.rs index 7071a520..11e3a37c 100644 --- a/src/upstream/proof_client/mod.rs +++ b/src/upstream/proof_client/mod.rs @@ -101,6 +101,7 @@ async fn fetch_connections_by_platform_identity( let req = hyper::Request::builder() .method(Method::GET) .uri(uri) + .header("x-api-key", C.upstream.proof_service.api_key.clone()) .body(Body::empty()) .map_err(|_err| Error::ParamError(format!("Proof Service Build Request Error {}", _err)))?;