Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a new resolver module for Virustotal API, #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

onsali
Copy link

@onsali onsali commented May 25, 2023

Integrated into main by allowing cli arguments for picking a resolver. Implemented error handling and code refactoring.
This commit solves issue #6

…by allowing cli arguments for picking a resolver. Implemented error handling and code refactoring.
Copy link
Owner

@chapinb chapinb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on this! A few comments for consideration. I will check out and play with it locally tomorrow.

}
Ok(results)
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a tests module to this, at least for the parse method and we can figure out the best way to add tests for the VT API since it requires an API key.

Ok(vt_record)
}

pub fn resolve(&self, ip_addresses: Vec<IpAddr>) -> anyhow::Result<Vec<String>> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! We should drop the print statements since we want to present the output to the user within main.rs

.filter_map(|record| serde_json::to_string(record).ok())
.collect())
match resolver_type.to_lowercase().as_str() {
"ip-api" | "ipapi" | "IPAPI" => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea to handle multiple user inputs for both this and virustotal

@@ -142,7 +147,8 @@ fn run_chickadee(ips: String, columns: Option<Vec<String>>) -> Result<()> {
Ok(())
}

#[cfg(test)]
/*
[cfg(test)]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to re-enable the tests ;)

We should also add tests for the new CLI arg and resolver parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants