diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-08-25 17:26:20 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-09-15 12:21:00 -0500 |
commit | e40e3fdc8271d1becf7952c7e30546c5abecb79b (patch) | |
tree | d2b8ef12a133ea77c598b456d15c46ea55a1e1bd /lib/api/internal.rb | |
parent | f8bd9625f44ae4233c14e473c57becfb7ff15ca9 (diff) | |
download | gitlab-ce-e40e3fdc8271d1becf7952c7e30546c5abecb79b.tar.gz |
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 |