Page MenuHomePhabricator

Allow triggering of user password reset email via the API
Closed, ResolvedPublic

Description

Allow triggering of user password reset email via the API

<Ryan_Lane> RoanKattouw: is there any way to request a password through email via the api?
<Reedy> No, it'd be trivial enough to add though if wanted
<RoanKattouw> Not that I know of
<Ryan_Lane> :(
<Reedy> In theory, Akshays rewrite should allow that if it doesn't already
<Reedy> If you've got a need for it.. I can do it, it won't be much work
<Ryan_Lane> I do have a need
<Ryan_Lane> I'm making a script to automatically link SVN accounts with labs
<Reedy> File it in BZ, I'll see about getting to it in the morning
<Reedy> It'll be fairly standalone hopefully, so pushing in 1.17wmf1/1.18 shouldn't be an issue..
<Ryan_Lane> it gives them a wiki name, changes their password to something random, logs in as them, and then should send them a password reset email
<Ryan_Lane> I'm using the 1.18 branch, if that's easier


Version: unspecified
Severity: enhancement
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=67539

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:48 PM
bzimport set Reference to bz30788.
bzimport added a subscriber: Unknown Object (MLST).

Created attachment 9022
Skeleton

Stashing patch here. Seems stability of password stuff on trunk (and 1.18) is undecided, don't really want to do it twice! Nowhere near functional or anything, just skeleton

Attached:

Annoyingly, looks like a lot of the password reset logic is in the special page code right now.

Anomie subscribed.

This is turning out to be somewhat harder to do that I first thought, for two reasons:

  1. I'm also doing change-password and change-email.
  2. I'm doing it right, which means factoring the actual working code out of the existing special pages (instead of just hackily calling the Web UI code like ApiEditPage does).

If I don't get something up by the end of the week (or follow up here somehow), feel free to steal it from me.

gerritbot subscribed.

Change 187840 had a related patch set uploaded (by Anomie):
API: Add actions for resetting/changing password and email

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

Patch-For-Review

Can we decide whether this patch is going to move forward or be abandoned? It has been sitting in Needs Review since January.

There are two unrelated issues with respect to the patch:

  • Architectural dispute over whether we should make the User class worse, plan to make lots of single-function User-helper classes, or plan to make fewer/one User-helper class.
  • After it was written we started on the AuthManager project, which is going to have major implications for the authentication-related aspects of the patch, which means I'm not very motivated to work on this as it exists now, so I haven't been motivated to push it forward at all.

Change 187840 abandoned by Anomie:
API: Add actions for resetting/changing password and email

Reason:
I'll redo this at some point after AuthManager is done. No point in leaving it hanging around for people to complain about it needing rebasing.

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

Change 265201 had a related patch set uploaded (by Anomie):
WIP: API changes for AuthManager

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

Change 265201 merged by jenkins-bot:
API changes for AuthManager

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

This is resolved now with the introduction of AuthManager, and specifically API action=resetpassword which uses the same backend code that SpecialPasswordReset uses to do this.

There's no timeframe for when this will be available on WMF wikis, though, beyond "soon". The next step will be to resolve T110282, then a gradual deploy while watching for things to break.

Change 289122 had a related patch set uploaded (by Gergő Tisza):
API changes for AuthManager

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

Change 289122 merged by jenkins-bot:
API changes for AuthManager

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