dradis-plugins 3.17.0 → 3.22.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63c73b9308963a281e182f68ce2eaaa1d1da5c0dab9fb3a042e63ff9f6f4668d
4
- data.tar.gz: b7d3cab673e307dc688828d9a1735295e6d1da9e1c4450aab4f4210993163e03
3
+ metadata.gz: aec930044375d9b49474c44716cd0108e7417168ada398e15fc7de4c996e9eef
4
+ data.tar.gz: 76dba5b7f11a1482f33e2a5bfbecaa6237cea9411c194a4a890c33a17222ef05
5
5
  SHA512:
6
- metadata.gz: 0d557b0eb64458639b1ec6df6ddf38977e017eb0a0f4bf14d5b18b1e3265295b5753dd79dfe757bbade80ec46d8786ab8daeeb2373240cf838ddb6bf4e109702
7
- data.tar.gz: 0547b4ca3771a9f2aa8db971295292063a5a9ff6afb67dd89cc6a2d92393ae27ca6ba8bb452ef553fe75f04cb783f0ba4900084c80cc47ce2c15cb2fe9427e41
6
+ metadata.gz: a6ee68cdd5537f7ff4c5d56ff035e93c504d3405c99ed0ed418eb982d72d877876e36f94e59d4c6a973c8396cc42672b8ef0808a09f6c450e050020f62efbf1c
7
+ data.tar.gz: e79a08c7dadbf644e658ec32a805e5604edc273c9da0819473262ebf9a12e495b35e47be32b93771317cf8ad741dd9c8163ec58b47e99664691898388eec470a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## Dradis Framework 3.22 (April, 2021) ##
2
+
3
+ * ContentService#create_evidence: deduplicate Evidence from integrations.
4
+
5
+ ## Dradis Framework 3.21 (February, 2021) ##
6
+
7
+ * Rename `parent` methods to `module_parent` as `Module#parent` is deprecated.
8
+
9
+ ## Dradis Framework 3.20 (January, 2021) ##
10
+
11
+ * No changes.
12
+
13
+ ## Dradis Framework 3.19 (September, 2020) ##
14
+
15
+ * No changes.
16
+
17
+ ## Dradis Framework 3.18 (July, 2020) ##
18
+
19
+ * Added PersistentPermissions module to dry up permissions endpoints.
20
+
1
21
  ## Dradis Framework 3.17 (May, 2020) ##
2
22
 
3
23
  * No changes.
data/Gemfile CHANGED
@@ -1,10 +1,6 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
2
 
3
- #gem 'dradis_core', path: '/Users/etd/dradis/git/dradis/core'
4
- #gem 'dradis', :github => 'dradis/dradisframework' # temporarily here until 3.0.0.beta is released
5
- # git "https://github.com/dradis/dradisframework.git", :branch => 'dradis3.x' do
6
- # gem 'dradis_core'
7
- # end
3
+ source 'https://rubygems.org'
8
4
 
9
5
  # Specify your gem's dependencies in dradis-html_export.gemspec
10
6
  gemspec
@@ -0,0 +1,43 @@
1
+ module Dradis
2
+ module Plugins
3
+ module PersistentPermissions
4
+ extend ActiveSupport::Concern
5
+
6
+ def update
7
+ @user = User.authors.find(params[:id])
8
+
9
+ Permission.transaction do
10
+ Permission.where(component: self.class.component_name, user_id: params[:id]).destroy_all
11
+
12
+ permissions_params[:permissions]&.each do |permission|
13
+ # Validate the permission being created is a valid value
14
+ next unless self.class.permissions_validation.call(permission) if self.class.permissions_validation
15
+
16
+ Permission.create!(
17
+ component: self.class.component_name,
18
+ name: permission,
19
+ user_id: params[:id]
20
+ )
21
+ end
22
+ end
23
+
24
+ redirect_to main_app.edit_admin_user_permissions_path(params[:id]), notice: "#{@user.name}'s permissions have been updated."
25
+ end
26
+
27
+ private
28
+
29
+ def permissions_params
30
+ params.require(self.class.component_name).permit(permissions: [])
31
+ end
32
+
33
+ class_methods do
34
+ attr_accessor :component_name, :permissions_validation
35
+
36
+ def permissible_tool(component_name, opts = {})
37
+ self.component_name = component_name
38
+ self.permissions_validation = opts[:validation]
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
@@ -7,10 +7,11 @@ module Dradis::Plugins::ContentService
7
7
  node = args.fetch(:node, default_node_parent)
8
8
  issue = args[:issue] || default_evidence_issue
9
9
 
10
- evidence = node.evidence.new(issue_id: issue.id, content: content)
10
+ # Using node.evidence.new would result in some evidence being saved later on.
11
+ evidence = ::Evidence.new(issue_id: issue.id, content: content, node_id: node.id)
11
12
 
12
13
  if evidence.valid?
13
- evidence.save
14
+ evidence = ::Evidence.find_or_create_by(issue_id: issue.id, node_id: node.id, content: content)
14
15
  else
15
16
  try_rescue_from_length_validation(
16
17
  model: evidence,
@@ -7,7 +7,7 @@ module Dradis
7
7
 
8
8
  module VERSION
9
9
  MAJOR = 3
10
- MINOR = 17
10
+ MINOR = 22
11
11
  TINY = 0
12
12
  PRE = nil
13
13
 
@@ -22,7 +22,7 @@ module Dradis::Plugins::Upload::Base
22
22
  extend ActiveSupport::Concern
23
23
 
24
24
  included do
25
- parent.extend NamespaceClassMethods
25
+ module_parent.extend NamespaceClassMethods
26
26
  end
27
27
 
28
28
  module ClassMethods
@@ -41,7 +41,7 @@ module Dradis::Plugins::Upload::Base
41
41
  # ]
42
42
  # end
43
43
  def uploaders()
44
- [parent]
44
+ [module_parent]
45
45
  end
46
46
  end
47
47
 
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.17.0
4
+ version: 3.22.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: 2020-06-02 00:00:00.000000000 Z
11
+ date: 2021-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -67,6 +67,7 @@ files:
67
67
  - LICENSE
68
68
  - README.md
69
69
  - Rakefile
70
+ - app/controllers/concerns/dradis/plugins/persistent_permissions.rb
70
71
  - app/controllers/dradis/plugins/export/base_controller.rb
71
72
  - dradis-plugins.gemspec
72
73
  - lib/dradis-plugins.rb
@@ -125,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
126
  - !ruby/object:Gem::Version
126
127
  version: '0'
127
128
  requirements: []
128
- rubygems_version: 3.0.1
129
+ rubygems_version: 3.1.2
129
130
  signing_key:
130
131
  specification_version: 4
131
132
  summary: Plugin manager for the Dradis Framework project.