hiera-eyaml 3.2.2 → 3.4.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: 5bfbd5d31fef9569be60fa1914e921a042203d41c83925cb908173d74963df05
4
- data.tar.gz: f93f91ef3fa2c34cef964e7e5b5a3b64dde0e1cc2ddb4ad06a0ea94b251bbf4e
3
+ metadata.gz: 07fa2470dede6663473220848ff12ea2bde95812f5f504c665553c255271adc7
4
+ data.tar.gz: 126d572ebb4c0e69dec8d110aea095b7fb9e5184ca1019829c571eebf12654f1
5
5
  SHA512:
6
- metadata.gz: e060aeb86e2f48506413629c9664441c4d1b0fa9862be7c7136e414df7e015a477a399b0453893b2b68d92751b6a2893cf5bbb898fdd6aea0d18b91611678761
7
- data.tar.gz: de656da85d672bdc7b950c21663140cba2eb5c980abdeed0e7f44961f881ac5193c5e394c5e202b5a32dc78086b0e40bda73ada9b6615add4a7640c717934ee9
6
+ metadata.gz: aae5790a6789e3c4a67ccdaba0aca0f396d254fa5f56ca640f6ab645ccee962eab81662f43ea92ac75d2dabc67b8da3b8e646ae291aab506e9589c511f642151
7
+ data.tar.gz: 49dc7d8cedac0ba007f1ccb32cc916c56fb0a9e89f9b67ca5f41482d296f66040372eec1e50f79f9ed946a4736da44fce222c45b7eb66fe9e9a69cb545bcdeaa
@@ -0,0 +1,17 @@
1
+ version: 2
2
+ updates:
3
+ # raise PRs for gem updates
4
+ - package-ecosystem: bundler
5
+ directory: "/"
6
+ schedule:
7
+ interval: daily
8
+ time: "13:00"
9
+ open-pull-requests-limit: 10
10
+
11
+ # Maintain dependencies for GitHub Actions
12
+ - package-ecosystem: github-actions
13
+ directory: "/"
14
+ schedule:
15
+ interval: daily
16
+ time: "13:00"
17
+ open-pull-requests-limit: 10
@@ -1,24 +1,30 @@
1
1
  name: Release
2
2
 
3
3
  on:
4
- create:
5
- ref_type: tag
4
+ push:
5
+ tags:
6
+ - '*'
6
7
 
7
8
  jobs:
8
9
  release:
9
10
  runs-on: ubuntu-latest
10
- if: github.repository == 'voxpupuli/hiera-eyaml'
11
- env:
12
- BUNDLE_WITHOUT: release
11
+ if: github.repository_owner == 'voxpupuli'
13
12
  steps:
14
- - uses: actions/checkout@v2
15
- - name: Install Ruby 2.7
13
+ - uses: actions/checkout@v3
14
+ - name: Install Ruby 3.1
16
15
  uses: ruby/setup-ruby@v1
17
16
  with:
18
- ruby-version: '2.7'
17
+ ruby-version: '3.1'
19
18
  - name: Build gem
20
19
  run: gem build *.gemspec
21
- - name: Publish gem
20
+ - name: Publish gem to rubygems.org
22
21
  run: gem push *.gem
23
22
  env:
24
23
  GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_AUTH_TOKEN }}'
24
+ - name: Setup GitHub packages access
25
+ run: |
26
+ mkdir -p ~/.gem
27
+ echo ":github: Bearer ${{ secrets.GITHUB_TOKEN }}" >> ~/.gem/credentials
28
+ chmod 0600 ~/.gem/credentials
29
+ - name: Publish gem to GitHub packages
30
+ run: gem push --key github --host https://rubygems.pkg.github.com/voxpupuli *.gem
@@ -1,8 +1,13 @@
1
1
  name: Test
2
2
 
3
3
  on:
4
- - pull_request
5
- - push
4
+ pull_request: {}
5
+ push:
6
+ branches:
7
+ - master
8
+
9
+ env:
10
+ BUNDLE_WITHOUT: release
6
11
 
7
12
  jobs:
8
13
  test:
@@ -14,12 +19,53 @@ jobs:
14
19
  - "2.5"
15
20
  - "2.6"
16
21
  - "2.7"
