Comment 2 for bug 1782764

Revision history for this message
Christian Glahn (cpglahn) wrote :

Today I ran into something similar, but we have a larger user base that uses different (public and self-hosted) platforms, so just one URL won't be enough. I thought about a more general solution to the problem.

As many platforms offer a similar protocol, it would make sense to allow admins to register protos (like lp and gh) in /etc/ssh/ssh_import_id.

My ideal format for that file would look as following:

{
  "_comment_": "...",
  "URL": "https://launchpad.net/~%s/+sshkeys",
  "protos": {
     "lp": {
       "URL": "https://launchpad.net/~%s/+sshkeys"
     },
     "gh": {
       "URL": "https://api.github.com/users/%s/keys"
     },
     "gl": {
       "URL": "https://gitlab.com/%s.keys"
     },
     "home": {
       "URL": "https://api.self-hosted-server.example.com/users/%s/keys"
     }
  }
}

This would offer much greater flexibility and would allow us to draw on our different solutions without touching the defaults.

It might be possible even to add a hint, if the format is GH's JSON or ssh's authorized_keys as used by LP.