Page MenuHomePhabricator

WikimediaEvents: Log hCaptcha risk scores for account creation events
Closed, ResolvedPublic

Description

Summary

The mediawiki/hcaptcha/risk_score schema supports action=createaccount and identifier_type=account, but no such events are currently produced to that schema, because we currently log only to serversideaccountcreation.

Technical notes

WikimediaEvents/includes/EditPage/CaptchaScoreHooks.php implements PageSaveComplete and EditPage::attemptSave_after. We should add a handler for account creation.

We can leave the existing serversideaccountcreation schema integration in place for now.

Acceptance criteria

  • account creations that are checked by hCaptcha emit a createaccount event with identifier_type=account and a valid risk score in the hcaptcha/risk_score schema

Event Timeline

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

[mediawiki/extensions/WikimediaEvents@master] CaptchaScoreHooks: Collect risk score for account creations

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

Change #1272647 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] CaptchaScoreHooks: Collect risk score for account creations

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

Testing notes

I don't really know about this, so a developer could pick this up.

Yeah, it should be possible to verify this by looking at the data. I can look soon or latest next week when I'm back

Testing notes

I don't really know about this, so a developer could pick this up.

Confirmed that this is working:

spark-sql (default)> SELECT action, performer.user_text, identifier, identifier_type FROM event.mediawiki_hcaptcha_risk_score WHERE year = 2026 and month = 4 and day = 30 and action != 'edit' and action == 'createaccount';
action  user_text       identifier      identifier_type
createaccount   IOS-Eng-Test-20260429   73759   account