You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "quantranhong1999 (via GitHub)" <gi...@apache.org> on 2023/03/17 05:38:49 UTC

[GitHub] [james-project] quantranhong1999 commented on a diff in pull request #1489: [ADR] Changing username

quantranhong1999 commented on code in PR #1489:
URL: https://github.com/apache/james-project/pull/1489#discussion_r1139775150


##########
src/adr/0065-changing-username.md:
##########
@@ -0,0 +1,58 @@
+# 65. Changing username
+
+Date: 2023-03-17
+
+## Status
+
+Accepted (lazy consensus).
+
+Implemented.
+
+## Context
+Changing username is a desired feature for an email server. It is a common practice when a user marries. For example: 
+
+Alice MARTINEZ have an email address `alice.martinez@domain.tld` and gets married to Bob ERNANDEZ. She thus wants to
+change her email address to `alice.ernandez@domain.tld` while preserving her email data.
+
+Nowadays, James uses username as an identifier for user data. Therefore, this feature is hard to implement because of changing 
+directly identifier to another value is difficult and could break data consistency if we do not do it carefully.
+
+## Decision
+
+Need to copy the data
+Modular design
+
+We decided to do changing username with two steps: first create new username, then migrate the old user's data to new account - 
+the way we expect that is less dangerous to current data consistency. The data in old account need to be truncated after migrated to new account.
+
+For the data migration step, we decided to form it under a webadmin task with a modular design. A big data migration task contains 
+many small tasks that implement `UsernameChangeTaskStep` interface. This modular design for migration steps could help developers easier 
+to manage/test each step, and help other tailor James servers can implement their own steps as well.
+
+Today, implemented migration steps are:
+
+- `ForwardUsernameChangeTaskStep`: creates forward from old user to new user and migrates existing forwards
+- `FilterUsernameChangeTaskStep`: migrates users filtering rules
+- `DelegationUsernameChangeTaskStep`: migrates delegations where the impacted user is either delegatee or delegator
+- `MailboxUsernameChangeTaskStep`: migrates mailboxes belonging to the old user to the account of the new user. It also
+  migrates user's mailbox subscriptions.
+- `ACLUsernameChangeTaskStep`: migrates ACLs on mailboxes the migrated user has access to and updates subscriptions accordingly.
+
+We introduce `fromStep` query parameter that allows skipping previous steps, allowing to resume the username change from a failed step.
+This option could ease operators in case the data migration fails in the middle.
+
+## Consequences
+- Add one more useful feature to James rich feature set: Users can change their name while preserving their email data.
+- User would be aware that they have a new account through new username/password. No implicit migration without user attention is archived today.
+- JMAP Identity data is not migrated because they are tightly coupled to old username, user should create identities again themselves.
+- Some data considered not critical like Push subscription, Vacation response,... are not migrated today. Contributions for them is welcome.

Review Comment:
   BTW are we missing migration for Quota?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org