hiera-eyaml 4.2.0 → 4.3.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: 9eb7f6a848fd49e92f95073ea457a181427bf20e47ba869515a6510d43cc893d
4
- data.tar.gz: cc69d4fa0b0b197c25cd873b30f6974dd669e136e39525fddd6813b72504010b
3
+ metadata.gz: e2577211244aa5ae7a4702accf5c85ccaf652631cc8e83fb1cecd11aa0a6e4de
4
+ data.tar.gz: c399d35a8687cea60ec1a969776163b1b3fe4cd0a53614243154979c4306b104
5
5
  SHA512:
6
- metadata.gz: fe9b09b8ee6c02c20680851b8468336ed4c415987c70c19d1ceb3ec61c97898dbeee0b6cf1df1ad7b807f8797104897d75e497dadb21c52d68614028c9a3bf48
7
- data.tar.gz: e6a29c5b00b2da302a6e621c0bde65809713391aa827a329ee29b890d244d4c75ecc7718f7179b29b0691580a50a2ecff0bdda598a7c00eeb88392fd83238fee
6
+ metadata.gz: 5a2efe12d2603a60cd2d0c3a2931ed1c4b3b9150e65604c20765ba12d34fcf66f87f0f2f48738cc3f07604b0ee65a618eb9797e93b6a46d5df5e248c893ed84e
7
+ data.tar.gz: 69eaedaf4cd15cd26233177a508bfc0e780557639374618c78d3b1c2ff6b081000a5c9bcca0072c020da9eaefcd309ef45c67d094769e47901cb938d63772d16
@@ -11,10 +11,10 @@ jobs:
11
11
  if: github.repository_owner == 'voxpupuli'
12
12
  steps:
13
13
  - uses: actions/checkout@v4
14
- - name: Install Ruby 3.1
14
+ - name: Install Ruby 3.3
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
17
- ruby-version: '3.1'
17
+ ruby-version: '3.3'
18
18
  - name: Build gem
19
19
  run: gem build --strict --verbose *.gemspec
20
20
  - name: Publish gem to rubygems.org
@@ -1,3 +1,4 @@
1
+ ---
1
2
  name: Test
2
3
 
3
4
  on:
@@ -13,7 +14,7 @@ jobs:
13
14
  rubocop:
14
15
  env:
15
16
  BUNDLE_WITHOUT: release
16
- runs-on: ubuntu-latest
17
+ runs-on: ubuntu-24.04
17
18
  steps:
18
19
  - uses: actions/checkout@v4
19
20
  - name: Install Ruby ${{ matrix.ruby }}
@@ -24,7 +25,7 @@ jobs:
24
25
  - name: Run Rubocop
25
26
  run: bundle exec rake rubocop
26
27
  test:
27
- runs-on: ubuntu-latest
28
+ runs-on: ubuntu-24.04
28
29
  strategy:
29
30
  fail-fast: false
30
31
  matrix:
@@ -33,28 +34,35 @@ jobs:
33
34
  - "3.0"
34
35
  - "3.1"
35
36
  - "3.2"
37
+ - "3.3"
36
38
  - jruby-9.4
37
- puppet:
38
- - "~> 8.0"
39
- - "~> 7.24"
40
- - "https://github.com/puppetlabs/puppet.git#main"
39
+ openvox:
40
+ - "~> 8"
41
+ - "~> 7"
42
+ - "https://github.com/OpenVoxProject/puppet.git#main"
41
43
  exclude:
42
44
  - ruby: "3.0"
43
- puppet: "~> 8.0"
45
+ openvox: "~> 8"
46
+ - ruby: "2.7"
47
+ openvox: "~> 8"
48
+
49
+ - ruby: "3.0"
50
+ openvox: "https://github.com/openvoxlabs/puppet.git#main"
44
51
  - ruby: "2.7"
45
- puppet: "~> 8.0"
52
+ openvox: "https://github.com/openvoxlabs/puppet.git#main"
46
53
 
47
54
  - ruby: "3.0"
48
- puppet: "https://github.com/puppetlabs/puppet.git#main"
55
+ openvox: "https://github.com/openvoxproject/puppet.git#main"
49
56
  - ruby: "2.7"
50
- puppet: "https://github.com/puppetlabs/puppet.git#main"
57
+ openvox: "https://github.com/openvoxproject/puppet.git#main"
58
+
51
59
  env:
52
- PUPPET_VERSION: ${{ matrix.puppet }}
60
+ OPENVOX_VERSION: ${{ matrix.openvox }}
53
61
  COVERAGE: ${{ matrix.coverage }}
