dradis-plugins 4.19.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71b6ed361bb7be89c9866b89c5aaf0f07dcea637453c80db034d84f53e4baac5
4
- data.tar.gz: 11db1abdc7c169d147c2a2445e9ce277568103579c9d9435b30fbe1a978fe19f
3
+ metadata.gz: 0c0f03b4fe267f990094ae155369fc8d7eb667ad36dffb3cb2359126731f6bf2
4
+ data.tar.gz: fd98735eab3125c8145b49968dca0de2a80a46f3a8769ca02bdf06b71b0168cc
5
5
  SHA512:
6
- metadata.gz: c3457901aaadbd6ff208f087dcb10e36faae4d54a2d2f4ce2dcd708c4ee732b9fef857c8e62c2551b98a641956d29f2e900c221657d34265009cbcb80f068639
7
- data.tar.gz: be6a12a20cd48e49f54ba69e7b176cf1891ecc61091d0db620c9e6b5285d6bc87f290887c05ab5819ea58df5509598cc79f40f6378e3798f7cce3ed04787c58c
6
+ metadata.gz: ab7cafa1f6a2c963990e4e8162e6e7232f9ec8e918588ca5767a268fd0e0aabe861da5dbc4d1a2db206f5c720f4054149a898c42b151f8597a6a3d125ae49191
7
+ data.tar.gz: a6557601dde763a45b2f760e1f0b2315c6d126cce2919909093f89a2b0037b11e874decee2ad281951131f9b509909540b215a00d1ce15b0a35a8b118c6af1a4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ v5.0.0 (March 2026)
2
+ - Return false when checking Engine.enabled? if the db is not yet ready
3
+ - Store encrypted configuration under `config/credentials/`
4
+
1
5
  v4.19.0 (November 2025)
2
6
  - Add state attribute to Result class
3
7
 
@@ -43,19 +43,26 @@ module Dradis
43
43
  end
44
44
 
45
45
  def enabled?
46
- ActiveRecord::Type::Boolean.new.cast(self.settings.enabled)
46
+ # if db is ready, answer truthfully. If not, return false
47
+ db_ready? && ActiveRecord::Type::Boolean.new.cast(self.settings.enabled)
47
48
  end
48
49
 
49
50
  def enable!
51
+ return unless db_ready?
50
52
  self.settings.update_settings(enabled: true)
51
53
  Dradis::Plugins::clear_enabled_list
52
54
  end
53
55
 
54
56
  def disable!
57
+ return unless db_ready?
55
58
  self.settings.update_settings(enabled: false)
56
59
  Dradis::Plugins::clear_enabled_list
57
60
  end
58
61
  end
62
+
63
+ def db_ready?
64
+ (ActiveRecord::Base.connection.verify! rescue false) && ::Configuration.table_exists?
65
+ end
59
66
  end
60
67
  end
61
68
  end
@@ -6,8 +6,8 @@ module Dradis
6
6
  end
7
7
 
8
8
  module VERSION
9
- MAJOR = 4
10
- MINOR = 19
9
+ MAJOR = 5
10
+ MINOR = 0
11
11
  TINY = 0
12
12
  PRE = nil
13
13
 
@@ -9,11 +9,11 @@ module Dradis::Plugins::Settings::Adapters
9
9
  end
10
10
 
11
11
  def exists?(key)
12
- db_ready? && Configuration.exists?(name: namespaced_key(key))
12
+ Configuration.exists?(name: namespaced_key(key))
13
13
  end
14
14
 
15
15
  def read(key)
16
- db_ready? && Configuration.find_by(name: namespaced_key(key))&.value
16
+ Configuration.find_by(name: namespaced_key(key))&.value
17
17
  end
18
18
 
19
19
  def write(key, value)
@@ -26,9 +26,5 @@ module Dradis::Plugins::Settings::Adapters
26
26
  def namespaced_key(key)
27
27
  [@namespace, key.to_s.underscore].join(':')
28
28
  end
29
-
30
- def db_ready?
31
- (ActiveRecord::Base.connection.verify! rescue false) && Configuration.table_exists?
32
- end
33
29
  end
34
30
  end
@@ -32,17 +32,17 @@ module Dradis::Plugins::Settings::Adapters
32
32
  end
33
33
 
34
34
  private
35
+
35
36
  def config_path
36
- @config_path ||= Rails.root.join('config', 'shared', 'dradis-plugins.yml.enc')
37
+ @config_path ||= Rails.root.join('config', 'credentials', 'dradis-plugins.yml.enc')
37
38
  end
38
39
 
39
40
  def configuration
40
41
  @configuration ||= begin
41
42
  create_key unless key_path.exist?
42
-
43
+ # env_key is a no-op since we're always providing a key_path, but it is required by the initializer and we don't want to re-use RAILS_MASTER_KEY
43
44
  ActiveSupport::EncryptedConfiguration.new(
44
- config_path: config_path, key_path: key_path,
45
- env_key: 'RAILS_MASTER_KEY', raise_if_missing_key: true
45
+ config_path: config_path, key_path: key_path, env_key: 'DRADIS_PLUGINS_KEY', raise_if_missing_key: true
46
46
  )
47
47
  end
48
48
  end
@@ -52,7 +52,7 @@ module Dradis::Plugins::Settings::Adapters
52
52
  end
53
53
 
54
54
  def key_path
55
- @key_path ||= Rails.root.join('config', 'shared', 'dradis-plugins.key')
55
+ @key_path ||= Rails.root.join('config', 'credentials', 'dradis-plugins.key')
56
56
  end
57
57
  end
58
58
  end
@@ -22,8 +22,9 @@ module Dradis
22
22
 
23
23
  # Filters the list of plugins and only returns those that provide the
24
24
  # requested feature and enabled
25
- def with_feature(feature)
26
- enabled_list.select do |plugin|
25
+ def with_feature(feature, include_disabled: false)
26
+ integrations_list = include_disabled ? list : enabled_list
27
+ integrations_list.select do |plugin|
27
28
  # engine = "#{plugin}::Engine".constantize
28
29
  plugin.provides?(feature)
29
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dradis-plugins
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.19.0
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Martin