hiera-eyaml 3.2.2 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +14 -8
- data/.github/workflows/test.yml +34 -3
- data/CHANGELOG.md +14 -0
- data/Gemfile +20 -1
- data/README.md +8 -5
- data/Rakefile +30 -0
- data/hiera-eyaml.gemspec +4 -1
- data/lib/hiera/backend/eyaml/plugins.rb +5 -3
- data/lib/hiera/backend/eyaml.rb +1 -1
- metadata +9 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ba41ba9c345e4f06ad535c7b80c6ea77c6ac146e8c983ce19b447b75fbbec32
|
4
|
+
data.tar.gz: 93ebbe3b9a22e5a3fda21e304faf1f837fc6f592288eb6a3745d862d592a8b74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16b457ef156c42950e5610e503ffe45a8553b383f845d983ebf71fe3104312b742dfd325d61a59ad6e09895c485313611699f1063139567432886a693f964cb0
|
7
|
+
data.tar.gz: 66c315ed82b9516a246712d0659874188d6a58837068013f2bc40a31907624bf29c5044c883a519a216ebf8cdc5ce2347c94f960d93f50cca28b0fed79456be9
|
@@ -1,24 +1,30 @@
|
|
1
1
|
name: Release
|
2
2
|
|
3
3
|
on:
|
4
|
-
|
5
|
-
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- '*'
|
6
7
|
|
7
8
|
jobs:
|
8
9
|
release:
|
9
10
|
runs-on: ubuntu-latest
|
10
|
-
if: github.
|
11
|
-
env:
|
12
|
-
BUNDLE_WITHOUT: release
|
11
|
+
if: github.repository_owner == 'voxpupuli'
|
13
12
|
steps:
|
14
13
|
- uses: actions/checkout@v2
|
15
|
-
- name: Install Ruby
|
14
|
+
- name: Install Ruby 3.1
|
16
15
|
uses: ruby/setup-ruby@v1
|
17
16
|
with:
|
18
|
-
ruby-version: '
|
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
|
data/.github/workflows/test.yml
CHANGED
@@ -4,6 +4,9 @@ on:
|
|
4
4
|
- pull_request
|
5
5
|
- push
|
6
6
|
|
7
|
+
env:
|
8
|
+
BUNDLE_WITHOUT: release
|
9
|
+
|
7
10
|
jobs:
|
8
11
|
test:
|
9
12
|
runs-on: ubuntu-latest
|
@@ -14,11 +17,35 @@ jobs:
|
|
14
17
|
- "2.5"
|
15
18
|
- "2.6"
|
16
19
|
- "2.7"
|
20
|
+
- "3.0"
|
21
|
+
- "3.1"
|
22
|
+
puppet:
|
23
|
+
- "~> 7.0"
|
24
|
+
- "~> 6.0"
|
25
|
+
- "https://github.com/puppetlabs/puppet.git#main"
|
26
|
+
exclude:
|
27
|
+
- ruby: "2.6"
|
28
|
+
puppet: "~> 7.0"
|
29
|
+
- ruby: "2.5"
|
30
|
+
puppet: "~> 7.0"
|
31
|
+
|
32
|
+
- ruby: "3.1"
|
33
|
+
puppet: "~> 6.0"
|
34
|
+
- ruby: "3.0"
|
35
|
+
puppet: "~> 6.0"
|
36
|
+
|
37
|
+
- ruby: "2.6"
|
38
|
+
puppet: "https://github.com/puppetlabs/puppet.git#main"
|
39
|
+
- ruby: "2.5"
|
40
|
+
puppet: "https://github.com/puppetlabs/puppet.git#main"
|
17
41
|
env:
|
18
|
-
|
19
|
-
|
20
|
-
name: Ruby ${{ matrix.ruby }}
|
42
|
+
PUPPET_VERSION: ${{ matrix.puppet }}
|
43
|
+
COVERAGE: ${{ matrix.coverage }}
|
44
|
+
name: "Ruby ${{ matrix.ruby }} - Puppet ${{ matrix.puppet }}"
|
21
45
|
steps:
|
46
|
+
- name: Enable coverage reporting on Ruby 3.1
|
47
|
+
if: matrix.puppet == '~> 7.0' && matrix.ruby == '3.1'
|
48
|
+
run: echo 'COVERAGE=yes' >> $GITHUB_ENV
|
22
49
|
- uses: actions/checkout@v2
|
23
50
|
- name: Install expect
|
24
51
|
run: sudo apt-get install expect
|
@@ -27,5 +54,9 @@ jobs:
|
|
27
54
|
with:
|
28
55
|
ruby-version: ${{ matrix.ruby }}
|
29
56
|
bundler-cache: true
|
57
|
+
- name: spec tests
|
58
|
+
run: bundle exec rake features
|
59
|
+
- name: Verify gem builds
|
60
|
+
run: gem build *.gemspec
|
30
61
|
- name: Run tests
|
31
62
|
run: bundle exec cucumber -f progress
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,20 @@
|
|
2
2
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
|
5
|
+
## [v3.3.0](https://github.com/voxpupuli/hiera-eyaml/tree/v3.3.0) (2022-05-20)
|
6
|
+
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/hiera-eyaml/compare/v3.2.2...v3.3.0)
|
8
|
+
|
9
|
+
**Implemented enhancements:**
|
10
|
+
|
11
|
+
- Build gem during CI [\#330](https://github.com/voxpupuli/hiera-eyaml/pull/330) ([bastelfreak](https://github.com/bastelfreak))
|
12
|
+
- Add more Ruby/Puppet versions to CI matrix [\#326](https://github.com/voxpupuli/hiera-eyaml/pull/326) ([bastelfreak](https://github.com/bastelfreak))
|
13
|
+
|
14
|
+
**Fixed bugs:**
|
15
|
+
|
16
|
+
- 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))
|
17
|
+
- Fix an "undefined method" error with rubygems \>= 3.3.0 [\#327](https://github.com/voxpupuli/hiera-eyaml/pull/327) ([davidsansome](https://github.com/davidsansome))
|
18
|
+
|
5
19
|
## [v3.2.2](https://github.com/voxpupuli/hiera-eyaml/tree/v3.2.2) (2021-05-03)
|
6
20
|
|
7
21
|
[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
|
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
|
-
|
5
|
-
[![
|
6
|
-
[![
|
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.
|
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 = "
|
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 =
|
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 =
|
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
|
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
|
data/lib/hiera/backend/eyaml.rb
CHANGED
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.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Vox Pupuli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: optimist
|
@@ -39,7 +39,7 @@ 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: []
|
@@ -99,14 +99,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
99
99
|
requirements:
|
100
100
|
- - ">="
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version:
|
102
|
+
version: 2.5.0
|
103
|
+
- - "<"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '4'
|
103
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
104
107
|
requirements:
|
105
108
|
- - ">="
|
106
109
|
- !ruby/object:Gem::Version
|
107
110
|
version: '0'
|
108
111
|
requirements: []
|
109
|
-
rubygems_version: 3.
|
112
|
+
rubygems_version: 3.3.7
|
110
113
|
signing_key:
|
111
114
|
specification_version: 4
|
112
115
|
summary: OpenSSL Encryption backend for Hiera
|