From 717e39f58b4b1ec770f791b9425daf8f552b3b21 Mon Sep 17 00:00:00 2001 From: "will.li" <120463031+higherordertech@users.noreply.github.com> Date: Fri, 23 Feb 2024 21:20:26 +1100 Subject: [PATCH] fix: P-507 rename config name discord_litentry_url to litentry_discord_microservice_url, added prod api endpoint for it, and remove twitter_litentry mock and config (#2519) Co-authored-by: higherordertech --- bitacross-worker/docker/docker-compose.yml | 3 +- .../docker/multiworker-docker-compose.yml | 9 ++--- .../scripts/litentry/release/config.json.eg | 3 +- tee-worker/docker/docker-compose.yml | 3 +- .../docker/multiworker-docker-compose.yml | 9 ++--- .../litentry/core/assertion-build/src/a2.rs | 8 ++-- .../litentry/core/assertion-build/src/a3.rs | 6 ++- .../src/generic_discord_role.rs | 5 ++- .../data-providers/src/discord_litentry.rs | 16 ++++---- .../litentry/core/data-providers/src/lib.rs | 24 ++++-------- .../litentry/core/mock-server/src/lib.rs | 2 - .../core/mock-server/src/twitter_litentry.rs | 38 ------------------- tee-worker/local-setup/.env.dev | 3 +- 13 files changed, 39 insertions(+), 90 deletions(-) delete mode 100644 tee-worker/litentry/core/mock-server/src/twitter_litentry.rs diff --git a/bitacross-worker/docker/docker-compose.yml b/bitacross-worker/docker/docker-compose.yml index fedb1e549f..95116de23b 100644 --- a/bitacross-worker/docker/docker-compose.yml +++ b/bitacross-worker/docker/docker-compose.yml @@ -118,10 +118,9 @@ services: environment: - RUST_LOG=info,litentry_worker=debug,ws=warn,sp_io=error,substrate_api_client=warn,itc_parentchain_light_client=info,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=debug,ita_stf=debug,its_rpc_handler=warn,itc_rpc_client=warn,its_consensus_common=debug,its_state=warn,its_consensus_aura=warn,aura*=warn,its_consensus_slots=warn,itp_attestation_handler=debug,http_req=debug,lc_mock_server=warn,itc_rest_client=debug,lc_credentials=debug,lc_identity_verification=debug,lc_stf_task_receiver=debug,lc_stf_task_sender=debug,lc_data_providers=debug,itp_top_pool=debug,itc_parentchain_indirect_calls_executor=debug, - TWITTER_OFFICIAL_URL=http://localhost:19527 - - TWITTER_LITENTRY_URL=http://localhost:19527 - TWITTER_AUTH_TOKEN_V2= - DISCORD_OFFICIAL_URL=http://localhost:19527 - - DISCORD_LITENTRY_URL=http://localhost:19527 + - LITENTRY_DISCORD_MICROSERVICE_URL=http://localhost:19527 - DISCORD_AUTH_TOKEN= - ACHAINABLE_URL=http://localhost:19527 - ACHAINABLE_AUTH_KEY= diff --git a/bitacross-worker/docker/multiworker-docker-compose.yml b/bitacross-worker/docker/multiworker-docker-compose.yml index 081077de84..a3b2c2aa90 100644 --- a/bitacross-worker/docker/multiworker-docker-compose.yml +++ b/bitacross-worker/docker/multiworker-docker-compose.yml @@ -119,10 +119,9 @@ services: environment: - RUST_LOG=info,litentry_worker=debug,ws=warn,sp_io=error,substrate_api_client=warn,itc_parentchain_light_client=info,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=debug,ita_stf=debug,its_rpc_handler=warn,itc_rpc_client=warn,its_consensus_common=debug,its_state=warn,its_consensus_aura=warn,aura*=warn,its_consensus_slots=warn,itp_attestation_handler=debug,http_req=debug,lc_mock_server=warn,itc_rest_client=debug,lc_credentials=debug,lc_identity_verification=debug,lc_stf_task_receiver=debug,lc_stf_task_sender=debug,lc_data_providers=debug,itp_top_pool=debug,itc_parentchain_indirect_calls_executor=debug, - TWITTER_OFFICIAL_URL=http://localhost:19527 - - TWITTER_LITENTRY_URL=http://localhost:19527 - TWITTER_AUTH_TOKEN_V2= - DISCORD_OFFICIAL_URL=http://localhost:19527 - - DISCORD_LITENTRY_URL=http://localhost:19527 + - LITENTRY_DISCORD_MICROSERVICE_URL=http://localhost:19527 - DISCORD_AUTH_TOKEN= - ACHAINABLE_URL=http://localhost:19527 - ACHAINABLE_AUTH_KEY= @@ -169,10 +168,9 @@ services: environment: - RUST_LOG=info,litentry_worker=debug,ws=warn,sp_io=error,substrate_api_client=warn,itc_parentchain_light_client=info,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=debug,ita_stf=debug,its_rpc_handler=warn,itc_rpc_client=warn,its_consensus_common=debug,its_state=warn,its_consensus_aura=warn,aura*=warn,its_consensus_slots=warn,itp_attestation_handler=debug,http_req=debug,lc_mock_server=warn,itc_rest_client=debug,lc_credentials=debug,lc_identity_verification=debug,lc_stf_task_receiver=debug,lc_stf_task_sender=debug,lc_data_providers=debug,itp_top_pool=debug,itc_parentchain_indirect_calls_executor=debug, - TWITTER_OFFICIAL_URL=http://localhost:19527 - - TWITTER_LITENTRY_URL=http://localhost:19527 - TWITTER_AUTH_TOKEN_V2= - DISCORD_OFFICIAL_URL=http://localhost:19527 - - DISCORD_LITENTRY_URL=http://localhost:19527 + - LITENTRY_DISCORD_MICROSERVICE_URL=http://localhost:19527 - DISCORD_AUTH_TOKEN= - ACHAINABLE_URL=http://localhost:19527 - ACHAINABLE_AUTH_KEY= @@ -219,10 +217,9 @@ services: environment: - RUST_LOG=info,litentry_worker=debug,ws=warn,sp_io=error,substrate_api_client=warn,itc_parentchain_light_client=info,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=debug,ita_stf=debug,its_rpc_handler=warn,itc_rpc_client=warn,its_consensus_common=debug,its_state=warn,its_consensus_aura=warn,aura*=warn,its_consensus_slots=warn,itp_attestation_handler=debug,http_req=debug,lc_mock_server=warn,itc_rest_client=debug,lc_credentials=debug,lc_identity_verification=debug,lc_stf_task_receiver=debug,lc_stf_task_sender=debug,lc_data_providers=debug,itp_top_pool=debug,itc_parentchain_indirect_calls_executor=debug, - TWITTER_OFFICIAL_URL=http://localhost:19527 - - TWITTER_LITENTRY_URL=http://localhost:19527 - TWITTER_AUTH_TOKEN_V2= - DISCORD_OFFICIAL_URL=http://localhost:19527 - - DISCORD_LITENTRY_URL=http://localhost:19527 + - LITENTRY_DISCORD_MICROSERVICE_URL=http://localhost:19527 - DISCORD_AUTH_TOKEN= - ACHAINABLE_URL=http://localhost:19527 - ACHAINABLE_AUTH_KEY= diff --git a/bitacross-worker/scripts/litentry/release/config.json.eg b/bitacross-worker/scripts/litentry/release/config.json.eg index acfdbc872a..c655446160 100644 --- a/bitacross-worker/scripts/litentry/release/config.json.eg +++ b/bitacross-worker/scripts/litentry/release/config.json.eg @@ -1,9 +1,8 @@ { "twitter_official_url": "https://api.twitter.com", - "twitter_litentry_url": "", "twitter_auth_token_v2": "abcdefghijklmnopqrstuvwxyz", "discord_official_url": "https://discordapp.com", - "discord_litentry_url": "", + "litentry_discord_microservice_url": "", "discord_auth_token": "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "achainable_url": "https://graph.tdf-labs.io/", "achainable_auth_key": "88888888-4444-4444-4444-1234567890ab", diff --git a/tee-worker/docker/docker-compose.yml b/tee-worker/docker/docker-compose.yml index c9436092d0..938565778b 100644 --- a/tee-worker/docker/docker-compose.yml +++ b/tee-worker/docker/docker-compose.yml @@ -118,10 +118,9 @@ services: environment: - RUST_LOG=info,litentry_worker=debug,ws=warn,sp_io=error,substrate_api_client=warn,itc_parentchain_light_client=info,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=debug,ita_stf=debug,its_rpc_handler=warn,itc_rpc_client=warn,its_consensus_common=debug,its_state=warn,its_consensus_aura=warn,aura*=warn,its_consensus_slots=warn,itp_attestation_handler=debug,http_req=debug,lc_mock_server=warn,itc_rest_client=debug,lc_credentials=debug,lc_identity_verification=debug,lc_stf_task_receiver=debug,lc_stf_task_sender=debug,lc_data_providers=debug,itp_top_pool=debug,itc_parentchain_indirect_calls_executor=debug, - TWITTER_OFFICIAL_URL=http://localhost:19527 - - TWITTER_LITENTRY_URL=http://localhost:19527 - TWITTER_AUTH_TOKEN_V2= - DISCORD_OFFICIAL_URL=http://localhost:19527 - - DISCORD_LITENTRY_URL=http://localhost:19527 + - LITENTRY_DISCORD_MICROSERVICE_URL=http://localhost:19527 - DISCORD_AUTH_TOKEN= - ACHAINABLE_URL=http://localhost:19527 - ACHAINABLE_AUTH_KEY= diff --git a/tee-worker/docker/multiworker-docker-compose.yml b/tee-worker/docker/multiworker-docker-compose.yml index ffc6c7d27c..ce3688afe1 100644 --- a/tee-worker/docker/multiworker-docker-compose.yml +++ b/tee-worker/docker/multiworker-docker-compose.yml @@ -119,10 +119,9 @@ services: environment: - RUST_LOG=info,litentry_worker=debug,ws=warn,sp_io=error,substrate_api_client=warn,itc_parentchain_light_client=info,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=debug,ita_stf=debug,its_rpc_handler=warn,itc_rpc_client=warn,its_consensus_common=debug,its_state=warn,its_consensus_aura=warn,aura*=warn,its_consensus_slots=warn,itp_attestation_handler=debug,http_req=debug,lc_mock_server=warn,itc_rest_client=debug,lc_credentials=debug,lc_identity_verification=debug,lc_stf_task_receiver=debug,lc_stf_task_sender=debug,lc_data_providers=debug,itp_top_pool=debug,itc_parentchain_indirect_calls_executor=debug, - TWITTER_OFFICIAL_URL=http://localhost:19527 - - TWITTER_LITENTRY_URL=http://localhost:19527 - TWITTER_AUTH_TOKEN_V2= - DISCORD_OFFICIAL_URL=http://localhost:19527 - - DISCORD_LITENTRY_URL=http://localhost:19527 + - LITENTRY_DISCORD_MICROSERVICE_URL=http://localhost:19527 - DISCORD_AUTH_TOKEN= - ACHAINABLE_URL=http://localhost:19527 - ACHAINABLE_AUTH_KEY= @@ -171,10 +170,9 @@ services: environment: - RUST_LOG=info,litentry_worker=debug,ws=warn,sp_io=error,substrate_api_client=warn,itc_parentchain_light_client=info,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=debug,ita_stf=debug,its_rpc_handler=warn,itc_rpc_client=warn,its_consensus_common=debug,its_state=warn,its_consensus_aura=warn,aura*=warn,its_consensus_slots=warn,itp_attestation_handler=debug,http_req=debug,lc_mock_server=warn,itc_rest_client=debug,lc_credentials=debug,lc_identity_verification=debug,lc_stf_task_receiver=debug,lc_stf_task_sender=debug,lc_data_providers=debug,itp_top_pool=debug,itc_parentchain_indirect_calls_executor=debug, - TWITTER_OFFICIAL_URL=http://localhost:19527 - - TWITTER_LITENTRY_URL=http://localhost:19527 - TWITTER_AUTH_TOKEN_V2= - DISCORD_OFFICIAL_URL=http://localhost:19527 - - DISCORD_LITENTRY_URL=http://localhost:19527 + - LITENTRY_DISCORD_MICROSERVICE_URL=http://localhost:19527 - DISCORD_AUTH_TOKEN= - ACHAINABLE_URL=http://localhost:19527 - ACHAINABLE_AUTH_KEY= @@ -223,10 +221,9 @@ services: environment: - RUST_LOG=info,litentry_worker=debug,ws=warn,sp_io=error,substrate_api_client=warn,itc_parentchain_light_client=info,jsonrpsee_ws_client=warn,jsonrpsee_ws_server=warn,enclave_runtime=debug,ita_stf=debug,its_rpc_handler=warn,itc_rpc_client=warn,its_consensus_common=debug,its_state=warn,its_consensus_aura=warn,aura*=warn,its_consensus_slots=warn,itp_attestation_handler=debug,http_req=debug,lc_mock_server=warn,itc_rest_client=debug,lc_credentials=debug,lc_identity_verification=debug,lc_stf_task_receiver=debug,lc_stf_task_sender=debug,lc_data_providers=debug,itp_top_pool=debug,itc_parentchain_indirect_calls_executor=debug, - TWITTER_OFFICIAL_URL=http://localhost:19527 - - TWITTER_LITENTRY_URL=http://localhost:19527 - TWITTER_AUTH_TOKEN_V2= - DISCORD_OFFICIAL_URL=http://localhost:19527 - - DISCORD_LITENTRY_URL=http://localhost:19527 + - LITENTRY_DISCORD_MICROSERVICE_URL=http://localhost:19527 - DISCORD_AUTH_TOKEN= - ACHAINABLE_URL=http://localhost:19527 - ACHAINABLE_AUTH_KEY= diff --git a/tee-worker/litentry/core/assertion-build/src/a2.rs b/tee-worker/litentry/core/assertion-build/src/a2.rs index 191777cb49..4307645078 100644 --- a/tee-worker/litentry/core/assertion-build/src/a2.rs +++ b/tee-worker/litentry/core/assertion-build/src/a2.rs @@ -25,7 +25,7 @@ use lc_data_providers::{ discord_litentry::DiscordLitentryClient, vec_to_string, DataProviderConfig, }; -const VC_A2_SUBJECT_DESCRIPTION: &str = "The user is a member of Litentry Discord. +const VC_A2_SUBJECT_DESCRIPTION: &str = "The user is a member of Litentry Discord. Server link: https://discord.gg/phBSa3eMX9 Guild ID: 807161594245152800."; const VC_A2_SUBJECT_TYPE: &str = "Litentry Discord Member"; @@ -44,7 +44,8 @@ pub fn build( Error::RequestVCFailed(Assertion::A2(guild_id.clone()), ErrorDetail::ParseError) })?; - let mut client = DiscordLitentryClient::new(&data_provider_config.discord_litentry_url); + let mut client = + DiscordLitentryClient::new(&data_provider_config.litentry_discord_microservice_url); for identity in &req.identities { if let Identity::Discord(address) = &identity.0 { discord_cnt += 1; @@ -94,7 +95,8 @@ mod tests { #[test] fn build_a2_works() { let mut data_provider_config = DataProviderConfig::new(); - data_provider_config.set_discord_litentry_url("http://localhost:19527".to_string()); + data_provider_config + .set_litentry_discord_microservice_url("http://localhost:19527".to_string()); let guild_id_u: u64 = 919848390156767232; let guild_id_vec: Vec = format!("{}", guild_id_u).as_bytes().to_vec(); diff --git a/tee-worker/litentry/core/assertion-build/src/a3.rs b/tee-worker/litentry/core/assertion-build/src/a3.rs index 9e43923fba..0f2bad9a2f 100644 --- a/tee-worker/litentry/core/assertion-build/src/a3.rs +++ b/tee-worker/litentry/core/assertion-build/src/a3.rs @@ -59,7 +59,8 @@ pub fn build( ) })?; - let mut client = DiscordLitentryClient::new(&data_provider_config.discord_litentry_url); + let mut client = + DiscordLitentryClient::new(&data_provider_config.litentry_discord_microservice_url); for identity in &req.identities { if let Identity::Discord(address) = &identity.0 { let resp = client @@ -117,7 +118,8 @@ mod tests { #[test] fn build_a3_works() { let mut data_provider_config = DataProviderConfig::new(); - data_provider_config.set_discord_litentry_url("http://localhost:19527".to_string()); + data_provider_config + .set_litentry_discord_microservice_url("http://localhost:19527".to_string()); let guild_id_u: u64 = 919848390156767232; let channel_id_u: u64 = 919848392035794945; let role_id_u: u64 = 1034083718425493544; diff --git a/tee-worker/litentry/core/assertion-build/src/generic_discord_role.rs b/tee-worker/litentry/core/assertion-build/src/generic_discord_role.rs index cadb2ef9e2..e460b7a324 100644 --- a/tee-worker/litentry/core/assertion-build/src/generic_discord_role.rs +++ b/tee-worker/litentry/core/assertion-build/src/generic_discord_role.rs @@ -38,7 +38,8 @@ pub fn build( })?; let mut has_role_value = false; - let mut client = DiscordLitentryClient::new(&data_provider_config.discord_litentry_url); + let mut client = + DiscordLitentryClient::new(&data_provider_config.litentry_discord_microservice_url); for identity in &req.identities { if let Identity::Discord(address) = &identity.0 { let resp = @@ -110,7 +111,7 @@ mod tests { let url = run(0).unwrap(); let mut data_provider_conifg = DataProviderConfig::new(); - data_provider_conifg.set_discord_litentry_url(url); + data_provider_conifg.set_litentry_discord_microservice_url(url); data_provider_conifg.set_contest_legend_discord_role_id("1034083718425493544".to_string()); data_provider_conifg.set_sora_quiz_attendee_id("1034083718425493544".to_string()); data_provider_conifg diff --git a/tee-worker/litentry/core/data-providers/src/discord_litentry.rs b/tee-worker/litentry/core/data-providers/src/discord_litentry.rs index 129f5ce55e..302013aaa7 100644 --- a/tee-worker/litentry/core/data-providers/src/discord_litentry.rs +++ b/tee-worker/litentry/core/data-providers/src/discord_litentry.rs @@ -17,11 +17,11 @@ #[cfg(all(not(feature = "std"), feature = "sgx"))] use crate::sgx_reexport_prelude::*; -use crate::{build_client, vec_to_string, Error, HttpError}; +use crate::{build_client_with_cert, vec_to_string, Error, HttpError}; use http::header::CONNECTION; use http_req::response::Headers; use itc_rest_client::{ - http_client::{DefaultSend, HttpClient}, + http_client::{HttpClient, SendWithCertificateVerification}, rest_client::RestClient, RestGet, RestPath, }; @@ -50,14 +50,14 @@ impl RestPath for DiscordResponse { } pub struct DiscordLitentryClient { - client: RestClient>, + client: RestClient>, } impl DiscordLitentryClient { pub fn new(url: &str) -> Self { let mut headers = Headers::new(); headers.insert(CONNECTION.as_str(), "close"); - let client = build_client(url, headers); + let client = build_client_with_cert(url, headers); DiscordLitentryClient { client } } @@ -162,7 +162,7 @@ mod tests { let _ = env_logger::builder().is_test(true).try_init(); let url = run(0).unwrap(); let mut data_provider_config = DataProviderConfig::new(); - data_provider_config.set_discord_litentry_url(url); + data_provider_config.set_litentry_discord_microservice_url(url); data_provider_config } @@ -171,7 +171,8 @@ mod tests { let data_provider_config = init(); let guild_id = "919848390156767232".as_bytes().to_vec(); let handler = "againstwar".as_bytes().to_vec(); - let mut client = DiscordLitentryClient::new(&data_provider_config.discord_litentry_url); + let mut client = + DiscordLitentryClient::new(&data_provider_config.litentry_discord_microservice_url); let response = client.check_join(guild_id, handler); assert!(response.is_ok(), "check join discord error: {:?}", response); } @@ -183,7 +184,8 @@ mod tests { let channel_id = "919848392035794945".as_bytes().to_vec(); let role_id = "1034083718425493544".as_bytes().to_vec(); let handler = "ericzhang.eth".as_bytes().to_vec(); - let mut client = DiscordLitentryClient::new(&data_provider_config.discord_litentry_url); + let mut client = + DiscordLitentryClient::new(&data_provider_config.litentry_discord_microservice_url); let response = client.check_id_hubber(guild_id, channel_id, role_id, handler); assert!(response.is_ok(), "check discord id hubber error: {:?}", response); } diff --git a/tee-worker/litentry/core/data-providers/src/lib.rs b/tee-worker/litentry/core/data-providers/src/lib.rs index e6e4050773..6d9cbebcb9 100644 --- a/tee-worker/litentry/core/data-providers/src/lib.rs +++ b/tee-worker/litentry/core/data-providers/src/lib.rs @@ -169,10 +169,9 @@ impl TokenFromString for ETokenAddress { #[derive(PartialEq, Eq, Clone, Encode, Decode, Serialize, Deserialize, Debug)] pub struct DataProviderConfig { pub twitter_official_url: String, - pub twitter_litentry_url: String, pub twitter_auth_token_v2: String, pub discord_official_url: String, - pub discord_litentry_url: String, + pub litentry_discord_microservice_url: String, pub discord_auth_token: String, pub achainable_url: String, pub achainable_auth_key: String, @@ -215,10 +214,10 @@ impl DataProviderConfig { // default prod config let mut config = DataProviderConfig { twitter_official_url: "https://api.twitter.com".to_string(), - twitter_litentry_url: "http://127.0.0.1:9527”".to_string(), twitter_auth_token_v2: "".to_string(), discord_official_url: "https://discordapp.com".to_string(), - discord_litentry_url: "http://127.0.0.1:9527”".to_string(), + litentry_discord_microservice_url: "https://tee-microservice.litentry.io:9528" + .to_string(), discord_auth_token: "".to_string(), achainable_url: "https://label-production.graph.tdf-labs.io/".to_string(), achainable_auth_key: "".to_string(), @@ -255,14 +254,11 @@ impl DataProviderConfig { if let Ok(v) = env::var("TWITTER_OFFICIAL_URL") { config.set_twitter_official_url(v); } - if let Ok(v) = env::var("TWITTER_LITENTRY_URL") { - config.set_twitter_litentry_url(v); - } if let Ok(v) = env::var("DISCORD_OFFICIAL_URL") { config.set_discord_official_url(v); } - if let Ok(v) = env::var("DISCORD_LITENTRY_URL") { - config.set_discord_litentry_url(v); + if let Ok(v) = env::var("LITENTRY_DISCORD_MICROSERVICE_URL") { + config.set_litentry_discord_microservice_url(v); } if let Ok(v) = env::var("ACHAINABLE_URL") { config.set_achainable_url(v); @@ -356,10 +352,6 @@ impl DataProviderConfig { debug!("set_twitter_official_url: {:?}", v); self.twitter_official_url = v; } - pub fn set_twitter_litentry_url(&mut self, v: String) { - debug!("set_twitter_litentry_url: {:?}", v); - self.twitter_litentry_url = v; - } pub fn set_twitter_auth_token_v2(&mut self, v: String) { debug!("set_twitter_auth_token_v2: {:?}", v); self.twitter_auth_token_v2 = v; @@ -368,9 +360,9 @@ impl DataProviderConfig { debug!("set_discord_official_url: {:?}", v); self.discord_official_url = v; } - pub fn set_discord_litentry_url(&mut self, v: String) { - debug!("set_discord_litentry_url: {:?}", v); - self.discord_litentry_url = v; + pub fn set_litentry_discord_microservice_url(&mut self, v: String) { + debug!("set_litentry_discord_microservice_url: {:?}", v); + self.litentry_discord_microservice_url = v; } pub fn set_discord_auth_token(&mut self, v: String) { debug!("set_discord_auth_token: {:?}", v); diff --git a/tee-worker/litentry/core/mock-server/src/lib.rs b/tee-worker/litentry/core/mock-server/src/lib.rs index 7d50adcc4e..d725b79ed5 100644 --- a/tee-worker/litentry/core/mock-server/src/lib.rs +++ b/tee-worker/litentry/core/mock-server/src/lib.rs @@ -28,7 +28,6 @@ pub mod karat_dao; pub mod litentry_archive; pub mod moralis; pub mod nodereal_jsonrpc; -pub mod twitter_litentry; pub mod twitter_official; pub mod vip3; @@ -60,7 +59,6 @@ pub fn run(port: u16) -> Result { .or(twitter_official::query_retweeted_by()) .or(twitter_official::query_user_by_name()) .or(twitter_official::query_user_by_id()) - .or(twitter_litentry::check_follow()) .or(discord_official::query_message()) .or(discord_litentry::check_id_hubber()) .or(discord_litentry::check_join()) diff --git a/tee-worker/litentry/core/mock-server/src/twitter_litentry.rs b/tee-worker/litentry/core/mock-server/src/twitter_litentry.rs deleted file mode 100644 index 00443af0eb..0000000000 --- a/tee-worker/litentry/core/mock-server/src/twitter_litentry.rs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2020-2024 Trust Computing GmbH. -// This file is part of Litentry. -// -// Litentry is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Litentry is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Litentry. If not, see . -#![allow(opaque_hidden_inferred_bound)] - -use std::collections::HashMap; -use warp::{http::Response, Filter}; - -pub(crate) fn check_follow( -) -> impl Filter + Clone { - warp::get() - .and(warp::path!("twitter" / "followers" / "verification")) - .and(warp::query::>()) - .map(move |p: HashMap| { - let default = String::default(); - let handler1 = p.get("handler1").unwrap_or(&default); - let handler2 = p.get("handler2").unwrap_or(&default); - - let body = r#"{ "data": false }"#; - if handler1.as_str() == "litentry" && handler2 == "paritytech" { - Response::builder().body(body.to_string()) - } else { - Response::builder().status(400).body(String::from("Error query")) - } - }) -} diff --git a/tee-worker/local-setup/.env.dev b/tee-worker/local-setup/.env.dev index 2e82cc537b..5f9c5dbec7 100644 --- a/tee-worker/local-setup/.env.dev +++ b/tee-worker/local-setup/.env.dev @@ -36,9 +36,8 @@ MORALIS_API_KEY= # The followings are default value. # Can be skipped; or overwrite within non-production mode. TWITTER_OFFICIAL_URL=http://localhost:19527 -TWITTER_LITENTRY_URL=http://localhost:19527 DISCORD_OFFICIAL_URL=http://localhost:19527 -DISCORD_LITENTRY_URL=http://localhost:19527 +LITENTRY_DISCORD_MICROSERVICE_URL=http://localhost:19527 ACHAINABLE_URL=http://localhost:19527 CREDENTIAL_ENDPOINT=http://localhost:9933 ONEBLOCK_NOTION_URL=https://abc.com