Actions
Feature #12626
closed[API] Merge user accounts (redirect=true case)
Story points:
3.0
Release:
Release relationship:
Auto
Description
New API endpoint:
POST /arvados/v1/users/merge
- Authorization header has valid API token for the "old" account
- new_user_token (post form param in request body) has valid API token for the "new" account
- new_owner_uuid (post form param in request body) has either new user's UUID, or a group UUID writable by the new user
- redirect_to_new_user=true (optional)
- Current token ("old account") has scopes=["all"]
- new_user_token ("new account") has scopes=["all"]
- API logs show the UUID of the corresponding api_client_auth record instead of merge_into_token
- Move all records (groups, links, collections, jobs, pipelines, container requests, etc) owned by the old user into new_owner_uuid (this is typically a new empty project or a new user who doesn't own anything, so name conflicts would be a surprise/error)
- Update links set tail_uuid=new_user_uuid where tail_uuid=old_user_uuid
- Set old user's redirect_to_user_uuid field to the new user's UUID
- Move old user's SSH keys to the new user
- Ensure API tokens associated with old user will give access to the new account.
- Update links with head_uuid = old user to point to new user
- Leave old user's redirect_to_user_uuid field alone
- Delete old user's SSH keys
- Leave old user's API tokens alone
- Leave links with head_uuid = old user alone.
This is all done in a transaction: if anything fails, the entire operation is cancelled.
Implementation
Actions