hiera-eyaml 2.0.7 → 2.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/CHANGES.md +5 -0
- data/Gemfile +3 -1
- data/lib/hiera/backend/eyaml.rb +1 -1
- data/lib/hiera/backend/eyaml/subcommands/edit.rb +3 -3
- data/lib/hiera/backend/eyaml/utils.rb +13 -0
- data/tools/regem.sh +2 -0
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
|
4
|
-
|
3
|
+
data.tar.gz: ebf0bc12a2d2dee0ff34b2b5ff40a8e5947f453c
|
4
|
+
metadata.gz: a5513c72714f17232041547bef4ed0f0df78466c
|
5
5
|
SHA512:
|
6
|
-
|
7
|
-
|
6
|
+
data.tar.gz: a825732caca0993b76700f4ad49be7c275ea58666a1d89ba78cc1aea45ca2bb0f2d019c44ea8f1396cc6ec1e6a6ad99e343fd106b03361fb4daef33155be985e
|
7
|
+
metadata.gz: 4e7d9bb0ea87cd0aebeae0073009288baa4a60879036abf67e2e28e09d6453d17967816e12ba8b65fb58371da977038ae70b49406c6f7067d2d4769bc43e2f29
|
data/.travis.yml
CHANGED
data/CHANGES.md
CHANGED
data/Gemfile
CHANGED
data/lib/hiera/backend/eyaml.rb
CHANGED
@@ -68,15 +68,15 @@ eos
|
|
68
68
|
end
|
69
69
|
|
70
70
|
def self.execute
|
71
|
+
editor = Utils.find_editor
|
72
|
+
|
71
73
|
encrypted_parser = Parser::ParserFactory.encrypted_parser
|
72
74
|
tokens = encrypted_parser.parse Eyaml::Options[:input_data]
|
73
75
|
decrypted_input = tokens.each_with_index.to_a.map{|(t,index)| t.to_decrypted :index => index}.join
|
74
76
|
decrypted_file_content = Eyaml::Options[:no_preamble] ? decrypted_input : (self.preamble + decrypted_input)
|
75
|
-
decrypted_file = Utils.write_tempfile decrypted_file_content
|
76
|
-
|
77
|
-
editor = Utils.find_editor
|
78
77
|
|
79
78
|
begin
|
79
|
+
decrypted_file = Utils.write_tempfile decrypted_file_content unless decrypted_file
|
80
80
|
system "#{editor} \"#{decrypted_file}\""
|
81
81
|
status = $?
|
82
82
|
|
@@ -72,9 +72,22 @@ class Hiera
|
|
72
72
|
file.close!
|
73
73
|
|
74
74
|
file = File.open(path, "w")
|
75
|
+
file.chmod(0600)
|
76
|
+
if ENV['OS'] == 'Windows_NT'
|
77
|
+
# Windows doesn't support chmod
|
78
|
+
icacls = 'C:\Windows\system32\icacls.exe'
|
79
|
+
if File.executable? icacls
|
80
|
+
current_user = `C:\\Windows\\system32\\whoami.exe`.chomp
|
81
|
+
# Use ACLs to restrict access to the current user only
|
82
|
+
command = %Q{#{icacls} "#{file.path}" /grant:r "#{current_user}":f /inheritance:r}
|
83
|
+
system "#{command} >NUL 2>&1"
|
84
|
+
end
|
85
|
+
end
|
75
86
|
file.puts data_to_write
|
76
87
|
file.close
|
77
88
|
|
89
|
+
Utils::debug "Wrote temporary file: #{path}"
|
90
|
+
|
78
91
|
path
|
79
92
|
end
|
80
93
|
|
data/tools/regem.sh
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hiera-eyaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Poulton
|
@@ -9,28 +9,28 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-04-15 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
+
name: trollop
|
16
|
+
prerelease: false
|
15
17
|
requirement: &id001 !ruby/object:Gem::Requirement
|
16
18
|
requirements:
|
17
19
|
- - ~>
|
18
20
|
- !ruby/object:Gem::Version
|
19
21
|
version: "2.0"
|
20
|
-
version_requirements: *id001
|
21
|
-
prerelease: false
|
22
22
|
type: :runtime
|
23
|
-
|
23
|
+
version_requirements: *id001
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
|
+
name: highline
|
26
|
+
prerelease: false
|
25
27
|
requirement: &id002 !ruby/object:Gem::Requirement
|
26
28
|
requirements:
|
27
29
|
- - ~>
|
28
30
|
- !ruby/object:Gem::Version
|
29
31
|
version: 1.6.19
|
30
|
-
version_requirements: *id002
|
31
|
-
prerelease: false
|
32
32
|
type: :runtime
|
33
|
-
|
33
|
+
version_requirements: *id002
|
34
34
|
description: Hiera backend for decrypting encrypted yaml properties
|
35
35
|
email:
|
36
36
|
executables:
|