adds function to get geolocation from domain names using round robin dns#58
Open
kf0jvt wants to merge 6 commits intoyolothreat:masterfrom
Open
adds function to get geolocation from domain names using round robin dns#58kf0jvt wants to merge 6 commits intoyolothreat:masterfrom
kf0jvt wants to merge 6 commits intoyolothreat:masterfrom
Conversation
Member
|
Once #59 is merged into master, you can merge that into here (or just do that from your own branch) so we can get happy ✅ |
Member
There was a problem hiding this comment.
We need a test case that exercises this conditional. Maybe google.com or such?
Member
There was a problem hiding this comment.
For context, we only have one line that is not getting covered by tests.
Contributor
Author
|
you mean we need to add a test to |
Member
|
Oops, missed your question here. The first one - it'll test the conditional and raise the warning and that'll be good. |
Member
|
This shows as good to go, is it? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This came up for discussion in our python code review club meeting earlier this week. The
domain_to_geofunction passes the domain directly to pygeoip which returns a location. However if the domain being searched uses round-robin DNS for some reason then the domain may resolve to multiple IP addresses which could be in several places.This PR adds a function called
domain_to_mgeowhich will get all the ip addresses that the domain resolves to and then get location info for each of them, returning a list of dictionaries. In order to honor the promises made by previous functions, the existingdomain_to_geofunction continues to work the way it did before but it does raise a warning if a domain resolves to multiple ip addresses.