Repository navigation
Conversation
…ical form The plugin looks the visitor up in these lists by the canonical spelling of the entries (IpHelper::canonicalEntry()): "2001:DB8::1" is stored as "2001:db8::1", "203.0.113.77/24" as "203.0.113.0/24". The tests are in the bfstop repository (branch cidr-lookup-cost). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LhhhdjhErC9ZiaS4HyRjsh
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
Component side of codeling/bfstop's
cidr-lookup-costbranch. The plugin now looks a visitor up in the block and allow list by the canonical spelling of the entries (an indexed lookup instead of reading and testing every network on every request), so the edit forms have to store entries that way:AllowTable::check()/BlockTable::check()store the canonical form (IpHelper::canonicalEntry()):2001:DB8::1->2001:db8::1,203.0.113.77/24->203.0.113.0/24. Values that are not an address or network are left to the form validation, as before.What is blocked or allowed does not change. Existing entries are converted by the plugin on the first request after the update. Please merge together with the plugin PR (without this change, entries typed into the forms in a non-canonical spelling would not be found).
Testing
Tests are in the bfstop repository (
ComponentTest::testEntriesOfTheEditFormsAreStoredInCanonicalForm, plus the lookup/migration tests): 352 passing on Joomla 5.4.8 / PostgreSQL 16 with both branches.Generated by Claude Code