Many static function in class BotPassword using services
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | None | T259960 Inject services into API modules and special pages | |||
Resolved | None | T141495 AuthManager should use dependency injection | |||
Open | None | T265769 Research to create service for BotPassword class | |||
Resolved | • Pchelolo | T265767 Research to create service for CentralIdLookup::factory |
Event Timeline
I have seen the usage on Special:BotPasswords and was creating this task, but AuthManager also using that class
Change 635599 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Cleanup BotPassword class to prepare for refactor
Plan:
BotPasswordStore service:
Handle DB
BotPassword::save -> BotPasswordStore::insertBotPassword and ::updateBotPassword
BotPassword::delete -> BotPasswordStore::deleteBotPassword
BotPassword::invalidateAllPasswordsForUser - BotPasswordStore::invalidateAllPasswordsForUser
BotPassword::invalidateAllPasswordsForCentralId -> merged with above method, no other users
BotPassword::removeAllPasswordsForUser -> BotPasswordStore::removeAllPasswordsForUser
BotPassword::removeAllPasswordsForCentralId -> merged with above method, no other users
That handles part of the class, the rest TBD
Nit: there is no point in repeating the class name name in the verbs, IMO. It's a bot password store, of course it's going to insert bot passwords. Just call it insert / update / invalidateAllForUser etc.
I find it helps with tracking uses if generic method names like 'insert' and 'update' are avoided - I'll use invalidateAllForUser, but would prefer insertPassword or insertBotPassword
I don't have a strong opinion on it but I'm not sure it's a good idea to build our naming conventions around plaintext search. A decent IDE can list usages of a specific method.
Change 635599 merged by jenkins-bot:
[mediawiki/core@master] Cleanup BotPassword class to prepare for refactor
Change 637663 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/core@master] Add BotPasswordStore service
Change 637663 merged by jenkins-bot:
[mediawiki/core@master] Add BotPasswordStore service
Change 704620 had a related patch set uploaded (by DannyS712; author: DannyS712):
[mediawiki/core@master] Deprecate unused BotPassword methods
Change 704620 merged by jenkins-bot:
[mediawiki/core@master] Deprecate unused BotPassword methods
Change 704813 had a related patch set uploaded (by DannyS712; author: DannyS712):
[mediawiki/core@master] Move BotPassword lookup methods to BotPasswordStore
Change 704813 merged by jenkins-bot:
[mediawiki/core@master] Move BotPassword lookup methods to BotPasswordStore
Change 705987 had a related patch set uploaded (by DannyS712; author: DannyS712):
[mediawiki/core@master] BotPasswordStore: accept UserIdentity objects
Change 705987 merged by jenkins-bot:
[mediawiki/core@master] BotPasswordStore: accept UserIdentity objects
Change 708422 had a related patch set uploaded (by DannyS712; author: DannyS712):
[mediawiki/core@master] Inject and use BotPasswordStore
Change 710104 had a related patch set uploaded (by DannyS712; author: DannyS712):
[mediawiki/core@master] AuthManager: inject more services
Change 710104 merged by jenkins-bot:
[mediawiki/core@master] AuthManager: inject more services
I'm sorry that I haven't handled this task. I recently returned from a long bout of unexpected inactivity, and while I plan to resume my contributions here on Phabricator its unfair to claim tasks that I might not work on when others may be interested in handling them. I'm removing myself as the assignee in a batch-action, but if someone feels that I really should be the one to handle this task feel free to re-assign me and I'll take a look.