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
path: root/lib
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-02-16 17:54:32 +0300
committerStan Hu <stanhu@gmail.com>2019-02-16 17:57:28 +0300
commit2c15cf471d22e5aa69d47924e6bfb6d5eb083552 (patch)
treef1c9886c0c79054eaaaa1da1321aef9378b5a8be /lib
parent894ede2631b995f129770b66f81f03f82205c326 (diff)
Include gl_project_path in API /internal/allowed response
This will enable us to track the human-readable project path with SSH access in gitlab-shell. Currently the Gitaly logs will only show the hashed storage and gl_repository path (e.g. project-1234).
Diffstat (limited to 'lib')
-rw-r--r--lib/api/helpers/internal_helpers.rb8
-rw-r--r--lib/api/internal.rb1
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/api/helpers/internal_helpers.rb b/lib/api/helpers/internal_helpers.rb
index 4eaaca96b49..fe78049af87 100644
--- a/lib/api/helpers/internal_helpers.rb
+++ b/lib/api/helpers/internal_helpers.rb
@@ -81,6 +81,14 @@ module API
Gitlab::GlRepository.gl_repository(project, wiki?)
end
+ def gl_project_path
+ if wiki?
+ project.wiki.full_path
+ else
+ project.full_path
+ end
+ end
+
# Return the repository depending on whether we want the wiki or the
# regular repository
def repository
diff --git a/lib/api/internal.rb b/lib/api/internal.rb
index b44ef2a6ea4..70b32f7d758 100644
--- a/lib/api/internal.rb
+++ b/lib/api/internal.rb
@@ -77,6 +77,7 @@ module API
when ::Gitlab::GitAccessResult::Success
payload = {
gl_repository: gl_repository,
+ gl_project_path: gl_project_path,
gl_id: Gitlab::GlId.gl_id(user),
gl_username: user&.username,
git_config_options: [],