IP lookup: rename blocklists to IP lists, move the is_ fields into a flags object, raise the download cap to 200 MiB #233

Closed
opened 2026-11-10 10:15:07 +01:00 by clawbot · 1 comment
Collaborator

Part of #203. Comes first: every later addition builds on this shape.

sneak, #203 (comment): "make the json shape better. the is_ fields should probably be a sub object, and "blocklists" is a bad term as the data inside isn't just used for blocking." and "download cap raised to 200MiB".

Change.

  1. The term goes everywhere. The JSON field blocklists becomes ip_lists. The package internal/blocklist becomes internal/iplist (git mv), and its doc says public IP lists. Blocklists becomes IPLists, SetBlocklists becomes SetIPLists, the state directory blocklists becomes iplists, the README section "Blocklists" becomes "IP lists". Comments and log messages follow. Before 1.0 there is no installed base: no compatibility for the old field, path or directory.
  2. Every result of an IP lookup gains a flags object (IPLookupResult in internal/server/handlers.go), present for every address, a routed one or not:
    • is_tor: the address is on tor_exits.
    • is_bogon: bogon.Prefix says the address, as a /32 or /128, is reserved.
  3. maxDownloadSize in internal/iplist/download.go becomes 200 MiB, and the README sentence with it.

Later issues add is_vpn and is_relay to flags. Only flags that work are added here.

before: "ptr": [...], "blocklists": [{"name": "tor_exits", "description": "...", "updated": "..."}]
after:  "ptr": [...], "flags": {"is_tor": true, "is_bogon": false}, "ip_lists": [{"name": "tor_exits", "description": "...", "updated": "..."}]

Tests. is_tor true and false; is_bogon for a private, a loopback and a public address, IPv4 and IPv6; a file over the old cap and under 200 MiB is accepted, without allocating 200 MiB (an io.Reader that generates bytes); the JSON keys.

Done when. No identifier, comment, log line, directory or README sentence says blocklist, except abuse.ch's and Spamhaus's own URLs; the README's IP lookup field list has flags and ip_lists. Read API_POLICIES.md in the repo before changing the response.

Model: opus-5-5

Part of https://git.eeqj.de/sneak/routewatch/issues/203. Comes first: every later addition builds on this shape. sneak, https://git.eeqj.de/sneak/routewatch/issues/203#issuecomment-165190: "make the json shape better. the is_ fields should probably be a sub object, and "blocklists" is a bad term as the data inside isn't just used for blocking." and "download cap raised to 200MiB". **Change.** 1. The term goes everywhere. The JSON field `blocklists` becomes `ip_lists`. The package `internal/blocklist` becomes `internal/iplist` (`git mv`), and its doc says public IP lists. `Blocklists` becomes `IPLists`, `SetBlocklists` becomes `SetIPLists`, the state directory `blocklists` becomes `iplists`, the README section "Blocklists" becomes "IP lists". Comments and log messages follow. Before 1.0 there is no installed base: no compatibility for the old field, path or directory. 2. Every result of an IP lookup gains a `flags` object (`IPLookupResult` in `internal/server/handlers.go`), present for every address, a routed one or not: - `is_tor`: the address is on `tor_exits`. - `is_bogon`: `bogon.Prefix` says the address, as a /32 or /128, is reserved. 3. `maxDownloadSize` in `internal/iplist/download.go` becomes 200 MiB, and the README sentence with it. Later issues add `is_vpn` and `is_relay` to `flags`. Only flags that work are added here. ```json before: "ptr": [...], "blocklists": [{"name": "tor_exits", "description": "...", "updated": "..."}] after: "ptr": [...], "flags": {"is_tor": true, "is_bogon": false}, "ip_lists": [{"name": "tor_exits", "description": "...", "updated": "..."}] ``` **Tests.** `is_tor` true and false; `is_bogon` for a private, a loopback and a public address, IPv4 and IPv6; a file over the old cap and under 200 MiB is accepted, without allocating 200 MiB (an `io.Reader` that generates bytes); the JSON keys. **Done when.** No identifier, comment, log line, directory or README sentence says blocklist, except `abuse.ch`'s and Spamhaus's own URLs; the README's IP lookup field list has `flags` and `ip_lists`. Read `API_POLICIES.md` in the repo before changing the response. Model: opus-5-5
clawbot self-assigned this 2026-11-10 10:15:07 +01:00
Author
Collaborator

Built in #241: the rename to IP lists, the flags object and the 200 MiB limit. The PR body has the details and disclosures.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/routewatch/pulls/241: the rename to IP lists, the `flags` object and the 200 MiB limit. The PR body has the details and disclosures. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/routewatch#233