mpw 4.2.1 → 4.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/VERSION +1 -1
- data/i18n/en.yml +3 -1
- data/i18n/fr.yml +3 -1
- data/lib/mpw/cli.rb +20 -10
- data/lib/mpw/config.rb +1 -0
- data/templates/add_form.erb +16 -8
- data/test/test_cli.rb +3 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd7cabb7232c353bce58aa23e034f4475d4c784e
|
4
|
+
data.tar.gz: abcae3e4e64eed61a021dbfbaedcf220b06942ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00f35bb2da6bf78f3140b0697eac7caa07c387310dec5ab101e21551413b82182701667057e25a4d7648f55232d229a677e797966a3db0fa2780caeb84d6ecb5
|
7
|
+
data.tar.gz: f0e3c8b3e3b7338bb93e994376ac0e606f708a6700475dbf30a65f176abe0f0aebf59f07c63253c5162365590110536aa86854ff7fb495befa3cf2201ef536f2
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# MPW: Manage your passwords!
|
2
|
-
[![Version](https://img.shields.io/badge/latest_version-4.2.
|
2
|
+
[![Version](https://img.shields.io/badge/latest_version-4.2.2-green.svg)](https://github.com/nishiki/manage-password/releases)
|
3
3
|
[![Build Status](https://travis-ci.org/nishiki/manage-password.svg?branch=master)](https://travis-ci.org/nishiki/manage-password)
|
4
4
|
[![License](https://img.shields.io/badge/license-GPL--2.0-blue.svg)](https://github.com/nishiki/manage-password/blob/master/LICENSE)
|
5
5
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.2.
|
1
|
+
4.2.2
|
data/i18n/en.yml
CHANGED
data/i18n/fr.yml
CHANGED
@@ -91,7 +91,9 @@ fr:
|
|
91
91
|
wallet_dir: "Spécifie le répertoire des portefeuilles"
|
92
92
|
|
93
93
|
form:
|
94
|
-
select:
|
94
|
+
select:
|
95
|
+
choice: "Sélectionner l'élément: "
|
96
|
+
error: "Aucun élément sélectionné"
|
95
97
|
add_key:
|
96
98
|
valid: "La clé a bien été ajoutée!"
|
97
99
|
add_item:
|
data/lib/mpw/cli.rb
CHANGED
@@ -286,9 +286,22 @@ module MPW
|
|
286
286
|
return items[0] if items.length == 1
|
287
287
|
|
288
288
|
items.sort! { |a, b| a.group.to_s.downcase <=> b.group.to_s.downcase }
|
289
|
-
choice = ask(I18n.t('form.select')).to_i
|
289
|
+
choice = ask(I18n.t('form.select.choice')).to_i
|
290
290
|
|
291
|
-
choice >= 1 && choice <= items.length
|
291
|
+
raise I18n.t('form.select.error') unless choice >= 1 && choice <= items.length
|
292
|
+
|
293
|
+
items[choice - 1]
|
294
|
+
end
|
295
|
+
|
296
|
+
# Print help message for clipboard mode
|
297
|
+
# @param item [Item]
|
298
|
+
def clipboard_help(item)
|
299
|
+
puts "----- #{I18n.t('form.clipboard.help.name')} -----".cyan
|
300
|
+
puts I18n.t('form.clipboard.help.url')
|
301
|
+
puts I18n.t('form.clipboard.help.login')
|
302
|
+
puts I18n.t('form.clipboard.help.password')
|
303
|
+
puts I18n.t('form.clipboard.help.otp_code') if item.otp
|
304
|
+
puts I18n.t('form.clipboard.help.quit')
|
292
305
|
end
|
293
306
|
|
294
307
|
# Copy in clipboard the login and password
|
@@ -339,7 +352,10 @@ module MPW
|
|
339
352
|
end
|
340
353
|
|
341
354
|
when 'o', 'otp'
|
342
|
-
if
|
355
|
+
if !item.otp
|
356
|
+
clipboard_help(item)
|
357
|
+
next
|
358
|
+
elsif clipboard
|
343
359
|
Clipboard.copy(@mpw.get_otp_code(item.id))
|
344
360
|
else
|
345
361
|
puts @mpw.get_otp_code(item.id)
|
@@ -347,13 +363,7 @@ module MPW
|
|
347
363
|
puts I18n.t('form.clipboard.otp', time: @mpw.get_otp_remaining_time).yellow
|
348
364
|
|
349
365
|
else
|
350
|
-
|
351
|
-
puts I18n.t('form.clipboard.help.url')
|
352
|
-
puts I18n.t('form.clipboard.help.login')
|
353
|
-
puts I18n.t('form.clipboard.help.password')
|
354
|
-
puts I18n.t('form.clipboard.help.otp_code')
|
355
|
-
puts I18n.t('form.clipboard.help.quit')
|
356
|
-
next
|
366
|
+
clipboard_help(item)
|
357
367
|
end
|
358
368
|
end
|
359
369
|
|
data/lib/mpw/config.rb
CHANGED
@@ -161,6 +161,7 @@ module MPW
|
|
161
161
|
# @param wallet [String] wallet name
|
162
162
|
def set_wallet_path(path, wallet)
|
163
163
|
path = @wallet_dir if path == 'default'
|
164
|
+
path = File.absolute_path(path)
|
164
165
|
|
165
166
|
return if path == @wallet_dir && File.exist?("#{@wallet_dir}/#{wallet}.mpw")
|
166
167
|
return if path == @wallet_paths[wallet]
|
data/templates/add_form.erb
CHANGED
@@ -1,9 +1,17 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
# <%= I18n.t('form.add_item.host') %>
|
3
|
+
host: <%= options[:host] %>
|
4
|
+
# <%= I18n.t('form.add_item.login') %>
|
5
|
+
user: <%= options[:user] %>
|
6
|
+
# <%= I18n.t('form.add_item.group') %>
|
7
|
+
group: <%= options[:group] %>
|
8
|
+
# <%= I18n.t('form.add_item.protocol') %>
|
9
|
+
protocol: <%= options[:protocol] %><% unless password %>
|
10
|
+
# <%= I18n.t('form.add_item.password') %>
|
11
|
+
password:<% end %>
|
12
|
+
# <%= I18n.t('form.add_item.port') %>
|
13
|
+
port: <%= options[:port] %>
|
14
|
+
# <%= I18n.t('form.add_item.comment') %>
|
15
|
+
comment: <%= options[:comment] %>
|
16
|
+
# <%= I18n.t('form.add_item.otp_key') %>
|
17
|
+
otp_key: <%= options[:otp] %>
|
data/test/test_cli.rb
CHANGED
@@ -142,7 +142,6 @@ class TestConfig < Test::Unit::TestCase
|
|
142
142
|
end
|
143
143
|
|
144
144
|
def test_07_setup_wallet
|
145
|
-
path = '/tmp/'
|
146
145
|
gpg_key = 'test2@example.com'
|
147
146
|
|
148
147
|
output = %x(echo #{@password} | mpw wallet --add-gpg-key #{gpg_key})
|
@@ -167,14 +166,14 @@ class TestConfig < Test::Unit::TestCase
|
|
167
166
|
puts output
|
168
167
|
assert_match('| default', output)
|
169
168
|
|
170
|
-
output = %x(mpw wallet --path
|
169
|
+
output = %x(mpw wallet --path '.')
|
171
170
|
puts output
|
172
171
|
assert_match(I18n.t('form.set_wallet_path.valid'), output)
|
173
172
|
|
174
173
|
output = %x(mpw config)
|
175
174
|
puts output
|
176
|
-
assert_match(%r{path_wallet_default.+\| #{
|
177
|
-
assert(File.exist?("#{
|
175
|
+
assert_match(%r{path_wallet_default.+\| #{Dir.pwd}/default.mpw}, output)
|
176
|
+
assert(File.exist?("#{Dir.pwd}/default.mpw"))
|
178
177
|
|
179
178
|
output = %x(mpw wallet --default-path)
|
180
179
|
puts output
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mpw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrien Waksberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|