awskeyring 1.0.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +26 -179
- data/CONTRIBUTING.md +48 -0
- data/Gemfile +4 -1
- data/README.md +13 -11
- data/Rakefile +3 -0
- data/i18n/en.yml +1 -0
- data/lib/awskeyring.rb +50 -0
- data/lib/awskeyring/version.rb +2 -2
- data/lib/awskeyring_command.rb +65 -26
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9c691b2c94541dc7bf3562ae06b25231dbc8b04f42a04cb327209424f46c9849
|
4
|
+
data.tar.gz: a4c0362c4656c64de13708d44a38a1258da651abc1fb79635d99992b0259fd4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7982836f83b748af2e4a64ce91b74f33f7f26a6423919fe0ce114011b8ffae9af61039e93a9307e7caeb97eb60ba22131dc57725d6bedd69529fc80e57c6db2
|
7
|
+
data.tar.gz: 79700754547b8ce87008a8624686dac7d362947f48e2e9a8a9904e71522454c53c63ed5edfc0fea5f16f5b2be9409641375836fb78fc0dd1c6f91c7b7b6464ca
|
data/CHANGELOG.md
CHANGED
@@ -1,220 +1,67 @@
|
|
1
|
-
#
|
1
|
+
# Changelog
|
2
2
|
|
3
|
-
## [v1.0
|
4
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v1.0.0...v1.0.1)
|
3
|
+
## [v1.2.0](https://github.com/servian/awskeyring/tree/v1.2.0) (2020-01-20)
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
- auto-complete the --version [\#47](https://github.com/vibrato/awskeyring/pull/47) ([tristanmorgan](https://github.com/tristanmorgan))
|
9
|
-
|
10
|
-
**Fixed bugs:**
|
11
|
-
|
12
|
-
- Unfreeze secret strings. [\#46](https://github.com/vibrato/awskeyring/pull/46) ([tristanmorgan](https://github.com/tristanmorgan))
|
13
|
-
|
14
|
-
## [v1.0.0](https://github.com/vibrato/awskeyring/tree/v1.0.0) (2019-05-19)
|
15
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.10.0...v1.0.0)
|
5
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v1.1.2...v1.2.0)
|
16
6
|
|
17
7
|
**Implemented enhancements:**
|
18
8
|
|
19
|
-
-
|
20
|
-
|
21
|
-
## [v0.10.0](https://github.com/vibrato/awskeyring/tree/v0.10.0) (2019-04-24)
|
22
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.9.0...v0.10.0)
|
9
|
+
- Check for existing account keys and role arns [\#56](https://github.com/servian/awskeyring/pull/56) ([tristanmorgan](https://github.com/tristanmorgan))
|
23
10
|
|
24
|
-
|
11
|
+
## [v1.1.2](https://github.com/servian/awskeyring/tree/v1.1.2) (2020-01-06)
|
25
12
|
|
26
|
-
|
27
|
-
|
28
|
-
## [v0.9.0](https://github.com/vibrato/awskeyring/tree/v0.9.0) (2019-04-09)
|
29
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.8.1...v0.9.0)
|
30
|
-
|
31
|
-
**Implemented enhancements:**
|
32
|
-
|
33
|
-
- Strip whitespace from user input [\#43](https://github.com/vibrato/awskeyring/pull/43) ([tristanmorgan](https://github.com/tristanmorgan))
|
34
|
-
|
35
|
-
## [v0.8.1](https://github.com/vibrato/awskeyring/tree/v0.8.1) (2019-02-06)
|
36
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.8.0...v0.8.1)
|
13
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v1.1.1...v1.1.2)
|
37
14
|
|
38
15
|
**Fixed bugs:**
|
39
16
|
|
40
|
-
-
|
41
|
-
|
42
|
-
## [v0.8.0](https://github.com/vibrato/awskeyring/tree/v0.8.0) (2018-12-19)
|
43
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.7.2...v0.8.0)
|
44
|
-
|
45
|
-
**Implemented enhancements:**
|
46
|
-
|
47
|
-
- Provide input feedback for secret fields. [\#41](https://github.com/vibrato/awskeyring/pull/41) ([tristanmorgan](https://github.com/tristanmorgan))
|
48
|
-
|
49
|
-
**Fixed bugs:**
|
50
|
-
|
51
|
-
- Cannot enter secret access key when adding new accounts in 0.7.0 [\#36](https://github.com/vibrato/awskeyring/issues/36)
|
52
|
-
|
53
|
-
## [v0.7.2](https://github.com/vibrato/awskeyring/tree/v0.7.2) (2018-12-17)
|
54
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.7.1...v0.7.2)
|
55
|
-
|
56
|
-
**Fixed bugs:**
|
57
|
-
|
58
|
-
- Validate that account doesn't already exists. [\#40](https://github.com/vibrato/awskeyring/pull/40) ([tristanmorgan](https://github.com/tristanmorgan))
|
59
|
-
- Check for COMMAND param to exec. [\#38](https://github.com/vibrato/awskeyring/pull/38) ([tristanmorgan](https://github.com/tristanmorgan))
|
60
|
-
|
61
|
-
## [v0.7.1](https://github.com/vibrato/awskeyring/tree/v0.7.1) (2018-12-03)
|
62
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.7.0...v0.7.1)
|
63
|
-
|
64
|
-
**Fixed bugs:**
|
65
|
-
|
66
|
-
- Trailing LF was being passed to validator [\#37](https://github.com/vibrato/awskeyring/pull/37) ([tristanmorgan](https://github.com/tristanmorgan))
|
67
|
-
|
68
|
-
## [v0.7.0](https://github.com/vibrato/awskeyring/tree/v0.7.0) (2018-11-26)
|
69
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.6.0...v0.7.0)
|
70
|
-
|
71
|
-
**Implemented enhancements:**
|
72
|
-
|
73
|
-
- Validate existing account. [\#35](https://github.com/vibrato/awskeyring/pull/35) ([tristanmorgan](https://github.com/tristanmorgan))
|
74
|
-
- Swap Highline for Thor::LineEditor [\#34](https://github.com/vibrato/awskeyring/pull/34) ([tristanmorgan](https://github.com/tristanmorgan))
|
75
|
-
|
76
|
-
## [v0.6.0](https://github.com/vibrato/awskeyring/tree/v0.6.0) (2018-10-18)
|
77
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.5.3...v0.6.0)
|
78
|
-
|
79
|
-
**Fixed bugs:**
|
80
|
-
|
81
|
-
- Use a default Region for Rotate. [\#33](https://github.com/vibrato/awskeyring/pull/33) ([tristanmorgan](https://github.com/tristanmorgan))
|
82
|
-
- Fix JSON time format to use ISO8601. [\#32](https://github.com/vibrato/awskeyring/pull/32) ([tristanmorgan](https://github.com/tristanmorgan))
|
83
|
-
|
84
|
-
## [v0.5.3](https://github.com/vibrato/awskeyring/tree/v0.5.3) (2018-10-03)
|
85
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.5.2...v0.5.3)
|
17
|
+
- Deprecation warning for exit\_on\_failure [\#55](https://github.com/servian/awskeyring/pull/55) ([tristanmorgan](https://github.com/tristanmorgan))
|
86
18
|
|
87
|
-
|
88
|
-
|
89
|
-
- Console favourites [\#31](https://github.com/vibrato/awskeyring/pull/31) ([tristanmorgan](https://github.com/tristanmorgan))
|
19
|
+
## [v1.1.1](https://github.com/servian/awskeyring/tree/v1.1.1) (2019-11-27)
|
90
20
|
|
91
|
-
|
92
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.5.1...v0.5.2)
|
21
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v1.1.0...v1.1.1)
|
93
22
|
|
94
23
|
**Implemented enhancements:**
|
95
24
|
|
96
|
-
-
|
97
|
-
|
98
|
-
## [v0.5.1](https://github.com/vibrato/awskeyring/tree/v0.5.1) (2018-09-12)
|
99
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.5.0...v0.5.1)
|
100
|
-
|
101
|
-
**Implemented enhancements:**
|
25
|
+
- Add --detail flag for roles. [\#54](https://github.com/servian/awskeyring/pull/54) ([tristanmorgan](https://github.com/tristanmorgan))
|
102
26
|
|
103
|
-
|
27
|
+
## [v1.1.0](https://github.com/servian/awskeyring/tree/v1.1.0) (2019-11-06)
|
104
28
|
|
105
|
-
|
106
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.4.0...v0.5.0)
|
29
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v1.0.2...v1.1.0)
|
107
30
|
|
108
31
|
**Implemented enhancements:**
|
109
32
|
|
110
|
-
-
|
33
|
+
- Add completion to input prompts [\#53](https://github.com/servian/awskeyring/pull/53) ([tristanmorgan](https://github.com/tristanmorgan))
|
34
|
+
- Check for existing \(or not\) role names [\#52](https://github.com/servian/awskeyring/pull/52) ([tristanmorgan](https://github.com/tristanmorgan))
|
111
35
|
|
112
|
-
|
36
|
+
## [v1.0.2](https://github.com/servian/awskeyring/tree/v1.0.2) (2019-10-18)
|
113
37
|
|
114
|
-
|
115
|
-
|
116
|
-
## [v0.4.0](https://github.com/vibrato/awskeyring/tree/v0.4.0) (2018-08-21)
|
117
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.3.1...v0.4.0)
|
38
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v1.0.1...v1.0.2)
|
118
39
|
|
119
40
|
**Implemented enhancements:**
|
120
41
|
|
121
|
-
-
|
122
|
-
-
|
123
|
-
|
124
|
-
## [v0.3.1](https://github.com/vibrato/awskeyring/tree/v0.3.1) (2018-07-25)
|
125
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.3.0...v0.3.1)
|
42
|
+
- Move to a new home, Servian. [\#51](https://github.com/servian/awskeyring/pull/51) ([tristanmorgan](https://github.com/tristanmorgan))
|
43
|
+
- Use RuboCop-RSpec too and expect\(\) more. [\#48](https://github.com/servian/awskeyring/pull/48) ([tristanmorgan](https://github.com/tristanmorgan))
|
126
44
|
|
127
|
-
|
45
|
+
## [v1.0.1](https://github.com/servian/awskeyring/tree/v1.0.1) (2019-05-23)
|
128
46
|
|
129
|
-
|
130
|
-
|
131
|
-
**Fixed bugs:**
|
132
|
-
|
133
|
-
- Error adding account when region is not specified [\#21](https://github.com/vibrato/awskeyring/issues/21)
|
134
|
-
- Check more locations for current region. [\#23](https://github.com/vibrato/awskeyring/pull/23) ([tristanmorgan](https://github.com/tristanmorgan))
|
135
|
-
|
136
|
-
**Merged pull requests:**
|
137
|
-
|
138
|
-
- Set a default region on cred verify. [\#22](https://github.com/vibrato/awskeyring/pull/22) ([tristanmorgan](https://github.com/tristanmorgan))
|
139
|
-
|
140
|
-
## [v0.3.0](https://github.com/vibrato/awskeyring/tree/v0.3.0) (2018-04-12)
|
141
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.2.0...v0.3.0)
|
47
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v1.0.0...v1.0.1)
|
142
48
|
|
143
49
|
**Implemented enhancements:**
|
144
50
|
|
145
|
-
-
|
146
|
-
- Generate a token from IAM User credentials using the GetFederationToken API [\#17](https://github.com/vibrato/awskeyring/issues/17)
|
147
|
-
- Test creds against AWS API \(optionally\). [\#20](https://github.com/vibrato/awskeyring/pull/20) ([tristanmorgan](https://github.com/tristanmorgan))
|
148
|
-
- Allow STS get\_session\_token without role [\#19](https://github.com/vibrato/awskeyring/pull/19) ([tristanmorgan](https://github.com/tristanmorgan))
|
149
|
-
|
150
|
-
## [v0.2.0](https://github.com/vibrato/awskeyring/tree/v0.2.0) (2018-04-05)
|
151
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.1.1...v0.2.0)
|
152
|
-
|
153
|
-
**Implemented enhancements:**
|
154
|
-
|
155
|
-
- Add AWS CLI credential\_process compatible JSON output [\#16](https://github.com/vibrato/awskeyring/pull/16) ([tristanmorgan](https://github.com/tristanmorgan))
|
156
|
-
|
157
|
-
## [v0.1.1](https://github.com/vibrato/awskeyring/tree/v0.1.1) (2018-03-25)
|
158
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.1.0...v0.1.1)
|
159
|
-
|
160
|
-
**Merged pull requests:**
|
161
|
-
|
162
|
-
- More coverage with tests. [\#15](https://github.com/vibrato/awskeyring/pull/15) ([tristanmorgan](https://github.com/tristanmorgan))
|
163
|
-
- Validate MFA code and tweak Autocomplete [\#14](https://github.com/vibrato/awskeyring/pull/14) ([tristanmorgan](https://github.com/tristanmorgan))
|
164
|
-
|
165
|
-
## [v0.1.0](https://github.com/vibrato/awskeyring/tree/v0.1.0) (2018-03-14)
|
166
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.0.6...v0.1.0)
|
167
|
-
|
168
|
-
**Implemented enhancements:**
|
169
|
-
|
170
|
-
- Item refactor [\#13](https://github.com/vibrato/awskeyring/pull/13) ([tristanmorgan](https://github.com/tristanmorgan))
|
171
|
-
- Aws refactor [\#12](https://github.com/vibrato/awskeyring/pull/12) ([tristanmorgan](https://github.com/tristanmorgan))
|
172
|
-
|
173
|
-
## [v0.0.6](https://github.com/vibrato/awskeyring/tree/v0.0.6) (2018-03-01)
|
174
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.0.5...v0.0.6)
|
175
|
-
|
176
|
-
**Implemented enhancements:**
|
177
|
-
|
178
|
-
- Credential Rotation Feature [\#4](https://github.com/vibrato/awskeyring/issues/4)
|
179
|
-
- Rotate credentials feature. [\#11](https://github.com/vibrato/awskeyring/pull/11) ([tristanmorgan](https://github.com/tristanmorgan))
|
180
|
-
|
181
|
-
**Merged pull requests:**
|
182
|
-
|
183
|
-
- Input validation [\#10](https://github.com/vibrato/awskeyring/pull/10) ([tristanmorgan](https://github.com/tristanmorgan))
|
184
|
-
- Adding a check for incorrect file modes. [\#9](https://github.com/vibrato/awskeyring/pull/9) ([tristanmorgan](https://github.com/tristanmorgan))
|
185
|
-
|
186
|
-
## [v0.0.5](https://github.com/vibrato/awskeyring/tree/v0.0.5) (2018-02-15)
|
187
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.0.4...v0.0.5)
|
51
|
+
- auto-complete the --version [\#47](https://github.com/servian/awskeyring/pull/47) ([tristanmorgan](https://github.com/tristanmorgan))
|
188
52
|
|
189
53
|
**Fixed bugs:**
|
190
54
|
|
191
|
-
-
|
192
|
-
|
193
|
-
**Merged pull requests:**
|
55
|
+
- Unfreeze secret strings. [\#46](https://github.com/servian/awskeyring/pull/46) ([tristanmorgan](https://github.com/tristanmorgan))
|
194
56
|
|
195
|
-
|
57
|
+
## [v1.0.0](https://github.com/servian/awskeyring/tree/v1.0.0) (2019-05-19)
|
196
58
|
|
197
|
-
|
198
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.0.3...v0.0.4)
|
199
|
-
|
200
|
-
## [v0.0.3](https://github.com/vibrato/awskeyring/tree/v0.0.3) (2018-01-28)
|
201
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.0.2...v0.0.3)
|
59
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.10.0...v1.0.0)
|
202
60
|
|
203
61
|
**Implemented enhancements:**
|
204
62
|
|
205
|
-
-
|
206
|
-
- Implement exec command [\#2](https://github.com/vibrato/awskeyring/issues/2)
|
207
|
-
- Add Remove token feature [\#6](https://github.com/vibrato/awskeyring/pull/6) ([tristanmorgan](https://github.com/tristanmorgan))
|
208
|
-
- Implement exec feature. [\#3](https://github.com/vibrato/awskeyring/pull/3) ([tristanmorgan](https://github.com/tristanmorgan))
|
209
|
-
|
210
|
-
## [v0.0.2](https://github.com/vibrato/awskeyring/tree/v0.0.2) (2018-01-18)
|
211
|
-
[Full Changelog](https://github.com/vibrato/awskeyring/compare/v0.0.1...v0.0.2)
|
212
|
-
|
213
|
-
**Merged pull requests:**
|
214
|
-
|
215
|
-
- Sledgehammer disable of rubocop metrics. [\#1](https://github.com/vibrato/awskeyring/pull/1) ([tristanmorgan](https://github.com/tristanmorgan))
|
63
|
+
- More RuboCop changes and tweaked version string. [\#45](https://github.com/servian/awskeyring/pull/45) ([tristanmorgan](https://github.com/tristanmorgan))
|
216
64
|
|
217
|
-
## [v0.0.1](https://github.com/vibrato/awskeyring/tree/v0.0.1) (2017-12-25)
|
218
65
|
|
219
66
|
|
220
|
-
\* *This
|
67
|
+
\* *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/
|
3
|
+
![Awskeyring](https://raw.githubusercontent.com/servian/awskeyring/master/awskeyring-144.png)
|
4
4
|
|
5
|
-
* [![Build Status](https://travis-ci.org/
|
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](
|
8
|
-
* [![All Downloads](
|
9
|
-
* [![Version Downloads](
|
10
|
-
* [![Documentation](
|
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](
|
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/
|
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](
|
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
data/lib/awskeyring.rb
CHANGED
@@ -87,6 +87,11 @@ module Awskeyring # rubocop:disable Metrics/ModuleLength
|
|
87
87
|
load_keychain.generic_passwords
|
88
88
|
end
|
89
89
|
|
90
|
+
# return an item by accout
|
91
|
+
private_class_method def self.item_by_account(account)
|
92
|
+
all_items.where(account: account).first
|
93
|
+
end
|
94
|
+
|
90
95
|
# Add an account item
|
91
96
|
#
|
92
97
|
# @param [String] account The account name to create
|
@@ -174,6 +179,11 @@ module Awskeyring # rubocop:disable Metrics/ModuleLength
|
|
174
179
|
list_roles.map { |elem| elem.attributes[:label][(ROLE_PREFIX.length)..-1] }
|
175
180
|
end
|
176
181
|
|
182
|
+
# Return a list role item names and arns
|
183
|
+
def self.list_role_names_plus
|
184
|
+
list_roles.map { |elem| "#{elem.attributes[:label][(ROLE_PREFIX.length)..-1]}\t#{elem.attributes[:account]}" }
|
185
|
+
end
|
186
|
+
|
177
187
|
# Return a list of console paths
|
178
188
|
def self.list_console_path
|
179
189
|
prefs.key?('console') ? prefs['console'] : DEFAULT_CONSOLE_LIST
|
@@ -302,4 +312,44 @@ module Awskeyring # rubocop:disable Metrics/ModuleLength
|
|
302
312
|
|
303
313
|
account_name
|
304
314
|
end
|
315
|
+
|
316
|
+
# Validate access key does not exists
|
317
|
+
#
|
318
|
+
# @param [String] access_key the associated access key.
|
319
|
+
def self.access_key_not_exists(access_key)
|
320
|
+
Awskeyring::Validate.access_key(access_key)
|
321
|
+
raise 'Access KEY already exists' if item_by_account(access_key)
|
322
|
+
|
323
|
+
access_key
|
324
|
+
end
|
325
|
+
|
326
|
+
# Validate role exists
|
327
|
+
#
|
328
|
+
# @param [String] role_name the associated role name.
|
329
|
+
def self.role_exists(role_name)
|
330
|
+
Awskeyring::Validate.role_name(role_name)
|
331
|
+
raise 'Role does not exist' unless list_role_names.include?(role_name)
|
332
|
+
|
333
|
+
role_name
|
334
|
+
end
|
335
|
+
|
336
|
+
# Validate role does not exists
|
337
|
+
#
|
338
|
+
# @param [String] role_name the associated role name.
|
339
|
+
def self.role_not_exists(role_name)
|
340
|
+
Awskeyring::Validate.role_name(role_name)
|
341
|
+
raise 'Role already exists' if list_role_names.include?(role_name)
|
342
|
+
|
343
|
+
role_name
|
344
|
+
end
|
345
|
+
|
346
|
+
# Validate role arn not exists
|
347
|
+
#
|
348
|
+
# @param [String] role_arn the associated role arn.
|
349
|
+
def self.role_arn_not_exists(role_arn)
|
350
|
+
Awskeyring::Validate.role_arn(role_arn)
|
351
|
+
raise 'Role ARN already exists' if item_by_account(role_arn)
|
352
|
+
|
353
|
+
role_arn
|
354
|
+
end
|
305
355
|
end
|
data/lib/awskeyring/version.rb
CHANGED
data/lib/awskeyring_command.rb
CHANGED
@@ -28,6 +28,11 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
28
28
|
map ['tok'] => :token
|
29
29
|
map ['up'] => :update
|
30
30
|
|
31
|
+
# default to returning an error on failure.
|
32
|
+
def self.exit_on_failure?
|
33
|
+
true
|
34
|
+
end
|
35
|
+
|
31
36
|
desc '--version, -v', I18n.t('__version.desc')
|
32
37
|
# print the version number
|
33
38
|
def __version
|
@@ -44,7 +49,12 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
44
49
|
exit 1
|
45
50
|
end
|
46
51
|
|
47
|
-
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
|
+
)
|
48
58
|
keychain = 'awskeyring' if keychain.empty?
|
49
59
|
|
50
60
|
puts I18n.t('message.newkeychain')
|
@@ -63,9 +73,14 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
63
73
|
|
64
74
|
map 'list-role' => :list_role
|
65
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
|
66
77
|
# List roles
|
67
78
|
def list_role
|
68
|
-
|
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
|
69
84
|
end
|
70
85
|
|
71
86
|
desc 'env ACCOUNT', I18n.t('env.desc')
|
@@ -78,7 +93,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
78
93
|
else
|
79
94
|
account = ask_check(
|
80
95
|
existing: account, message: I18n.t('message.account'),
|
81
|
-
validator: Awskeyring.method(:account_exists)
|
96
|
+
validator: Awskeyring.method(:account_exists),
|
97
|
+
limited_to: Awskeyring.list_account_names
|
82
98
|
)
|
83
99
|
cred = age_check_and_get(account: account, no_token: options['no-token'])
|
84
100
|
put_env_string(cred)
|
@@ -88,7 +104,7 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
88
104
|
desc 'json ACCOUNT', I18n.t('json.desc')
|
89
105
|
method_option 'no-token', type: :boolean, aliases: '-n', desc: I18n.t('method_option.notoken'), default: false
|
90
106
|
# Print JSON for use with credential_process
|
91
|
-
def json(account
|
107
|
+
def json(account)
|
92
108
|
account = ask_check(
|
93
109
|
existing: account, message: I18n.t('message.account'), validator: Awskeyring.method(:account_exists)
|
94
110
|
)
|
@@ -133,15 +149,15 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
133
149
|
existing: account, message: I18n.t('message.account'), validator: Awskeyring.method(:account_not_exists)
|
134
150
|
)
|
135
151
|
key = ask_check(
|
136
|
-
existing: options[:key], message: I18n.t('message.key'), validator: Awskeyring
|
152
|
+
existing: options[:key], message: I18n.t('message.key'), validator: Awskeyring.method(:access_key_not_exists)
|
137
153
|
)
|
138
154
|
secret = ask_check(
|
139
155
|
existing: options[:secret], message: I18n.t('message.secret'),
|
140
|
-
|
156
|
+
flags: 'secure', validator: Awskeyring::Validate.method(:secret_access_key)
|
141
157
|
)
|
142
158
|
mfa = ask_check(
|
143
159
|
existing: options[:mfa], message: I18n.t('message.mfa'),
|
144
|
-
|
160
|
+
flags: 'optional', validator: Awskeyring::Validate.method(:mfa_arn)
|
145
161
|
)
|
146
162
|
Awskeyring::Awsapi.verify_cred(key: key, secret: secret) unless options['no-remote']
|
147
163
|
Awskeyring.add_account(
|
@@ -158,16 +174,18 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
158
174
|
method_option :secret, type: :string, aliases: '-s', desc: I18n.t('method_option.secret')
|
159
175
|
method_option 'no-remote', type: :boolean, aliases: '-r', desc: I18n.t('method_option.noremote'), default: false
|
160
176
|
# Update an Account
|
161
|
-
def update(account = nil) # rubocop:disable Metrics/MethodLength
|
177
|
+
def update(account = nil) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
162
178
|
account = ask_check(
|
163
|
-
existing: account, message: I18n.t('message.account'),
|
179
|
+
existing: account, message: I18n.t('message.account'),
|
180
|
+
validator: Awskeyring.method(:account_exists),
|
181
|
+
limited_to: Awskeyring.list_account_names
|
164
182
|
)
|
165
183
|
key = ask_check(
|
166
|
-
existing: options[:key], message: I18n.t('message.key'), validator: Awskeyring
|
184
|
+
existing: options[:key], message: I18n.t('message.key'), validator: Awskeyring.method(:access_key_not_exists)
|
167
185
|
)
|
168
186
|
secret = ask_check(
|
169
187
|
existing: options[:secret], message: I18n.t('message.secret'),
|
170
|
-
|
188
|
+
flags: 'secure', validator: Awskeyring::Validate.method(:secret_access_key)
|
171
189
|
)
|
172
190
|
Awskeyring::Awsapi.verify_cred(key: key, secret: secret) unless options['no-remote']
|
173
191
|
Awskeyring.update_account(
|
@@ -185,11 +203,11 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
185
203
|
def add_role(role = nil)
|
186
204
|
role = ask_check(
|
187
205
|
existing: role, message: I18n.t('message.role'),
|
188
|
-
validator: Awskeyring
|
206
|
+
validator: Awskeyring.method(:role_not_exists)
|
189
207
|
)
|
190
208
|
arn = ask_check(
|
191
209
|
existing: options[:arn], message: I18n.t('message.arn'),
|
192
|
-
validator: Awskeyring
|
210
|
+
validator: Awskeyring.method(:role_arn_not_exists)
|
193
211
|
)
|
194
212
|
|
195
213
|
Awskeyring.add_role(
|
@@ -203,7 +221,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
203
221
|
# Remove an account
|
204
222
|
def remove(account = nil)
|
205
223
|
account = ask_check(
|
206
|
-
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
|
207
226
|
)
|
208
227
|
Awskeyring.delete_account(account: account, message: I18n.t('message.delaccount', account: account))
|
209
228
|
end
|
@@ -212,7 +231,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
212
231
|
# remove a session token
|
213
232
|
def remove_token(account = nil)
|
214
233
|
account = ask_check(
|
215
|
-
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
|
216
236
|
)
|
217
237
|
Awskeyring.delete_token(account: account, message: I18n.t('message.deltoken', account: account))
|
218
238
|
end
|
@@ -222,7 +242,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
222
242
|
# remove a role
|
223
243
|
def remove_role(role = nil)
|
224
244
|
role = ask_check(
|
225
|
-
existing: role, message: I18n.t('message.role'), validator: Awskeyring
|
245
|
+
existing: role, message: I18n.t('message.role'), validator: Awskeyring.method(:role_exists),
|
246
|
+
limited_to: Awskeyring.list_role_names
|
226
247
|
)
|
227
248
|
Awskeyring.delete_role(role_name: role, message: I18n.t('message.delrole', role: role))
|
228
249
|
end
|
@@ -231,7 +252,10 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
231
252
|
# rotate Account keys
|
232
253
|
def rotate(account = nil) # rubocop:disable Metrics/MethodLength
|
233
254
|
account = ask_check(
|
234
|
-
existing: account,
|
255
|
+
existing: account,
|
256
|
+
message: I18n.t('message.account'),
|
257
|
+
validator: Awskeyring.method(:account_exists),
|
258
|
+
limited_to: Awskeyring.list_account_names
|
235
259
|
)
|
236
260
|
cred = Awskeyring.get_valid_creds(account: account, no_token: true)
|
237
261
|
|
@@ -263,12 +287,16 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
263
287
|
# generate a sessiopn token
|
264
288
|
def token(account = nil, role = nil, code = nil) # rubocop:disable all
|
265
289
|
account = ask_check(
|
266
|
-
existing: account,
|
290
|
+
existing: account,
|
291
|
+
message: I18n.t('message.account'),
|
292
|
+
validator: Awskeyring.method(:account_exists),
|
293
|
+
limited_to: Awskeyring.list_account_names
|
267
294
|
)
|
268
295
|
role ||= options[:role]
|
269
296
|
if role
|
270
297
|
role = ask_check(
|
271
|
-
existing: role, message: I18n.t('message.role'), validator: Awskeyring
|
298
|
+
existing: role, message: I18n.t('message.role'), validator: Awskeyring.method(:role_exists),
|
299
|
+
limited_to: Awskeyring.list_role_names
|
272
300
|
)
|
273
301
|
end
|
274
302
|
code ||= options[:code]
|
@@ -320,7 +348,10 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
320
348
|
# Open the AWS Console
|
321
349
|
def console(account = nil) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
|
322
350
|
account = ask_check(
|
323
|
-
existing: account,
|
351
|
+
existing: account,
|
352
|
+
message: I18n.t('message.account'),
|
353
|
+
validator: Awskeyring.method(:account_exists),
|
354
|
+
limited_to: Awskeyring.list_account_names
|
324
355
|
)
|
325
356
|
cred = age_check_and_get(account: account, no_token: options['no-token'])
|
326
357
|
|
@@ -436,11 +467,17 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
436
467
|
Awskeyring::Awsapi::AWS_ENV_VARS.each { |key| puts "unset #{key}" unless env_var.key?(key) }
|
437
468
|
end
|
438
469
|
|
439
|
-
def ask_check(existing:, message:,
|
470
|
+
def ask_check(existing:, message:, flags: nil, validator: nil, limited_to: nil) # rubocop:disable Metrics/MethodLength
|
440
471
|
retries ||= 3
|
441
472
|
begin
|
442
|
-
value = ask_missing(
|
443
|
-
|
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)
|
444
481
|
rescue RuntimeError => e
|
445
482
|
warn e.message
|
446
483
|
existing = nil
|
@@ -450,15 +487,17 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
450
487
|
value
|
451
488
|
end
|
452
489
|
|
453
|
-
def ask_missing(existing:, message:, secure: false, optional: false)
|
454
|
-
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
|
455
492
|
end
|
456
493
|
|
457
|
-
def ask(message:, secure: false, optional: false)
|
494
|
+
def ask(message:, secure: false, optional: false, limited_to: nil)
|
458
495
|
if secure
|
459
496
|
Awskeyring::Input.read_secret(message.rjust(20) + ': ')
|
460
497
|
elsif optional
|
461
498
|
Thor::LineEditor.readline((message + ' (optional)').rjust(20) + ': ')
|
499
|
+
elsif limited_to
|
500
|
+
Thor::LineEditor.readline(message.rjust(20) + ': ', limited_to: limited_to)
|
462
501
|
else
|
463
502
|
Thor::LineEditor.readline(message.rjust(20) + ': ')
|
464
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
|
4
|
+
version: 1.2.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:
|
11
|
+
date: 2020-01-20 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/
|
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
|
-
|
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
|