comply with api key constraint#2710
comply with api key constraint#2710PaulAngus merged 1 commit intoapache:4.11apache/cloudstack:4.11from shapeblue:moveUserDelOldKeysshapeblue/cloudstack:moveUserDelOldKeysCopy head branch name to clipboard
Conversation
| @@ -1734,6 +1734,8 @@ public Boolean doInTransaction(TransactionStatus status) { | ||
| UserVO newUser = new UserVO(user); |
There was a problem hiding this comment.
Why creating a new user entry? I mean, isn't this a matter of simply updating the accountId of the user? Then, you would not change the UUID of the "old" user entry, and you would also not need to update the keys and then mark the user as removed.
There was a problem hiding this comment.
Then you would loose the audit trail in the old account
There was a problem hiding this comment.
hmm, what do you mean by audit trail? Is it possible for the old account to list the "moved" users?
There was a problem hiding this comment.
that would be a nice extra feature for the future ;)
No, actions in the old account must be tracable to a user in that account. As the ownership of assets is with accounts and not users, and the physical user is going to loose access to their old assets anyway, it is more convenient to copy the login data of the user to a new user object.
There was a problem hiding this comment.
Ok. Then, there is one thing I still do not understand. If we want to keep the history, why are we changing the old user UUID? Shouldn't it be the opposite?
There was a problem hiding this comment.
We are not changing db id which is used for foreign key relations. and we are copying the uuid to the external identity for future reference. through the new user we can then also find any 'real external' ids.
There was a problem hiding this comment.
Got it. Thanks for the details.
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2122 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
not coded any tests but here is the procedure: |
mdesaive
left a comment
There was a problem hiding this comment.
Looks good to me! Thanks a lot for taking care!
|
@blueorangutan package |
|
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-2125 |
|
@blueorangutan test |
|
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-2760)
|
|
The errors are mostly know to be related to other issues. @PaulAngus can we merge? |
|
LGTM - tested moving a user who had API keys - no issues. ..Merging |
Description
moveUser only works for users without API keys which beats the (one of the two) main purpose(s) of the moveUser API.
Types of changes
GitHub Issue/PRs
Fixes: #2707
Screenshots (if appropriate):
How Has This Been Tested?
Checklist:
Testing