chef-vault 4.1.11 → 4.2.5

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: 44f75213a45df776972cad854aedf5abb94d7a54fde7a9986caed78930f8790e
4
- data.tar.gz: aaa272cb7893c232b456ef5148bfc0ff91bc5b53a8ae4e9b573f68edaff78df8
3
+ metadata.gz: '0974951af472b372835093b27c8749e84742a232ea3ca1b2431619b833955f33'
4
+ data.tar.gz: 29b8a342842474dca7ff663addf310b8d1a968e954840c2c2a16bd0e812bbf9d
5
5
  SHA512:
6
- metadata.gz: ad149c125f2aa41b9e3fd8d07281c65ecec8317bbc5a6daf2b7deb9e6def089820e57ee59ca68b53852f6fffe54cbf8d711e1c40b6ac04629597bc3ef07107c2
7
- data.tar.gz: 8e0f928a9b4e8dfb6a2800d0d5c65af323cc2f4678b91b2a535b4c450cd71d96ea320b9861638329821ffe5041e025a81e1cf5dbb1cab5bc90bfcd703876afc1
6
+ metadata.gz: 71e4d13486154f085c0b9eed253e473849f9630cf236f36ca653a8a4e8993a932d8b87f443a37283c66b66a955958026348ca74e629d947f87075c0ed01b06c7
7
+ data.tar.gz: e00903b95732ff8c124d731125f465feda8f0c44a0361b8150bf5ce3bc70c8f36138ed55ce149f33a2651a30b16367f1277fc9e78f7efb9d3c7c94e1da44e2fa
data/Gemfile CHANGED
@@ -5,20 +5,22 @@ gemspec
5
5
  group :development do
6
6
  gem "chefstyle"
7
7
  gem "rake"
8
- gem "contracts", "~> 0.16.1" # pin until we drop ruby < 2.7
8
+ gem "appbundler"
9
9
  if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.0.0")
10
+ gem "contracts", "~> 0.16.1" # pin until we drop ruby < 2.7
10
11
  gem "chef-zero"
11
- gem "rspec", "~> 3.4"
12
- gem "aruba", "~> 0.6"
13
- gem "chef", "~> 14.0"
14
- gem "chef-utils", "17.10.0" # pin until we drop ruby 2.5
12
+ gem "rspec", "~> 3.0"
13
+ gem "aruba", "~> 2.2"
14
+ gem "chef", "~> 15.4"
15
+ gem "chef-utils", "17.10.68" # pin until we drop ruby 2.5
15
16
  else
16
- gem "chef-zero", ">= 15.0.4"
17
- gem "chef", "~> 17.0"
18
- gem "rspec", "~> 3.10.0"
19
- gem "aruba", "~> 1.1"
20
- gem "knife", "~> 17.0"
21
- gem "chef-utils", "17.10.0" # pin until we drop ruby >=3
17
+ gem "contracts", "~> 0.17"
18
+ gem "chef-zero", "~> 15.0"
19
+ gem "chef", ">= 18.5.0"
20
+ gem "rspec", "~> 3.0"
21
+ gem "aruba", "~> 2.3"
22
+ gem "knife", "~> 18.0"
23
+ gem "chef-utils", ">= 18.5.0" # pin until we drop ruby >=3
22
24
  end
23
25
  end
24
26
 
@@ -31,7 +33,6 @@ end
31
33
  group :debug do
32
34
  gem "pry"
33
35
  gem "pry-byebug"
34
- gem "pry-stack_explorer", "~> 0.6.1" # pin until we drop ruby < 2.6
35
36
  gem "rb-readline"
36
37
  end
37
38
 
data/chef-vault.gemspec CHANGED
@@ -31,5 +31,8 @@ Gem::Specification.new do |s|
31
31
  s.bindir = "bin"
32
32
  s.executables = %w{ chef-vault }
33
33
 
34
- s.required_ruby_version = ">= 2.6"
34
+ s.required_ruby_version = ">= 3.1"
35
+
36
+ # syslog was removed from Ruby's standard library in 3.4; see https://stdgems.org/new-in/3.4
37
+ s.add_dependency "syslog", "~> 0.3"
35
38
  end
@@ -39,38 +39,10 @@ class ChefVault
39
39
  end
40
40
 
41
41
  def values_from_json(json)
42
- validate_json(json)
43
42
  JSON.parse(json)
44
43
  rescue JSON::ParserError
45
44
  raise JSON::ParserError, "#{json} is not valid JSON!"
46
45
  end
47
-
48
- # I/P: json string
49
- # Raises `InvalidValue` if any of the json's values contain non-printable characters.
50
- def validate_json(json)
51
- begin
52
- evaled_json = eval(json) # rubocop: disable Security/Eval
53
- rescue SyntaxError
54
- raise ChefVault::Exceptions::InvalidValue, "#{json} is not valid JSON!"
55
- end
56
-
57
- if evaled_json.is_a?(Hash)
58
- evaled_json.each do |key, value|
59
- next unless printable?(value.to_s)
60
-
61
- msg = "Value '#{value}' of key '#{key}' contains non-printable characters. Check that backslashes are escaped with another backslash (e.g. C:\\\\Windows) in double-quoted strings."
62
- ChefVault::Log.warn(msg)
63
- end
64
- end
65
- end
66
-
67
- # I/P: String
68
- # O/P: true/false
69
- # returns true if string is free of non-printable characters (escape sequences)
70
- # this returns false for whitespace escape sequences as well, e.g. \n\t
71
- def printable?(string)
72
- /[^[:print:]]|[[:space:]]/.match(string)
73
- end
74
46
  end
75
47
  end
76
48
  end
@@ -318,6 +318,9 @@ class ChefVault
318
318
  rescue Chef::Exceptions::ValidationFailed
319
319
  raise ChefVault::Exceptions::ItemNotFound,
320
320
  "#{vault}/#{name} could not be found"
321
+ rescue Chef::EncryptedDataBagItem::DecryptionFailure
322
+ raise ChefVault::Exceptions::SecretDecryption,
323
+ "#{vault}/#{name} is encrypted for you, but your private key failed to decrypt the contents."
321
324
  end
322
325
  format_output(opts[:values], item) if opts[:values]
323
326
  item
@@ -15,6 +15,6 @@
15
15
  # limitations under the License.
16
16
 
17
17
  class ChefVault
18
- VERSION = "4.1.11"
18
+ VERSION = "4.2.5"
19
19
  MAJOR, MINOR, TINY = VERSION.split(".")
20
20
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-vault
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.11
4
+ version: 4.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom May
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-14 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2025-09-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: syslog
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.3'
13
27
  description: Data encryption support for Chef Infra using data bags
14
28
  email:
15
29
  - thom@chef.io
@@ -61,14 +75,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
61
75
  requirements:
62
76
  - - ">="
63
77
  - !ruby/object:Gem::Version
64
- version: '2.6'
78
+ version: '3.1'
65
79
  required_rubygems_version: !ruby/object:Gem::Requirement
66
80
  requirements:
67
81
  - - ">="
68
82
  - !ruby/object:Gem::Version
69
83
  version: '0'
70
84
  requirements: []
71
- rubygems_version: 3.1.4
85
+ rubygems_version: 3.3.27
72
86
  signing_key:
73
87
  specification_version: 4
74
88
  summary: Data encryption support for Chef Infra using data bags