dradis-projects 3.7.0 → 3.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/dradis/plugins/projects/export/template.rb +8 -6
- data/lib/dradis/plugins/projects/export/v1/template.rb +3 -1
- data/lib/dradis/plugins/projects/gem_version.rb +1 -1
- data/lib/dradis/plugins/projects/upload/template.rb +1 -1
- data/lib/dradis/plugins/projects/upload/v1/template.rb +21 -41
- data/lib/tasks/thorfile.rb +12 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c89adcdc78b9d1cb42caf85a3c5bdfac676f7537
|
4
|
+
data.tar.gz: 802d58668e34660d86f46b550e6544a3f62ed35f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8dda41635dd76a933bef1b412df282ced535f4f4f4fa31da0080da9337640cc23df02aa38174da8b2b70633faf7d9f67bbacfb50d793bf083a105c716ff68c5a
|
7
|
+
data.tar.gz: 63049c10e2b62045fa0bf6cd235f6c2ad8987c4c2898a37808e893f534e187a555104c7f4725c7c0a60a6960f1220335e17ae2a203bdbae2a8dac6d89678f2a6
|
data/CHANGELOG.md
CHANGED
@@ -11,17 +11,19 @@ module Dradis::Plugins::Projects::Export
|
|
11
11
|
build_methodologies(template_builder)
|
12
12
|
build_categories(template_builder)
|
13
13
|
build_tags(template_builder)
|
14
|
+
build_report_content(template_builder)
|
14
15
|
end
|
15
16
|
return result
|
16
17
|
end
|
17
18
|
|
18
19
|
private
|
19
|
-
def build_categories(builder);
|
20
|
-
def build_issues(builder);
|
21
|
-
def build_methodologies(builder);
|
22
|
-
def build_nodes(builder);
|
23
|
-
def build_tags(builder);
|
24
|
-
def
|
20
|
+
def build_categories(builder); raise NotImplementedError; end
|
21
|
+
def build_issues(builder); raise NotImplementedError; end
|
22
|
+
def build_methodologies(builder); raise NotImplementedError; end
|
23
|
+
def build_nodes(builder); raise NotImplementedError; end
|
24
|
+
def build_tags(builder); raise NotImplementedError; end
|
25
|
+
def build_report_content(builder); raise NotImplementedError; end
|
26
|
+
def version; raise NotImplementedError; end
|
25
27
|
end
|
26
28
|
end
|
27
29
|
|
@@ -70,7 +70,7 @@ module Dradis::Plugins::Projects::Export::V1
|
|
70
70
|
methodologies = Node.methodology_library.notes
|
71
71
|
builder.methodologies do |methodologies_builder|
|
72
72
|
methodologies.each do |methodology|
|
73
|
-
methodologies_builder.methodology do |methodology_builder|
|
73
|
+
methodologies_builder.methodology(version: VERSION) do |methodology_builder|
|
74
74
|
methodology_builder.text do
|
75
75
|
methodology_builder.cdata!(methodology.text)
|
76
76
|
end
|
@@ -122,6 +122,8 @@ module Dradis::Plugins::Projects::Export::V1
|
|
122
122
|
end
|
123
123
|
end
|
124
124
|
|
125
|
+
def build_report_content(builder); end
|
126
|
+
|
125
127
|
def build_tags(builder)
|
126
128
|
tags = Tag.all
|
127
129
|
builder.tags do |tags_builder|
|
@@ -81,7 +81,7 @@ module Dradis::Plugins::Projects::Upload
|
|
81
81
|
def parse_issues(template); raise NotImplementedError; end
|
82
82
|
def parse_methodologies(template); raise NotImplementedError; end
|
83
83
|
def parse_nodes(template); raise NotImplementedError; end
|
84
|
-
def parse_report_content(template)
|
84
|
+
def parse_report_content(template) raise NotImplementedError; end
|
85
85
|
def parse_tags(template); raise NotImplementedError; end
|
86
86
|
end
|
87
87
|
end
|
@@ -214,27 +214,27 @@ module Dradis::Plugins::Projects::Upload::V1
|
|
214
214
|
|
215
215
|
logger.info { "New node detected: #{label}, parent_id: #{parent_id}, type_id: #{type_id}" }
|
216
216
|
|
217
|
-
# There
|
218
|
-
#
|
219
|
-
#
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
217
|
+
# There are exceptions to the rule, when it does not make sense to have
|
218
|
+
# more than one of this nodes, in any given tree:
|
219
|
+
# - the Configuration.uploadsNode node (detected by its label)
|
220
|
+
# - any nodes with type different from DEFAULT or HOST
|
221
|
+
node =
|
222
|
+
if label == Configuration.plugin_uploads_node
|
223
|
+
Node.create_with(type_id: type_id, parent_id: parent_id)
|
224
|
+
.find_or_create_by!(label: label)
|
225
|
+
elsif [Node::Types::DEFAULT, Node::Types::HOST].exclude?(type_id.to_i)
|
226
|
+
Node.create_with(label: label)
|
227
|
+
.find_or_create_by!(type_id: type_id)
|
228
|
+
else
|
229
|
+
Node.create!(
|
230
|
+
type_id: type_id,
|
231
|
+
label: label,
|
232
|
+
parent_id: parent_id,
|
233
|
+
position: position
|
234
|
+
)
|
235
|
+
end
|
234
236
|
|
235
|
-
if properties
|
236
|
-
node.raw_properties = properties
|
237
|
-
end
|
237
|
+
node.raw_properties = properties if properties
|
238
238
|
|
239
239
|
node.update_attribute(:created_at, created_at.text.strip) if created_at
|
240
240
|
node.update_attribute(:updated_at, updated_at.text.strip) if updated_at
|
@@ -328,27 +328,7 @@ module Dradis::Plugins::Projects::Upload::V1
|
|
328
328
|
end
|
329
329
|
end
|
330
330
|
|
331
|
-
def parse_report_content(template)
|
332
|
-
logger.info { 'Processing Report Content...' }
|
333
|
-
|
334
|
-
contentlib_type_id =
|
335
|
-
template.at_xpath(
|
336
|
-
"//nodes/node/type-id[text()='#{Node::Types::CONTENTLIB}']"
|
337
|
-
)
|
338
|
-
|
339
|
-
if contentlib_type_id
|
340
|
-
content_library_xml = contentlib_type_id.parent
|
341
|
-
document_properties =
|
342
|
-
JSON.parse(content_library_xml.at_xpath('properties').text)
|
343
|
-
|
344
|
-
content_library = Node.content_library
|
345
|
-
content_library.properties =
|
346
|
-
content_library.properties.merge(document_properties)
|
347
|
-
content_library.save
|
348
|
-
end
|
349
|
-
|
350
|
-
logger.info { 'Done.' }
|
351
|
-
end
|
331
|
+
def parse_report_content(template); end
|
352
332
|
|
353
333
|
def parse_tags(template)
|
354
334
|
logger.info { 'Processing Tags...' }
|
data/lib/tasks/thorfile.rb
CHANGED
@@ -79,7 +79,12 @@ class UploadTasks < Thor
|
|
79
79
|
|
80
80
|
detect_and_set_project_scope
|
81
81
|
|
82
|
-
|
82
|
+
default_user_id = @project.owners.first.id
|
83
|
+
|
84
|
+
task_options.merge!({
|
85
|
+
plugin: Dradis::Plugins::Projects::Upload::Template,
|
86
|
+
default_user_id: default_user_id
|
87
|
+
})
|
83
88
|
|
84
89
|
importer = Dradis::Plugins::Projects::Upload::Template::Importer.new(task_options)
|
85
90
|
importer.import(file: file_path)
|
@@ -100,7 +105,12 @@ class UploadTasks < Thor
|
|
100
105
|
|
101
106
|
detect_and_set_project_scope
|
102
107
|
|
103
|
-
|
108
|
+
default_user_id = @project.owners.first.id
|
109
|
+
|
110
|
+
task_options.merge!({
|
111
|
+
plugin: Dradis::Plugins::Projects::Upload::Package,
|
112
|
+
default_user_id: default_user_id
|
113
|
+
})
|
104
114
|
|
105
115
|
importer = Dradis::Plugins::Projects::Upload::Package::Importer.new(task_options)
|
106
116
|
importer.import(file: file_path)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dradis-projects
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Martin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|