Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 12:08:42 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-19 12:08:42 +0300
commitb76ae638462ab0f673e5915986070518dd3f9ad3 (patch)
treebdab0533383b52873be0ec0eb4d3c66598ff8b91 /app/controllers/repositories
parent434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff)
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'app/controllers/repositories')
-rw-r--r--app/controllers/repositories/git_http_client_controller.rb2
-rw-r--r--app/controllers/repositories/lfs_api_controller.rb6
-rw-r--r--app/controllers/repositories/lfs_locks_api_controller.rb4
-rw-r--r--app/controllers/repositories/lfs_storage_controller.rb4
4 files changed, 14 insertions, 2 deletions
diff --git a/app/controllers/repositories/git_http_client_controller.rb b/app/controllers/repositories/git_http_client_controller.rb
index 76d9983d341..b3adda8c633 100644
--- a/app/controllers/repositories/git_http_client_controller.rb
+++ b/app/controllers/repositories/git_http_client_controller.rb
@@ -33,7 +33,7 @@ module Repositories
end
def authenticate_user
- @authentication_result = Gitlab::Auth::Result.new
+ @authentication_result = Gitlab::Auth::Result::EMPTY
if allow_basic_auth? && basic_auth_provided?
login, password = user_name_and_password(request)
diff --git a/app/controllers/repositories/lfs_api_controller.rb b/app/controllers/repositories/lfs_api_controller.rb
index 4f2e02c78c3..a7719516cb6 100644
--- a/app/controllers/repositories/lfs_api_controller.rb
+++ b/app/controllers/repositories/lfs_api_controller.rb
@@ -10,6 +10,10 @@ module Repositories
skip_before_action :lfs_check_access!, only: [:deprecated]
before_action :lfs_check_batch_operation!, only: [:batch]
+ # added here as a part of the refactor, will be removed
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/328692
+ delegate :deploy_token, :user, to: :authentication_result, allow_nil: true
+
def batch
unless objects.present?
render_lfs_not_found
@@ -141,7 +145,7 @@ module Repositories
end
def lfs_auth_header
- return unless user.is_a?(User)
+ return unless user
Gitlab::LfsToken.new(user).basic_encoding
end
diff --git a/app/controllers/repositories/lfs_locks_api_controller.rb b/app/controllers/repositories/lfs_locks_api_controller.rb
index 19fc09ad4de..1d091a5bfcd 100644
--- a/app/controllers/repositories/lfs_locks_api_controller.rb
+++ b/app/controllers/repositories/lfs_locks_api_controller.rb
@@ -4,6 +4,10 @@ module Repositories
class LfsLocksApiController < Repositories::GitHttpClientController
include LfsRequest
+ # added here as a part of the refactor, will be removed
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/328692
+ delegate :deploy_token, :user, to: :authentication_result, allow_nil: true
+
def create
@result = Lfs::LockFileService.new(project, user, lfs_params).execute
diff --git a/app/controllers/repositories/lfs_storage_controller.rb b/app/controllers/repositories/lfs_storage_controller.rb
index 36912948b77..6ec63a0f939 100644
--- a/app/controllers/repositories/lfs_storage_controller.rb
+++ b/app/controllers/repositories/lfs_storage_controller.rb
@@ -8,6 +8,10 @@ module Repositories
skip_before_action :verify_workhorse_api!, only: :download
+ # added here as a part of the refactor, will be removed
+ # https://gitlab.com/gitlab-org/gitlab/-/issues/328692
+ delegate :deploy_token, :user, to: :authentication_result, allow_nil: true
+
def download
lfs_object = LfsObject.find_by_oid(oid)
unless lfs_object && lfs_object.file.exists?