54
- name: "Ruby ${{ matrix.ruby }} - Puppet ${{ matrix.puppet }}"
62
+ name: "Ruby ${{ matrix.ruby }} - OpenVox ${{ matrix.openvox }}"
55
63
  steps:
56
64
  - name: Enable coverage reporting on Ruby 3.1
57
- if: matrix.puppet == '~> 7.24' && matrix.ruby == '3.1'
65
+ if: matrix.openvox == '~> 7.24' && matrix.ruby == '3.1'
58
66
  run: echo 'COVERAGE=yes' >> $GITHUB_ENV
59
67
  - uses: actions/checkout@v4
60
68
  - name: Install expect
@@ -64,6 +72,8 @@ jobs:
64
72
  with:
65
73
  ruby-version: ${{ matrix.ruby }}
66
74
  bundler-cache: true
75
+ - name: Display Ruby environment
76
+ run: bundle env
67
77
  - name: spec tests
68
78
  run: bundle exec rake features
69
79
  - name: Verify gem builds
data/.rubocop.yml CHANGED
@@ -6,3 +6,6 @@ inherit_gem:
6
6
 
7
7
  Metrics:
8
8
  Enabled: false
9
+
10
+ Style/IfUnlessModifier:
11
+ Enabled: false
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2024-10-20 14:24:21 UTC using RuboCop version 1.64.1.
2
+ # `rubocop --auto-gen-config --no-auto-gen-timestamp`
3
+ # using RuboCop version 1.75.8.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -13,14 +13,6 @@ Layout/CommentIndentation:
13
13
  Exclude:
14
14
  - 'lib/hiera/backend/eyaml/subcommands/help.rb'
15
15
 
16
- # Offense count: 2
17
- # This cop supports safe autocorrection (--autocorrect).
18
- # Configuration parameters: EnforcedStyle.
19
- # SupportedStyles: space, compact, no_space
20
- Layout/SpaceInsideParens:
21
- Exclude:
22
- - 'lib/hiera/backend/eyaml/logginghelper.rb'
23
-
24
16
  # Offense count: 1
25
17
  Lint/DuplicateMethods:
26
18
  Exclude:
@@ -45,23 +37,6 @@ Lint/RescueException:
45
37
  Exclude:
46
38
  - 'lib/hiera/backend/eyaml/subcommand.rb'
47
39
 
48
- # Offense count: 1
49
- Lint/ShadowingOuterLocalVariable:
50
- Exclude:
51
- - 'lib/hiera/backend/eyaml_backend.rb'
52
-
53
- # Offense count: 7
54
- # This cop supports unsafe autocorrection (--autocorrect-all).
55
- # Configuration parameters: AutoCorrect.
56
- Lint/UselessAssignment:
57
- Exclude:
58
- - 'features/support/env.rb'
59
- - 'lib/hiera/backend/eyaml/plugins.rb'
60
- - 'lib/hiera/backend/eyaml/subcommand.rb'
61
- - 'lib/hiera/backend/eyaml/subcommands/unknown_command.rb'
62
- - 'lib/hiera/backend/eyaml/subcommands/version.rb'
63
- - 'lib/hiera/backend/eyaml/utils.rb'
64
-
65
40
  # Offense count: 1
66
41
  # This cop supports unsafe autocorrection (--autocorrect-all).
67
42
  # Configuration parameters: AutoCorrect.
@@ -74,7 +49,7 @@ Lint/UselessMethodDefinition:
74
49
  # Configuration parameters: AutoCorrect, CheckForMethodsWithNoSideEffects.
75
50
  Lint/Void:
76
51
  Exclude:
77
- - 'lib/hiera/backend/eyaml/parser/token.rb'
52
+ - 'features/support/env.rb'
78
53
 
79
54
  # Offense count: 1
80
55
  Naming/AccessorMethodName:
@@ -107,8 +82,9 @@ Naming/HeredocDelimiterNaming:
107
82
  - 'lib/hiera/backend/eyaml/subcommands/unknown_command.rb'
108
83
 
109
84
  # Offense count: 1
110
- # Configuration parameters: EnforcedStyle, AllowedPatterns.
85
+ # Configuration parameters: EnforcedStyle, AllowedPatterns, ForbiddenIdentifiers, ForbiddenPatterns.
111
86
  # SupportedStyles: snake_case, camelCase
87
+ # ForbiddenIdentifiers: __id__, __send__
112
88
  Naming/MethodName:
