Add residential proxy data to anonymizer object#207
Conversation
This adds a new residential sub-object to the anonymizer object in the GeoIP2 Insights web service response. It is sourced from the full-feed GeoIP Residential Proxy database and includes confidence scoring, provider name detection, and network last seen date for residential proxies. Because the residential proxy feed is a superset of what is covered by Anonymous Plus, the anonymizer object may now contain only the residential key. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a new residential object (represented by the AnonymizerFeed class) to the anonymizer record in the GeoIP2 Insights model, allowing users to access residential proxy data such as confidence, provider name, and last seen date. The feedback suggests two improvements: using the safe navigation operator (&.) in Anonymizer#initialize for cleaner, more idiomatic Ruby code, and ensuring that nil values are correctly cached in AnonymizerFeed#network_last_seen to prevent redundant lookups when the date is missing.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| def initialize(record) | ||
| super | ||
|
|
||
| @residential = AnonymizerFeed.new(record.nil? ? nil : record['residential']) | ||
| end |
There was a problem hiding this comment.
Since this project requires Ruby 3.2+, we can use the safe navigation operator (&.) to safely access 'residential' on record if it is not nil. This is much more idiomatic and concise than the ternary operator check.
def initialize(record)
super
@residential = AnonymizerFeed.new(record&.[]('residential'))
end| def network_last_seen | ||
| return @network_last_seen if defined?(@network_last_seen) | ||
|
|
||
| date_string = get('network_last_seen') | ||
|
|
||
| if !date_string | ||
| return nil | ||
| end | ||
|
|
||
| @network_last_seen = Date.parse(date_string) | ||
| end |
There was a problem hiding this comment.
In Ruby, defined?(@ivar) returns true if the instance variable has been initialized, even if its value is nil. However, because @network_last_seen is not assigned when date_string is nil/falsy, subsequent calls to network_last_seen will repeatedly call get('network_last_seen') instead of returning the cached nil value.
We can optimize this and make it more idiomatic by assigning the result of the ternary operator directly to @network_last_seen.
def network_last_seen
return @network_last_seen if defined?(@network_last_seen)
date_string = get('network_last_seen')
@network_last_seen = date_string ? Date.parse(date_string) : nil
end
Summary
The GeoIP Insights web service is adding a
residentialsub-object to theanonymizerobject, sourced from the full-feed GeoIP Residential Proxy database. Because that feed is a superset of the residential proxies in GeoIP Anonymous Plus, theanonymizerobject may now contain only theresidentialkey.confidence,network_last_seen,provider_name) namedAnonymizerFeed, so future sibling feeds (VPN, mobile, datacenter) can share itresidentialproperty on theAnonymizerrecordTesting
bundle exec rake test(61 runs, 244 assertions) andbundle exec rubocoppass.🤖 Generated with Claude Code