dradis-plugins 3.13.0 → 3.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +5 -1
- data/lib/dradis/plugins/content_service/boards.rb +12 -3
- data/lib/dradis/plugins/gem_version.rb +1 -1
- data/spec/lib/dradis/plugins/content_service/boards_spec.rb +45 -0
- data/spec/lib/dradis/plugins/{content_service_spec.rb → content_service/issues_spec.rb} +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2c2c50ad9fb6fab4f1e5b85a9c4586b666fc418299b6b603ff1556662165bfc3
|
4
|
+
data.tar.gz: 3603125d69092bf35542ec51628f9e59abfebdc9dc0a45ecb8f85c219d9b52f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2b5bed67bb4fba361447daf70d8a104b606770af23af972dfeb4e395d26d8f6881041cd86a3118906d041d1cb3364dbf491dff33cd8f44b9e6ece3eb71586af
|
7
|
+
data.tar.gz: 5e2e98ea8c75f6c795460e9c51192a0f3da5520d956865e528dad614c552fbbbd114b2c465181e1917f609421e86f09f56b13c3007eecb853bd70346ffbcdbe0
|
data/CHANGELOG.md
CHANGED
@@ -3,17 +3,26 @@ module Dradis::Plugins::ContentService
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
def all_boards
|
6
|
-
|
6
|
+
project.boards
|
7
|
+
end
|
8
|
+
|
9
|
+
def project_boards
|
10
|
+
project.methodology_library.boards
|
7
11
|
end
|
8
12
|
|
9
13
|
def create_board(args={})
|
10
|
-
name
|
11
|
-
|
14
|
+
name = args.fetch(:name, default_board_name)
|
15
|
+
node_id = args.fetch(:node_id, default_node_id)
|
16
|
+
Board.create(name: name, project_id: project.id, node_id: node_id)
|
12
17
|
end
|
13
18
|
|
14
19
|
private
|
15
20
|
def default_board_name
|
16
21
|
"create_board() invoked by #{plugin} without a :name parameter"
|
17
22
|
end
|
23
|
+
|
24
|
+
def default_node_id
|
25
|
+
project.methodology_library.id
|
26
|
+
end
|
18
27
|
end
|
19
28
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
# To run, execute from Dradis main app folder:
|
4
|
+
# bin/rspec [dradis-plugins path]/spec/lib/dradis/plugins/content_service/boards_spec.rb
|
5
|
+
describe Dradis::Plugins::ContentService::Boards do
|
6
|
+
let(:plugin) { Dradis::Plugins::Nessus }
|
7
|
+
let(:project) { create(:project) }
|
8
|
+
let(:service) do
|
9
|
+
Dradis::Plugins::ContentService::Base.new(
|
10
|
+
plugin: plugin,
|
11
|
+
logger: Rails.logger,
|
12
|
+
project: project
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
describe 'Boards' do
|
17
|
+
describe '#all_boards' do
|
18
|
+
it 'returns all the project-level boards' do
|
19
|
+
board = create(:board, project: project)
|
20
|
+
node = create(:node, project: project)
|
21
|
+
node_board = create(:board, node: node, project: project)
|
22
|
+
|
23
|
+
boards = service.all_boards
|
24
|
+
|
25
|
+
expect(boards).to include(board)
|
26
|
+
expect(boards).to_not include(node_board)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '#create_board' do
|
31
|
+
it 'creates a board without a node' do
|
32
|
+
service.create_board(name: 'NodelessBoard')
|
33
|
+
|
34
|
+
expect(project.reload.boards.where(name: 'NodelessBoard')).to_not be_nil
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'creates a board with a node' do
|
38
|
+
node = create(:node, project: project)
|
39
|
+
service.create_board(name: 'NodeBoard', node_id: node.id)
|
40
|
+
|
41
|
+
expect(project.reload.boards.where(name: 'NodeBoard')).to_not be_nil
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -2,7 +2,7 @@ require 'rails_helper'
|
|
2
2
|
|
3
3
|
# These specs are coming from engines/dradispro-rules/spec/content_service_spec.rb
|
4
4
|
# To run, execute from Dradis main app folder:
|
5
|
-
# bin/rspec [dradis-plugins path]/spec/lib/dradis/plugins/
|
5
|
+
# bin/rspec [dradis-plugins path]/spec/lib/dradis/plugins/content_service/issues_spec.rb
|
6
6
|
|
7
7
|
describe Dradis::Plugins::ContentService::Base do
|
8
8
|
let(:plugin) { Dradis::Plugins::Nessus }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dradis-plugins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.14.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: 2019-
|
11
|
+
date: 2019-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -102,7 +102,8 @@ files:
|
|
102
102
|
- lib/dradis/plugins/upload/importer.rb
|
103
103
|
- lib/dradis/plugins/version.rb
|
104
104
|
- spec/internal/log/test.log
|
105
|
-
- spec/lib/dradis/plugins/
|
105
|
+
- spec/lib/dradis/plugins/content_service/boards_spec.rb
|
106
|
+
- spec/lib/dradis/plugins/content_service/issues_spec.rb
|
106
107
|
- spec/settings_spec.rb
|
107
108
|
- spec/spec_helper.rb
|
108
109
|
homepage: http://dradisframework.org
|
@@ -124,13 +125,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
125
|
- !ruby/object:Gem::Version
|
125
126
|
version: '0'
|
126
127
|
requirements: []
|
127
|
-
|
128
|
-
rubygems_version: 2.6.12
|
128
|
+
rubygems_version: 3.0.2
|
129
129
|
signing_key:
|
130
130
|
specification_version: 4
|
131
131
|
summary: Plugin manager for the Dradis Framework project.
|
132
132
|
test_files:
|
133
133
|
- spec/internal/log/test.log
|
134
|
-
- spec/lib/dradis/plugins/
|
134
|
+
- spec/lib/dradis/plugins/content_service/boards_spec.rb
|
135
|
+
- spec/lib/dradis/plugins/content_service/issues_spec.rb
|
135
136
|
- spec/settings_spec.rb
|
136
137
|
- spec/spec_helper.rb
|