Customer lookup based on host range and zone match #27
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.
Overview
This PR implements requested feature in #23. Specifically, it modifies the customer lookup logic with the following:
Implementation
database
MySQL
customers.zones
table:group_name
field has been renamed toname
host
field has been removedip_start
andip_end
binary fields have been added to store IP rangesapplication logic
The radix tree has been removed and replaced with the newly forked and updated interval tree which stores IP ranges as intervals in memory. The logic has been adjusted to reflect the priority of IP range lookup over the qname prefix match.
Finally, there are few basic tests to validate the customer matching functionality.
Note that due to database schema updates, this change is not backward compatible. Any applications accessing the customers database must be updated to reflect the new schema.