Page MenuHomePhabricator

Add hook to support custom logging in `ProtectedVarsAccessLogger`
Closed, ResolvedPublic

Description

The ProtectedVarsAccessLogger class in AbuseFilter is responsible for logging access to protected variables. As IPs are the only protected variable at the moment and CheckUser's temporary accounts support wants to centralize logging access to IPs, the class does a check to see if CU is installed and if so, prefers its logger over AF's.

We can remove this business logic by adding a hook to ProtectedVarsAccessLogger that allows CU to respond to this event and contain CheckUser's logging reqs in the extension itself. Depending on implementation, an additional mechanism may need to be implemented in order to allow an override as opposed to a lateral logger. Whatever the implementation, I don't think the event should be logged twice.

Acceptance Criteria:

  • Hook exists and is run in ProtectedVarsAccessLogger
  • Mechanism allows for logger/log to be diverted from AbuseFilter's logging

Details

Event Timeline

Change #1125212 had a related patch set uploaded (by STran; author: STran):

[mediawiki/extensions/AbuseFilter@master] [WIP] Add ProtectedVarsAccessLogger hook

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

Change #1125212 merged by jenkins-bot:

[mediawiki/extensions/AbuseFilter@master] Add ProtectedVarsAccessLogger hook

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

Djackson-ctr subscribed.

QA is completed, I have verified the new code has been implemented and is functioning as expected Per the Acceptance Criteria.