confidante 0.28.0.pre.10 → 0.28.0.pre.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8273e0a3063db0d1ff80d33159bc27544c8f89444e249d3221198aedb6af7f2
4
- data.tar.gz: 452834270326676018fe7ebd46360584d89d31e5624a33d66dcff9d1f34564cd
3
+ metadata.gz: f6a9c4e82dcf2195dba2d6bd9d93af2f0e6b84222b9536bda2f888a097076851
4
+ data.tar.gz: b18f17998406440b3a075a4393399148cbda3fea00e56e36ab5d4ef30f192d7c
5
5
  SHA512:
6
- metadata.gz: 6fe58a590d51eeb706ff0c147e688261ac8ac08f36872410e5b239cade8ac092ea3415fc2ab90fa99f1b12f0df9acd96e907fe65c6e611ca90a85868cddf1efe
7
- data.tar.gz: '058ae6098dfb7c8df769d68d60eca6d6b326a8bd6a74a0d8623d834d093eec8054b11695245b56953152def722cc8fb3bd83689d1e82be215f8c08a1fab4fb0f'
6
+ metadata.gz: 366c98cff98776df6b7a9577da69a97f36b7b96106c4345073521e26c24289a93207152e9e35ba7aa1043520b52579639e5bcf019a916ed6d266a0427c3a1686
7
+ data.tar.gz: 173105f8ee23c22b82665947fd02cc0cc7ccc282b788c4d68a175aa8125494aea943fcc9c156b3a76a483ffba028c1c7740e7b1c9ae9d2a082cc9dd87ae9b5c7
data/Gemfile.lock CHANGED
@@ -1,15 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- confidante (0.28.0.pre.10)
4
+ confidante (0.28.0.pre.13)
5
5
  activesupport (>= 4)
6
6
  hiera (~> 3.3)
7
7
  shikashi (~> 0.6)
8
+ vault (~> 0.17)
8
9
 
9
10
  GEM
10
11
  remote: https://rubygems.org/
11
12
  specs:
12
- activesupport (7.0.2.3)
13
+ activesupport (7.0.3.1)
13
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
15
  i18n (>= 1.6, < 2)
15
16
  minitest (>= 5.1)
@@ -17,8 +18,11 @@ GEM
17
18
  addressable (2.8.0)
18
19
  public_suffix (>= 2.0.2, < 5.0)
19
20
  ast (2.4.2)
21
+ aws-eventstream (1.2.0)
22
+ aws-sigv4 (1.5.1)
23
+ aws-eventstream (~> 1, >= 1.0.2)
20
24
  colored2 (3.1.2)
21
- concurrent-ruby (1.1.9)
25
+ concurrent-ruby (1.1.10)
22
26
  diff-lcs (1.5.0)
23
27
  docile (1.4.0)
24
28
  evalhook (0.6.0)
@@ -52,20 +56,21 @@ GEM
52
56
  getsource (0.2.2)
53
57
  hamster (3.0.0)
54
58
  concurrent-ruby (~> 1.0)
55
- hiera (3.8.0)
56
- i18n (1.10.0)
59
+ hiera (3.10.0)
60
+ i18n (1.11.0)
57
61
  concurrent-ruby (~> 1.0)
62
+ json (2.6.2)
58
63
  lino (3.0.0)
59
64
  hamster (~> 3.0)
60
65
  open4 (~> 1.3)
61
- minitest (5.15.0)
66
+ minitest (5.16.2)
62
67
  multipart-post (2.1.1)
63
68
  octokit (4.22.0)
64
69
  faraday (>= 0.9)
65
70
  sawyer (~> 0.8.0, >= 0.5.3)
66
71
  open4 (1.3.4)
67
- parallel (1.21.0)
68
- parser (3.1.1.0)
72
+ parallel (1.22.1)
73
+ parser (3.1.2.1)
69
74
  ast (~> 2.4.1)
70
75
  partialruby (0.3.0)
71
76
  ruby2ruby (~> 2)
@@ -93,7 +98,7 @@ GEM
93
98
  colored2 (~> 3.1)
94
99
  rake_factory (~> 0.23)
95
100
  sshkey (~> 2.0)
96
- regexp_parser (2.2.1)
101
+ regexp_parser (2.5.0)
97
102
  rexml (3.2.5)
98
103
  rspec (3.11.0)
99
104
  rspec-core (~> 3.11.0)
@@ -108,21 +113,22 @@ GEM
108
113
  diff-lcs (>= 1.2.0, < 2.0)
109
114
  rspec-support (~> 3.11.0)
110
115
  rspec-support (3.11.0)