113
89
  Exclude:
114
90
  - 'lib/hiera/backend/eyaml/encryptors/pkcs7.rb'
@@ -123,7 +99,7 @@ Naming/MethodParameterName:
123
99
  # Offense count: 1
124
100
  # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
125
101
  # SupportedStyles: snake_case, normalcase, non_integer
126
- # AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
102
+ # AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
127
103
  Naming/VariableNumber:
128
104
  Exclude:
129
105
  - 'lib/hiera/backend/eyaml/utils.rb'
@@ -169,14 +145,13 @@ Security/YAMLLoad:
169
145
  - 'features/step_definitions/decrypt_steps.rb'
170
146
  - 'lib/hiera/backend/eyaml_backend.rb'
171
147
 
172
- # Offense count: 9
148
+ # Offense count: 8
173
149
  # This cop supports unsafe autocorrection (--autocorrect-all).
174
150
  # Configuration parameters: EnforcedStyle.
175
151
  # SupportedStyles: always, conditionals
176
152
  Style/AndOr:
177
153
  Exclude:
178
154
  - 'lib/hiera/backend/eyaml/encryptors/pkcs7.rb'
179
- - 'lib/hiera/backend/eyaml/highlinehelper.rb'
180
155
  - 'lib/hiera/backend/eyaml/logginghelper.rb'
181
156
  - 'lib/hiera/backend/eyaml/subcommand.rb'
182
157
  - 'lib/hiera/backend/eyaml_backend.rb'
@@ -220,7 +195,7 @@ Style/EnvHome:
220
195
 
221
196
  # Offense count: 10
222
197
  # This cop supports safe autocorrection (--autocorrect).
223
- # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns.
198
+ # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, Mode, AllowedMethods, AllowedPatterns.
224
199
  # SupportedStyles: annotated, template, unannotated
225
200
  Style/FormatStringToken:
226
201
  EnforcedStyle: unannotated
@@ -248,22 +223,6 @@ Style/IdenticalConditionalBranches:
248
223
  - 'lib/hiera/backend/eyaml/subcommands/decrypt.rb'
249
224
  - 'lib/hiera/backend/eyaml/subcommands/edit.rb'
250
225
 
251
- # Offense count: 3
252
- # This cop supports safe autocorrection (--autocorrect).
253
- Style/IfUnlessModifier:
254
- Exclude:
255
- - 'lib/hiera/backend/eyaml/encryptors/pkcs7.rb'
256
- - 'lib/hiera/backend/eyaml/parser/encrypted_tokens.rb'
257
-
258
- # Offense count: 2
259
- # This cop supports unsafe autocorrection (--autocorrect-all).
260
- # Configuration parameters: AllowedMethods.
261
- # AllowedMethods: nonzero?
262
- Style/IfWithBooleanLiteralBranches:
263
- Exclude:
264
- - 'lib/hiera/backend/eyaml/highlinehelper.rb'
265
- - 'lib/hiera/backend/eyaml_backend.rb'
266
-
267
226
  # Offense count: 1
268
227
  # This cop supports unsafe autocorrection (--autocorrect-all).
269
228
  Style/MapIntoArray:
@@ -408,9 +367,9 @@ Style/ZeroLengthPredicate:
408
367
  Exclude:
409
368
  - 'lib/hiera/backend/eyaml/parser/parser.rb'
410
369
 
411
- # Offense count: 11
370
+ # Offense count: 13
412
371
  # This cop supports safe autocorrection (--autocorrect).
413
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
372
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
414
373
  # URISchemes: http, https
415
374
  Layout/LineLength:
416
375
  Max: 194