22
+ - "3.0"
23
+ - "3.1"
24
+ - "3.2"
25
+ puppet:
26
+ - "~> 8.0"
27
+ - "~> 7.24"
28
+ - "~> 6.29"
29
+ - "https://github.com/puppetlabs/puppet.git#main"
30
+ exclude:
31
+ - ruby: "3.0"
32
+ puppet: "~> 8.0"
33
+ - ruby: "2.7"
34
+ puppet: "~> 8.0"
35
+ - ruby: "2.6"
36
+ puppet: "~> 8.0"
37
+ - ruby: "2.5"
38
+ puppet: "~> 8.0"
39
+
40
+ - ruby: "2.6"
41
+ puppet: "~> 7.24"
42
+ - ruby: "2.5"
43
+ puppet: "~> 7.24"
44
+
45
+ - ruby: "3.2"
46
+ puppet: "~> 6.29"
47
+ - ruby: "3.1"
48
+ puppet: "~> 6.29"
49
+ - ruby: "3.0"
50
+ puppet: "~> 6.29"
51
+
52
+ - ruby: "3.0"
53
+ puppet: "https://github.com/puppetlabs/puppet.git#main"
54
+ - ruby: "2.7"
55
+ puppet: "https://github.com/puppetlabs/puppet.git#main"
56
+ - ruby: "2.6"
57
+ puppet: "https://github.com/puppetlabs/puppet.git#main"
58
+ - ruby: "2.5"
59
+ puppet: "https://github.com/puppetlabs/puppet.git#main"
17
60
  env:
18
- BUNDLE_WITHOUT: release
19
- PUPPET_VERSION: "~> 6.0"
20
- name: Ruby ${{ matrix.ruby }}
61
+ PUPPET_VERSION: ${{ matrix.puppet }}
62
+ COVERAGE: ${{ matrix.coverage }}
63
+ name: "Ruby ${{ matrix.ruby }} - Puppet ${{ matrix.puppet }}"
21
64
  steps:
22
- - uses: actions/checkout@v2
65
+ - name: Enable coverage reporting on Ruby 3.1
66
+ if: matrix.puppet == '~> 7.0' && matrix.ruby == '3.1'
67
+ run: echo 'COVERAGE=yes' >> $GITHUB_ENV
68
+ - uses: actions/checkout@v3
23
69
  - name: Install expect
24
70
  run: sudo apt-get install expect
25
71
  - name: Install Ruby ${{ matrix.ruby }}
@@ -27,5 +73,17 @@ jobs:
27
73
  with:
28
74
  ruby-version: ${{ matrix.ruby }}
29
75
  bundler-cache: true
76
+ - name: spec tests
77
+ run: bundle exec rake features
78
+ - name: Verify gem builds
79
+ run: gem build *.gemspec
30
80
  - name: Run tests
31
81
  run: bundle exec cucumber -f progress
