SSH "Key has already been taken" when user is destroyed
Created by: RaymiiOrg
When a user adds a public key and uses it to do at least one code push, then is destroyed, another user cannot add the same public key. It gets the error Key has already been taken
.
Env: Ubuntu 12.04 x32 OpenVZ, up to date apt. Gitlab 5.1:
commit a06d9a4992d3d3523a668f6923fe6ee8ebf23fac
Author: Dmitriy Zaporozhets <[email protected]>
Date: Mon May 13 11:59:30 2013 +0300
More strict validation for SSH Key content
ruby 1.9.3p392 (2013-02-22 revision 39386) [i686-linux]
Relevant production.log
:
Started POST "/keys" for at 2013-05-14 08:46:43 +0400
Processing by KeysController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"[...]", "key"=>{"title"=>"rvanelst@[...].com", "key"=>"ssh-rsa A[...]Kz45iTuDIl rvanelst@[...].com"}}
Rendered keys/_form.html.haml (2.2ms)
Rendered keys/new.html.haml within layouts/profile (2.5ms)
Rendered layouts/_head.html.haml (0.8ms)
Rendered layouts/_search.html.haml (6.3ms)
Rendered layouts/_init_auto_complete.html.haml (3.8ms)
Rendered layouts/_head_panel.html.haml (12.5ms)
Rendered layouts/_flash.html.haml (0.1ms)
Rendered layouts/nav/_profile.html.haml (1.5ms)
Completed 200 OK in 27ms (Views: 17.7ms | ActiveRecord: 0.5ms)