awskeyring 0.5.1 → 0.5.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/lib/awskeyring/version.rb +1 -1
- data/lib/awskeyring_command.rb +20 -10
- 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: 2cc56e9c03339dd2516abf62a94d07dcccef3b50
|
4
|
+
data.tar.gz: d568b27b9b8648cfc5e72bc2aa033397d21163f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c153176f3d556eecd47ecd3dc7d1b825a187913e82a41f17e1fc514d9dc3ea49bf80d7f1cb624d6737c10199c1e7b4c1521eb809699be5ef30dba0ee0b318633
|
7
|
+
data.tar.gz: c6ec6d01d3ecaaf7c9bb3a22dc0ec361485f5fe1f864174cd43420923fd0ebf6a80cfb26592f970e771612ef84943e10b7c98af9a9a9810afa5b5b60e046006f
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [v0.5.
|
3
|
+
## [v0.5.2](https://github.com/vibrato/awskeyring/tree/v0.5.2) (2018-09-18)
|
4
|
+
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.5.1...v0.5.2)
|
5
|
+
|
6
|
+
**Implemented enhancements:**
|
7
|
+
|
8
|
+
- More robust autocomplete. [\#30](https://github.com/vibrato/awskeyring/pull/30) ([tristanmorgan](https://github.com/tristanmorgan))
|
9
|
+
|
10
|
+
## [v0.5.1](https://github.com/vibrato/awskeyring/tree/v0.5.1) (2018-09-12)
|
4
11
|
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.5.0...v0.5.1)
|
5
12
|
|
6
13
|
**Implemented enhancements:**
|
data/lib/awskeyring/version.rb
CHANGED
data/lib/awskeyring_command.rb
CHANGED
@@ -13,7 +13,6 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
13
13
|
I18n.backend.load_translations
|
14
14
|
|
15
15
|
map %w[--version -v] => :__version
|
16
|
-
map %w[--help -h] => :help
|
17
16
|
map ['init'] => :initialise
|
18
17
|
map ['con'] => :console
|
19
18
|
map ['ls'] => :list
|
@@ -22,6 +21,7 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
22
21
|
map ['rmr'] => :remove_role
|
23
22
|
map ['rmt'] => :remove_token
|
24
23
|
map ['rot'] => :rotate
|
24
|
+
map ['tok'] => :token
|
25
25
|
map ['up'] => :update
|
26
26
|
|
27
27
|
desc '--version, -v', I18n.t('__version.desc')
|
@@ -357,11 +357,21 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
357
357
|
|
358
358
|
private
|
359
359
|
|
360
|
+
def age_check_and_get(account:, no_token:)
|
361
|
+
cred = Awskeyring.get_valid_creds(account: account, no_token: no_token)
|
362
|
+
|
363
|
+
maxage = Awskeyring.prefs[:keyage] || Awskeyring::DEFAULT_KEY_AGE
|
364
|
+
age = (Time.new - cred[:updated]).div Awskeyring::Awsapi::ONE_DAY
|
365
|
+
warn I18n.t('message.age_check', account: account, age: age) unless age < maxage
|
366
|
+
|
367
|
+
cred
|
368
|
+
end
|
369
|
+
|
360
370
|
def comp_type(comp_line:, curr:, prev:)
|
361
371
|
comp_len = comp_line.split.index(prev)
|
362
|
-
sub_cmd = comp_line.split
|
372
|
+
sub_cmd = sub_command(comp_line.split)
|
363
373
|
|
364
|
-
comp_len = 3 if curr.start_with?('-')
|
374
|
+
comp_len = 3 if curr.start_with?('-')
|
365
375
|
|
366
376
|
case prev
|
367
377
|
when 'help'
|
@@ -373,14 +383,14 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
373
383
|
[curr, comp_len, sub_cmd]
|
374
384
|
end
|
375
385
|
|
376
|
-
def
|
377
|
-
|
386
|
+
def sub_command(comp_lines)
|
387
|
+
return nil if comp_lines.nil? || comp_lines.length < 2
|
378
388
|
|
379
|
-
|
380
|
-
age = (Time.new - cred[:updated]).div Awskeyring::Awsapi::ONE_DAY
|
381
|
-
warn I18n.t('message.age_check', account: account, age: age) unless age < maxage
|
389
|
+
sub_cmd = comp_lines[1]
|
382
390
|
|
383
|
-
|
391
|
+
return sub_cmd if self.class.all_commands.keys.index(sub_cmd)
|
392
|
+
|
393
|
+
self.class.map[sub_cmd].to_s
|
384
394
|
end
|
385
395
|
|
386
396
|
def print_auto_resp(curr, len, sub_cmd)
|
@@ -405,7 +415,7 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
405
415
|
end
|
406
416
|
|
407
417
|
def list_arguments(command:)
|
408
|
-
|
418
|
+
exit 1 if command.empty?
|
409
419
|
self.class.all_commands[command].options.values.map(&:aliases).flatten! +
|
410
420
|
self.class.all_commands[command].options.values.map(&:switch_name)
|
411
421
|
end
|
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.5.
|
4
|
+
version: 0.5.2
|
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-09-
|
11
|
+
date: 2018-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-iam
|