When adding an ssh key, one is inclined to simply paste an openssh-style public key file of the form
ssh-rsa abcdef1234...fedcba0987654321 somekey_id
into the text field. The UI accepts this, but when the key is actually provisioned (to ldap, for example), the key will be
ssh-rsa ssh-rsa abcdef1234...fedcba0987654321 somekey_id comment
I guess in a way this makes sense, as COmanage simply adds the key type and comment the user has provided, but for a user it is a bit unfriendly.
I guess there are several ways around this:
- make clearer in the UI what the user should enter, exactly
- reject user input that doesn't adhere to the format COmanage is expecting (the common case can be caught based on a simple regex, I guess)
- automatically detect the openssl key foramt, and populate/override the key type and comment fields.
From a UI point of view, option 3 would be preferable, I guess. It could be implemented by a small piece of js, and combined with a server side check for option 2.