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>2023-10-30 21:10:11 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-10-30 21:10:11 +0300
commitc51425915fb1b2c367d6d828449b5cc7772ac104 (patch)
treee0bb2d9f3e0c9aaec6fe71a9da26f9bab5d9890c /lib/gitlab
parentf65227a163435d66e3f0b80f4c52ae59d8df39a2 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/git_access_project.rb2
-rw-r--r--lib/gitlab/git_audit_event.rb28
-rw-r--r--lib/gitlab/workhorse.rb3
3 files changed, 3 insertions, 30 deletions
diff --git a/lib/gitlab/git_access_project.rb b/lib/gitlab/git_access_project.rb
index 732e0e14257..b007a957348 100644
--- a/lib/gitlab/git_access_project.rb
+++ b/lib/gitlab/git_access_project.rb
@@ -47,7 +47,7 @@ module Gitlab
end
def repository_path_match
- strong_memoize(:repository_path_match) { repository_path.match(Gitlab::PathRegex.full_project_git_path_regex) || {} }
+ strong_memoize(:repository_path_match) { repository_path&.match(Gitlab::PathRegex.full_project_git_path_regex) || {} }
end
def ensure_project_on_push!
diff --git a/lib/gitlab/git_audit_event.rb b/lib/gitlab/git_audit_event.rb
deleted file mode 100644
index b8365bdf41f..00000000000
--- a/lib/gitlab/git_audit_event.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-# frozen_string_literal: true
-
-module Gitlab
- class GitAuditEvent # rubocop:disable Gitlab/NamespacedClass
- attr_reader :project, :user, :author
-
- def initialize(player, project)
- @project = project
- @author = player.is_a?(::API::Support::GitAccessActor) ? player.deploy_key_or_user : player
- @user = player.is_a?(::API::Support::GitAccessActor) ? player.user : player
- end
-
- def send_audit_event(msg)
- return if user.blank? || project.blank?
-
- audit_context = {
- name: 'repository_git_operation',
- stream_only: true,
- author: author,
- scope: project,
- target: project,
- message: msg
- }
-
- ::Gitlab::Audit::Auditor.audit(audit_context)
- end
- end
-end
diff --git a/lib/gitlab/workhorse.rb b/lib/gitlab/workhorse.rb
index f2db7e3c9b9..057e89a2a97 100644
--- a/lib/gitlab/workhorse.rb
+++ b/lib/gitlab/workhorse.rb
@@ -20,7 +20,7 @@ module Gitlab
include JwtAuthenticatable
class << self
- def git_http_ok(repository, repo_type, user, action, show_all_refs: false)
+ def git_http_ok(repository, repo_type, user, action, show_all_refs: false, need_audit: false)
raise "Unsupported action: #{action}" unless ALLOWED_GIT_HTTP_ACTIONS.include?(action.to_s)
attrs = {
@@ -28,6 +28,7 @@ module Gitlab
GL_REPOSITORY: repo_type.identifier_for_container(repository.container),
GL_USERNAME: user&.username,
ShowAllRefs: show_all_refs,
+ NeedAudit: need_audit,
Repository: repository.gitaly_repository.to_h,
GitConfigOptions: [],
GitalyServer: {