awskeyring 0.8.1 → 1.0.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 +5 -5
- data/CHANGELOG.md +124 -84
- data/CONTRIBUTING.md +48 -0
- data/Gemfile +4 -1
- data/README.md +15 -11
- data/Rakefile +2 -0
- data/awskeyring.gemspec +4 -2
- data/exe/awskeyring +3 -2
- data/i18n/en.yml +1 -0
- data/lib/awskeyring.rb +6 -4
- data/lib/awskeyring/awsapi.rb +49 -8
- data/lib/awskeyring/input.rb +3 -1
- data/lib/awskeyring/validate.rb +2 -0
- data/lib/awskeyring/version.rb +6 -2
- data/lib/awskeyring_command.rb +32 -38
- 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: 98c9cb7a8b1bb999039afa9aa3ecadab9fc7cea93a370d954df6eeadde4439df
|
|
4
|
+
data.tar.gz: bf180c1f0bd4938effce45a6649b91dec8400f39212e6ef60c4af788989ba12a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c63542d56d3f72bd58f5e4157840695955492795a10fdfb9271a847c64bd6347d4addfca4b9c8f9a2b2f6463d93cf9775e3c47745bf447fd65fd2d1be9a0b557
|
|
7
|
+
data.tar.gz: 1bdd84d62afb7496f22403e8a2fb09df0b543962c7c7308b260763a3a394e1adcc954da52cd1828fa6c8193ec136bbac0fc6c3121294e4da43f8967914854234
|
data/CHANGELOG.md
CHANGED
|
@@ -1,188 +1,228 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## [
|
|
4
|
-
[Full Changelog](https://github.com/
|
|
3
|
+
## [v1.0.2](https://github.com/servian/awskeyring/tree/v1.0.2) (2019-10-18)
|
|
4
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v1.0.1...v1.0.2)
|
|
5
|
+
|
|
6
|
+
**Implemented enhancements:**
|
|
7
|
+
|
|
8
|
+
- Move to a new home, Servian. [\#51](https://github.com/servian/awskeyring/pull/51) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
9
|
+
- Use RuboCop-RSpec too and expect\(\) more. [\#48](https://github.com/servian/awskeyring/pull/48) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
10
|
+
|
|
11
|
+
## [v1.0.1](https://github.com/servian/awskeyring/tree/v1.0.1) (2019-05-23)
|
|
12
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v1.0.0...v1.0.1)
|
|
13
|
+
|
|
14
|
+
**Implemented enhancements:**
|
|
15
|
+
|
|
16
|
+
- auto-complete the --version [\#47](https://github.com/servian/awskeyring/pull/47) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
17
|
+
|
|
18
|
+
**Fixed bugs:**
|
|
19
|
+
|
|
20
|
+
- Unfreeze secret strings. [\#46](https://github.com/servian/awskeyring/pull/46) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
21
|
+
|
|
22
|
+
## [v1.0.0](https://github.com/servian/awskeyring/tree/v1.0.0) (2019-05-19)
|
|
23
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.10.0...v1.0.0)
|
|
24
|
+
|
|
25
|
+
**Implemented enhancements:**
|
|
26
|
+
|
|
27
|
+
- More RuboCop changes and tweaked version string. [\#45](https://github.com/servian/awskeyring/pull/45) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
28
|
+
|
|
29
|
+
## [v0.10.0](https://github.com/servian/awskeyring/tree/v0.10.0) (2019-04-24)
|
|
30
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.9.0...v0.10.0)
|
|
31
|
+
|
|
32
|
+
**Implemented enhancements:**
|
|
33
|
+
|
|
34
|
+
- Add --unset flag to env command [\#44](https://github.com/servian/awskeyring/pull/44) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
35
|
+
|
|
36
|
+
## [v0.9.0](https://github.com/servian/awskeyring/tree/v0.9.0) (2019-04-09)
|
|
37
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.8.1...v0.9.0)
|
|
38
|
+
|
|
39
|
+
**Implemented enhancements:**
|
|
40
|
+
|
|
41
|
+
- Strip whitespace from user input [\#43](https://github.com/servian/awskeyring/pull/43) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
42
|
+
|
|
43
|
+
## [v0.8.1](https://github.com/servian/awskeyring/tree/v0.8.1) (2019-02-06)
|
|
44
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.8.0...v0.8.1)
|
|
5
45
|
|
|
6
46
|
**Fixed bugs:**
|
|
7
47
|
|
|
8
|
-
- Fix usage behind PROXIES [\#42](https://github.com/
|
|
48
|
+
- Fix usage behind PROXIES [\#42](https://github.com/servian/awskeyring/pull/42) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
9
49
|
|
|
10
|
-
## [v0.8.0](https://github.com/
|
|
11
|
-
[Full Changelog](https://github.com/
|
|
50
|
+
## [v0.8.0](https://github.com/servian/awskeyring/tree/v0.8.0) (2018-12-19)
|
|
51
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.7.2...v0.8.0)
|
|
12
52
|
|
|
13
53
|
**Implemented enhancements:**
|
|
14
54
|
|
|
15
|
-
- Provide input feedback for secret fields. [\#41](https://github.com/
|
|
55
|
+
- Provide input feedback for secret fields. [\#41](https://github.com/servian/awskeyring/pull/41) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
16
56
|
|
|
17
57
|
**Fixed bugs:**
|
|
18
58
|
|
|
19
|
-
- Cannot enter secret access key when adding new accounts in 0.7.0 [\#36](https://github.com/
|
|
59
|
+
- Cannot enter secret access key when adding new accounts in 0.7.0 [\#36](https://github.com/servian/awskeyring/issues/36)
|
|
20
60
|
|
|
21
|
-
## [v0.7.2](https://github.com/
|
|
22
|
-
[Full Changelog](https://github.com/
|
|
61
|
+
## [v0.7.2](https://github.com/servian/awskeyring/tree/v0.7.2) (2018-12-17)
|
|
62
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.7.1...v0.7.2)
|
|
23
63
|
|
|
24
64
|
**Fixed bugs:**
|
|
25
65
|
|
|
26
|
-
- Validate that account doesn't already exists. [\#40](https://github.com/
|
|
27
|
-
- Check for COMMAND param to exec. [\#38](https://github.com/
|
|
66
|
+
- Validate that account doesn't already exists. [\#40](https://github.com/servian/awskeyring/pull/40) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
67
|
+
- Check for COMMAND param to exec. [\#38](https://github.com/servian/awskeyring/pull/38) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
28
68
|
|
|
29
|
-
## [v0.7.1](https://github.com/
|
|
30
|
-
[Full Changelog](https://github.com/
|
|
69
|
+
## [v0.7.1](https://github.com/servian/awskeyring/tree/v0.7.1) (2018-12-03)
|
|
70
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.7.0...v0.7.1)
|
|
31
71
|
|
|
32
72
|
**Fixed bugs:**
|
|
33
73
|
|
|
34
|
-
- Trailing LF was being passed to validator [\#37](https://github.com/
|
|
74
|
+
- Trailing LF was being passed to validator [\#37](https://github.com/servian/awskeyring/pull/37) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
35
75
|
|
|
36
|
-
## [v0.7.0](https://github.com/
|
|
37
|
-
[Full Changelog](https://github.com/
|
|
76
|
+
## [v0.7.0](https://github.com/servian/awskeyring/tree/v0.7.0) (2018-11-26)
|
|
77
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.6.0...v0.7.0)
|
|
38
78
|
|
|
39
79
|
**Implemented enhancements:**
|
|
40
80
|
|
|
41
|
-
- Validate existing account. [\#35](https://github.com/
|
|
42
|
-
- Swap Highline for Thor::LineEditor [\#34](https://github.com/
|
|
81
|
+
- Validate existing account. [\#35](https://github.com/servian/awskeyring/pull/35) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
82
|
+
- Swap Highline for Thor::LineEditor [\#34](https://github.com/servian/awskeyring/pull/34) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
43
83
|
|
|
44
|
-
## [v0.6.0](https://github.com/
|
|
45
|
-
[Full Changelog](https://github.com/
|
|
84
|
+
## [v0.6.0](https://github.com/servian/awskeyring/tree/v0.6.0) (2018-10-18)
|
|
85
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.5.3...v0.6.0)
|
|
46
86
|
|
|
47
87
|
**Fixed bugs:**
|
|
48
88
|
|
|
49
|
-
- Use a default Region for Rotate. [\#33](https://github.com/
|
|
50
|
-
- Fix JSON time format to use ISO8601. [\#32](https://github.com/
|
|
89
|
+
- Use a default Region for Rotate. [\#33](https://github.com/servian/awskeyring/pull/33) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
90
|
+
- Fix JSON time format to use ISO8601. [\#32](https://github.com/servian/awskeyring/pull/32) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
51
91
|
|
|
52
|
-
## [v0.5.3](https://github.com/
|
|
53
|
-
[Full Changelog](https://github.com/
|
|
92
|
+
## [v0.5.3](https://github.com/servian/awskeyring/tree/v0.5.3) (2018-10-03)
|
|
93
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.5.2...v0.5.3)
|
|
54
94
|
|
|
55
95
|
**Implemented enhancements:**
|
|
56
96
|
|
|
57
|
-
- Console favourites [\#31](https://github.com/
|
|
97
|
+
- Console favourites [\#31](https://github.com/servian/awskeyring/pull/31) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
58
98
|
|
|
59
|
-
## [v0.5.2](https://github.com/
|
|
60
|
-
[Full Changelog](https://github.com/
|
|
99
|
+
## [v0.5.2](https://github.com/servian/awskeyring/tree/v0.5.2) (2018-09-18)
|
|
100
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.5.1...v0.5.2)
|
|
61
101
|
|
|
62
102
|
**Implemented enhancements:**
|
|
63
103
|
|
|
64
|
-
- More robust autocomplete. [\#30](https://github.com/
|
|
104
|
+
- More robust autocomplete. [\#30](https://github.com/servian/awskeyring/pull/30) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
65
105
|
|
|
66
|
-
## [v0.5.1](https://github.com/
|
|
67
|
-
[Full Changelog](https://github.com/
|
|
106
|
+
## [v0.5.1](https://github.com/servian/awskeyring/tree/v0.5.1) (2018-09-12)
|
|
107
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.5.0...v0.5.1)
|
|
68
108
|
|
|
69
109
|
**Implemented enhancements:**
|
|
70
110
|
|
|
71
|
-
- Autocomplete flags too. [\#29](https://github.com/
|
|
111
|
+
- Autocomplete flags too. [\#29](https://github.com/servian/awskeyring/pull/29) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
72
112
|
|
|
73
|
-
## [v0.5.0](https://github.com/
|
|
74
|
-
[Full Changelog](https://github.com/
|
|
113
|
+
## [v0.5.0](https://github.com/servian/awskeyring/tree/v0.5.0) (2018-09-10)
|
|
114
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.4.0...v0.5.0)
|
|
75
115
|
|
|
76
116
|
**Implemented enhancements:**
|
|
77
117
|
|
|
78
|
-
- Separate update account from add account. [\#28](https://github.com/
|
|
118
|
+
- Separate update account from add account. [\#28](https://github.com/servian/awskeyring/pull/28) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
79
119
|
|
|
80
120
|
**Merged pull requests:**
|
|
81
121
|
|
|
82
|
-
- Refactor [\#27](https://github.com/
|
|
122
|
+
- Refactor [\#27](https://github.com/servian/awskeyring/pull/27) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
83
123
|
|
|
84
|
-
## [v0.4.0](https://github.com/
|
|
85
|
-
[Full Changelog](https://github.com/
|
|
124
|
+
## [v0.4.0](https://github.com/servian/awskeyring/tree/v0.4.0) (2018-08-21)
|
|
125
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.3.1...v0.4.0)
|
|
86
126
|
|
|
87
127
|
**Implemented enhancements:**
|
|
88
128
|
|
|
89
|
-
- I18n - Internationalisation [\#26](https://github.com/
|
|
90
|
-
- Adds no token flag to skip saved token [\#25](https://github.com/
|
|
129
|
+
- I18n - Internationalisation [\#26](https://github.com/servian/awskeyring/pull/26) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
130
|
+
- Adds no token flag to skip saved token [\#25](https://github.com/servian/awskeyring/pull/25) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
91
131
|
|
|
92
|
-
## [v0.3.1](https://github.com/
|
|
93
|
-
[Full Changelog](https://github.com/
|
|
132
|
+
## [v0.3.1](https://github.com/servian/awskeyring/tree/v0.3.1) (2018-07-25)
|
|
133
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.3.0...v0.3.1)
|
|
94
134
|
|
|
95
135
|
**Implemented enhancements:**
|
|
96
136
|
|
|
97
|
-
- Warn about key-age [\#24](https://github.com/
|
|
137
|
+
- Warn about key-age [\#24](https://github.com/servian/awskeyring/pull/24) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
98
138
|
|
|
99
139
|
**Fixed bugs:**
|
|
100
140
|
|
|
101
|
-
- Error adding account when region is not specified [\#21](https://github.com/
|
|
102
|
-
- Check more locations for current region. [\#23](https://github.com/
|
|
141
|
+
- Error adding account when region is not specified [\#21](https://github.com/servian/awskeyring/issues/21)
|
|
142
|
+
- Check more locations for current region. [\#23](https://github.com/servian/awskeyring/pull/23) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
103
143
|
|
|
104
144
|
**Merged pull requests:**
|
|
105
145
|
|
|
106
|
-
- Set a default region on cred verify. [\#22](https://github.com/
|
|
146
|
+
- Set a default region on cred verify. [\#22](https://github.com/servian/awskeyring/pull/22) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
107
147
|
|
|
108
|
-
## [v0.3.0](https://github.com/
|
|
109
|
-
[Full Changelog](https://github.com/
|
|
148
|
+
## [v0.3.0](https://github.com/servian/awskeyring/tree/v0.3.0) (2018-04-12)
|
|
149
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.2.0...v0.3.0)
|
|
110
150
|
|
|
111
151
|
**Implemented enhancements:**
|
|
112
152
|
|
|
113
|
-
- Validate tokens upon adding them to the keychain [\#18](https://github.com/
|
|
114
|
-
- Generate a token from IAM User credentials using the GetFederationToken API [\#17](https://github.com/
|
|
115
|
-
- Test creds against AWS API \(optionally\). [\#20](https://github.com/
|
|
116
|
-
- Allow STS get\_session\_token without role [\#19](https://github.com/
|
|
153
|
+
- Validate tokens upon adding them to the keychain [\#18](https://github.com/servian/awskeyring/issues/18)
|
|
154
|
+
- Generate a token from IAM User credentials using the GetFederationToken API [\#17](https://github.com/servian/awskeyring/issues/17)
|
|
155
|
+
- Test creds against AWS API \(optionally\). [\#20](https://github.com/servian/awskeyring/pull/20) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
156
|
+
- Allow STS get\_session\_token without role [\#19](https://github.com/servian/awskeyring/pull/19) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
117
157
|
|
|
118
|
-
## [v0.2.0](https://github.com/
|
|
119
|
-
[Full Changelog](https://github.com/
|
|
158
|
+
## [v0.2.0](https://github.com/servian/awskeyring/tree/v0.2.0) (2018-04-05)
|
|
159
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.1.1...v0.2.0)
|
|
120
160
|
|
|
121
161
|
**Implemented enhancements:**
|
|
122
162
|
|
|
123
|
-
- Add AWS CLI credential\_process compatible JSON output [\#16](https://github.com/
|
|
163
|
+
- Add AWS CLI credential\_process compatible JSON output [\#16](https://github.com/servian/awskeyring/pull/16) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
124
164
|
|
|
125
|
-
## [v0.1.1](https://github.com/
|
|
126
|
-
[Full Changelog](https://github.com/
|
|
165
|
+
## [v0.1.1](https://github.com/servian/awskeyring/tree/v0.1.1) (2018-03-25)
|
|
166
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.1.0...v0.1.1)
|
|
127
167
|
|
|
128
168
|
**Merged pull requests:**
|
|
129
169
|
|
|
130
|
-
- More coverage with tests. [\#15](https://github.com/
|
|
131
|
-
- Validate MFA code and tweak Autocomplete [\#14](https://github.com/
|
|
170
|
+
- More coverage with tests. [\#15](https://github.com/servian/awskeyring/pull/15) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
171
|
+
- Validate MFA code and tweak Autocomplete [\#14](https://github.com/servian/awskeyring/pull/14) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
132
172
|
|
|
133
|
-
## [v0.1.0](https://github.com/
|
|
134
|
-
[Full Changelog](https://github.com/
|
|
173
|
+
## [v0.1.0](https://github.com/servian/awskeyring/tree/v0.1.0) (2018-03-14)
|
|
174
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.0.6...v0.1.0)
|
|
135
175
|
|
|
136
176
|
**Implemented enhancements:**
|
|
137
177
|
|
|
138
|
-
- Item refactor [\#13](https://github.com/
|
|
139
|
-
- Aws refactor [\#12](https://github.com/
|
|
178
|
+
- Item refactor [\#13](https://github.com/servian/awskeyring/pull/13) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
179
|
+
- Aws refactor [\#12](https://github.com/servian/awskeyring/pull/12) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
140
180
|
|
|
141
|
-
## [v0.0.6](https://github.com/
|
|
142
|
-
[Full Changelog](https://github.com/
|
|
181
|
+
## [v0.0.6](https://github.com/servian/awskeyring/tree/v0.0.6) (2018-03-01)
|
|
182
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.0.5...v0.0.6)
|
|
143
183
|
|
|
144
184
|
**Implemented enhancements:**
|
|
145
185
|
|
|
146
|
-
- Credential Rotation Feature [\#4](https://github.com/
|
|
147
|
-
- Rotate credentials feature. [\#11](https://github.com/
|
|
186
|
+
- Credential Rotation Feature [\#4](https://github.com/servian/awskeyring/issues/4)
|
|
187
|
+
- Rotate credentials feature. [\#11](https://github.com/servian/awskeyring/pull/11) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
148
188
|
|
|
149
189
|
**Merged pull requests:**
|
|
150
190
|
|
|
151
|
-
- Input validation [\#10](https://github.com/
|
|
152
|
-
- Adding a check for incorrect file modes. [\#9](https://github.com/
|
|
191
|
+
- Input validation [\#10](https://github.com/servian/awskeyring/pull/10) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
192
|
+
- Adding a check for incorrect file modes. [\#9](https://github.com/servian/awskeyring/pull/9) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
153
193
|
|
|
154
|
-
## [v0.0.5](https://github.com/
|
|
155
|
-
[Full Changelog](https://github.com/
|
|
194
|
+
## [v0.0.5](https://github.com/servian/awskeyring/tree/v0.0.5) (2018-02-15)
|
|
195
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.0.4...v0.0.5)
|
|
156
196
|
|
|
157
197
|
**Fixed bugs:**
|
|
158
198
|
|
|
159
|
-
- Issue on add [\#7](https://github.com/
|
|
199
|
+
- Issue on add [\#7](https://github.com/servian/awskeyring/issues/7)
|
|
160
200
|
|
|
161
201
|
**Merged pull requests:**
|
|
162
202
|
|
|
163
|
-
- fix issue \#7 and add a path to open console. [\#8](https://github.com/
|
|
203
|
+
- fix issue \#7 and add a path to open console. [\#8](https://github.com/servian/awskeyring/pull/8) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
164
204
|
|
|
165
|
-
## [v0.0.4](https://github.com/
|
|
166
|
-
[Full Changelog](https://github.com/
|
|
205
|
+
## [v0.0.4](https://github.com/servian/awskeyring/tree/v0.0.4) (2018-01-29)
|
|
206
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.0.3...v0.0.4)
|
|
167
207
|
|
|
168
|
-
## [v0.0.3](https://github.com/
|
|
169
|
-
[Full Changelog](https://github.com/
|
|
208
|
+
## [v0.0.3](https://github.com/servian/awskeyring/tree/v0.0.3) (2018-01-28)
|
|
209
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.0.2...v0.0.3)
|
|
170
210
|
|
|
171
211
|
**Implemented enhancements:**
|
|
172
212
|
|
|
173
|
-
- Remove Token feature [\#5](https://github.com/
|
|
174
|
-
- Implement exec command [\#2](https://github.com/
|
|
175
|
-
- Add Remove token feature [\#6](https://github.com/
|
|
176
|
-
- Implement exec feature. [\#3](https://github.com/
|
|
213
|
+
- Remove Token feature [\#5](https://github.com/servian/awskeyring/issues/5)
|
|
214
|
+
- Implement exec command [\#2](https://github.com/servian/awskeyring/issues/2)
|
|
215
|
+
- Add Remove token feature [\#6](https://github.com/servian/awskeyring/pull/6) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
216
|
+
- Implement exec feature. [\#3](https://github.com/servian/awskeyring/pull/3) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
177
217
|
|
|
178
|
-
## [v0.0.2](https://github.com/
|
|
179
|
-
[Full Changelog](https://github.com/
|
|
218
|
+
## [v0.0.2](https://github.com/servian/awskeyring/tree/v0.0.2) (2018-01-18)
|
|
219
|
+
[Full Changelog](https://github.com/servian/awskeyring/compare/v0.0.1...v0.0.2)
|
|
180
220
|
|
|
181
221
|
**Merged pull requests:**
|
|
182
222
|
|
|
183
|
-
- Sledgehammer disable of rubocop metrics. [\#1](https://github.com/
|
|
223
|
+
- Sledgehammer disable of rubocop metrics. [\#1](https://github.com/servian/awskeyring/pull/1) ([tristanmorgan](https://github.com/tristanmorgan))
|
|
184
224
|
|
|
185
|
-
## [v0.0.1](https://github.com/
|
|
225
|
+
## [v0.0.1](https://github.com/servian/awskeyring/tree/v0.0.1) (2017-12-25)
|
|
186
226
|
|
|
187
227
|
|
|
188
228
|
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/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
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
source 'https://rubygems.org'
|
|
2
4
|
|
|
3
5
|
# Specify your gem's dependencies in awskeyring.gemspec
|
|
4
6
|
gemspec
|
|
5
7
|
|
|
6
8
|
group :development do
|
|
7
|
-
gem 'bundler'
|
|
8
9
|
gem 'github_changelog_generator'
|
|
9
10
|
gem 'rake'
|
|
10
11
|
gem 'rspec'
|
|
11
12
|
gem 'rubocop'
|
|
13
|
+
gem 'rubocop-performance'
|
|
14
|
+
gem 'rubocop-rspec'
|
|
12
15
|
gem 'yard'
|
|
13
16
|
end
|
data/README.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# Awskeyring
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
* [](https://travis-ci.org/servian/awskeyring)
|
|
4
6
|
* [](https://badge.fury.io/rb/awskeyring)
|
|
5
|
-
* [](https://opensource.org/licenses/MIT)
|
|
8
|
+
* [](https://rubygems.org/gems/awskeyring)
|
|
9
|
+
* [](https://rubygems.org/gems/awskeyring)
|
|
10
|
+
* [](https://www.rubydoc.info/gems/awskeyring)
|
|
9
11
|
|
|
10
12
|
Awskeyring is a small tool to manage AWS account keys in the macOS Keychain.
|
|
11
13
|
|
|
@@ -24,6 +26,10 @@ Install it with:
|
|
|
24
26
|
|
|
25
27
|
$ gem install awskeyring --user-install
|
|
26
28
|
|
|
29
|
+
## Wiki
|
|
30
|
+
|
|
31
|
+
Please see the [Wiki](https://github.com/servian/awskeyring/wiki) for full usage instructions and tips.
|
|
32
|
+
|
|
27
33
|
## Quick start
|
|
28
34
|
|
|
29
35
|
First you need to initialise your keychain to hold your AWS credentials.
|
|
@@ -38,14 +44,12 @@ Now your keys are stored safely in the macOS keychain. To print environment vari
|
|
|
38
44
|
|
|
39
45
|
awskeyring env personal-aws
|
|
40
46
|
|
|
41
|
-
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.
|
|
42
48
|
|
|
43
49
|
[profile personal]
|
|
44
50
|
region = us-west-1
|
|
45
51
|
credential_process = /usr/local/bin/awskeyring json personal-aws
|
|
46
52
|
|
|
47
|
-
See below and in the [wiki](https://github.com/vibrato/awskeyring/wiki) for more details on usage.
|
|
48
|
-
|
|
49
53
|
## Usage
|
|
50
54
|
|
|
51
55
|
The CLI is using [Thor](http://whatisthor.com) with help provided interactively.
|
|
@@ -83,7 +87,7 @@ To set your environment easily the following bash function helps:
|
|
|
83
87
|
|
|
84
88
|
## Development
|
|
85
89
|
|
|
86
|
-
After checking out the repo, run `bundle update` to install dependencies. Then, run `rake` to run the tests. Run `bundle exec awskeyring` to use the gem in this directory, ignoring other installed copies of this gem.
|
|
90
|
+
After checking out the repo, run `bundle update` to install dependencies. Then, run `rake` to run the tests. Run `bundle exec awskeyring` to use the gem in this directory, ignoring other installed copies of this gem. Awskeyring is tested against the last two versions of Ruby shipped with macOS.
|
|
87
91
|
|
|
88
92
|
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
89
93
|
|
|
@@ -93,9 +97,9 @@ If you believe you have found a security issue in Awskeyring, please responsibly
|
|
|
93
97
|
|
|
94
98
|
## Contributing
|
|
95
99
|
|
|
96
|
-
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.
|
|
97
101
|
|
|
98
102
|
## License
|
|
99
103
|
|
|
100
|
-
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).
|
|
101
105
|
|
data/Rakefile
CHANGED
data/awskeyring.gemspec
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
lib = File.expand_path('lib', __dir__)
|
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
5
|
require 'awskeyring/version'
|
|
@@ -10,10 +12,10 @@ Gem::Specification.new do |spec|
|
|
|
10
12
|
|
|
11
13
|
spec.summary = 'Manages AWS credentials in the macOS keychain'
|
|
12
14
|
spec.description = 'Manages AWS credentials in the macOS keychain'
|
|
13
|
-
spec.homepage =
|
|
15
|
+
spec.homepage = Awskeyring::HOMEPAGE
|
|
14
16
|
spec.license = 'MIT'
|
|
15
17
|
|
|
16
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec
|
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/|^\..*|^.*\.png}) }
|
|
17
19
|
spec.bindir = 'exe'
|
|
18
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
19
21
|
spec.require_paths = ['lib']
|
data/exe/awskeyring
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
2
3
|
|
|
3
4
|
require_relative '../lib/awskeyring_command'
|
|
4
5
|
|
|
@@ -9,7 +10,7 @@ end
|
|
|
9
10
|
|
|
10
11
|
begin
|
|
11
12
|
AwskeyringCommand.start
|
|
12
|
-
rescue Keychain::UserCancelledError =>
|
|
13
|
-
warn
|
|
13
|
+
rescue Keychain::UserCancelledError => e
|
|
14
|
+
warn e.to_s
|
|
14
15
|
exit 1
|
|
15
16
|
end
|
data/i18n/en.yml
CHANGED
data/lib/awskeyring.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'json'
|
|
2
4
|
require 'keychain'
|
|
3
5
|
require 'awskeyring/validate'
|
|
@@ -8,13 +10,13 @@ module Awskeyring # rubocop:disable Metrics/ModuleLength
|
|
|
8
10
|
# Default rpeferences fole path
|
|
9
11
|
PREFS_FILE = (File.expand_path '~/.awskeyring').freeze
|
|
10
12
|
# Prefix for Roles
|
|
11
|
-
ROLE_PREFIX = 'role '
|
|
13
|
+
ROLE_PREFIX = 'role '
|
|
12
14
|
# Prefix for Accounts
|
|
13
|
-
ACCOUNT_PREFIX = 'account '
|
|
15
|
+
ACCOUNT_PREFIX = 'account '
|
|
14
16
|
# Prefix for Session Keys
|
|
15
|
-
SESSION_KEY_PREFIX = 'session-key '
|
|
17
|
+
SESSION_KEY_PREFIX = 'session-key '
|
|
16
18
|
# Prefix for Session Tokens
|
|
17
|
-
SESSION_TOKEN_PREFIX = 'session-token '
|
|
19
|
+
SESSION_TOKEN_PREFIX = 'session-token '
|
|
18
20
|
# Default keychain Lock period
|
|
19
21
|
FIVE_MINUTES = 300
|
|
20
22
|
# Default warning of key age in days.
|
data/lib/awskeyring/awsapi.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'aws-sdk-iam'
|
|
2
4
|
require 'cgi'
|
|
3
5
|
require 'json'
|
|
@@ -18,7 +20,17 @@ module Awskeyring
|
|
|
18
20
|
}.to_json.freeze
|
|
19
21
|
|
|
20
22
|
# AWS Signin url
|
|
21
|
-
AWS_SIGNIN_URL = 'https://signin.aws.amazon.com/federation'
|
|
23
|
+
AWS_SIGNIN_URL = 'https://signin.aws.amazon.com/federation'
|
|
24
|
+
|
|
25
|
+
# AWS Env vars
|
|
26
|
+
AWS_ENV_VARS = %w[
|
|
27
|
+
AWS_ACCESS_KEY_ID
|
|
28
|
+
AWS_ACCESS_KEY
|
|
29
|
+
AWS_SECRET_ACCESS_KEY
|
|
30
|
+
AWS_SECRET_KEY
|
|
31
|
+
AWS_SECURITY_TOKEN
|
|
32
|
+
AWS_SESSION_TOKEN
|
|
33
|
+
].freeze
|
|
22
34
|
|
|
23
35
|
# Twelve hours in seconds
|
|
24
36
|
TWELVE_HOUR = (60 * 60 * 12)
|
|
@@ -70,8 +82,8 @@ module Awskeyring
|
|
|
70
82
|
duration_seconds: params[:duration]
|
|
71
83
|
)
|
|
72
84
|
end
|
|
73
|
-
rescue Aws::STS::Errors::AccessDenied =>
|
|
74
|
-
warn
|
|
85
|
+
rescue Aws::STS::Errors::AccessDenied => e
|
|
86
|
+
warn e.to_s
|
|
75
87
|
exit 1
|
|
76
88
|
end
|
|
77
89
|
|
|
@@ -101,6 +113,35 @@ module Awskeyring
|
|
|
101
113
|
)
|
|
102
114
|
end
|
|
103
115
|
|
|
116
|
+
# Generates Environment Variables for the AWS CLI
|
|
117
|
+
#
|
|
118
|
+
# @param [Hash] params including
|
|
119
|
+
# [String] account The aws_access_key_id
|
|
120
|
+
# [String] secret The aws_secret_access_key
|
|
121
|
+
# [String] token The aws_session_token
|
|
122
|
+
# @return [Hash] env_var hash
|
|
123
|
+
def self.get_env_array(params = {})
|
|
124
|
+
env_var = {}
|
|
125
|
+
env_var['AWS_DEFAULT_REGION'] = 'us-east-1' unless region
|
|
126
|
+
env_var['AWS_ACCOUNT_NAME'] = params[:account] if params[:account]
|
|
127
|
+
|
|
128
|
+
if params[:key]
|
|
129
|
+
env_var['AWS_ACCESS_KEY_ID'] = params[:key]
|
|
130
|
+
env_var['AWS_ACCESS_KEY'] = params[:key]
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if params[:secret]
|
|
134
|
+
env_var['AWS_SECRET_ACCESS_KEY'] = params[:secret]
|
|
135
|
+
env_var['AWS_SECRET_KEY'] = params[:secret]
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if params[:token]
|
|
139
|
+
env_var['AWS_SECURITY_TOKEN'] = params[:token]
|
|
140
|
+
env_var['AWS_SESSION_TOKEN'] = params[:token]
|
|
141
|
+
end
|
|
142
|
+
env_var
|
|
143
|
+
end
|
|
144
|
+
|
|
104
145
|
# Verify Credentials are active and valid
|
|
105
146
|
#
|
|
106
147
|
# @param [String] key The aws_access_key_id
|
|
@@ -110,8 +151,8 @@ module Awskeyring
|
|
|
110
151
|
ENV['AWS_DEFAULT_REGION'] = 'us-east-1' unless region
|
|
111
152
|
sts = Aws::STS::Client.new(access_key_id: key, secret_access_key: secret)
|
|
112
153
|
sts.get_caller_identity
|
|
113
|
-
rescue Aws::Errors::ServiceError =>
|
|
114
|
-
warn
|
|
154
|
+
rescue Aws::Errors::ServiceError => e
|
|
155
|
+
warn e.to_s
|
|
115
156
|
exit 1
|
|
116
157
|
end
|
|
117
158
|
true
|
|
@@ -185,7 +226,7 @@ module Awskeyring
|
|
|
185
226
|
# @return [String] key The aws_access_key_id
|
|
186
227
|
# @return [String] secret The aws_secret_access_key
|
|
187
228
|
# @return [String] account the associated account name.
|
|
188
|
-
def self.rotate(account:, key:, secret:, key_message:) # rubocop:disable Metrics/MethodLength
|
|
229
|
+
def self.rotate(account:, key:, secret:, key_message:) # rubocop:disable Metrics/MethodLength
|
|
189
230
|
ENV['AWS_DEFAULT_REGION'] = 'us-east-1' unless region
|
|
190
231
|
iam = Aws::IAM::Client.new(access_key_id: key, secret_access_key: secret)
|
|
191
232
|
|
|
@@ -218,13 +259,13 @@ module Awskeyring
|
|
|
218
259
|
retries ||= 1
|
|
219
260
|
begin
|
|
220
261
|
yield block
|
|
221
|
-
rescue Aws::IAM::Errors::InvalidClientTokenId =>
|
|
262
|
+
rescue Aws::IAM::Errors::InvalidClientTokenId => e
|
|
222
263
|
if retries < 4
|
|
223
264
|
sleep 2**retries
|
|
224
265
|
retries += 1
|
|
225
266
|
retry
|
|
226
267
|
end
|
|
227
|
-
warn
|
|
268
|
+
warn e.message
|
|
228
269
|
exit 1
|
|
229
270
|
end
|
|
230
271
|
end
|
data/lib/awskeyring/input.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'io/console'
|
|
2
4
|
|
|
3
5
|
# Awskeyring Module,
|
|
@@ -13,7 +15,7 @@ module Awskeyring
|
|
|
13
15
|
end
|
|
14
16
|
|
|
15
17
|
private_class_method def self.hide_input # rubocop:disable Metrics/MethodLength
|
|
16
|
-
password = ''
|
|
18
|
+
password = +''
|
|
17
19
|
loop do
|
|
18
20
|
character = $stdin.getch
|
|
19
21
|
break unless character
|
data/lib/awskeyring/validate.rb
CHANGED
data/lib/awskeyring/version.rb
CHANGED
data/lib/awskeyring_command.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'i18n'
|
|
2
4
|
require 'thor'
|
|
3
5
|
|
|
@@ -13,7 +15,9 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
|
13
15
|
I18n.backend.load_translations
|
|
14
16
|
|
|
15
17
|
map %w[--version -v] => :__version
|
|
18
|
+
map %w[--help -h] => :help
|
|
16
19
|
map ['init'] => :initialise
|
|
20
|
+
map ['adr'] => :add_role
|
|
17
21
|
map ['con'] => :console
|
|
18
22
|
map ['ls'] => :list
|
|
19
23
|
map ['lsr'] => :list_role
|
|
@@ -27,7 +31,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
|
27
31
|
desc '--version, -v', I18n.t('__version.desc')
|
|
28
32
|
# print the version number
|
|
29
33
|
def __version
|
|
30
|
-
puts Awskeyring::VERSION
|
|
34
|
+
puts "Awskeyring v#{Awskeyring::VERSION}"
|
|
35
|
+
puts "Homepage #{Awskeyring::HOMEPAGE}"
|
|
31
36
|
end
|
|
32
37
|
|
|
33
38
|
desc 'initialise', I18n.t('initialise.desc')
|
|
@@ -65,13 +70,19 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
|
65
70
|
|
|
66
71
|
desc 'env ACCOUNT', I18n.t('env.desc')
|
|
67
72
|
method_option 'no-token', type: :boolean, aliases: '-n', desc: I18n.t('method_option.notoken'), default: false
|
|
73
|
+
method_option 'unset', type: :boolean, aliases: '-u', desc: I18n.t('method_option.unset'), default: false
|
|
68
74
|
# Print Env vars
|
|
69
75
|
def env(account = nil)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
if options['unset']
|
|
77
|
+
put_env_string(account: nil, key: nil, secret: nil, token: nil)
|
|
78
|
+
else
|
|
79
|
+
account = ask_check(
|
|
80
|
+
existing: account, message: I18n.t('message.account'),
|
|
81
|
+
validator: Awskeyring.method(:account_exists)
|
|
82
|
+
)
|
|
83
|
+
cred = age_check_and_get(account: account, no_token: options['no-token'])
|
|
84
|
+
put_env_string(cred)
|
|
85
|
+
end
|
|
75
86
|
end
|
|
76
87
|
|
|
77
88
|
desc 'json ACCOUNT', I18n.t('json.desc')
|
|
@@ -100,13 +111,13 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
|
100
111
|
exit 1
|
|
101
112
|
end
|
|
102
113
|
cred = age_check_and_get(account: account, no_token: options['no-token'])
|
|
103
|
-
env_vars =
|
|
114
|
+
env_vars = Awskeyring::Awsapi.get_env_array(cred)
|
|
104
115
|
begin
|
|
105
116
|
pid = Process.spawn(env_vars, command.join(' '))
|
|
106
117
|
Process.wait pid
|
|
107
118
|
$CHILD_STATUS
|
|
108
|
-
rescue Errno::ENOENT =>
|
|
109
|
-
warn
|
|
119
|
+
rescue Errno::ENOENT => e
|
|
120
|
+
warn e.to_s
|
|
110
121
|
exit 1
|
|
111
122
|
end
|
|
112
123
|
end
|
|
@@ -231,8 +242,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
|
231
242
|
secret: cred[:secret],
|
|
232
243
|
key_message: I18n.t('message.rotate', account: account)
|
|
233
244
|
)
|
|
234
|
-
rescue Aws::Errors::ServiceError =>
|
|
235
|
-
warn
|
|
245
|
+
rescue Aws::Errors::ServiceError => e
|
|
246
|
+
warn e.to_s
|
|
236
247
|
exit 1
|
|
237
248
|
end
|
|
238
249
|
|
|
@@ -285,8 +296,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
|
285
296
|
user: ENV['USER']
|
|
286
297
|
)
|
|
287
298
|
Awskeyring.delete_token(account: account, message: '# Removing STS credentials')
|
|
288
|
-
rescue Aws::Errors::ServiceError =>
|
|
289
|
-
warn
|
|
299
|
+
rescue Aws::Errors::ServiceError => e
|
|
300
|
+
warn e.to_s
|
|
290
301
|
exit 1
|
|
291
302
|
end
|
|
292
303
|
|
|
@@ -323,8 +334,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
|
323
334
|
path: path,
|
|
324
335
|
user: ENV['USER']
|
|
325
336
|
)
|
|
326
|
-
rescue Aws::Errors::ServiceError =>
|
|
327
|
-
warn
|
|
337
|
+
rescue Aws::Errors::ServiceError => e
|
|
338
|
+
warn e.to_s
|
|
328
339
|
exit 1
|
|
329
340
|
end
|
|
330
341
|
|
|
@@ -369,7 +380,7 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
|
369
380
|
comp_len = 3 if curr.start_with?('-')
|
|
370
381
|
|
|
371
382
|
case prev
|
|
372
|
-
when 'help'
|
|
383
|
+
when 'help', File.basename($PROGRAM_NAME)
|
|
373
384
|
comp_len = 0
|
|
374
385
|
when 'remove-role', '-r', 'rmr'
|
|
375
386
|
comp_len = 2
|
|
@@ -419,27 +430,10 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
|
419
430
|
self.class.all_commands[command].options.values.map(&:switch_name)
|
|
420
431
|
end
|
|
421
432
|
|
|
422
|
-
def env_vars(cred)
|
|
423
|
-
env_var = {}
|
|
424
|
-
env_var['AWS_DEFAULT_REGION'] = 'us-east-1' unless Awskeyring::Awsapi.region
|
|
425
|
-
env_var['AWS_ACCOUNT_NAME'] = cred[:account]
|
|
426
|
-
env_var['AWS_ACCESS_KEY_ID'] = cred[:key]
|
|
427
|
-
env_var['AWS_ACCESS_KEY'] = cred[:key]
|
|
428
|
-
env_var['AWS_SECRET_ACCESS_KEY'] = cred[:secret]
|
|
429
|
-
env_var['AWS_SECRET_KEY'] = cred[:secret]
|
|
430
|
-
if cred[:token]
|
|
431
|
-
env_var['AWS_SECURITY_TOKEN'] = cred[:token]
|
|
432
|
-
env_var['AWS_SESSION_TOKEN'] = cred[:token]
|
|
433
|
-
end
|
|
434
|
-
env_var
|
|
435
|
-
end
|
|
436
|
-
|
|
437
433
|
def put_env_string(cred)
|
|
438
|
-
env_var =
|
|
434
|
+
env_var = Awskeyring::Awsapi.get_env_array(cred)
|
|
439
435
|
env_var.each { |var, value| puts "export #{var}=\"#{value}\"" }
|
|
440
|
-
|
|
441
|
-
puts 'unset AWS_SECURITY_TOKEN' unless cred[:token]
|
|
442
|
-
puts 'unset AWS_SESSION_TOKEN' unless cred[:token]
|
|
436
|
+
Awskeyring::Awsapi::AWS_ENV_VARS.each { |key| puts "unset #{key}" unless env_var.key?(key) }
|
|
443
437
|
end
|
|
444
438
|
|
|
445
439
|
def ask_check(existing:, message:, secure: false, optional: false, validator: nil)
|
|
@@ -447,8 +441,8 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
|
447
441
|
begin
|
|
448
442
|
value = ask_missing(existing: existing, message: message, secure: secure, optional: optional)
|
|
449
443
|
value = validator.call(value) unless value.empty? && optional
|
|
450
|
-
rescue RuntimeError =>
|
|
451
|
-
warn
|
|
444
|
+
rescue RuntimeError => e
|
|
445
|
+
warn e.message
|
|
452
446
|
existing = nil
|
|
453
447
|
retry unless (retries -= 1).zero?
|
|
454
448
|
exit 1
|
|
@@ -457,7 +451,7 @@ class AwskeyringCommand < Thor # rubocop:disable Metrics/ClassLength
|
|
|
457
451
|
end
|
|
458
452
|
|
|
459
453
|
def ask_missing(existing:, message:, secure: false, optional: false)
|
|
460
|
-
existing || ask(message: message, secure: secure, optional: optional)
|
|
454
|
+
existing || ask(message: message, secure: secure, optional: optional).strip
|
|
461
455
|
end
|
|
462
456
|
|
|
463
457
|
def ask(message:, secure: false, optional: false)
|
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.
|
|
4
|
+
version: 1.0.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-
|
|
11
|
+
date: 2019-10-18 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
|