Repository navigation
fix: read proxy_providers from Residential Proxy database v2 - #8
Merged
Merged
Conversation
Residential Proxy database v2 renamed proxy_provider to proxy_providers, an array of every provider. With only that database loaded, the plugin no longer derived is_residential_proxy, so blockResidentialProxy let those addresses through, and the provider fields came back empty. - is_residential_proxy is derived from proxy_providers (v1 proxy_provider still works). - proxy_provider and residential_proxy_provider join every provider with listSeparator. - New number fields proxy_days_seen_7d, proxy_days_seen_30d and proxy_provider_count_30d, read from the IP Security database or from Residential Proxy database v2, whichever is declared first.
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.
Problem
Residential Proxy database v2 renamed
proxy_providertoproxy_providers, an array of every provider. With only that database loaded:is_residential_proxywas never derived, soblockResidentialProxy: truelet residential proxies through (200 instead of 403).residential_proxy_providerandproxy_providercame back empty.v2 also adds three proxy activity counts that the plugin did not expose.
Changes
is_residential_proxyis derived fromproxy_providers. The v1proxy_providercolumn still works.proxy_providerandresidential_proxy_providerjoin every provider withlistSeparator, e.g.Proxy-Seller,ProxyWing.proxy_days_seen_7d,proxy_days_seen_30dandproxy_provider_count_30d(headersX-IPGeo-Proxy-Days-Seen-7dand so on, included in thefullpreset). They are read from the IP Security database or from Residential Proxy database v2, whichever is declared first.Tests
TestResidentialProxyV2Database: builds a v2.mmdb(counts stored as uint16, like the real database) and checks all seven headers plus the 403 fromblockResidentialProxy. It fails onmain.TestFieldExtractionchecks them, andTestTargetedAccessMatchesFullDecodecovers them automatically.go vetclean,go test -race -cover ./...passes,make yaegipasses all 12 checks.