data/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [v4.3.0](https://github.com/voxpupuli/hiera-eyaml/tree/v4.3.0) (2025-06-05)
6
+
7
+ [Full Changelog](https://github.com/voxpupuli/hiera-eyaml/compare/v4.2.0...v4.3.0)
8
+
9
+ **Implemented enhancements:**
10
+
11
+ - CI: Replace puppet with openvox [\#390](https://github.com/voxpupuli/hiera-eyaml/pull/390) ([bastelfreak](https://github.com/bastelfreak))
12
+ - Add Ruby 3.3 to CI matrix [\#386](https://github.com/voxpupuli/hiera-eyaml/pull/386) ([bastelfreak](https://github.com/bastelfreak))
13
+
14
+ **Merged pull requests:**
15
+
16
+ - voxpupuli-rubocop: Update 2.8.0-\>3.1.0 [\#393](https://github.com/voxpupuli/hiera-eyaml/pull/393) ([bastelfreak](https://github.com/bastelfreak))
17
+
5
18
  ## [v4.2.0](https://github.com/voxpupuli/hiera-eyaml/tree/v4.2.0) (2024-10-21)
6
19
 
7
20
  [Full Changelog](https://github.com/voxpupuli/hiera-eyaml/compare/v4.1.0...v4.2.0)
data/Gemfile CHANGED
@@ -21,7 +21,7 @@ group :development do
21
21
  gem 'aruba', '~> 2.2'
22
22
  gem 'cucumber', '~> 9.2'
23
23
  gem 'hiera-eyaml-plaintext'
24
- gem 'puppet', *location_for(ENV['PUPPET_VERSION']) if ENV['PUPPET_VERSION']
24
+ gem 'openvox', *location_for(ENV['OPENVOX_VERSION']) if ENV['OPENVOX_VERSION']
25
25
  end
26
26
 
27
27
  group :release do
data/Rakefile CHANGED
@@ -26,7 +26,7 @@ end
26
26
  # https://stackoverflow.com/questions/6473419/using-simplecov-to-display-cucumber-code-coverage
27
27
  require 'cucumber/rake/task'
28
28
  Cucumber::Rake::Task.new(:features) do |t|
29
- t.cucumber_opts = %w[--format progress] # Any valid command line option can go here.
29
+ t.cucumber_opts = %w[--format progress --strict] # Any valid command line option can go here.
30
30
  end
31
31
 
32
32
  begin
data/hiera-eyaml.gemspec CHANGED
@@ -16,12 +16,12 @@ Gem::Specification.new do |gem|
16
16
  gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
17
17
  gem.require_paths = ['lib']
18
18
 
19
- gem.add_runtime_dependency 'highline', '>= 2.1', '< 4'
20
- gem.add_runtime_dependency 'optimist', '~> 3.1'
19
+ gem.add_dependency 'highline', '>= 2.1', '< 4'
20
+ gem.add_dependency 'optimist', '~> 3.1'
21
21
 
22
22
  gem.add_development_dependency 'rake', '~> 13.2', '>= 13.2.1'
23
23
  gem.add_development_dependency 'rspec-expectations', '~> 3.13'
24
- gem.add_development_dependency 'voxpupuli-rubocop', '~> 2.8.0'
24
+ gem.add_development_dependency 'voxpupuli-rubocop', '~> 3.1.0'
25
25
 
26
26
  gem.required_ruby_version = '>= 2.7', ' < 4'
27
27
  end
@@ -10,11 +10,7 @@ class Hiera
10
10
 
11
11
  def self.confirm?(message)
12
12
  result = ask("#{message} (y/N): ")
13
- if result.downcase == 'y' or result.downcase == 'yes'
14
- true
15
- else
16
- false
17
- end
13
+ %w[y yes].include?(result.downcase) || false
18
14
  end
19
15
  end
20
16
  end
@@ -50,7 +50,7 @@ class Hiera
50
50
  if hiera?
51
51
  Hiera.send(hiera_loglevel, message) if threshold.nil? or Eyaml.verbosity_level > threshold
52
52
  elsif threshold.nil? or Eyaml.verbosity_level > threshold
53
- STDERR.puts self.colorize( message, cli_color )
53
+ STDERR.puts self.colorize(message, cli_color)
54
54
  end
55
55
  end
56
56
 
@@ -146,9 +146,7 @@ class Hiera
146
146
 
147
147
  def create_token(string)
148
148
  md = @regex.match(string)
149
- if EncToken.encrypt_unchanged == false && !md[1].nil? && (md[3] == EncToken.tokens_map[md[1]])
150
- return EncToken.plain_text_value(:string, md[3], md[2], string, md[1])
151
- end
149
+ return EncToken.plain_text_value(:string, md[3], md[2], string, md[1]) if EncToken.encrypt_unchanged == false && !md[1].nil? && (md[3] == EncToken.tokens_map[md[1]])
152
150
 
153
151
  EncToken.decrypted_value(:string, md[3], md[2], string, md[1])
154
152
  end
@@ -161,9 +159,7 @@ class Hiera
161
159
 
162
160
  def create_token(string)
163
161
  md = @regex.match(string)
164
- if EncToken.encrypt_unchanged == false && !md[2].nil? && (md[4] == EncToken.tokens_map[md[2]])
165
- return EncToken.plain_text_value(:string, md[4], md[3], string, md[2])
166
- end
162
+ return EncToken.plain_text_value(:string, md[4], md[3], string, md[2]) if EncToken.encrypt_unchanged == false && !md[2].nil? && (md[4] == EncToken.tokens_map[md[2]])
167
163
 
168
164
  EncToken.decrypted_value(:block, md[4], md[3], string, md[2], md[1])
169
165
  end
@@ -5,7 +5,6 @@ class Hiera
5
5
  class TokenType
6
6
  attr_reader :regex
7
7
 
8
- @regex
9
8
  def create_token(_string)
10
9
  raise 'Abstract method called'
11
10
  end
@@ -37,7 +37,6 @@ class Hiera
37
37
  dependency = spec.dependencies.find { |d| d.name == 'hiera-eyaml' }
38
38
  next if dependency && !dependency.requirement.satisfied_by?(this_version)
39
39
 
40
- file = nil
41
40
  file = if gem_version >= Gem::Version.new('1.8.0')
42
41
  spec.matches_for_glob('**/eyaml_init.rb').first
43
42
  else
@@ -86,7 +86,7 @@ class Hiera
86
86
  def self.find(commandname = 'unknown_command')
87
87
  begin
88
88
  require "hiera/backend/eyaml/subcommands/#{commandname.downcase}"
89
- rescue Exception => e
89
+ rescue Exception
90
90
  require 'hiera/backend/eyaml/subcommands/unknown_command'
91
91
  return Hiera::Backend::Eyaml::Subcommands::UnknownCommand
92
92
  end
@@ -20,7 +20,6 @@ class Hiera
20
20
  end
21
21
 
22
22
  def self.execute
23
- subcommands = Eyaml.subcommands
24
23
  puts <<~EOS
25
24
  Unknown subcommand#{': ' + Eyaml.subcommand if Eyaml.subcommand}
26
25
 
@@ -15,8 +15,6 @@ class Hiera
15
15
  end
16
16
 
17
17
  def self.execute
18
- plugin_versions = {}
19
-
20
18
  Eyaml::LoggingHelper.info "hiera-eyaml (core): #{Eyaml::VERSION}"
21
19
 
22
20
  Plugins.plugins.each do |plugin|
@@ -60,7 +60,7 @@ class Hiera
60
60
  return string if orig_encoding == Encoding::UTF_8
61
61
 
62
62
  string.dup.force_encoding(Encoding::UTF_8)
63
- rescue EncodingError => e
63
+ rescue EncodingError
64
64
  warn "Unable to encode to \"Encoding::UTF_8\" using the original \"#{orig_encoding}\""
65
65
  string
66
66
  end
@@ -1,7 +1,7 @@
1
1
  class Hiera
2
2
  module Backend
3
3
  module Eyaml
4
- VERSION = '4.2.0'
4
+ VERSION = '4.3.0'
5
5
  DESCRIPTION = 'Hiera-eyaml is a backend for Hiera which provides OpenSSL encryption/decryption for Hiera properties'
6
6
 
7
7
  class RecoverableError < StandardError
@@ -105,7 +105,7 @@ class Hiera
105
105
  end
106
106
 
107
107
  def encrypted?(data)
108
- /.*ENC\[.*\]/.match?(data) ? true : false
108
+ /.*ENC\[.*\]/.match?(data) || false
109
109
  end
110
110
 
111
111
  def parse_answer(data, scope, extra_data = {})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiera-eyaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-21 00:00:00.000000000 Z
11
+ date: 2025-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -84,14 +84,14 @@ dependencies:
84
84
  requirements:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
- version: 2.8.0
87
+ version: 3.1.0
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: 2.8.0
94
+ version: 3.1.0
95
95
  description: Hiera backend for decrypting encrypted yaml properties
96
96
  email: voxpupuli@groups.io
97
97
  executables:
@@ -146,7 +146,7 @@ homepage: https://github.com/voxpupuli/hiera-eyaml/
146
146
  licenses:
147
147
  - MIT
148
148
  metadata: {}
149
- post_install_message:
149
+ post_install_message:
150
150
  rdoc_options: []
151
151
  require_paths:
152
152
  - lib
@@ -164,8 +164,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  - !ruby/object:Gem::Version
165
165
  version: '0'
166
166
  requirements: []
167
- rubygems_version: 3.3.27
168
- signing_key:
167
+ rubygems_version: 3.5.22
168
+ signing_key:
169
169
  specification_version: 4
170
170
  summary: OpenSSL Encryption backend for Hiera
171
171
  test_files: []