confidante 0.28.0.pre.11 → 0.28.0.pre.14

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: 571b8fba49d0fb9679352a9a4d22070261fed80942e6ce7817749a9c4c91315f
4
- data.tar.gz: e5c7946afcc9a1912ab4cbc03119a0d8dd27a5de942450b8cc648a340fe15e9d
3
+ metadata.gz: 79c9839bc842ebec023e9ed5b5dfb855a0d71065197b823f61fd672ccde8ae0a
4
+ data.tar.gz: 3fb77acf16a3aefb99ac313a02b834ac091b1ada64af3dd669d190c72e5d66b5
5
5
  SHA512:
6
- metadata.gz: 99a8db822df284964ad16fe615cd2d8cda3a52e61b19270d7809747ba41235afcecdb90f9498a67150da300254388d4829d2c3531fde61f45fd31f4770216c28
7
- data.tar.gz: cc5b6e8431b277932747ac1e1183af7358f6cd29e1687be8d5d7d5b7e8a7dedb21ea80c89ee8c8eb2b0c332409363c1b82f1856fa23d721c51bf2295e7def1ee
6
+ metadata.gz: ced6ac392c151b4a5e70ea61cbb5a17c3e4f41c99c54d70f780e0079697b09a2b63099eb367a4eaf1c791a51aff82ed1082bf6d6cf5dcb1346cfb8f0e60aad9e
7
+ data.tar.gz: e94e7f53374f7e2b5b3570111cc959874b546ecbea03738eff28c0f890637d43260f2884a8d93b3b45c146b38cdfb88ac5c58f8476174a8f48b1bfe6ed5d5e91
data/Gemfile.lock CHANGED
@@ -1,15 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- confidante (0.28.0.pre.11)
4
+ confidante (0.28.0.pre.14)
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.11'
4
+ VERSION = '0.28.0.pre.14'
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,33 @@
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
+ end
13
+
14
+ def lookup(key, scope, _order_override, resolution_type, _context)
15
+ Hiera.debug("Looking up #{key} in vault backend " \
16
+ "with #{resolution_type}")
17
+
18
+ vault_config = Backend.parse_answer(Config[:vault], scope)
19
+ vault_address = vault_config[:address]
20
+ vault_client = Vault::Client.new(address: vault_address)
21
+
22
+ secret = vault_client.kv('kv').read(key)
23
+ throw(:no_such_key) unless secret
24
+
25
+ value = secret.data[:value]
26
+ throw(:no_such_key) unless value
27
+
28
+ Backend.parse_answer(value, scope)
29
+ end
30
+ end
31
+ # rubocop:enable Naming/ClassAndModuleCamelCase
32
+ end
33
+ 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.11
4
+ version: 0.28.0.pre.14
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: