Why: * Part of a temporary user name is generated from an index that increments, which is stored in the database. * As specified in T345855, the index will be restarted each year. * Also specified in T345855, the year will be included in generated temporary user names. What: * Since the year must be included in the name in order to avoid naming conflicts if the index is restarted each year, both are implemented together and controlled by a single config. * Add a new config option that, when true, restarts the name generation index at the start of each year and add the year into the user name: $wgAutoCreateTempUser['serialProvider']['useYear'] * Add a uas_year column to the user_autocreate_serial table, which is unique in combination with uas_shard, so the index can be stored for each shard/year combination. * The year is added into the username just after the prefix, as specified in T345855. This is based on research that having the year near the start of the name aids understanding that the names are not IP addresses. The position of the year within the name is therefore not configurable (though whether to include it is). See T345855 for the research. Bug: T349494 Bug: T349501 Depends-On: I6b3c640a4e74f52fd4a4f46de5a2cbe80fe3b665 Change-Id: If51acb3f4efa361ce36d919c862a52501a5a7d24
49 lines
1.4 KiB
JSON
49 lines
1.4 KiB
JSON
{
|
|
"comment": "Add uas_year to user_autocreate_serial table",
|
|
"before": {
|
|
"name": "user_autocreate_serial",
|
|
"comment": "Table for sequential name generation for auto-created temporary users",
|
|
"columns": [
|
|
{
|
|
"name": "uas_shard",
|
|
"comment": "The segment of ID space, ID mod N, referred to by this row",
|
|
"type": "integer",
|
|
"options": { "unsigned": true, "notnull": true }
|
|
},
|
|
{
|
|
"name": "uas_value",
|
|
"comment": "The maximum allocated ID value",
|
|
"type": "integer",
|
|
"options": { "unsigned": true, "notnull": true }
|
|
}
|
|
],
|
|
"indexes": [],
|
|
"pk": [ "uas_shard" ]
|
|
},
|
|
"after": {
|
|
"name": "user_autocreate_serial",
|
|
"comment": "Table for sequential name generation for auto-created temporary users",
|
|
"columns": [
|
|
{
|
|
"name": "uas_shard",
|
|
"comment": "The segment of ID space, ID mod N, referred to by this row",
|
|
"type": "integer",
|
|
"options": { "unsigned": true, "notnull": true }
|
|
},
|
|
{
|
|
"name": "uas_year",
|
|
"comment": "The year to which this row belongs, if $wgAutoCreateTempUser['serialProvider']['useYear'] is true.",
|
|
"type": "smallint",
|
|
"options": { "unsigned": true, "notnull": true }
|
|
},
|
|
{
|
|
"name": "uas_value",
|
|
"comment": "The maximum allocated ID value",
|
|
"type": "integer",
|
|
"options": { "unsigned": true, "notnull": true }
|
|
}
|
|
],
|
|
"indexes": [],
|
|
"pk": [ "uas_shard", "uas_year" ]
|
|
}
|
|
}
|