Commit graph

2 commits

Author SHA1 Message Date
Thalia
e1cb9deacb Temp users: Add 'offset' option for PlainNumericSerialMapping
Why:

* Naming conflicts may arise on autocreation.
* For example, when generating temporary user names, the config
  wgAutoCreateTempUser['serialMapping']['type'] determines how
  the unique, numerical part of the name is generated, and naming
  conflicts may arise when changing types.
* Specifically we encountered the case of changing the
  $wgAutoCreateTempUser['serialMapping']['type'] from 'scramble'
  to 'plain-numeric'.
* In general conflict could be avoided in 'plain-numeric' mode if
  the highest number used in an existing username is known, by
  adding an offset.

What:

* Handle an 'offset' config option in PlainNumericSerialMapping to
  allow avoiding conflicts.

Bug: T353545
Change-Id: Id2f9a5b5cc808ce859b93b597cf7ea0efcd9e269
2023-12-18 12:20:42 +00:00
Tim Starling
e8dbf5f80c TempUser infrastructure and services
Add services and utilities for automatic creation of temporary user
accounts on page save, in order to avoid exposing the user's IP
address.

* Add $wgAutoCreateTempUser, for configuring the system
* Add TempUserConfig service, which interprets the config.
* Add TempUserCreator service, which creates users during page save as
  requested by EditPage. With proxy methods to TempUserConfig for
  convenience.
* Add table user_autocreate_serial. Table creation is necessary before
  the feature is enabled but is not necessary before deployment of this
  commit.

Bug: T300263
Change-Id: Ib14a352490fc42039106523118e8d021844e3dfb
2022-04-14 09:23:55 +10:00