You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a request is made via HTTP to download a file, a request is made to GET /REPO/objects/OID and a hypermedia link is returned, eg: {"download": { "href": "https://some-download.com" } }. This is awesome.
However, when a request is made by SSH, despite the request containing the same information: git-lfs-authenticate REPO download OID, the response seems to be totally different, a link to the root of the repository, on which an additional, seemingly unnecessary request is made for the hypermedia information.
I would very much like to be able to return the {"download": { "href": "https://some-download.com" } } information directly from SSH. Is this possible? If not, it seems like an additional authentication mechanism will be needed for the intermediate HTTP request since we don't have the user's HTTP password.
My SSH server does have access to the upload / download URLs. In my case these are authenticated by one-time-password generated by the SSH or HTTP server, so it would be great if the SSH server could direct them in the same way the HTTP server does.
Unfortunately what my SSH server doesn't have is the end user's password to assist them in authenticating the HTTP version of the repository. Obviously having to ask the user for their password once they've authenticated by SSH key is less than ideal.
I don't know if I have the necessary skill in Go to implement this feature myself but I'll take a look.
I briefly tried to implement this, but due to the API of newApiRequest, this will require more changes to the flow of the program than I'm comfortable making.
I'd very much appreciate it if there's anything you could do here. My proposed API (including backward compatibility with Github's) would look like this:
Unfortunately what my SSH server doesn't have is the end user's password to assist them in authenticating the HTTP version of the repository. Obviously having to ask the user for their password once they've authenticated by SSH key is less than ideal.
That seems to defeat the purpose.
That schema looks good. Though, it's missing an optional Verify link relation.
Also, this may not even be needed, since we're moving towards a bulk api: #285
Doing this in bulk makes a lot more sense to me. I'm happy to skip straight to the bulk API if it's coming soon.
I think there's some confusion in my mind about how each part of the process should be authenticated, and how closely tied the Git Server and LFS API should be.
In the case of HTTP, the LFS API is essentially part of the Git server, authenticated using the same credentials as Git, and immediately returning media URLs. Whereas when using SSH, the LFS API becomes detached from the Git Server, requiring separate authentication. This is something I was looking to avoid.
Reuse existing Git authentication over SSH or HTTP.
Support multiple storage backends. This is why the link relations specify both a URL and a list of header keys and values.
Whatever is generating the link (the Git LFS HTTP server, or the SSH command as you suggest) should be able to generate a URL and header to download or upload the object from the storage backend. It's not necessary, but otherwise users will be prompted for a user and pass for the storage backend's domain.
That's great, this is exactly what I was hoping for.
I'd really appreciate it if the protocol could be extended so that all metadata could be transferred by SSH rather than having the extra HTTP step between SSH and the final Upload/Download URL.
As you say, it might be better to do this alongside the bulk API, as this seems much more efficient.
Activity
technoweenie commentedon May 27, 2015
It really depends on your SSH server setup, and whether it can access that data. I think adding the capability would be great though.
catphish commentedon May 27, 2015
My SSH server does have access to the upload / download URLs. In my case these are authenticated by one-time-password generated by the SSH or HTTP server, so it would be great if the SSH server could direct them in the same way the HTTP server does.
Unfortunately what my SSH server doesn't have is the end user's password to assist them in authenticating the HTTP version of the repository. Obviously having to ask the user for their password once they've authenticated by SSH key is less than ideal.
I don't know if I have the necessary skill in Go to implement this feature myself but I'll take a look.
catphish commentedon May 28, 2015
I briefly tried to implement this, but due to the API of
newApiRequest, this will require more changes to the flow of the program than I'm comfortable making.I'd very much appreciate it if there's anything you could do here. My proposed API (including backward compatibility with Github's) would look like this:
This would allow SSH to respond either with a base HTTP URL (as per the current API), or with a direct Upload or Download link (IMO more efficient).
technoweenie commentedon May 28, 2015
That seems to defeat the purpose.
That schema looks good. Though, it's missing an optional
Verifylink relation.Also, this may not even be needed, since we're moving towards a bulk api: #285
catphish commentedon May 28, 2015
Doing this in bulk makes a lot more sense to me. I'm happy to skip straight to the bulk API if it's coming soon.
I think there's some confusion in my mind about how each part of the process should be authenticated, and how closely tied the Git Server and LFS API should be.
In the case of HTTP, the LFS API is essentially part of the Git server, authenticated using the same credentials as Git, and immediately returning media URLs. Whereas when using SSH, the LFS API becomes detached from the Git Server, requiring separate authentication. This is something I was looking to avoid.
I hope this makes some sense.
technoweenie commentedon May 28, 2015
There are two big goals with Git LFS:
Whatever is generating the link (the Git LFS HTTP server, or the SSH command as you suggest) should be able to generate a URL and header to download or upload the object from the storage backend. It's not necessary, but otherwise users will be prompted for a user and pass for the storage backend's domain.
catphish commentedon May 28, 2015
That's great, this is exactly what I was hoping for.
I'd really appreciate it if the protocol could be extended so that all metadata could be transferred by SSH rather than having the extra HTTP step between SSH and the final Upload/Download URL.
As you say, it might be better to do this alongside the bulk API, as this seems much more efficient.