Repository navigation
fix(atproto): address the take-ownership reset by DID, not by email - #603
Merged
Merged
Conversation
Take ownership sent a PDS password reset to the OpenMeet email address. Nothing keeps that address in step with the email on the AT Protocol account. Changing an OpenMeet email never writes the PDS side, so the two can drift apart. com.atproto.server.requestPasswordReset sends to whichever account owns the address it is given. If the OpenMeet address had drifted and another account owned it, the user got a working reset code for an account that was not theirs. If no account owned it, the reset failed with an unclear error. The account is now resolved from the identity DID through com.atproto.admin.getAccountInfo, and the reset is sent to the address on that account. A missing account or a missing address now fails with a clear error instead of reporting success, and the response reports the address the reset actually went to. The OpenMeet email is no longer required to start take ownership, since it is no longer the identifier. A mismatch between the two addresses is logged as a warning, without the addresses themselves.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
Take ownership sends a PDS password reset so the user can set their own password. It addressed that reset by the OpenMeet email address.
Nothing keeps the OpenMeet address in step with the email on the AT Protocol account. Changing an OpenMeet email through the ordinary profile path never writes the PDS side, so the two addresses can drift apart.
com.atproto.server.requestPasswordResetsends to whichever account owns the address it is given. Two things follow from that:The DID is the identity. The email is not, so it should not be the identifier.
The change
In
initiateTakeOwnership:com.atproto.admin.getAccountInfo, and the reset is sent to the address on that account. A reset can now only reach the account the DID owns.@openmeet.netaddress will now see that address instead of a silent success. Delivery for those accounts is still broken and is not fixed here.The response shape is unchanged. Only the source of the value moved.
Not in this change
syncEmailToPdsis still not called from the profile update path, and it still swallows failures into a warning. That is where the drift comes from. This change makes drift harmless at the reset. It does not stop drift happening.Testing
atproto-identity-recovery.service.spec.ts, 124 acrosssrc/atproto-identity/.eslintis clean on both changed files.tsc --noEmitoutput is identical to the same run onmain. The repository has pre-existing errors in spec and e2e files. This change adds none, and there are no errors in the files it touches.