diff options
author | Stan Hu <stanhu@gmail.com> | 2019-02-16 17:54:32 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-02-16 17:57:28 +0300 |
commit | 2c15cf471d22e5aa69d47924e6bfb6d5eb083552 (patch) | |
tree | f1c9886c0c79054eaaaa1da1321aef9378b5a8be /lib | |
parent | 894ede2631b995f129770b66f81f03f82205c326 (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.rb | 8 | ||||
-rw-r--r-- | lib/api/internal.rb | 1 |
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: [], |