summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-07-15 14:23:26 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-07-15 14:23:26 +0200
commitbb9f827ddc51eba73c78be83b977a07e10638936 (patch)
treed9cff42442d5df65763c098c9c47e720e3ceaef8
parent86f39fece2273319e2c960d96b131924a9fbdc3c (diff)
downloadgitlab-ce-bb9f827ddc51eba73c78be83b977a07e10638936.tar.gz
Fix fetching LFS objects for private CI projects
-rw-r--r--CHANGELOG1
-rw-r--r--lib/gitlab/backend/grack_auth.rb2
-rw-r--r--spec/requests/lfs_http_spec.rb7
3 files changed, 8 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index a977fc3fdbf..671a7c2e4a9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -18,6 +18,7 @@ v 8.10.0 (unreleased)
- Fix MR-auto-close text added to description. !4836
- Fix issue, preventing users w/o push access to sort tags !5105 (redetection)
- Add Spring EmojiOne updates.
+ - Fix fetching LFS objects for private CI projects
- Add syntax for multiline blockquote using `>>>` fence !3954
- Fix viewing notification settings when a project is pending deletion
- Fix pagination when sorting by columns with lots of ties (like priority)
diff --git a/lib/gitlab/backend/grack_auth.rb b/lib/gitlab/backend/grack_auth.rb
index 478f145bfed..ab94abeda77 100644
--- a/lib/gitlab/backend/grack_auth.rb
+++ b/lib/gitlab/backend/grack_auth.rb
@@ -63,7 +63,7 @@ module Grack
def ci_request?(login, password)
matched_login = /(?<s>^[a-zA-Z]*-ci)-token$/.match(login)
- if project && matched_login.present? && git_cmd == 'git-upload-pack'
+ if project && matched_login.present?
underscored_service = matched_login['s'].underscore
if underscored_service == 'gitlab_ci'
diff --git a/spec/requests/lfs_http_spec.rb b/spec/requests/lfs_http_spec.rb
index d862cb5b0b4..aaad1e3a6ec 100644
--- a/spec/requests/lfs_http_spec.rb
+++ b/spec/requests/lfs_http_spec.rb
@@ -98,6 +98,8 @@ describe Gitlab::Lfs::Router do
context 'with required headers' do
shared_examples 'responds with a file' do
+ let(:sendfile) { 'X-Sendfile' }
+
it 'responds with status 200' do
expect(response).to have_http_status(200)
end
@@ -110,7 +112,6 @@ describe Gitlab::Lfs::Router do
context 'with user is authorized' do
let(:authorization) { authorize_user }
- let(:sendfile) { 'X-Sendfile' }
context 'and does not have project access' do
let(:update_permissions) do
@@ -135,6 +136,10 @@ describe Gitlab::Lfs::Router do
context 'when CI is authorized' do
let(:authorization) { authorize_ci_project }
+ let(:update_permissions) do
+ project.lfs_objects << lfs_object
+ end
+
it_behaves_like 'responds with a file'
end
end