From 752da8af0576966ebd861b89d8ebfd8bf651fa9e Mon Sep 17 00:00:00 2001 From: Borja Aparicio Date: Tue, 11 Oct 2016 14:20:54 +0200 Subject: [PATCH] Fix Git access panel for Wikis when Kerberos authentication is enabled --- CHANGELOG-EE | 1 + app/models/project_wiki.rb | 5 +++++ spec/models/project_wiki_spec.rb | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/CHANGELOG-EE b/CHANGELOG-EE index c4fdcebdba1127..3455fcb7bcfebf 100644 --- a/CHANGELOG-EE +++ b/CHANGELOG-EE @@ -3,6 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.13.0 (unreleased) - Fix 500 error updating mirror URLs for projects - Fix validations related to mirroring settings form. !773 + - Fix Git access panel for Wikis when Kerberos authentication is enabled (Borja Aparicio) v 8.12.5 (unreleased) diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb index 4c74f0b81d6ee4..c17421b3d0974a 100644 --- a/app/models/project_wiki.rb +++ b/app/models/project_wiki.rb @@ -45,6 +45,11 @@ def http_url_to_repo [Gitlab.config.gitlab.url, "/", path_with_namespace, ".git"].join('') end + # No need to have a Kerberos Web url. Kerberos URL will be used only to clone + def kerberos_url_to_repo + [Gitlab.config.build_gitlab_kerberos_url, "/", path_with_namespace, ".git"].join('') + end + def wiki_base_path [Gitlab.config.gitlab.relative_url_root, "/", @project.path_with_namespace, "/wikis"].join('') end diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb index 58b57bd4fef4dc..c1baac00378eba 100644 --- a/spec/models/project_wiki_spec.rb +++ b/spec/models/project_wiki_spec.rb @@ -42,6 +42,14 @@ end end + describe "#kerberos_url_to_repo" do + it 'returns valid kerberos url for this repo' do + gitlab_kerberos_url = Gitlab.config.build_gitlab_kerberos_url + repo_kerberos_url = "#{gitlab_kerberos_url}/#{subject.path_with_namespace}.git" + expect(subject.kerberos_url_to_repo).to eq(repo_kerberos_url) + end + end + describe "#wiki_base_path" do it "returns the wiki base path" do wiki_base_path = "#{Gitlab.config.gitlab.relative_url_root}/#{project.path_with_namespace}/wikis" -- GitLab