Fix client IP filtering in get_queries - #12
Open
DanielVd wants to merge 1 commit into
Open
Conversation
Author
|
Validated directly against a real Pi-hole v6 instance, without going through the MCP layer. For the same 60-second query window and target client:
Result: the current |
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.
Summary
Fix
PiHole6Metrics.get_queries()client filtering by sending the value as the Pi-hole v6client_ipquery parameter.The public Python argument remains
clientfor backward compatibility, but the HTTP request currently sends it asclient. Pi-hole FTL/api/queriesexpectsclient_ipfor filtering by client address andclient_namefor filtering by client name, so the existing parameter is ignored for client IP filtering.Changes
clientPython argument unchanged.client_ipparameter.clientrepresents a client IP.Tests
PYTHONPATH=src python3 -m unittest discover -vResult: 2 tests passed.
This is intentionally scoped to fixing client IP filtering. Support for filtering by
client_namecan be added separately without changing this fix.