-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding support for discord oauth verification (#2710)
- Loading branch information
Showing
19 changed files
with
664 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
services: | ||
lit-discord-identity-test: | ||
image: litentry/litentry-cli:latest | ||
container_name: litentry-discord-identity-test | ||
volumes: | ||
- ../ts-tests:/ts-tests | ||
- ../client-api:/client-api | ||
- ../cli:/usr/local/worker-cli | ||
build: | ||
context: .. | ||
dockerfile: build.Dockerfile | ||
target: deployed-client | ||
depends_on: | ||
litentry-node: | ||
condition: service_healthy | ||
litentry-worker-1: | ||
condition: service_healthy | ||
networks: | ||
- litentry-test-network | ||
entrypoint: "bash -c '/usr/local/worker-cli/lit_ts_integration_test.sh discord_identity.test.ts 2>&1' " | ||
restart: "no" | ||
networks: | ||
litentry-test-network: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
tee-worker/litentry/core/identity-verification/src/web2/discord.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use crate::{Error, Result}; | ||
use lc_data_providers::discord_official::DiscordMessage; | ||
use litentry_primitives::ErrorDetail; | ||
use std::vec::Vec; | ||
|
||
pub fn payload_from_discord(discord: &DiscordMessage) -> Result<Vec<u8>> { | ||
let data = &discord.content; | ||
hex::decode(data.strip_prefix("0x").unwrap_or(data.as_str())) | ||
.map_err(|_| Error::LinkIdentityFailed(ErrorDetail::ParseError)) | ||
} |
Oops, something went wrong.