yaml_vault 0.4.1 → 0.5.0

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
  SHA1:
3
- metadata.gz: 10122ee4034384fdfb8e7c9d77c5f18a923b94a2
4
- data.tar.gz: 3b805a5feda21783340cb71855e9b9a48daad551
3
+ metadata.gz: 7701aaf47f1f8a9aa15aa5a92cf42ba9faa683b6
4
+ data.tar.gz: bdd5eb6f504aadaabf6fb6b1404c6778a5365c7c
5
5
  SHA512:
6
- metadata.gz: b12a970f34f02aa18aa63400b22de1d7a48936110346c693fc93708ea5dde8a5902893eb58b2e7d785ab119c2f0a4e2c3cde77b1067fbd9da35975ae125eac81
7
- data.tar.gz: 350904118d1b600095a0ac764e02eb9c91b4d441fb983189396f2bcd48b4496988d91921748a4797b7cff2b6a277e4f12e8ccb1e9dbe42ec44951f6d19d59255
6
+ metadata.gz: 605babf1e0e0000ea234cbe65a4d43e2176940da312d8df88cff698678590eea5d3b7668d0905ea7c6b13d06ff87791f4dea99adf983d34ab175a4e240d2b604
7
+ data.tar.gz: d7f18f1e1d329a939bba142eda79da0fbb4f7e389ddc7f9364799feb7c8ad87b1e07060a4749c8d7da4dea22ada0d23647020d86741675e92b18ff14216a897a
data/README.md CHANGED
@@ -90,6 +90,13 @@ vault:
90
90
  - four: 4
91
91
  ```
92
92
 
93
+ `--key` option supports Symbol and Array.
94
+
95
+ `:<key_name>` is symbol key.
96
+ `[0]` is array key.
97
+
98
+ ex. `production.:slaves.[0].:password`
99
+
93
100
  #### AWS KMS Encryption
94
101
 
95
102
  Max encryptable size is 4096 bytes. (value size as encoded by Base64)
data/exe/yaml_vault CHANGED
@@ -85,7 +85,22 @@ class YamlVault::Cli < Thor
85
85
  end
86
86
 
87
87
  def target_keys
88
- options[:key] ? options[:key].split(/,\s?/).map { |k| k.split(".") } : ["vault"]
88
+ if options[:key]
89
+ options[:key].split(/,\s?/).map do |k|
90
+ k.split(".").map do |part|
91
+ case part
92
+ when /\A:(.*)\z/
93
+ $1.to_sym
94
+ when /\A\[(\d+)\]\z/
95
+ $1.to_i
96
+ else
97
+ part
98
+ end
99
+ end
100
+ end
101
+ else
102
+ ["vault"]
103
+ end
89
104
  end
90
105
  end
91
106
 
@@ -1,3 +1,3 @@
1
1
  module YamlVault
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaml_vault
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - joker1007
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-07 00:00:00.000000000 Z
11
+ date: 2017-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  version: '0'
136
136
  requirements: []
137
137
  rubyforge_project:
138
- rubygems_version: 2.6.8
138
+ rubygems_version: 2.6.11
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: yaml encryption/decryption helper.