Remove /ip_addresses page.

Remove the /ip_addresses page. This page allowed moderators to search
users by IP, and to see recent activity tied to an IP. However, it was
limited to IPs tied to uploads, comments, dmails, artist edits, note
edits, and wiki edits.

Remove this page because it was limited in scope and because there are
better ways of doing what it did. The /user_events page is better at
catching sockpuppets because it tracks IPs for every login, not just for
certain types of edits. And the /user_actions page is better at
monitoring user activity because it shows all activity associated with
an account, not just for certain types of edits.

Removing this allows us to drop IP addresses from all tables besides the
user_events table. This is good because these IPs are no longer necessary
for any purpose, and because storing them forever is a liability.
This commit is contained in:
evazion
2022-09-17 15:36:51 -05:00
parent 1ac56b72a7
commit 075199cd1e
18 changed files with 136 additions and 351 deletions

View File

@@ -5,40 +5,6 @@ class IpAddressesControllerTest < ActionDispatch::IntegrationTest
setup do
@mod = create(:mod_user, last_ip_addr: "1.2.3.4")
@user = create(:user, last_ip_addr: "5.6.7.8")
CurrentUser.scoped(@user, "5.6.7.9") do
@note = create(:note)
@artist = create(:artist)
end
end
context "index action" do
should "list all IP addresses" do
get_auth ip_addresses_path, @mod
assert_response :success
end
should "allow searching by subnet" do
get_auth ip_addresses_path(search: { ip_addr: "5.0.0.0/8" }), @mod, as: :json
assert_response :success
assert(response.parsed_body.present?)
end
should "allow grouping by user" do
get_auth ip_addresses_path(search: { ip_addr: @user.last_ip_addr, group_by: "user" }), @mod
assert_response :success
end
should "allow grouping by IP" do
get_auth ip_addresses_path(search: { user_id: @user.id, group_by: "ip_addr" }), @mod
assert_response :success
end
should "not allow non-moderators to view IP addresses" do
get_auth ip_addresses_path, @user
assert_response 403
end
end
context "show action" do