-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
…by allowing cli arguments for picking a resolver. Implemented error handling and code refactoring.
There was a problem hiding this 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) | ||
} | ||
} |
There was a problem hiding this comment.
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>> { |
There was a problem hiding this comment.
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" => { |
There was a problem hiding this comment.
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)] |
There was a problem hiding this comment.
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.
Integrated into main by allowing cli arguments for picking a resolver. Implemented error handling and code refactoring.
This commit solves issue #6