You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Moving User with API key fails through MySQLIntegrityConstraintViolationException #2707
Hi @DaanHoogland I did have a look at the code and it looks reasonable to me, although I have no Java Knowledge or IDE on hand. ;) If you like me to review it I can confirm it looks reasonable to me, assuming the following:
I understand the steps to move a user to another account like this:
create a new user with the neccesary data in the table "user"
put the foreign key for the destination account in "account_id"
do "some magic" to take care that all resources of the user are now assigned to the destination account. (Is the connection made by UUID?)
Reading your discussion with @rafaelweingartner in PR #2710 the reason for creating a new entry in the database is that you do not want to loose information that is connected to old user.
Looking in the code with a texteditor, I see, that you erase API-key and API-secret for one of the users. I assume it is the old user? So the user attached to the destination domain will still have the old API-key available?
@mdesaive one of your assumptions is wrong; resources do not belong to users but to accounts, which means that a 'moved' user will loose all of it assets. The reasong for this change was to allow for a configuration change directed by a configured LDAP.
@DaanHoogland I approved the changes for the PR. Hope I did that correctly, as it was my first time I reviewed code on GitHub. Please get back for me, if something more needs to be done.
Activity
DaanHoogland commentedon Jun 13, 2018
thanks @mdesaive
mdesaive commentedon Jun 15, 2018
@DaanHoogland thanks a lot for taking care of this!
DaanHoogland commentedon Jun 15, 2018
welcome @mdesaive care to do a review of the code in return?
mdesaive commentedon Jun 15, 2018
Hi @DaanHoogland I did have a look at the code and it looks reasonable to me, although I have no Java Knowledge or IDE on hand. ;) If you like me to review it I can confirm it looks reasonable to me, assuming the following:
I understand the steps to move a user to another account like this:
Reading your discussion with @rafaelweingartner in PR #2710 the reason for creating a new entry in the database is that you do not want to loose information that is connected to old user.
Looking in the code with a texteditor, I see, that you erase API-key and API-secret for one of the users. I assume it is the old user? So the user attached to the destination domain will still have the old API-key available?
DaanHoogland commentedon Jun 15, 2018
@mdesaive one of your assumptions is wrong; resources do not belong to users but to accounts, which means that a 'moved' user will loose all of it assets. The reasong for this change was to allow for a configuration change directed by a configured LDAP.
mdesaive commentedon Jun 15, 2018
@DaanHoogland I approved the changes for the PR. Hope I did that correctly, as it was my first time I reviewed code on GitHub. Please get back for me, if something more needs to be done.
PaulAngus commentedon Jun 19, 2018
Fixed by PR:
#2710