summaryrefslogtreecommitdiff
path: root/lib/api/internal.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-09-15 21:16:38 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-09-15 21:16:38 +0200
commit83b643a0145cf3f5b919cc61342ba0a824dfdcc9 (patch)
tree41bf105a1b8d28b8385bfbccc033df544b7ebdfe /lib/api/internal.rb
parenteed5c58d8542cef8cc4012a303c9bb963b7f5f20 (diff)
parentbe09bcf074e6048aa9ba5f8dfb99754e6afbe156 (diff)
downloadgitlab-ce-83b643a0145cf3f5b919cc61342ba0a824dfdcc9.tar.gz
Merge remote-tracking branch 'origin/lfs-support-for-ssh' into per-build-token
# Conflicts: # app/controllers/projects/git_http_client_controller.rb # app/helpers/lfs_helper.rb # lib/gitlab/auth.rb # spec/requests/lfs_http_spec.rb
Diffstat (limited to 'lib/api/internal.rb')
-rw-r--r--lib/api/internal.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/api/internal.rb b/lib/api/internal.rb
index 2610fd329d6..865379c51c4 100644
--- a/lib/api/internal.rb
+++ b/lib/api/internal.rb
@@ -82,6 +82,19 @@ module API
response
end
+ post "/lfs_authenticate" do
+ status 200
+
+ key = Key.find(params[:key_id])
+ token_handler = Gitlab::LfsToken.new(key)
+
+ {
+ username: token_handler.actor_name,
+ lfs_token: token_handler.generate,
+ repository_http_path: project.http_url_to_repo
+ }
+ end
+
get "/merge_request_urls" do
::MergeRequests::GetUrlsService.new(project).execute(params[:changes])
end