awskeyring 1.0.0 → 1.1.2

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
- SHA1:
3
- metadata.gz: 9ba83a2dbfa7ff7613421c1f3fbe82c695a67055
4
- data.tar.gz: 4b12ee81c5a56095407c68d25f064a5466fd3d46
2
+ SHA256:
3
+ metadata.gz: d6b813b7d04318821e16122cf1c377dd51d48ecef326e8bd67a4d5dfb914b221
4
+ data.tar.gz: 81d9c40c0ebff68f61802feb59ebbde9be8ad1745a62abcd01665eb0de163cad
5
5
  SHA512:
6
- metadata.gz: 6c5e2cc15bb1adb771b1d8bc6282fd62bf2285932a14bd7bb498606d290fc3d4ccc3b58e7207a73cde0fadabca1c5e827a6a5b8a976b3ab4371bb0c4eb9f3234
7
- data.tar.gz: bb684835c14ed7621bc57ffac0ec05390d0563efee66ea9a2b216d667766406f7821ee508993ffe08d71ecab974b6a5b68abcbb563fecc928bd772eb8e71ad28
6
+ metadata.gz: 64f8f178ec9ac97ba91bfd018b091fd8495ec716933bee81fa53045c03553e7903aaae96ff0d1dfe391f665f324e917059c0bcc509b0c742b13441b41d765cd0
7
+ data.tar.gz: 608d9ade4b39d5ea2eab4149c6d1e976c50e0877033012a06f58c0847ed21e566824c77037076aa995a281faf4a85b2a512ffbe7c31c313998a017673960ebaf
data/CHANGELOG.md CHANGED
@@ -1,209 +1,59 @@
1
- # Change Log
1
+ # Changelog
2
2
 
3
- ## [v1.0.0](https://github.com/vibrato/awskeyring/tree/v1.0.0) (2019-05-20)
4
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.10.0...v1.0.0)
3
+ ## [v1.1.2](https://github.com/servian/awskeyring/tree/v1.1.2) (2020-01-06)
5
4
 
