Closed jrbyrne closed 9 years ago
Intriguing. Is this actually on gitlab.com or on your own instance? The title (your email address) should be in pkey.title
, not pkey.key
.
This is our own server (GitLab 7.10.0), however I don't think that's significant. The value of pkey.key
is exactly what I imported into GitLab (copied from my ~/.ssh/id_rsa.pub
), and this includes my e-mail address. This is standard OpenSSH format.
I know it is the standard OpenSSH, but the GitLab api is not supposed to return it that way. The algorithm and key parts go in pkey.key
and the title part goes in pkey.title
. gitlab.com and gitlab 7.7.2 on my own server both do that, so I guess this is a new bug in 7.10.
Does pkey.title
actually contain anything for your key?
Does git lab public-keys work for you?
Yes, pkey.title
is also my e-mail address.
When you add a key in the GitLab GUI there are 'Title' and 'Key' boxes to fill in, so I'm guessing that pkey.title
is returning what I entered in the 'Title' field, which was my e-mail address, and pkey.key
is returning what I put in the 'Key' field, which was the whole of the public key.
Aha! What does that key look like in the git user's .ssh/authorized_keys
?
Like this (key abbreviated as before):
command="/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell key-3",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAA...Q2tt james.byrne@example.com
Thanks for all the debug output! I'd still say it's a bug in gitlab that it accepts this input, but that doesn't mean git lab
should gratuitously fail. Fixed in e60d3be and released as 2.5
I am seeing 'git lab whoami' fail in the following way:
The issue appears to be that my public key (i.e. the value of pkey.key) has the three fields but the code is only expecting two. The value of pkey.key looks like this (with the bulk of the key replaced by '...'):