summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislaw Wozniak <swozniak@sponte.uk>2017-12-18 11:15:41 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-12-18 11:15:41 +0000
commit48cb9fa8104c3b001856ebc0521bb52e0a6d7739 (patch)
treee3aed831ae96996a5dc2d33f9dc61927e678a119
parentb4ea25cafa0c7768a8618c673f9a1830f27fc950 (diff)
downloadgitlab-ce-48cb9fa8104c3b001856ebc0521bb52e0a6d7739.tar.gz
Fixes 40842 - Adds extra cookies to JIRA service requests
-rw-r--r--app/models/project_services/jira_service.rb2
-rw-r--r--changelogs/unreleased/feature-40842-provide-oracles-webgate-cookies-to-jira-requests.yml6
-rw-r--r--doc/user/project/integrations/jira.md3
-rw-r--r--spec/models/project_services/jira_service_spec.rb20
4 files changed, 31 insertions, 0 deletions
diff --git a/app/models/project_services/jira_service.rb b/app/models/project_services/jira_service.rb
index 1c065e1ddbd..2be35b6ea9d 100644
--- a/app/models/project_services/jira_service.rb
+++ b/app/models/project_services/jira_service.rb
@@ -46,6 +46,8 @@ class JiraService < IssueTrackerService
context_path: url.path,
auth_type: :basic,
read_timeout: 120,
+ use_cookies: true,
+ additional_cookies: ['OBBasicAuth=fromDialog'],
use_ssl: url.scheme == 'https'
}
end
diff --git a/changelogs/unreleased/feature-40842-provide-oracles-webgate-cookies-to-jira-requests.yml b/changelogs/unreleased/feature-40842-provide-oracles-webgate-cookies-to-jira-requests.yml
new file mode 100644
index 00000000000..d5ff5bc4627
--- /dev/null
+++ b/changelogs/unreleased/feature-40842-provide-oracles-webgate-cookies-to-jira-requests.yml
@@ -0,0 +1,6 @@
+---
+title: Provide additional cookies to JIRA service requests to allow Oracle WebGates
+ Basic Auth
+merge_request:
+author: Stanislaw Wozniak
+type: changed
diff --git a/doc/user/project/integrations/jira.md b/doc/user/project/integrations/jira.md
index 93aec56f8dc..7dc234a9759 100644
--- a/doc/user/project/integrations/jira.md
+++ b/doc/user/project/integrations/jira.md
@@ -98,6 +98,9 @@ password as they will be needed when configuring GitLab in the next section.
- GitLab 8.14 introduced a new way to integrate with JIRA which greatly simplified
the configuration options you have to enter. If you are using an older version,
[follow this documentation][jira-repo-old-docs].
+- In order to support Oracle's Access Manager, GitLab will send additional cookies
+ to enable Basic Auth. The cookie being added to each request is `OBBasicAuth` with
+ a value of `fromDialog`.
To enable JIRA integration in a project, navigate to the
[Integrations page](project_services.md#accessing-the-project-services), click
diff --git a/spec/models/project_services/jira_service_spec.rb b/spec/models/project_services/jira_service_spec.rb
index ad22fb2a386..c9b3c6cf602 100644
--- a/spec/models/project_services/jira_service_spec.rb
+++ b/spec/models/project_services/jira_service_spec.rb
@@ -395,6 +395,26 @@ describe JiraService do
end
end
+ describe 'additional cookies' do
+ let(:project) { create(:project) }
+
+ context 'provides additional cookies to allow basic auth with oracle webgate' do
+ before do
+ @service = project.create_jira_service(
+ active: true, properties: { url: 'http://jira.com' })
+ end
+
+ after do
+ @service.destroy!
+ end
+
+ it 'is initialized' do
+ expect(@service.options[:use_cookies]).to eq(true)
+ expect(@service.options[:additional_cookies]).to eq(["OBBasicAuth=fromDialog"])
+ end
+ end
+ end
+
describe 'project and issue urls' do
let(:project) { create(:project) }