82
+
83
+ tests:
84
+ needs:
85
+ - test
86
+ runs-on: ubuntu-latest
87
+ name: Test suite
88
+ steps:
89
+ - run: echo Test suite completed
data/CHANGELOG.md CHANGED
@@ -2,6 +2,47 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [v3.4.0](https://github.com/voxpupuli/hiera-eyaml/tree/v3.4.0) (2023-05-26)
6
+
7
+ [Full Changelog](https://github.com/voxpupuli/hiera-eyaml/compare/v3.3.0...v3.4.0)
8
+
9
+ **Implemented enhancements:**
10
+
11
+ - Add Puppet 8 to CI matrix [\#349](https://github.com/voxpupuli/hiera-eyaml/pull/349) ([bastelfreak](https://github.com/bastelfreak))
12
+ - Add Ruby 3.2 support [\#340](https://github.com/voxpupuli/hiera-eyaml/pull/340) ([pschrammel](https://github.com/pschrammel))
13
+
14
+ **Fixed bugs:**
15
+
16
+ - Puppet 7: Ensure we test against 7.24 or newer [\#347](https://github.com/voxpupuli/hiera-eyaml/pull/347) ([bastelfreak](https://github.com/bastelfreak))
17
+ - Run puppet main branch on Ruby 3.1 and newer [\#346](https://github.com/voxpupuli/hiera-eyaml/pull/346) ([bastelfreak](https://github.com/bastelfreak))
18
+
19
+ **Closed issues:**
20
+
21
+ - Encrypt yaml file on my workstation and push to git [\#344](https://github.com/voxpupuli/hiera-eyaml/issues/344)
22
+ - hiera lookup arbitrary hierachy level [\#185](https://github.com/voxpupuli/hiera-eyaml/issues/185)
23
+
24
+ **Merged pull requests:**
25
+
26
+ - Apply Vox Pupuli CI best practices [\#345](https://github.com/voxpupuli/hiera-eyaml/pull/345) ([bastelfreak](https://github.com/bastelfreak))
27
+ - Bump actions/checkout from 2 to 3 [\#343](https://github.com/voxpupuli/hiera-eyaml/pull/343) ([dependabot[bot]](https://github.com/apps/dependabot))
28
+ - Add dependabot for gems and github actions [\#342](https://github.com/voxpupuli/hiera-eyaml/pull/342) ([bastelfreak](https://github.com/bastelfreak))
29
+ - CI: Ensure we use Puppet 6.29 or newer [\#341](https://github.com/voxpupuli/hiera-eyaml/pull/341) ([bastelfreak](https://github.com/bastelfreak))
30
+ - README: Add apt to installation methods [\#338](https://github.com/voxpupuli/hiera-eyaml/pull/338) ([AntoineSebert](https://github.com/AntoineSebert))
31
+
32
+ ## [v3.3.0](https://github.com/voxpupuli/hiera-eyaml/tree/v3.3.0) (2022-05-20)
33
+
34
+ [Full Changelog](https://github.com/voxpupuli/hiera-eyaml/compare/v3.2.2...v3.3.0)
35
+
36
+ **Implemented enhancements:**
37
+
38
+ - Build gem during CI [\#330](https://github.com/voxpupuli/hiera-eyaml/pull/330) ([bastelfreak](https://github.com/bastelfreak))
39
+ - Add more Ruby/Puppet versions to CI matrix [\#326](https://github.com/voxpupuli/hiera-eyaml/pull/326) ([bastelfreak](https://github.com/bastelfreak))
40
+
41
+ **Fixed bugs:**
42
+
43
+ - Repair ruby 3.1.x compability with backwards compability. Bumped vers… [\#329](https://github.com/voxpupuli/hiera-eyaml/pull/329) ([mmachner](https://github.com/mmachner))
44
+ - Fix an "undefined method" error with rubygems \>= 3.3.0 [\#327](https://github.com/voxpupuli/hiera-eyaml/pull/327) ([davidsansome](https://github.com/davidsansome))
45
+
5
46
  ## [v3.2.2](https://github.com/voxpupuli/hiera-eyaml/tree/v3.2.2) (2021-05-03)
6
47
 
7
48
  [Full Changelog](https://github.com/voxpupuli/hiera-eyaml/compare/v3.2.1...v3.2.2)
data/Gemfile CHANGED
@@ -1,5 +1,19 @@
1
1
  source 'https://rubygems.org/'
2
2
 
3
+ # Find a location or specific version for a gem. place_or_version can be a
4
+ # version, which is most often used. It can also be git, which is specified as
5
+ # `git://somewhere.git#branch`. You can also use a file source location, which
6
+ # is specified as `file://some/location/on/disk`.
7
+ def location_for(place_or_version, fake_version = nil)
8
+ if place_or_version =~ /^(https[:@][^#]*)#(.*)/
9
+ [fake_version, { :git => $1, :branch => $2, :require => false }].compact
10
+ elsif place_or_version =~ /^file:\/\/(.*)/
11
+ ['>= 0', { :path => File.expand_path($1), :require => false }]
12
+ else
13
+ [place_or_version, { :require => false }]
14
+ end
15
+ end
16
+
3
17
  gemspec
4
18
 
5
19
  group :development do
@@ -7,7 +21,7 @@ group :development do
7
21
  gem "cucumber", '~> 1.1'
8
22
  gem "rspec-expectations", '~> 3.1.0'
9
23
  gem "hiera-eyaml-plaintext"
10
- gem "puppet", ENV['PUPPET_VERSION'] || '>= 7'
24
+ gem 'puppet', *location_for(ENV['PUPPET_VERSION']) if ENV['PUPPET_VERSION']
11
25
  gem 'github_changelog_generator'
12
26
  gem "activesupport"
13
27
  end
@@ -15,3 +29,8 @@ end
15
29
  group :test do
16
30
  gem "rake"
17
31
  end
32
+
33
+ group :coverage, optional: ENV['COVERAGE'] != 'yes' do
34
+ gem 'simplecov-console', :require => false
35
+ gem 'codecov', :require => false
36
+ end
data/README.md CHANGED
@@ -1,9 +1,12 @@
1
- Hiera eyaml
2
- ===========
1
+ # Hiera eyaml
3
2
 
4
- [![Build Status](https://travis-ci.org/voxpupuli/hiera-eyaml.png?branch=master)](https://travis-ci.org/voxpupuli/hiera-eyaml)
5
- [![Gem Version](https://img.shields.io/gem/v/hiera-eyaml.svg)](https://rubygems.org/gems/hiera-eyaml)
6
- [![Gem Downloads](https://img.shields.io/gem/dt/hiera-eyaml.svg)](https://rubygems.org/gems/hiera-eyaml)
3
+
4
+ [![License](https://img.shields.io/github/license/voxpupuli/hiera-eyaml.svg)](https://github.com/voxpupuli/hiera-eyaml/blob/master/LICENSE)
5
+ [![Test](https://github.com/voxpupuli/hiera-eyaml/actions/workflows/test.yml/badge.svg)](https://github.com/voxpupuli/hiera-eyaml/actions/workflows/test.yml)
6
+ [![codecov](https://codecov.io/gh/voxpupuli/hiera-eyaml/branch/master/graph/badge.svg)](https://codecov.io/gh/voxpupuli/hiera-eyaml)
7
+ [![Release](https://github.com/voxpupuli/hiera-eyaml/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/hiera-eyaml/actions/workflows/release.yml)
8
+ [![RubyGem Version](https://img.shields.io/gem/v/hiera-eyaml.svg)](https://rubygems.org/gems/hiera-eyaml)
9
+ [![RubyGem Downloads](https://img.shields.io/gem/dt/hiera-eyaml.svg)](https://rubygems.org/gems/hiera-eyaml)
7
10
 
8
11
  hiera-eyaml is a backend for Hiera that provides per-value encryption of sensitive data within yaml files
9
12
  to be used by Puppet.
@@ -64,7 +67,13 @@ Setup
64
67
 
65
68
  ### Installing hiera-eyaml
66
69
 
70
+ #### RubyGems
71
+
67
72
  $ gem install hiera-eyaml
73
+
74
+ #### Apt (Ubuntu 18.04+)
75
+
76
+ $ sudo apt install hiera-eyaml
68
77
 
69
78
  ### Installing hiera-eyaml for the new [puppet-server](https://github.com/puppetlabs/puppet-server)
70
79
 
data/Rakefile CHANGED
@@ -1,5 +1,35 @@
1
+ begin
2
+ require 'simplecov'
3
+ require 'simplecov-console'
4
+ require 'codecov'
5
+ rescue LoadError
6
+ else
7
+ SimpleCov.start do
8
+ track_files 'lib/**/*.rb'
9
+
10
+ add_filter '/spec'
11
+
12
+ enable_coverage :branch
13
+
14
+ # do not track vendored files
15
+ add_filter '/vendor'
16
+ add_filter '/.vendor'
17
+ end
18
+
19
+ SimpleCov.formatters = [
20
+ SimpleCov::Formatter::Console,
21
+ SimpleCov::Formatter::Codecov,
22
+ ]
23
+ end
1
24
  require "bundler/gem_tasks"
2
25
 
26
+ # https://cucumber.io/docs/tools/ruby/
27
+ # https://stackoverflow.com/questions/6473419/using-simplecov-to-display-cucumber-code-coverage
28
+ require 'cucumber/rake/task'
29
+ Cucumber::Rake::Task.new(:features) do |t|
30
+ t.cucumber_opts = "--format progress" # Any valid command line option can go here.
31
+ end
32
+
3
33
  begin
4
34
  require 'github_changelog_generator/task'
5
35
  GitHubChangelogGenerator::RakeTask.new :changelog do |config|
data/hiera-eyaml.gemspec CHANGED
@@ -8,7 +8,8 @@ Gem::Specification.new do |gem|
8
8
  gem.version = Hiera::Backend::Eyaml::VERSION
9
9
  gem.description = "Hiera backend for decrypting encrypted yaml properties"
10
10
  gem.summary = "OpenSSL Encryption backend for Hiera"
11
- gem.author = "Tom Poulton"
11
+ gem.author = "Vox Pupuli"
12
+ gem.email = "voxpupuli@groups.io"
12
13
  gem.license = "MIT"
13
14
 
14
15
  gem.homepage = "https://github.com/voxpupuli/hiera-eyaml/"
@@ -19,4 +20,6 @@ Gem::Specification.new do |gem|
19
20
 
20
21
  gem.add_dependency('optimist')
21
22
  gem.add_dependency('highline')
23
+
24
+ gem.required_ruby_version = '>= 2.5.0', ' < 4'
22
25
  end
@@ -25,20 +25,22 @@ class Hiera
25
25
 
26
26
  def self.find
27
27
 
28
+ gem_version = Gem::Version.new(Gem::VERSION)
28
29
  this_version = Gem::Version.create(Hiera::Backend::Eyaml::VERSION)
29
- index = Gem::VERSION >= "1.8.0" ? Gem::Specification : Gem.source_index
30
+ index = gem_version >= Gem::Version.new("1.8.0") ? Gem::Specification : Gem.source_index
30
31
 
31
32
  [index].flatten.each do |source|
32
- specs = Gem::VERSION >= "1.6.0" ? source.latest_specs(true) : source.latest_specs
33
+ specs = gem_version >= Gem::Version.new("1.6.0") ? source.latest_specs(true) : source.latest_specs
33
34
 
34
35
  specs.each do |spec|
36
+ spec = spec.to_spec if spec.respond_to?(:to_spec)
35
37
  next if @@plugins.include? spec
36
38
 
37
39
  dependency = spec.dependencies.find { |d| d.name == "hiera-eyaml" }
38
40
  next if dependency && !dependency.requirement.satisfied_by?( this_version )
39
41
 
40
42
  file = nil
41
- if Gem::VERSION >= "1.8.0"
43
+ if gem_version >= Gem::Version.new("1.8.0")
42
44
  file = spec.matches_for_glob("**/eyaml_init.rb").first
43
45
  else
44
46
  file = Gem.searcher.matching_files(spec, "**/eyaml_init.rb").first
@@ -59,7 +59,7 @@ eos
59
59
  Optimist::die "You must specify an eyaml file" if ARGV.empty?
60
60
  options[:source] = :eyaml
61
61
  options[:eyaml] = ARGV.shift
62
- if File.exists? options[:eyaml]
62
+ if File.exist? options[:eyaml]
63
63
  begin
64
64
  options[:input_data] = File.read options[:eyaml]
65
65
  rescue
@@ -2,7 +2,7 @@ class Hiera
2
2
  module Backend
3
3
  module Eyaml
4
4
 
5
- VERSION = "3.2.2"
5
+ VERSION = "3.4.0"
6
6
  DESCRIPTION = "Hiera-eyaml is a backend for Hiera which provides OpenSSL encryption/decryption for Hiera properties"
7
7
 
8
8
  class RecoverableError < StandardError
@@ -31,7 +31,7 @@ class Hiera
31
31
  debug("Looking for data source #{source}")
32
32
  eyaml_file = Backend.datafile(:eyaml, scope, source, extension) || next
33
33
 
34
- next unless File.exists?(eyaml_file)
34
+ next unless File.exist?(eyaml_file)
35
35
 
36
36
  data = @cache.read(eyaml_file, Hash) do |data|
37
37
  YAML.load(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: 3.2.2
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
- - Tom Poulton
7
+ - Vox Pupuli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-03 00:00:00.000000000 Z
11
+ date: 2023-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: optimist
@@ -39,12 +39,13 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Hiera backend for decrypting encrypted yaml properties
42
- email:
42
+ email: voxpupuli@groups.io
43
43
  executables:
44
44
  - eyaml
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
+ - ".github/dependabot.yml"
48
49
  - ".github/workflows/release.yml"
49
50
  - ".github/workflows/test.yml"
50
51
  - ".gitignore"
@@ -99,14 +100,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
100
  requirements:
100
101
  - - ">="
101
102
  - !ruby/object:Gem::Version
102
- version: '0'
103
+ version: 2.5.0
104
+ - - "<"
105
+ - !ruby/object:Gem::Version
106
+ version: '4'
103
107
  required_rubygems_version: !ruby/object:Gem::Requirement
104
108
  requirements:
105
109
  - - ">="
106
110
  - !ruby/object:Gem::Version
107
111
  version: '0'
108
112
  requirements: []
109
- rubygems_version: 3.1.6
113
+ rubygems_version: 3.3.26
110
114
  signing_key:
111
115
  specification_version: 4
112
116
  summary: OpenSSL Encryption backend for Hiera