111
- rubocop (1.26.0)
116
+ rubocop (1.35.0)
117
+ json (~> 2.3)
112
118
  parallel (~> 1.10)
113
- parser (>= 3.1.0.0)
119
+ parser (>= 3.1.2.1)
114
120
  rainbow (>= 2.2.2, < 4.0)
115
121
  regexp_parser (>= 1.8, < 3.0)
116
- rexml
117
- rubocop-ast (>= 1.16.0, < 2.0)
122
+ rexml (>= 3.2.5, < 4.0)
123
+ rubocop-ast (>= 1.20.1, < 2.0)
118
124
  ruby-progressbar (~> 1.7)
119
125
  unicode-display_width (>= 1.4.0, < 3.0)
120
- rubocop-ast (1.16.0)
126
+ rubocop-ast (1.21.0)
121
127
  parser (>= 3.1.1.0)
122
128
  rubocop-rake (0.6.0)
123
129
  rubocop (~> 1.0)
124
- rubocop-rspec (2.9.0)
125
- rubocop (~> 1.19)
130
+ rubocop-rspec (2.12.1)
131
+ rubocop (~> 1.31)
126
132
  ruby-progressbar (1.11.0)
127
133
  ruby2_keywords (0.0.5)
128
134
  ruby2ruby (2.4.4)
@@ -148,10 +154,13 @@ GEM
148
154
  sshkey (2.0.0)
149
155
  tzinfo (2.0.4)
150
156
  concurrent-ruby (~> 1.0)
151
- unicode-display_width (2.1.0)
157
+ unicode-display_width (2.2.0)
158
+ vault (0.17.0)
159
+ aws-sigv4
152
160
 
153
161
  PLATFORMS
154
162
  arm64-darwin-21
163
+ x86_64-darwin-20
155
164
  x86_64-linux
156
165
 
157
166
  DEPENDENCIES
@@ -170,4 +179,4 @@ DEPENDENCIES
170
179
  simplecov
171
180
 
172
181
  BUNDLED WITH
173
- 2.3.9
182
+ 2.3.20
data/confidante.gemspec CHANGED
@@ -41,6 +41,7 @@ Gem::Specification.new do |spec|
41
41
  spec.add_dependency 'activesupport', '>= 4'
42
42
  spec.add_dependency 'hiera', '~> 3.3'
43
43
  spec.add_dependency 'shikashi', '~> 0.6'
44
+ spec.add_dependency 'vault', '~> 0.17'
44
45
 
45
46
  spec.add_development_dependency 'bundler'
46
47
  spec.add_development_dependency 'gem-release'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Confidante
4
- VERSION = '0.28.0.pre.10'
4
+ VERSION = '0.28.0.pre.13'
5
5
  end
data/lib/confidante.rb CHANGED
@@ -8,6 +8,7 @@ require_relative 'shikashi_extensions/sandbox'
8
8
 
9
9
  require_relative 'hiera/backend/env_backend'
10
10
  require_relative 'hiera/backend/overrides_backend'
11
+ require_relative 'hiera/backend/vault_backend'
11
12
 
12
13
  module Confidante
13
14
  def self.configuration(opts = {})
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'hiera'
4
+ require 'vault'
5
+
6
+ class Hiera
7
+ module Backend
8
+ # rubocop:disable Naming/ClassAndModuleCamelCase
9
+ class Vault_backend
10
+ def initialize
11
+ Hiera.debug('Hiera vault backend starting')
12
+
13
+ @client = Vault::Client.new
14
+ end
15
+
16
+ def lookup(key, scope, _order_override, resolution_type, _context)
17
+ Hiera.debug("Looking up #{key} in vault backend " \
18
+ "with #{resolution_type}")
19
+
20
+ secret = @client.kv('kv').read(key)
21
+ throw(:no_such_key) unless secret
22
+
23
+ value = secret.data[:value]
24
+ throw(:no_such_key) unless value
25
+
26
+ Backend.parse_answer(value, scope)
27
+ end
28
+ end
29
+ # rubocop:enable Naming/ClassAndModuleCamelCase
30
+ end
31
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confidante
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.28.0.pre.10
4
+ version: 0.28.0.pre.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - InfraBlocks Maintainers
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-21 00:00:00.000000000 Z
11
+ date: 2022-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: vault
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.17'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.17'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: bundler
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -244,6 +258,7 @@ files:
244
258
  - lib/confidante/version.rb
245
259
  - lib/hiera/backend/env_backend.rb
246
260
  - lib/hiera/backend/overrides_backend.rb
261
+ - lib/hiera/backend/vault_backend.rb
247
262
  - lib/shikashi_extensions/sandbox.rb
248
263
  homepage: https://github.com/infrablocks/confidante
249
264
  licenses: