awskeyring 1.6.0 → 1.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8bf8ca4f1b8acb13b25ac0c3a362afcf390e5e8e8d5f1e42b1c4c68748f0149
4
- data.tar.gz: 3693e3e8d7a9fa30ab1430cea360cd32c85c98a22a9ae68a725f236c335afe2b
3
+ metadata.gz: c2690c242849838e2056d06295c4909c77c197e3b5457495970b9c1fde0c7c07
4
+ data.tar.gz: 47f5bcc564492730aa851a0d27998dd6d2c3c47bc4b8cb736759895c3f2eda2a
5
5
  SHA512:
6
- metadata.gz: 7c786f1bf73ccbe18f3c259824dfbc60bcbcf70e611916b70b8349fd9a40350f045b7e5b8e676e71bbf7bb0feadba76f54da28816cf18c32dd7a2d7acdc1d3e0
7
- data.tar.gz: 5a03251d5b09208802a0790b2d52dcfa3a581394e3cd041e79cf69fa39fbd298ec8e76ae47b237342f360402d85ea5b6512f7eea89163157dcff5fd7bbd946a5
6
+ metadata.gz: 55442049ab8dc9139d950e13a3a5e317bff29ccf310643d110c6c6f0a8672a605655b3c0481b254b5a48809dec9ca7b2edc4a8c96459f30e615c9965b59ba1fa
7
+ data.tar.gz: 950c7267da2f0df886b28d2472d0b88f664f240b6f8df8b3eb708c56884bce8951b5b8b372fe2719585a7450436bc7c84aaaf057d8f146e40e53bba8fbde428f
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.7.0](https://github.com/servian/awskeyring/tree/v1.7.0) (2020-11-18)
4
+
5
+ [Full Changelog](https://github.com/servian/awskeyring/compare/v1.6.0...v1.7.0)
6
+
7
+ **Implemented enhancements:**
8
+
9
+ - Allow specifying a browser other than the default [\#71](https://github.com/servian/awskeyring/issues/71)
10
+ - Autocomplete for Browsers [\#73](https://github.com/servian/awskeyring/pull/73) ([tristanmorgan](https://github.com/tristanmorgan))
11
+
3
12
  ## [v1.6.0](https://github.com/servian/awskeyring/tree/v1.6.0) (2020-08-11)
4
13
 
5
14
  [Full Changelog](https://github.com/servian/awskeyring/compare/v1.5.0...v1.6.0)
@@ -10,6 +19,10 @@
10
19
  - RuboCop and Spec update [\#68](https://github.com/servian/awskeyring/pull/68) ([tristanmorgan](https://github.com/tristanmorgan))
11
20
  - Add SimpleCov reports. [\#67](https://github.com/servian/awskeyring/pull/67) ([tristanmorgan](https://github.com/tristanmorgan))
12
21
 
22
+ **Merged pull requests:**
23
+
24
+ - Updates for added RuboCop checks. [\#70](https://github.com/servian/awskeyring/pull/70) ([tristanmorgan](https://github.com/tristanmorgan))
25
+
13
26
  ## [v1.5.0](https://github.com/servian/awskeyring/tree/v1.5.0) (2020-07-08)
14
27
 
15
28
  [Full Changelog](https://github.com/servian/awskeyring/compare/v1.4.0...v1.5.0)
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2017 Tristan Morgan
3
+ Copyright (c) 2017-2020 Tristan Morgan
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -113,6 +113,7 @@ the [Contributor Covenant](https://contributor-covenant.org) code of conduct.
113
113
 
114
114
  * Tristan [tristanmorgan](https://github.com/tristanmorgan)
115
115
  * Adam Sir [AzySir](https://github.com/AzySir)
116
+ * Vito Giarrusso [thtliife](https://github.com/thtliife)
116
117
 
117
118
  ## License
118
119
 
@@ -49,6 +49,7 @@ en:
49
49
  notoken: 'Do not use saved token.'
50
50
  noremote: 'Do not validate with remote api.'
51
51
  path: 'The service PATH to open.'
52
+ browser: 'Specify an alternative browser.'
52
53
  role: 'The ROLE to assume.'
53
54
  secret: 'AWS account secret.'
54
55
  unset: 'Unset environment variables.'
@@ -27,6 +27,8 @@ module Awskeyring # rubocop:disable Metrics/ModuleLength
27
27
  DEFAULT_KEY_AGE = 90
28
28
  # Default Console Paths
29
29
  DEFAULT_CONSOLE_LIST = %w[cloudformation ec2/v2 iam rds route53 s3 sns sqs vpc].freeze
30
+ # Default Browsers
31
+ DEFAULT_BROWSER_LIST = %w[Brave FireFox Opera Safari Vivaldi].freeze
30
32
 
31
33
  # Retrieve the preferences
32
34
  #
@@ -201,6 +203,11 @@ module Awskeyring # rubocop:disable Metrics/ModuleLength
201
203
  prefs.key?('console') ? prefs['console'] : DEFAULT_CONSOLE_LIST
202
204
  end
203
205
 
206
+ # Return a list of browserss
207
+ def self.list_browsers
208
+ prefs.key?('browser') ? prefs['browser'] : DEFAULT_BROWSER_LIST
209
+ end
210
+
204
211
  # Return Key age warning number
205
212
  def self.key_age
206
213
  prefs.key?('keyage') ? prefs['keyage'] : DEFAULT_KEY_AGE
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'io/console'
4
-
5
3
  # Awskeyring Module,
6
4
  module Awskeyring
7
5
  # Input methods for Awskeyring
@@ -15,18 +13,20 @@ module Awskeyring
15
13
  end
16
14
 
17
15
  private_class_method def self.hide_input # rubocop:disable Metrics/MethodLength
16
+ require 'io/console'
18
17
  password = +''
19
18
  loop do
20
19
  character = $stdin.getch
21
20
  break unless character
22
21
 
23
- if ["\n", "\r"].include? character
22
+ case character
23
+ when "\n", "\r"
24
24
  puts ''
25
25
  break
26
- elsif ["\b", "\u007f"].include? character
26
+ when "\b", "\u007f"
27
27
  password.chop!
28
28
  print "\b\e[P"
29
- elsif character == "\u0003"
29
+ when "\u0003"
30
30
  exit 1
31
31
  else
32
32
  print '*'
@@ -6,7 +6,7 @@ require 'json'
6
6
  # Version const and query of latest.
7
7
  module Awskeyring
8
8
  # The Gem's version number
9
- VERSION = '1.6.0'
9
+ VERSION = '1.7.0'
10
10
  # The Gem's homepage
11
11
  HOMEPAGE = 'https://github.com/servian/awskeyring'
12
12
 
@@ -387,6 +387,7 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
387
387
 
388
388
  desc 'console ACCOUNT', I18n.t('console.desc')
389
389
  method_option :path, type: :string, aliases: '-p', desc: I18n.t('method_option.path')
390
+ method_option :browser, type: :string, aliases: '-b', desc: I18n.t('method_option.browser')
390
391
  method_option 'no-token', type: :boolean, aliases: '-n', desc: I18n.t('method_option.notoken'), default: false
391
392
  method_option 'no-open', type: :boolean, aliases: '-o', desc: I18n.t('method_option.noopen'), default: false
392
393
  # Open the AWS Console
@@ -417,7 +418,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
417
418
  if options['no-open']
418
419
  puts login_url
419
420
  else
420
- pid = Process.spawn("open \"#{login_url}\"")
421
+ spawn_cmd = options[:browser] ? "open -a \"#{options[:browser]}\" \"#{login_url}\"" : "open \"#{login_url}\""
422
+ pid = Process.spawn(spawn_cmd)
421
423
  Process.wait pid
422
424
  end
423
425
  end
@@ -460,9 +462,11 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
460
462
  when 'remove-role', '-r', 'rmr'
461
463
  comp_len = 2
462
464
  when '--path', '-p'
463
- comp_len = 4
465
+ comp_len = 40
464
466
  when 'remove-token', 'rmt'
465
- comp_len = 5
467
+ comp_len = 50
468
+ when '--browser', '-b'
469
+ comp_len = 60
466
470
  end
467
471
 
468
472
  [curr, comp_len, sub_cmd]
@@ -487,12 +491,14 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
487
491
  list = Awskeyring.list_account_names
488
492
  when 2
489
493
  list = Awskeyring.list_role_names
490
- when 3
494
+ when 3..10
491
495
  list = list_arguments(command: sub_cmd)
492
- when 4
496
+ when 40
493
497
  list = Awskeyring.list_console_path
494
- when 5
498
+ when 50
495
499
  list = Awskeyring.list_token_names
500
+ when 60
501
+ list = Awskeyring.list_browsers
496
502
  else
497
503
  exit 1
498
504
  end
@@ -1,7 +1,7 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "AWSKEYRING" "5" "June 2020" "" ""
4
+ .TH "AWSKEYRING" "5" "November 2020" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBAwskeyring\fR \- is a small tool to manage AWS account keys in the macOS Keychain
@@ -24,36 +24,90 @@ The commands are as follows:
24
24
  .IP
25
25
  Prints the version
26
26
  .
27
+ .br
28
+ .
29
+ .IP
30
+ \-r, \-\-no\-remote: Do not validate with remote api\.
31
+ .
27
32
  .TP
28
33
  add ACCOUNT:
29
34
  .
30
35
  .IP
31
36
  Adds an ACCOUNT to the keyring
32
37
  .
38
+ .br
39
+ .
40
+ .IP
41
+ \-k, \-\-key=KEY: AWS account key id\.
42
+ .
43
+ .br
44
+ \-s, \-\-secret=SECRET: AWS account secret\.
45
+ .
46
+ .br
47
+ \-m, \-\-mfa=MFA: AWS virtual mfa arn\.
48
+ .
49
+ .br
50
+ \-r, \-\-no\-remote: Do not validate with remote api\.
51
+ .
33
52
  .TP
34
53
  add\-role ROLE:
35
54
  .
36
55
  .IP
37
56
  Adds a ROLE to the keyring
38
57
  .
58
+ .br
59
+ .
60
+ .IP
61
+ \-a, \-\-arn=ARN: AWS role arn\.
62
+ .
39
63
  .TP
40
- console ACCOUNT:
64
+ awskeyring console ACCOUNT:
41
65
  .
42
66
  .IP
43
67
  Open the AWS Console for the ACCOUNT
44
68
  .
69
+ .br
70
+ .
71
+ .IP
72
+ \-p, \-\-path=PATH: The service PATH to open\.
73
+ .
74
+ .br
75
+ \-b, \-\-browser=BROWSER: Specify an alternative browser\.
76
+ .
77
+ .br
78
+ \-n, \-\-no\-token: Do not use saved token\.
79
+ .
80
+ .br
81
+ \-o, \-\-no\-open: Do not open the url\.
82
+ .
45
83
  .TP
46
84
  env ACCOUNT:
47
85
  .
48
86
  .IP
49
87
  Outputs bourne shell environment exports for an ACCOUNT
50
88
  .
89
+ .br
90
+ .
91
+ .IP
92
+ \-n, \-\-no\-token: Do not use saved token\.
93
+ .
94
+ .br
95
+ \-u, \-\-unset, \-\-no\-unset: Unset environment variables\.
96
+ .
51
97
  .TP
52
98
  exec ACCOUNT command\.\.\.:
53
99
  .
54
100
  .IP
55
101
  Execute a COMMAND with the environment set for an ACCOUNT
56
102
  .
103
+ .br
104
+ .
105
+ .IP
106
+ \-n, \-\-no\-token: Do not use saved token\.
107
+ .
108
+ .br
109
+ \-b, \-\-no\-bundle: Unset Bundler environment variables\.
110
+ .
57
111
  .TP
58
112
  help [COMMAND]:
59
113
  .
@@ -66,18 +120,33 @@ import:
66
120
  .IP
67
121
  Import an ACCOUNT to the keyring from ~/\.aws/credentials
68
122
  .
123
+ .br
124
+ .
125
+ .IP
126
+ \-r, \-\-no\-remote: Do not validate with remote api\.
127
+ .
69
128
  .TP
70
129
  initialise:
71
130
  .
72
131
  .IP
73
132
  Initialises a new KEYCHAIN
74
133
  .
134
+ .br
135
+ .
136
+ .IP
137
+ \-n, \-\-keychain=KEYCHAIN: Name of KEYCHAIN to initialise\.
138
+ .
75
139
  .TP
76
140
  json ACCOUNT:
77
141
  .
78
142
  .IP
79
143
  Outputs AWS CLI compatible JSON for an ACCOUNT
80
144
  .
145
+ .br
146
+ .
147
+ .IP
148
+ \-n, \-\-no\-token: Do not use saved token\.
149
+ .
81
150
  .TP
82
151
  list:
83
152
  .
@@ -90,6 +159,11 @@ list\-role:
90
159
  .IP
91
160
  Prints a list of roles in the keyring
92
161
  .
162
+ .br
163
+ .
164
+ .IP
165
+ \-d, \-\-detail, \-\-no\-detail: Show more detail\.
166
+ .
93
167
  .TP
94
168
  remove ACCOUNT:
95
169
  .
@@ -120,12 +194,34 @@ token ACCOUNT [ROLE] [MFA]:
120
194
  .IP
121
195
  Create an STS Token from a ROLE or an MFA code
122
196
  .
197
+ .br
198
+ .
199
+ .IP
200
+ \-r, \-\-role=ROLE: The ROLE to assume\.
201
+ .
202
+ .br
203
+ \-c, \-\-code=CODE: Virtual mfa CODE\.
204
+ .
205
+ .br
206
+ \-d, \-\-duration=DURATION: Session DURATION in seconds\.
207
+ .
123
208
  .TP
124
209
  update ACCOUNT:
125
210
  .
126
211
  .IP
127
212
  Updates an ACCOUNT in the keyring
128
213
  .
214
+ .br
215
+ .
216
+ .IP
217
+ \-k, \-\-key=KEY: AWS account key id\.
218
+ .
219
+ .br
220
+ \-s, \-\-secret=SECRET: AWS account secret\.
221
+ .
222
+ .br
223
+ \-r, \-\-no\-remote: Do not validate with remote api\.
224
+ .
129
225
  .SH "ENVIRONMENT"
130
226
  The AWS_DEFAULT_REGION environment variable will be used for AWS API calls where specified or fall back to us\-east\-1 when not\.
131
227
  .
@@ -188,6 +284,9 @@ Tristan tristanmorgan \fIhttps://github\.com/tristanmorgan\fR
188
284
  .IP "\(bu" 4
189
285
  Adam Sir AzySir \fIhttps://github\.com/AzySir\fR
190
286
  .
287
+ .IP "\(bu" 4
288
+ Vito Giarrusso thtliife \fIhttps://github\.com/thtliife\fR
289
+ .
191
290
  .IP "" 0
192
291
  .
193
292
  .SH "LICENSE"
@@ -16,27 +16,47 @@ The commands are as follows:
16
16
 
17
17
  * --version, -v:
18
18
 
19
- Prints the version
19
+ Prints the version<br>
20
+
21
+ -r, --no-remote: Do not validate with remote api.
20
22
 
21
23
  * add ACCOUNT:
22
24
 
23
- Adds an ACCOUNT to the keyring
25
+ Adds an ACCOUNT to the keyring<br>
26
+
27
+ -k, --key=KEY: AWS account key id.<br>
28
+ -s, --secret=SECRET: AWS account secret.<br>
29
+ -m, --mfa=MFA: AWS virtual mfa arn.<br>
30
+ -r, --no-remote: Do not validate with remote api.
24
31
 
25
32
  * add-role ROLE:
26
33
 
27
- Adds a ROLE to the keyring
34
+ Adds a ROLE to the keyring<br>
35
+
36
+ -a, --arn=ARN: AWS role arn.
37
+
38
+ * awskeyring console ACCOUNT:
28
39
 
29
- * console ACCOUNT:
40
+ Open the AWS Console for the ACCOUNT<br>
30
41
 
31
- Open the AWS Console for the ACCOUNT
42
+ -p, --path=PATH: The service PATH to open.<br>
43
+ -b, --browser=BROWSER: Specify an alternative browser.<br>
44
+ -n, --no-token: Do not use saved token.<br>
45
+ -o, --no-open: Do not open the url.
32
46
 
33
47
  * env ACCOUNT:
34
48
 
35
- Outputs bourne shell environment exports for an ACCOUNT
49
+ Outputs bourne shell environment exports for an ACCOUNT<br>
50
+
51
+ -n, --no-token: Do not use saved token.<br>
52
+ -u, --unset, --no-unset: Unset environment variables.
36
53
 
37
54
  * exec ACCOUNT command...:
38
55
 
39
- Execute a COMMAND with the environment set for an ACCOUNT
56
+ Execute a COMMAND with the environment set for an ACCOUNT<br>
57
+
58
+ -n, --no-token: Do not use saved token.<br>
59
+ -b, --no-bundle: Unset Bundler environment variables.
40
60
 
41
61
  * help [COMMAND]:
42
62
 
@@ -44,15 +64,21 @@ The commands are as follows:
44
64
 
45
65
  * import:
46
66
 
47
- Import an ACCOUNT to the keyring from ~/.aws/credentials
67
+ Import an ACCOUNT to the keyring from ~/.aws/credentials<br>
68
+
69
+ -r, --no-remote: Do not validate with remote api.
48
70
 
49
71
  * initialise:
50
72
 
51
- Initialises a new KEYCHAIN
73
+ Initialises a new KEYCHAIN<br>
74
+
75
+ -n, --keychain=KEYCHAIN: Name of KEYCHAIN to initialise.
52
76
 
53
77
  * json ACCOUNT:
54
78
 
55
- Outputs AWS CLI compatible JSON for an ACCOUNT
79
+ Outputs AWS CLI compatible JSON for an ACCOUNT<br>
80
+
81
+ -n, --no-token: Do not use saved token.
56
82
 
57
83
  * list:
58
84
 
@@ -60,7 +86,9 @@ The commands are as follows:
60
86
 
61
87
  * list-role:
62
88
 
63
- Prints a list of roles in the keyring
89
+ Prints a list of roles in the keyring<br>
90
+
91
+ -d, --detail, --no-detail: Show more detail.
64
92
 
65
93
  * remove ACCOUNT:
66
94
 
@@ -80,11 +108,19 @@ The commands are as follows:
80
108
 
81
109
  * token ACCOUNT [ROLE] [MFA]:
82
110
 
83
- Create an STS Token from a ROLE or an MFA code
111
+ Create an STS Token from a ROLE or an MFA code<br>
112
+
113
+ -r, --role=ROLE: The ROLE to assume.<br>
114
+ -c, --code=CODE: Virtual mfa CODE.<br>
115
+ -d, --duration=DURATION: Session DURATION in seconds.
84
116
 
85
117
  * update ACCOUNT:
86
118
 
87
- Updates an ACCOUNT in the keyring
119
+ Updates an ACCOUNT in the keyring<br>
120
+
121
+ -k, --key=KEY: AWS account key id.<br>
122
+ -s, --secret=SECRET: AWS account secret.<br>
123
+ -r, --no-remote: Do not validate with remote api.
88
124
 
89
125
  ## ENVIRONMENT
90
126
 
@@ -132,6 +168,7 @@ Tristan Morgan <tristan.morgan@servian.com> is the maintainer of Awskeyring.
132
168
 
133
169
  * Tristan [tristanmorgan](https://github.com/tristanmorgan)
134
170
  * Adam Sir [AzySir](https://github.com/AzySir)
171
+ * Vito Giarrusso [thtliife](https://github.com/thtliife)
135
172
 
136
173
  ## LICENSE
137
174
 
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: 1.6.0
4
+ version: 1.7.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: 2020-08-11 00:00:00.000000000 Z
11
+ date: 2020-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-iam
@@ -98,8 +98,8 @@ licenses:
98
98
  metadata:
99
99
  bug_tracker_uri: https://github.com/servian/awskeyring/issues
100
100
  changelog_uri: https://github.com/servian/awskeyring/blob/master/CHANGELOG.md
101
- documentation_uri: https://rubydoc.info/gems/awskeyring/1.6.0
102
- source_code_uri: https://github.com/servian/awskeyring/tree/v1.6.0
101
+ documentation_uri: https://rubydoc.info/gems/awskeyring/1.7.0
102
+ source_code_uri: https://github.com/servian/awskeyring/tree/v1.7.0
103
103
  wiki_uri: https://github.com/servian/awskeyring/wiki
104
104
  post_install_message:
105
105
  rdoc_options: []