Skip to content

Consolidate user lifecycle mutations behind UserLifecycleService#1288

Draft
0x46616c6b wants to merge 1 commit into
mainfrom
refactor/user-lifecycle-service
Draft

Consolidate user lifecycle mutations behind UserLifecycleService#1288
0x46616c6b wants to merge 1 commit into
mainfrom
refactor/user-lifecycle-service

Conversation

@0x46616c6b

@0x46616c6b 0x46616c6b commented May 27, 2026

Copy link
Copy Markdown
Member

Summary

  • Replaced UserResetService, UserRestoreService, and DeleteHandler with a single UserLifecycleService seam exposing three methods: reset(), delete(), restore().
  • Introduced MailCryptCredentialRotation to own the ordering invariant: MailCryptKeyHandler.create() must run before RecoveryTokenHandler.create() because the recovery token encrypts the private key just set on the user. This invariant previously lived in a comment; it now has a named home.
  • Separated alias lifecycle from user lifecycle: deleteAlias is now inlined in AliasManager.delete() where it belongs. DeleteHandler becomes empty and is removed.
  • Added CONTEXT.md documenting the new domain terms (User Lifecycle, MailCrypt Credential Rotation) for future AI and human navigators.

The changes and the PR were generated by Claude.

@0x46616c6b 0x46616c6b force-pushed the refactor/user-lifecycle-service branch from a849b1f to e4ad324 Compare May 27, 2026 18:34
Replaced UserResetService, UserRestoreService, and DeleteHandler with
a single UserLifecycleService seam (reset / delete / restore) and a
MailCryptCredentialRotation collaborator that owns the ordering
invariant: MailCryptKeyHandler must run before RecoveryTokenHandler
because the recovery token encrypts the private key just set.

The alias lifecycle concern is separated: deleteAlias is now inlined
in AliasManager.delete() where it belongs; DeleteHandler becomes
empty and is removed entirely.

Co-Authored-By: Claude <claude@anthropic.com>
@0x46616c6b 0x46616c6b force-pushed the refactor/user-lifecycle-service branch from e4ad324 to f35dd45 Compare May 28, 2026 08:53
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant