Skip to content
Snippets Groups Projects
Unverified Commit c1c45a97 authored by Steve Xuereb's avatar Steve Xuereb :speech_balloon: Committed by Steve Azzopardi
Browse files

Merge branch 'sh-fix-issue-54189-11-3' into 'security-11-3'

[11.3] Prevent templated services from being imported

See merge request gitlab/gitlabhq!2637
parent 953f789f
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -147,6 +147,8 @@ excluded_attributes:
- :reference
- :reference_html
- :epic_id
services:
- :template
 
methods:
labels:
Loading
Loading
Loading
Loading
@@ -101,6 +101,28 @@
]
}
],
"services": [
{
"id": 100,
"title": "JetBrains TeamCity CI",
"project_id": 5,
"created_at": "2016-06-14T15:01:51.315Z",
"updated_at": "2016-06-14T15:01:51.315Z",
"active": false,
"properties": {},
"template": true,
"push_events": true,
"issues_events": true,
"merge_requests_events": true,
"tag_push_events": true,
"note_events": true,
"job_events": true,
"type": "TeamcityService",
"category": "ci",
"default": false,
"wiki_page_events": true
}
],
"snippets": [],
"hooks": []
}
Loading
Loading
@@ -297,7 +297,8 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
issues: 1,
labels: 1,
milestones: 1,
first_issue_labels: 1
first_issue_labels: 1,
services: 1
 
context 'project.json file access check' do
it 'does not read a symlink' do
Loading
Loading
@@ -382,6 +383,12 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
project_tree_restorer.instance_variable_set(:@path, "spec/lib/gitlab/import_export/project.light.json")
end
 
it 'does not import any templated services' do
restored_project_json
expect(project.services.where(template: true).count).to eq(0)
end
it 'imports labels' do
create(:group_label, name: 'Another label', group: project.group)
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment