summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlieablett <cablett@gitlab.com>2019-05-01 10:38:41 +1200
committercharlieablett <cablett@gitlab.com>2019-05-01 10:38:41 +1200
commit4b46b530829cc3dd82c2620a76fbe637ca9009c0 (patch)
tree0a077e44d882b0099be88a8677c28f107bd643cc
parentf2bc55d76f278e492902bec99534600d589177b7 (diff)
downloadgitlab-ce-4b46b530829cc3dd82c2620a76fbe637ca9009c0.tar.gz
Add `html` to sensitive words
-rw-r--r--lib/gitlab/import_export/attribute_cleaner.rb2
-rw-r--r--spec/features/projects/import_export/export_file_spec.rb2
-rw-r--r--spec/lib/gitlab/import_export/project_tree_restorer_spec.rb3
3 files changed, 4 insertions, 3 deletions
diff --git a/lib/gitlab/import_export/attribute_cleaner.rb b/lib/gitlab/import_export/attribute_cleaner.rb
index 7f67f63f26b..7bdef2b6cdb 100644
--- a/lib/gitlab/import_export/attribute_cleaner.rb
+++ b/lib/gitlab/import_export/attribute_cleaner.rb
@@ -4,7 +4,7 @@ module Gitlab
module ImportExport
class AttributeCleaner
ALLOWED_REFERENCES = RelationFactory::PROJECT_REFERENCES + RelationFactory::USER_REFERENCES + ['group_id']
- PROHIBITED_SUFFIXES = %w(_id _html).freeze
+ PROHIBITED_SUFFIXES = %w[_id _html].freeze
def self.clean(*args)
new(*args).clean
diff --git a/spec/features/projects/import_export/export_file_spec.rb b/spec/features/projects/import_export/export_file_spec.rb
index f76f9ba7577..9d74a96ab3d 100644
--- a/spec/features/projects/import_export/export_file_spec.rb
+++ b/spec/features/projects/import_export/export_file_spec.rb
@@ -12,7 +12,7 @@ describe 'Import/Export - project export integration test', :js do
let(:export_path) { "#{Dir.tmpdir}/import_file_spec" }
let(:config_hash) { YAML.load_file(Gitlab::ImportExport.config_file).deep_stringify_keys }
- let(:sensitive_words) { %w[pass secret token key encrypted] }
+ let(:sensitive_words) { %w[pass secret token key encrypted html] }
let(:safe_list) do
{
token: [ProjectHook, Ci::Trigger, CommitStatus],
diff --git a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
index 9aafa41feee..9d2b69ea798 100644
--- a/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
+++ b/spec/lib/gitlab/import_export/project_tree_restorer_spec.rb
@@ -63,6 +63,7 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
it 'does not import note_html' do
note_content = 'Quo reprehenderit aliquam qui dicta impedit cupiditate eligendi'
issue_note = Issue.find_by(description: 'Aliquam enim illo et possimus.').notes.select { |n| n.note.match(/#{note_content}/)}.first
+
expect(issue_note.note_html).to match(/#{note_content}/)
end
end
@@ -71,12 +72,12 @@ describe Gitlab::ImportExport::ProjectTreeRestorer do
it 'does not import note_html' do
note_content = 'Sit voluptatibus eveniet architecto quidem'
merge_request_note = MergeRequest.find_by(title: 'MR1').notes.select { |n| n.note.match(/#{note_content}/)}.first
+
expect(merge_request_note.note_html).to match(/#{note_content}/)
end
end
end
-
it 'creates a valid pipeline note' do
expect(Ci::Pipeline.find_by_sha('sha-notes').notes).not_to be_empty
end