Open onsali opened 1 year ago
Thanks for sharing! Here's some tips for next steps on integration.
Unfortunately chickadee-rs doesn't yet support async, so we will need to remove that component for now, though I hope to bring it into the framework soon.
The lookup_ip()
function can go in a new module, such as "resolver/virustotal.rs".
You will want to update the function to return a Vec<String>
, where the String is serialized JSON, so that it matches the return value of the IP API (in the future we could look at building a custom serializer struct, but can skip that for now)
Next you will want to update the resolve_ip_address() function to include this new virustotal resolver, maybe with a new argument influence a conditional to pick between the two available resolvers.
I believe the last step is to add a new command line argument that influences the conditional to select the correct resolver. Alternatively, we could look up from both sources all the time.
A few other notes to be aware of:
lookup_ip()
function to allow multiple IPs. If not, we'll want to create a loop to generate a Vec<>
of results..expect()
where you can and handle/return errors. I am using the anyhow::Result()
and you could use the anyhow::anyhow
macro to raise errors.I have rewritten the program without asynch, and managed to integrate it using an extra CLI argument for defining the resolver type. I have opened a pull request #7 under the branch virustotal_implementation, please take a look.
Hi Chapin, I wrote this resolver for the VirusTotal API which I am looking to integrate into Chickadee