awskeyring 0.7.2 → 0.8.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: 26f6f9112f7dd321eb160034017bdcfde89c3ea9
4
- data.tar.gz: 4d0c3eda8ef3301077925a69d1da7b6536c12229
3
+ metadata.gz: 3ad1f180eac2ee0404c4c8d96eb0206d4e1812de
4
+ data.tar.gz: 431a1d18c5547c6ab5f6c7f8c3b3a15ab2ca2467
5
5
  SHA512:
6
- metadata.gz: f7e7822873229041ec91de08fc4c073cafc8aee5d1e98bb4cad0424954196985f4679f23d041f035fe228359b411b9e6a80dcc2ba7c2d89c97591106b3f960bd
7
- data.tar.gz: de9945806b4a310e6ba60e486b00aeb40b1857a6649ff0e424cec36eb8710607a7e3abb77d01fbf486608b59e6c98a2c485c5d395bb60e5a0177feaf7d061e5d
6
+ metadata.gz: dc88bb7611ca1fe6c391e21a099a964726e87093b78278c19f972909f22a259b97af373927917df6b5a4f61d67362265dc1033914b4ddf61d30d018d7d51268f
7
+ data.tar.gz: 83132abd48684e6b58593781494a7ff43ec9c061e467a3efdbf5b68d2b066d1626999681620dc51323e7bc9e11fd5f1b4bf2d6f06b8a6c225683f859de6aa647
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Change Log
2
2
 
3
+ ## [v0.8.0](https://github.com/vibrato/awskeyring/tree/v0.8.0) (2018-12-19)
4
+ [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.7.2...v0.8.0)
5
+
6
+ **Implemented enhancements:**
7
+
8
+ - Provide input feedback for secret fields. [\#41](https://github.com/vibrato/awskeyring/pull/41) ([tristanmorgan](https://github.com/tristanmorgan))
9
+
10
+ **Fixed bugs:**
11
+
12
+ - Cannot enter secret access key when adding new accounts in 0.7.0 [\#36](https://github.com/vibrato/awskeyring/issues/36)
13
+
3
14
  ## [v0.7.2](https://github.com/vibrato/awskeyring/tree/v0.7.2) (2018-12-17)
4
15
  [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.7.1...v0.7.2)
5
16
 
@@ -0,0 +1,37 @@
1
+ require 'io/console'
2
+
3
+ # Awskeyring Module,
4
+ module Awskeyring
5
+ # Input methods for Awskeyring
6
+ module Input
7
+ # Read a secret in without echoing the characters
8
+ #
9
+ # @param [String] prompt text to prompt user with.
10
+ def self.read_secret(prompt)
11
+ $stdout.print(prompt)
12
+ hide_input
13
+ end
14
+
15
+ private_class_method def self.hide_input # rubocop:disable Metrics/MethodLength
16
+ password = ''
17
+ loop do
18
+ character = $stdin.getch
19
+ break unless character
20
+
21
+ if ["\n", "\r"].include? character
22
+ puts ''
23
+ break
24
+ elsif ["\b", "\u007f"].include? character
25
+ password.chop!
26
+ print "\b\e[P"
27
+ elsif character == "\u0003"
28
+ exit 1
29
+ else
30
+ print '*'
31
+ password << character
32
+ end
33
+ end
34
+ password
35
+ end
36
+ end
37
+ end
@@ -1,4 +1,4 @@
1
1
  module Awskeyring
2
2
  # The Gems version number
3
- VERSION = '0.7.2'.freeze
3
+ VERSION = '0.8.0'.freeze
4
4
  end
@@ -3,6 +3,7 @@ require 'thor'
3
3
 
4
4
  require 'awskeyring'
5
5
  require 'awskeyring/awsapi'
6
+ require 'awskeyring/input'
6
7
  require 'awskeyring/validate'
7
8
  require 'awskeyring/version'
8
9
 
@@ -461,7 +462,7 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
461
462
 
462
463
  def ask(message:, secure: false, optional: false)
463
464
  if secure
464
- Thor::LineEditor.readline(message.rjust(20) + ': ', echo: false).strip
465
+ Awskeyring::Input.read_secret(message.rjust(20) + ': ')
465
466
  elsif optional
466
467
  Thor::LineEditor.readline((message + ' (optional)').rjust(20) + ': ')
467
468
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awskeyring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tristan Morgan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-17 00:00:00.000000000 Z
11
+ date: 2018-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-iam
@@ -85,6 +85,7 @@ files:
85
85
  - i18n/en.yml
86
86
  - lib/awskeyring.rb
87
87
  - lib/awskeyring/awsapi.rb
88
+ - lib/awskeyring/input.rb
88
89
  - lib/awskeyring/validate.rb
89
90
  - lib/awskeyring/version.rb
90
91
  - lib/awskeyring_command.rb