Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
cycle-five committed Mar 1, 2024
1 parent da4c4e7 commit ca58579
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crack-osint/src/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ use reqwest::Url;
use serde::Deserialize;
use std::sync::Arc;

const VIRUSTOTAL_API_URL: &str = "https://www.virustotal.com/api/v3/urls";

#[derive(Deserialize)]
pub struct ScanResult {
result_url: String,
Expand Down Expand Up @@ -41,7 +43,6 @@ pub async fn scan(ctx: Context<'_>, url: String) -> Result<(), Error> {
ctx.data()
.add_msg_to_cache(guild_id_opt.unwrap_or(GuildId::new(1)), m);

Check warning on line 44 in crack-osint/src/scan.rs

View check run for this annotation

Codecov / codecov/patch

crack-osint/src/scan.rs#L40-L44

Added lines #L40 - L44 were not covered by tests
})
.map_err(|e| e.into())
}

/// Scan a website for viruses or malicious content.
Expand Down Expand Up @@ -71,7 +72,7 @@ pub async fn scan_url(url: String) -> Result<String, Error> {
/// --header 'x-apikey: <your API key>'
pub async fn perform_scan(url: &str) -> Result<ScanResult, Error> {

Check warning on line 73 in crack-osint/src/scan.rs

View check run for this annotation

Codecov / codecov/patch

crack-osint/src/scan.rs#L73

Added line #L73 was not covered by tests
// URL to submit the scan request to VirusTotal
let api_url = format!("https://www.virustotal.com/api/v3/urls");
let api_url = VIRUSTOTAL_API_URL.to_string();

Check warning on line 75 in crack-osint/src/scan.rs

View check run for this annotation

Codecov / codecov/patch

crack-osint/src/scan.rs#L75

Added line #L75 was not covered by tests
// Retrieve the API key from the environment variable
let api_key = std::env::var("VIRUSTOTAL_API_KEY")
.map_err(|_| CrackedError::Other("VIRUSTOTAL_API_KEY"))?;

Check warning on line 78 in crack-osint/src/scan.rs

View check run for this annotation

Codecov / codecov/patch

crack-osint/src/scan.rs#L77-L78

Added lines #L77 - L78 were not covered by tests
Expand Down

0 comments on commit ca58579

Please sign in to comment.