Page MenuHomePhabricator

Write null to cu_private_event.cupe_actor if temporary accounts are enabled and the performer is an IP address
Closed, ResolvedPublic2 Estimated Story Points

Description

In T359873: Make the cupe_private column nullable it will be made possible to write NULL to the cupe_actor column of the cu_private_event table. This is to allow IP addresses to be the performer of events in that table without having to have an actor ID. A value of NULL will cause the interfaces to treat the performer of the event as the IP address in the cupe_ip column.

In this task, the CheckUserInsert service should be updated to set the cupe_actor column to NULL if temporary accounts are enabled and the performer is an IP address. This should be dependent on T359873 but that schema change does not need to be on WMF wikis for this ticket to be worked on as temporary accounts are not enabled on any WMF wikis which prevents this value being used on any WMF wikis until this is resolved (as this is a blocker for testwiki release).

Acceptance criteria
  • NULL should the value of cupe_actor if the performer is an IP address and temporary accounts are enabled

QA Results - Local

Event Timeline

Change 1010591 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/CheckUser@master] Write NULL to cupe_actor in specific circumstances

https://gerrit.wikimedia.org/r/1010591

Change 1010591 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] Write NULL to cupe_actor in specific circumstances

https://gerrit.wikimedia.org/r/1010591

Suggested QA steps intended for a local wiki:

  1. Install CheckUser, if required
  2. Enable temporary accounts, if required
  3. Add $wgCheckUserLogLogins = true; to your LocalSettings.php if not already defined there
  4. Make a failed login attempt to an account (i.e. use a wrong username or password)
  5. Verify that no exception is thrown and instead an message is displayed indicating that the wrong password/username was used
  6. Open the DB for your wiki
  7. Find the last row that was inserted (which should the failed login attempt) and verify that the cupe_actor column is defined as NULL.

You can repeat this with step 4 and 5 replaced with using the Special:PasswordReset form and verifying that no exception is thrown. For step 7 you would expect to find a row for the password reset email being sent.

@Dreamy_Jazz Cupe_actor is defined as NULL with an incorrect password as seen in the screenshots. Also password reset email being sent is shown when using select * FROM cu_private_event;. I will move this to Done. Thanks for all your work and steps!

Status: ✅PASS
Environment: Local: 1.42.0-alpha (24d0d95) 10:06, 19 March 2024; CheckUser- 2.5 (dc0ec3b) 15:07, 19 March 2024
OS: macOS Sonoma 14.4
Browser: Chrome 122
Skins. Vector 2022
Device: MBA M2
Emulated Device:: n/a
Test Links:
http://localhost:8080/w/index.php?title=Special:UserLogin&returnto=Main+Page
Special:PasswordReset

✅AC1: https://phabricator.wikimedia.org/T359962

Wrong Passwordcupe_actor is NULLPassword Reset Email RequestVc: Password Reset Email Sent
2024-03-19_11-05-44.png (708×3 px, 439 KB)
2024-03-19_11-07-32.png (495×865 px, 85 KB)
2024-03-20_08-12-27.png (457×2 px, 129 KB)
2024-03-20_08-13-14.png (57×2 px, 24 KB)