"Invalid SSH key data" for SSH key with no comment is unclear
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
New
|
Undecided
|
Unassigned |
Bug Description
How to reproduce:
- Try adding an SSH key with no comment:
- ssh-keygen -f commentless-key -C ''
- https:/
What should happen:
- A nice error saying 'Invalid data: a comment is required' or something telling me what's actually needed.
What actually happens:
- Unclear error: Invalid SSH key data: "the-stuff-
This error comes from lib/lp/
The same error is sent to SSO via the API so any improvement in the error message here would also benefit SSH key handling from SSO.
I guess clearly stating what the expected format of the key is (both in SSO and Launchpad) would be a cheap mitigation; I was also under the impression a public SSH key was entirely unambiguous so "Invalid data" should be enough, but then ran into this case where a comment-less SSH key is valid and usable but Launchpad dislikes it.
https:/ /bugs.launchpad .net/launchpad/ +bug/60601 is relevant but not exactly a dupe; I'd be happy to just get a relevant error but still making the comment mandatory, while that one wants allowing comment-less keys.