diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-08-26 01:26:20 +0300 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-09-15 20:21:00 +0300 |
commit | e40e3fdc8271d1becf7952c7e30546c5abecb79b (patch) | |
tree | d2b8ef12a133ea77c598b456d15c46ea55a1e1bd /lib/api/internal.rb | |
parent | f8bd9625f44ae4233c14e473c57becfb7ff15ca9 (diff) |
Added LFS support to SSH
- Required on the GitLab Rails side is mostly authentication and API related.
Diffstat (limited to 'lib/api/internal.rb')
-rw-r--r-- | lib/api/internal.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb index 6e6efece7c4..7c0a6eaa652 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -69,6 +69,10 @@ module API else project.repository.path_to_repo end + + # Return HTTP full path, so that gitlab-shell has this information + # ready for git-lfs-authenticate + response[:repository_http_path] = project.http_url_to_repo end response @@ -83,7 +87,14 @@ module API # get "/discover" do key = Key.find(params[:key_id]) - present key.user, with: Entities::UserSafe + user = key.user + if user + user.ensure_lfs_token! + present user, with: Entities::UserSafe + else + key.ensure_lfs_token! + { username: 'lfs-deploy-key', lfs_token: key.lfs_token } + end end get "/check" do |