6
- **Implemented enhancements:**
7
-
8
- - More RuboCop changes and tweaked version string. [\#45](https://github.com/vibrato/awskeyring/pull/45) ([tristanmorgan](https://github.com/tristanmorgan))
9
-
10
- ## [v0.10.0](https://github.com/vibrato/awskeyring/tree/v0.10.0) (2019-04-24)
11
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.9.0...v0.10.0)
12
-
13
- **Implemented enhancements:**
14
-
15
- - Add --unset flag to env command [\#44](https://github.com/vibrato/awskeyring/pull/44) ([tristanmorgan](https://github.com/tristanmorgan))
16
-
17
- ## [v0.9.0](https://github.com/vibrato/awskeyring/tree/v0.9.0) (2019-04-09)
18
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.8.1...v0.9.0)
19
-
20
- **Implemented enhancements:**
21
-
22
- - Strip whitespace from user input [\#43](https://github.com/vibrato/awskeyring/pull/43) ([tristanmorgan](https://github.com/tristanmorgan))
23
-
24
- ## [v0.8.1](https://github.com/vibrato/awskeyring/tree/v0.8.1) (2019-02-06)
25
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.8.0...v0.8.1)
26
-
27
- **Fixed bugs:**
28
-
29
- - Fix usage behind PROXIES [\#42](https://github.com/vibrato/awskeyring/pull/42) ([tristanmorgan](https://github.com/tristanmorgan))
30
-
31
- ## [v0.8.0](https://github.com/vibrato/awskeyring/tree/v0.8.0) (2018-12-19)
32
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.7.2...v0.8.0)
33
-
34
- **Implemented enhancements:**
35
-
36
- - Provide input feedback for secret fields. [\#41](https://github.com/vibrato/awskeyring/pull/41) ([tristanmorgan](https://github.com/tristanmorgan))
5
+ [Full Changelog](https://github.com/servian/awskeyring/compare/v1.1.1...v1.1.2)
37
6
 
38
7
  **Fixed bugs:**
39
8
 
40
- - Cannot enter secret access key when adding new accounts in 0.7.0 [\#36](https://github.com/vibrato/awskeyring/issues/36)
41
-
42
- ## [v0.7.2](https://github.com/vibrato/awskeyring/tree/v0.7.2) (2018-12-17)
43
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.7.1...v0.7.2)
44
-
45
- **Fixed bugs:**
46
-
47
- - Validate that account doesn't already exists. [\#40](https://github.com/vibrato/awskeyring/pull/40) ([tristanmorgan](https://github.com/tristanmorgan))
48
- - Check for COMMAND param to exec. [\#38](https://github.com/vibrato/awskeyring/pull/38) ([tristanmorgan](https://github.com/tristanmorgan))
49
-
50
- ## [v0.7.1](https://github.com/vibrato/awskeyring/tree/v0.7.1) (2018-12-03)
51
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.7.0...v0.7.1)
52
-
53
- **Fixed bugs:**
54
-
55
- - Trailing LF was being passed to validator [\#37](https://github.com/vibrato/awskeyring/pull/37) ([tristanmorgan](https://github.com/tristanmorgan))
56
-
57
- ## [v0.7.0](https://github.com/vibrato/awskeyring/tree/v0.7.0) (2018-11-26)
58
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.6.0...v0.7.0)
59
-
60
- **Implemented enhancements:**
61
-
62
- - Validate existing account. [\#35](https://github.com/vibrato/awskeyring/pull/35) ([tristanmorgan](https://github.com/tristanmorgan))
63
- - Swap Highline for Thor::LineEditor [\#34](https://github.com/vibrato/awskeyring/pull/34) ([tristanmorgan](https://github.com/tristanmorgan))
64
-
65
- ## [v0.6.0](https://github.com/vibrato/awskeyring/tree/v0.6.0) (2018-10-18)
66
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.5.3...v0.6.0)
67
-
68
- **Fixed bugs:**
69
-
70
- - Use a default Region for Rotate. [\#33](https://github.com/vibrato/awskeyring/pull/33) ([tristanmorgan](https://github.com/tristanmorgan))
71
- - Fix JSON time format to use ISO8601. [\#32](https://github.com/vibrato/awskeyring/pull/32) ([tristanmorgan](https://github.com/tristanmorgan))
72
-
73
- ## [v0.5.3](https://github.com/vibrato/awskeyring/tree/v0.5.3) (2018-10-03)
74
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.5.2...v0.5.3)
75
-
76
- **Implemented enhancements:**
77
-
78
- - Console favourites [\#31](https://github.com/vibrato/awskeyring/pull/31) ([tristanmorgan](https://github.com/tristanmorgan))
79
-
80
- ## [v0.5.2](https://github.com/vibrato/awskeyring/tree/v0.5.2) (2018-09-18)
81
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.5.1...v0.5.2)
82
-
83
- **Implemented enhancements:**
84
-
85
- - More robust autocomplete. [\#30](https://github.com/vibrato/awskeyring/pull/30) ([tristanmorgan](https://github.com/tristanmorgan))
86
-
87
- ## [v0.5.1](https://github.com/vibrato/awskeyring/tree/v0.5.1) (2018-09-12)
88
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.5.0...v0.5.1)
89
-
90
- **Implemented enhancements:**
9
+ - Deprecation warning for exit\_on\_failure [\#55](https://github.com/servian/awskeyring/pull/55) ([tristanmorgan](https://github.com/tristanmorgan))
91
10
 
92
- - Autocomplete flags too. [\#29](https://github.com/vibrato/awskeyring/pull/29) ([tristanmorgan](https://github.com/tristanmorgan))
11
+ ## [v1.1.1](https://github.com/servian/awskeyring/tree/v1.1.1) (2019-11-27)
93
12
 
94
- ## [v0.5.0](https://github.com/vibrato/awskeyring/tree/v0.5.0) (2018-09-10)
95
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.4.0...v0.5.0)
13
+ [Full Changelog](https://github.com/servian/awskeyring/compare/v1.1.0...v1.1.1)
96
14
 
97
15
  **Implemented enhancements:**
98
16
 
99
- - Separate update account from add account. [\#28](https://github.com/vibrato/awskeyring/pull/28) ([tristanmorgan](https://github.com/tristanmorgan))
17
+ - Add --detail flag for roles. [\#54](https://github.com/servian/awskeyring/pull/54) ([tristanmorgan](https://github.com/tristanmorgan))
100
18
 
101
- **Merged pull requests:**
19
+ ## [v1.1.0](https://github.com/servian/awskeyring/tree/v1.1.0) (2019-11-06)
102
20
 
103
- - Refactor [\#27](https://github.com/vibrato/awskeyring/pull/27) ([tristanmorgan](https://github.com/tristanmorgan))
104
-
105
- ## [v0.4.0](https://github.com/vibrato/awskeyring/tree/v0.4.0) (2018-08-21)
106
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.3.1...v0.4.0)
107
-
108
- **Implemented enhancements:**
109
-
110
- - I18n - Internationalisation [\#26](https://github.com/vibrato/awskeyring/pull/26) ([tristanmorgan](https://github.com/tristanmorgan))
111
- - Adds no token flag to skip saved token [\#25](https://github.com/vibrato/awskeyring/pull/25) ([tristanmorgan](https://github.com/tristanmorgan))
112
-
113
- ## [v0.3.1](https://github.com/vibrato/awskeyring/tree/v0.3.1) (2018-07-25)
114
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.3.0...v0.3.1)
21
+ [Full Changelog](https://github.com/servian/awskeyring/compare/v1.0.2...v1.1.0)
115
22
 
116
23
  **Implemented enhancements:**
117
24
 
118
- - Warn about key-age [\#24](https://github.com/vibrato/awskeyring/pull/24) ([tristanmorgan](https://github.com/tristanmorgan))
119
-
120
- **Fixed bugs:**
121
-
122
- - Error adding account when region is not specified [\#21](https://github.com/vibrato/awskeyring/issues/21)
123
- - Check more locations for current region. [\#23](https://github.com/vibrato/awskeyring/pull/23) ([tristanmorgan](https://github.com/tristanmorgan))
124
-
125
- **Merged pull requests:**
25
+ - Add completion to input prompts [\#53](https://github.com/servian/awskeyring/pull/53) ([tristanmorgan](https://github.com/tristanmorgan))
26
+ - Check for existing \(or not\) role names [\#52](https://github.com/servian/awskeyring/pull/52) ([tristanmorgan](https://github.com/tristanmorgan))
126
27
 
127
- - Set a default region on cred verify. [\#22](https://github.com/vibrato/awskeyring/pull/22) ([tristanmorgan](https://github.com/tristanmorgan))
28
+ ## [v1.0.2](https://github.com/servian/awskeyring/tree/v1.0.2) (2019-10-18)
128
29
 
129
- ## [v0.3.0](https://github.com/vibrato/awskeyring/tree/v0.3.0) (2018-04-12)
130
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.2.0...v0.3.0)
30
+ [Full Changelog](https://github.com/servian/awskeyring/compare/v1.0.1...v1.0.2)
131
31
 
132
32
  **Implemented enhancements:**
133
33
 
134
- - Validate tokens upon adding them to the keychain [\#18](https://github.com/vibrato/awskeyring/issues/18)
135
- - Generate a token from IAM User credentials using the GetFederationToken API [\#17](https://github.com/vibrato/awskeyring/issues/17)
136
- - Test creds against AWS API \(optionally\). [\#20](https://github.com/vibrato/awskeyring/pull/20) ([tristanmorgan](https://github.com/tristanmorgan))
137
- - Allow STS get\_session\_token without role [\#19](https://github.com/vibrato/awskeyring/pull/19) ([tristanmorgan](https://github.com/tristanmorgan))
34
+ - Move to a new home, Servian. [\#51](https://github.com/servian/awskeyring/pull/51) ([tristanmorgan](https://github.com/tristanmorgan))
35
+ - Use RuboCop-RSpec too and expect\(\) more. [\#48](https://github.com/servian/awskeyring/pull/48) ([tristanmorgan](https://github.com/tristanmorgan))
138
36
 
139
- ## [v0.2.0](https://github.com/vibrato/awskeyring/tree/v0.2.0) (2018-04-05)
140
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.1.1...v0.2.0)
37
+ ## [v1.0.1](https://github.com/servian/awskeyring/tree/v1.0.1) (2019-05-23)
141
38
 
142
- **Implemented enhancements:**
143
-
144
- - Add AWS CLI credential\_process compatible JSON output [\#16](https://github.com/vibrato/awskeyring/pull/16) ([tristanmorgan](https://github.com/tristanmorgan))
145
-
146
- ## [v0.1.1](https://github.com/vibrato/awskeyring/tree/v0.1.1) (2018-03-25)
147
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.1.0...v0.1.1)
148
-
149
- **Merged pull requests:**
150
-
151
- - More coverage with tests. [\#15](https://github.com/vibrato/awskeyring/pull/15) ([tristanmorgan](https://github.com/tristanmorgan))
152
- - Validate MFA code and tweak Autocomplete [\#14](https://github.com/vibrato/awskeyring/pull/14) ([tristanmorgan](https://github.com/tristanmorgan))
153
-
154
- ## [v0.1.0](https://github.com/vibrato/awskeyring/tree/v0.1.0) (2018-03-14)
155
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.0.6...v0.1.0)
156
-
157
- **Implemented enhancements:**
158
-
159
- - Item refactor [\#13](https://github.com/vibrato/awskeyring/pull/13) ([tristanmorgan](https://github.com/tristanmorgan))
160
- - Aws refactor [\#12](https://github.com/vibrato/awskeyring/pull/12) ([tristanmorgan](https://github.com/tristanmorgan))
161
-
162
- ## [v0.0.6](https://github.com/vibrato/awskeyring/tree/v0.0.6) (2018-03-01)
163
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.0.5...v0.0.6)
39
+ [Full Changelog](https://github.com/servian/awskeyring/compare/v1.0.0...v1.0.1)
164
40
 
165
41
  **Implemented enhancements:**
166
42
 
167
- - Credential Rotation Feature [\#4](https://github.com/vibrato/awskeyring/issues/4)
168
- - Rotate credentials feature. [\#11](https://github.com/vibrato/awskeyring/pull/11) ([tristanmorgan](https://github.com/tristanmorgan))
169
-
170
- **Merged pull requests:**
171
-
172
- - Input validation [\#10](https://github.com/vibrato/awskeyring/pull/10) ([tristanmorgan](https://github.com/tristanmorgan))
173
- - Adding a check for incorrect file modes. [\#9](https://github.com/vibrato/awskeyring/pull/9) ([tristanmorgan](https://github.com/tristanmorgan))
174
-
175
- ## [v0.0.5](https://github.com/vibrato/awskeyring/tree/v0.0.5) (2018-02-15)
176
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.0.4...v0.0.5)
43
+ - auto-complete the --version [\#47](https://github.com/servian/awskeyring/pull/47) ([tristanmorgan](https://github.com/tristanmorgan))
177
44
 
178
45
  **Fixed bugs:**
179
46
 
180
- - Issue on add [\#7](https://github.com/vibrato/awskeyring/issues/7)
181
-
182
- **Merged pull requests:**
47
+ - Unfreeze secret strings. [\#46](https://github.com/servian/awskeyring/pull/46) ([tristanmorgan](https://github.com/tristanmorgan))
183
48
 
184
- - fix issue \#7 and add a path to open console. [\#8](https://github.com/vibrato/awskeyring/pull/8) ([tristanmorgan](https://github.com/tristanmorgan))
49
+ ## [v1.0.0](https://github.com/servian/awskeyring/tree/v1.0.0) (2019-05-19)
185
50
 
186
- ## [v0.0.4](https://github.com/vibrato/awskeyring/tree/v0.0.4) (2018-01-29)
187
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.0.3...v0.0.4)
188
-
189
- ## [v0.0.3](https://github.com/vibrato/awskeyring/tree/v0.0.3) (2018-01-28)
190
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.0.2...v0.0.3)
51
+ [Full Changelog](https://github.com/servian/awskeyring/compare/v0.10.0...v1.0.0)
191
52
 
192
53
  **Implemented enhancements:**
193
54
 
194
- - Remove Token feature [\#5](https://github.com/vibrato/awskeyring/issues/5)
195
- - Implement exec command [\#2](https://github.com/vibrato/awskeyring/issues/2)
196
- - Add Remove token feature [\#6](https://github.com/vibrato/awskeyring/pull/6) ([tristanmorgan](https://github.com/tristanmorgan))
197
- - Implement exec feature. [\#3](https://github.com/vibrato/awskeyring/pull/3) ([tristanmorgan](https://github.com/tristanmorgan))
198
-
199
- ## [v0.0.2](https://github.com/vibrato/awskeyring/tree/v0.0.2) (2018-01-18)
200
- [Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.0.1...v0.0.2)
201
-
202
- **Merged pull requests:**
203
-
204
- - Sledgehammer disable of rubocop metrics. [\#1](https://github.com/vibrato/awskeyring/pull/1) ([tristanmorgan](https://github.com/tristanmorgan))
55
+ - More RuboCop changes and tweaked version string. [\#45](https://github.com/servian/awskeyring/pull/45) ([tristanmorgan](https://github.com/tristanmorgan))
205
56
 
206
- ## [v0.0.1](https://github.com/vibrato/awskeyring/tree/v0.0.1) (2017-12-25)
207
57
 
208
58
 
209
- \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
59
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,48 @@
1
+ # How to contribute
2
+
3
+ Bug reports and pull requests from users are what keep this project working.
4
+
5
+ ## Basics
6
+
7
+ 1. Create an issue and describe your idea
8
+ 2. [Fork it](https://github.com/servian/awskeyring/fork)
9
+ 3. Create your feature branch (`git checkout -b my-new-feature`)
10
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
11
+ 5. Publish the branch (`git push origin my-new-feature`)
12
+ 6. Create a new Pull Request
13
+
14
+ ## Checking your work
15
+
16
+ You can run the test suite.
17
+
18
+ You can run [RuboCop] to check code style.
19
+
20
+ You can run [RSpec] to see if anything broke.
21
+
22
+ You can run [YARD] to see of your code is documented.
23
+
24
+ The default Rake task, runnable using `rake`.
25
+
26
+ ## Write documentation
27
+
28
+ This project has documentation in a few places:
29
+
30
+ ### Introduction and usage
31
+
32
+ A friendly `README.md` written for many audiences.
33
+
34
+ ### Examples and advanced usage
35
+
36
+ The [wiki].
37
+
38
+ ### API documentation
39
+
40
+ API documentation is written as [YARD] docblocks in the Ruby code.
41
+
42
+ This is rendered as Web pages on [Rubydoc.info][awskeyring on Rubydoc.info].
43
+
44
+ [wiki]: https://github.com/servian/awskeyring/wiki
45
+ [YARD]: https://yardoc.org/
46
+ [awskeyring on Rubydoc.info]: https://www.rubydoc.info/gems/awskeyring
47
+ [RuboCop]: https://rubocop.readthedocs.io/en/latest/
48
+ [Rspec]: https://rspec.info
data/Gemfile CHANGED
@@ -6,11 +6,14 @@ source 'https://rubygems.org'
6
6
  gemspec
7
7
 
8
8
  group :development do
9
- gem 'bundler'
10
9
  gem 'github_changelog_generator'
11
10
  gem 'rake'
12
11
  gem 'rspec'
13
12
  gem 'rubocop'
13
+ gem 'rubocop-md'
14
14
  gem 'rubocop-performance'
15
+ gem 'rubocop-rake'
16
+ gem 'rubocop-rspec'
17
+ gem 'rubocop-rubycw'
15
18
  gem 'yard'
16
19
  end
data/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Awskeyring
2
2
 
3
- ![Awskeyring](https://raw.githubusercontent.com/vibrato/awskeyring/master/awskeyring-144.png)
3
+ ![Awskeyring](https://raw.githubusercontent.com/servian/awskeyring/master/awskeyring-144.png)
4
4
 
5
- * [![Build Status](https://travis-ci.org/vibrato/awskeyring.svg?branch=master)](https://travis-ci.org/vibrato/awskeyring)
5
+ * [![Build Status](https://travis-ci.org/servian/awskeyring.svg?branch=master)](https://travis-ci.org/servian/awskeyring)
6
6
  * [![Gem Version](https://badge.fury.io/rb/awskeyring.svg)](https://badge.fury.io/rb/awskeyring)
7
- * [![license MIT](http://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)
8
- * [![All Downloads](http://ruby-gem-downloads-badge.herokuapp.com/awskeyring?type=total)](https://rubygems.org/gems/awskeyring)
9
- * [![Version Downloads](http://ruby-gem-downloads-badge.herokuapp.com/awskeyring?label=downloads-current-version)](https://rubygems.org/gems/awskeyring)
10
- * [![Documentation](http://img.shields.io/badge/yard-docs-brightgreen.svg)](http://www.rubydoc.info/gems/awskeyring)
7
+ * [![license MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)
8
+ * [![All Downloads](https://ruby-gem-downloads-badge.herokuapp.com/awskeyring?type=total)](https://rubygems.org/gems/awskeyring)
9
+ * [![Version Downloads](https://ruby-gem-downloads-badge.herokuapp.com/awskeyring?label=downloads-current-version)](https://rubygems.org/gems/awskeyring)
10
+ * [![Documentation](https://img.shields.io/badge/yard-docs-brightgreen.svg)](https://www.rubydoc.info/gems/awskeyring)
11
11
 
12
12
  Awskeyring is a small tool to manage AWS account keys in the macOS Keychain.
13
13
 
@@ -26,6 +26,10 @@ Install it with:
26
26
 
27
27
  $ gem install awskeyring --user-install
28
28
 
29
+ ## Wiki
30
+
31
+ Please see the [Wiki](https://github.com/servian/awskeyring/wiki) for full usage instructions and tips.
32
+
29
33
  ## Quick start
30
34
 
31
35
  First you need to initialise your keychain to hold your AWS credentials.
@@ -40,14 +44,12 @@ Now your keys are stored safely in the macOS keychain. To print environment vari
40
44
 
41
45
  awskeyring env personal-aws
42
46
 
43
- Alternatively you can create a profile using the credential_process config variable. See the [AWS CLI Config docs](http://docs.aws.amazon.com/cli/latest/topic/config-vars.html#cli-aws-help-config-vars) for more details on this config option.
47
+ Alternatively you can create a profile using the credential_process config variable. See the [AWS CLI Config docs](https://docs.aws.amazon.com/cli/latest/topic/config-vars.html#cli-aws-help-config-vars) for more details on this config option.
44
48
 
45
49
  [profile personal]
46
50
  region = us-west-1
47
51
  credential_process = /usr/local/bin/awskeyring json personal-aws
48
52
 
49
- See below and in the [wiki](https://github.com/vibrato/awskeyring/wiki) for more details on usage.
50
-
51
53
  ## Usage
52
54
 
53
55
  The CLI is using [Thor](http://whatisthor.com) with help provided interactively.
@@ -95,9 +97,9 @@ If you believe you have found a security issue in Awskeyring, please responsibly
95
97
 
96
98
  ## Contributing
97
99
 
98
- Bug reports and pull requests are welcome on GitHub at https://github.com/vibrato/awskeyring. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
100
+ Bug reports and pull requests are welcome on GitHub at https://github.com/servian/awskeyring. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](https://contributor-covenant.org) code of conduct.
99
101
 
100
102
  ## License
101
103
 
102
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
104
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
103
105
 
data/Rakefile CHANGED
@@ -7,7 +7,10 @@ require 'github_changelog_generator/task'
7
7
  require 'yard'
8
8
 
9
9
  GitHubChangelogGenerator::RakeTask.new :changelog do |config|
10
+ config.user = 'servian'
11
+ config.project = 'awskeyring'
10
12
  config.future_release = "v#{Awskeyring::VERSION}"
13
+ config.since_tag = 'v0.10.0'
11
14
  end
12
15
 
13
16
  RuboCop::RakeTask.new do |rubocop|
data/i18n/en.yml CHANGED
@@ -38,6 +38,7 @@ en:
38
38
  arn: 'AWS role arn.'
39
39
  code: 'Virtual mfa CODE.'
40
40
  duration: 'Session DURATION in seconds.'
41
+ detail: 'Show more detail.'
41
42
  key: 'AWS account key id.'
42
43
  keychain: 'Name of KEYCHAIN to initialise.'
43
44
  mfa: 'AWS virtual mfa arn.'
data/lib/awskeyring.rb CHANGED
@@ -174,6 +174,11 @@ module Awskeyring # rubocop:disable Metrics/ModuleLength
174
174
  list_roles.map { |elem| elem.attributes[:label][(ROLE_PREFIX.length)..-1] }
175
175
  end
176
176
 
177
+ # Return a list role item names and arns
178
+ def self.list_role_names_plus
179
+ list_roles.map { |elem| "#{elem.attributes[:label][(ROLE_PREFIX.length)..-1]}\t#{elem.attributes[:account]}" }
180
+ end
181
+
177
182
  # Return a list of console paths
178
183
  def self.list_console_path
179
184
  prefs.key?('console') ? prefs['console'] : DEFAULT_CONSOLE_LIST
@@ -302,4 +307,24 @@ module Awskeyring # rubocop:disable Metrics/ModuleLength
302
307
 
303
308
  account_name
304
309
  end
310
+
311
+ # Validate role exists
312
+ #
313
+ # @param [String] role_name the associated role name.
314
+ def self.role_exists(role_name)
315
+ Awskeyring::Validate.role_name(role_name)
316
+ raise 'Role does not exist' unless list_role_names.include?(role_name)
317
+
318
+ role_name
319
+ end
320
+
321
+ # Validate role does not exists
322
+ #
323
+ # @param [String] role_name the associated role name.
324
+ def self.role_not_exists(role_name)
325
+ Awskeyring::Validate.role_name(role_name)
326
+ raise 'Role already exists' if list_role_names.include?(role_name)
327
+
328
+ role_name
329
+ end
305
330
  end
@@ -15,7 +15,7 @@ module Awskeyring
15
15
  end
16
16
 
17
17
  private_class_method def self.hide_input # rubocop:disable Metrics/MethodLength
18
- password = ''
18
+ password = +''
19
19
  loop do
20
20
  character = $stdin.getch
21
21
  break unless character
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Awskeyring
4
4
  # The Gem's version number
5
- VERSION = '1.0.0'
5
+ VERSION = '1.1.2'
6
6
  # The Gem's homepage
7
- HOMEPAGE = 'https://github.com/vibrato/awskeyring'
7
+ HOMEPAGE = 'https://github.com/servian/awskeyring'
8
8
  end
@@ -15,6 +15,7 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
15
15
  I18n.backend.load_translations
16
16
 
17
17
  map %w[--version -v] => :__version
18
+ map %w[--help -h] => :help
18
19
  map ['init'] => :initialise
19
20
  map ['adr'] => :add_role
20
21
  map ['con'] => :console
@@ -27,6 +28,11 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
27
28
  map ['tok'] => :token
28
29
  map ['up'] => :update
29
30
 
31
+ # default to returning an error on failure.
32
+ def self.exit_on_failure?
33
+ true
34
+ end
35
+
30
36
  desc '--version, -v', I18n.t('__version.desc')
31
37
  # print the version number
32
38
  def __version
@@ -43,7 +49,12 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
43
49
  exit 1
44
50
  end
45
51
 
46
- keychain = ask_missing(existing: options[:keychain], message: I18n.t('message.keychain'))
52
+ keychain = ask_check(
53
+ existing: options[:keychain],
54
+ flags: 'optional',
55
+ message: I18n.t('message.keychain'),
56
+ validator: Awskeyring::Validate.method(:account_name)
57
+ )
47
58
  keychain = 'awskeyring' if keychain.empty?
48
59
 
49
60
  puts I18n.t('message.newkeychain')
@@ -62,9 +73,14 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
62
73
 
63
74
  map 'list-role' => :list_role
64
75
  desc 'list-role', I18n.t('list_role.desc')
76
+ method_option 'detail', type: :boolean, aliases: '-d', desc: I18n.t('method_option.detail'), default: false
65
77
  # List roles
66
78
  def list_role
67
- puts Awskeyring.list_role_names.join("\n")
79
+ if options['detail']
80
+ puts Awskeyring.list_role_names_plus.join("\n")
81
+ else
82
+ puts Awskeyring.list_role_names.join("\n")
83
+ end
68
84
  end
69
85
 
70
86
  desc 'env ACCOUNT', I18n.t('env.desc')
@@ -77,7 +93,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
77
93
  else
78
94
  account = ask_check(
79
95
  existing: account, message: I18n.t('message.account'),
80
- validator: Awskeyring.method(:account_exists)
96
+ validator: Awskeyring.method(:account_exists),
97
+ limited_to: Awskeyring.list_account_names
81
98
  )
82
99
  cred = age_check_and_get(account: account, no_token: options['no-token'])
83
100
  put_env_string(cred)
@@ -87,7 +104,7 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
87
104
  desc 'json ACCOUNT', I18n.t('json.desc')
88
105
  method_option 'no-token', type: :boolean, aliases: '-n', desc: I18n.t('method_option.notoken'), default: false
89
106
  # Print JSON for use with credential_process
90
- def json(account = nil)
107
+ def json(account)
91
108
  account = ask_check(
92
109
  existing: account, message: I18n.t('message.account'), validator: Awskeyring.method(:account_exists)
93
110
  )
@@ -136,11 +153,11 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
136
153
  )
137
154
  secret = ask_check(
138
155
  existing: options[:secret], message: I18n.t('message.secret'),
139
- secure: true, validator: Awskeyring::Validate.method(:secret_access_key)
156
+ flags: 'secure', validator: Awskeyring::Validate.method(:secret_access_key)
140
157
  )
141
158
  mfa = ask_check(
142
159
  existing: options[:mfa], message: I18n.t('message.mfa'),
143
- optional: true, validator: Awskeyring::Validate.method(:mfa_arn)
160
+ flags: 'optional', validator: Awskeyring::Validate.method(:mfa_arn)
144
161
  )
145
162
  Awskeyring::Awsapi.verify_cred(key: key, secret: secret) unless options['no-remote']
146
163
  Awskeyring.add_account(
@@ -157,16 +174,18 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
157
174
  method_option :secret, type: :string, aliases: '-s', desc: I18n.t('method_option.secret')
158
175
  method_option 'no-remote', type: :boolean, aliases: '-r', desc: I18n.t('method_option.noremote'), default: false
159
176
  # Update an Account
160
- def update(account = nil) # rubocop:disable Metrics/MethodLength
177
+ def update(account = nil) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
161
178
  account = ask_check(
162
- existing: account, message: I18n.t('message.account'), validator: Awskeyring.method(:account_exists)
179
+ existing: account, message: I18n.t('message.account'),
180
+ validator: Awskeyring.method(:account_exists),
181
+ limited_to: Awskeyring.list_account_names
163
182
  )
164
183
  key = ask_check(
165
184
  existing: options[:key], message: I18n.t('message.key'), validator: Awskeyring::Validate.method(:access_key)
166
185
  )
167
186
  secret = ask_check(
168
187
  existing: options[:secret], message: I18n.t('message.secret'),
169
- secure: true, validator: Awskeyring::Validate.method(:secret_access_key)
188
+ flags: 'secure', validator: Awskeyring::Validate.method(:secret_access_key)
170
189
  )
171
190
  Awskeyring::Awsapi.verify_cred(key: key, secret: secret) unless options['no-remote']
172
191
  Awskeyring.update_account(
@@ -184,7 +203,7 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
184
203
  def add_role(role = nil)
185
204
  role = ask_check(
186
205
  existing: role, message: I18n.t('message.role'),
187
- validator: Awskeyring::Validate.method(:role_name)
206
+ validator: Awskeyring.method(:role_not_exists)
188
207
  )
189
208
  arn = ask_check(
190
209
  existing: options[:arn], message: I18n.t('message.arn'),
@@ -202,7 +221,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
202
221
  # Remove an account
203
222
  def remove(account = nil)
204
223
  account = ask_check(
205
- existing: account, message: I18n.t('message.account'), validator: Awskeyring.method(:account_exists)
224
+ existing: account, message: I18n.t('message.account'), validator: Awskeyring.method(:account_exists),
225
+ limited_to: Awskeyring.list_account_names
206
226
  )
207
227
  Awskeyring.delete_account(account: account, message: I18n.t('message.delaccount', account: account))
208
228
  end
@@ -211,7 +231,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
211
231
  # remove a session token
212
232
  def remove_token(account = nil)
213
233
  account = ask_check(
214
- existing: account, message: I18n.t('message.account'), validator: Awskeyring.method(:account_exists)
234
+ existing: account, message: I18n.t('message.account'), validator: Awskeyring.method(:account_exists),
235
+ limited_to: Awskeyring.list_account_names
215
236
  )
216
237
  Awskeyring.delete_token(account: account, message: I18n.t('message.deltoken', account: account))
217
238
  end
@@ -221,7 +242,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
221
242
  # remove a role
222
243
  def remove_role(role = nil)
223
244
  role = ask_check(
224
- existing: role, message: I18n.t('message.role'), validator: Awskeyring::Validate.method(:role_name)
245
+ existing: role, message: I18n.t('message.role'), validator: Awskeyring.method(:role_exists),
246
+ limited_to: Awskeyring.list_role_names
225
247
  )
226
248
  Awskeyring.delete_role(role_name: role, message: I18n.t('message.delrole', role: role))
227
249
  end
@@ -230,7 +252,10 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
230
252
  # rotate Account keys
231
253
  def rotate(account = nil) # rubocop:disable Metrics/MethodLength
232
254
  account = ask_check(
233
- existing: account, message: I18n.t('message.account'), validator: Awskeyring.method(:account_exists)
255
+ existing: account,
256
+ message: I18n.t('message.account'),
257
+ validator: Awskeyring.method(:account_exists),
258
+ limited_to: Awskeyring.list_account_names
234
259
  )
235
260
  cred = Awskeyring.get_valid_creds(account: account, no_token: true)
236
261
 
@@ -262,12 +287,16 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
262
287
  # generate a sessiopn token
263
288
  def token(account = nil, role = nil, code = nil) # rubocop:disable all
264
289
  account = ask_check(
265
- existing: account, message: I18n.t('message.account'), validator: Awskeyring.method(:account_exists)
290
+ existing: account,
291
+ message: I18n.t('message.account'),
292
+ validator: Awskeyring.method(:account_exists),
293
+ limited_to: Awskeyring.list_account_names
266
294
  )
267
295
  role ||= options[:role]
268
296
  if role
269
297
  role = ask_check(
270
- existing: role, message: I18n.t('message.role'), validator: Awskeyring::Validate.method(:role_name)
298
+ existing: role, message: I18n.t('message.role'), validator: Awskeyring.method(:role_exists),
299
+ limited_to: Awskeyring.list_role_names
271
300
  )
272
301
  end
273
302
  code ||= options[:code]
@@ -319,7 +348,10 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
319
348
  # Open the AWS Console
320
349
  def console(account = nil) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
321
350
  account = ask_check(
322
- existing: account, message: I18n.t('message.account'), validator: Awskeyring.method(:account_exists)
351
+ existing: account,
352
+ message: I18n.t('message.account'),
353
+ validator: Awskeyring.method(:account_exists),
354
+ limited_to: Awskeyring.list_account_names
323
355
  )
324
356
  cred = age_check_and_get(account: account, no_token: options['no-token'])
325
357
 
@@ -379,7 +411,7 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
379
411
  comp_len = 3 if curr.start_with?('-')
380
412
 
381
413
  case prev
382
- when 'help'
414
+ when 'help', File.basename($PROGRAM_NAME)
383
415
  comp_len = 0
384
416
  when 'remove-role', '-r', 'rmr'
385
417
  comp_len = 2
@@ -435,11 +467,17 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
435
467
  Awskeyring::Awsapi::AWS_ENV_VARS.each { |key| puts "unset #{key}" unless env_var.key?(key) }
436
468
  end
437
469
 
438
- def ask_check(existing:, message:, secure: false, optional: false, validator: nil)
470
+ def ask_check(existing:, message:, flags: nil, validator: nil, limited_to: nil) # rubocop:disable Metrics/MethodLength
439
471
  retries ||= 3
440
472
  begin
441
- value = ask_missing(existing: existing, message: message, secure: secure, optional: optional)
442
- value = validator.call(value) unless value.empty? && optional
473
+ value = ask_missing(
474
+ existing: existing,
475
+ message: message,
476
+ secure: 'secure'.eql?(flags),
477
+ optional: 'optional'.eql?(flags),
478
+ limited_to: limited_to
479
+ )
480
+ value = validator.call(value) unless value.empty? && 'optional'.eql?(flags)
443
481
  rescue RuntimeError => e
444
482
  warn e.message
445
483
  existing = nil
@@ -449,15 +487,17 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
449
487
  value
450
488
  end
451
489
 
452
- def ask_missing(existing:, message:, secure: false, optional: false)
453
- existing || ask(message: message, secure: secure, optional: optional).strip
490
+ def ask_missing(existing:, message:, secure: false, optional: false, limited_to: nil)
491
+ existing || ask(message: message, secure: secure, optional: optional, limited_to: limited_to).strip
454
492
  end
455
493
 
456
- def ask(message:, secure: false, optional: false)
494
+ def ask(message:, secure: false, optional: false, limited_to: nil)
457
495
  if secure
458
496
  Awskeyring::Input.read_secret(message.rjust(20) + ': ')
459
497
  elsif optional
460
498
  Thor::LineEditor.readline((message + ' (optional)').rjust(20) + ': ')
499
+ elsif limited_to
500
+ Thor::LineEditor.readline(message.rjust(20) + ': ', limited_to: limited_to)
461
501
  else
462
502
  Thor::LineEditor.readline(message.rjust(20) + ': ')
463
503
  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: 1.0.0
4
+ version: 1.1.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: 2019-05-20 00:00:00.000000000 Z
11
+ date: 2020-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-iam
@@ -76,6 +76,7 @@ extra_rdoc_files: []
76
76
  files:
77
77
  - CHANGELOG.md
78
78
  - CODE_OF_CONDUCT.md
79
+ - CONTRIBUTING.md
79
80
  - Gemfile
80
81
  - LICENSE.txt
81
82
  - README.md
@@ -89,7 +90,7 @@ files:
89
90
  - lib/awskeyring/validate.rb
90
91
  - lib/awskeyring/version.rb
91
92
  - lib/awskeyring_command.rb
92
- homepage: https://github.com/vibrato/awskeyring
93
+ homepage: https://github.com/servian/awskeyring
93
94
  licenses:
94
95
  - MIT
95
96
  metadata: {}
@@ -108,8 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
109
  - !ruby/object:Gem::Version
109
110
  version: '0'
110
111
  requirements: []
111
- rubyforge_project:
112
- rubygems_version: 2.5.2.3
112
+ rubygems_version: 3.0.3
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Manages AWS credentials in the macOS keychain