hiera-housekeeper 0.10 → 0.11
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.
- data/lib/hiera/backend/housekeeper_backend.rb +17 -2
- metadata +2 -8
@@ -115,13 +115,28 @@ class Hiera
|
|
115
115
|
return answer
|
116
116
|
end
|
117
117
|
|
118
|
-
def
|
118
|
+
def passfunc(hook, uid_hint, passphrase_info, prev_was_bad, fd)
|
119
|
+
housekeeper_keypass = Backend.parse_string(Config[:housekeeper][:keypass], scope) || "housekeeper_bgch"
|
120
|
+
$stderr.write("Passphrase for #{uid_hint}: ")
|
121
|
+
$stderr.flush
|
122
|
+
begin
|
123
|
+
system('stty -echo')
|
124
|
+
io = IO.for_fd(fd, 'w')
|
125
|
+
io.puts(housekeeper_keypass)
|
126
|
+
io.flush
|
127
|
+
ensure
|
128
|
+
(0 ... $_.length).each do |i| $_[i] = ?0 end if $_
|
129
|
+
system('stty echo')
|
130
|
+
end
|
131
|
+
$stderr.puts
|
132
|
+
end
|
119
133
|
|
134
|
+
def decrypt(cipher, gnupghome)
|
120
135
|
gnupghome_backup = ENV["GNUPGHOME"]
|
121
136
|
ENV["GNUPGHOME"] = gnupghome
|
122
137
|
debug("GNUPGHOME is #{ENV['GNUPGHOME']}")
|
123
138
|
|
124
|
-
ctx = GPGME::Ctx.new
|
139
|
+
ctx = GPGME::Ctx.new({:passphrase_callback => method(:passfunc)})
|
125
140
|
|
126
141
|
if !ctx.keys.empty?
|
127
142
|
raw = GPGME::Data.new(cipher)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hiera-housekeeper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.11'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: hiera
|
@@ -62,18 +62,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
62
62
|
- - ! '>='
|
63
63
|
- !ruby/object:Gem::Version
|
64
64
|
version: '0'
|
65
|
-
segments:
|
66
|
-
- 0
|
67
|
-
hash: -2095638650506013581
|
68
65
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
66
|
none: false
|
70
67
|
requirements:
|
71
68
|
- - ! '>='
|
72
69
|
- !ruby/object:Gem::Version
|
73
70
|
version: '0'
|
74
|
-
segments:
|
75
|
-
- 0
|
76
|
-
hash: -2095638650506013581
|
77
71
|
requirements: []
|
78
72
|
rubyforge_project:
|
79
73
|
rubygems_version: 1.8.23
|