aws-keychain-util 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/aws-keychain-util.gemspec +2 -2
- data/bin/aws-creds +17 -5
- data/lib/aws-keychain-util.rb +5 -1
- metadata +15 -23
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: be488246906252df30fbbe24765a7d774f5fb21e
|
4
|
+
data.tar.gz: d5c43506532ff50a3ad86e258d07ab9b90e00c9f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 0078ffd3bc56738efa38ca033699932b2cd50c068813399441bccdde99a281e097f9d36aea6a8743f6a6255c7a25104181fe96c5d472c3297b96e7cc77badd0b
|
7
|
+
data.tar.gz: 4e0cf6c640e681f9eba0f17415d7ef056fa42808962aa05f25530168409480ea4482d5f42c6cbb71a568336d531c2452f7dbbc2a14ca27119b2d409470430f3e
|
data/aws-keychain-util.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "aws-keychain-util"
|
7
|
-
gem.version = '0.0.
|
7
|
+
gem.version = '0.0.10'
|
8
8
|
gem.authors = ["Zach Wily"]
|
9
9
|
gem.email = ["zach@zwily.com"]
|
10
10
|
gem.description = %q{Helps manage a keychain of AWS credentials on OS X.}
|
@@ -18,5 +18,5 @@ Gem::Specification.new do |gem|
|
|
18
18
|
|
19
19
|
gem.add_dependency('ruby-keychain')
|
20
20
|
gem.add_dependency('highline')
|
21
|
-
gem.add_dependency('aws-sdk')
|
21
|
+
gem.add_dependency('aws-sdk-v1')
|
22
22
|
end
|
data/bin/aws-creds
CHANGED
@@ -9,7 +9,7 @@ require 'highline'
|
|
9
9
|
require 'keychain'
|
10
10
|
require 'json'
|
11
11
|
require 'aws-keychain-util'
|
12
|
-
require 'aws'
|
12
|
+
require 'aws-sdk-v1'
|
13
13
|
|
14
14
|
def ask(question)
|
15
15
|
HighLine.new.ask(question)
|
@@ -83,12 +83,15 @@ when 'init'
|
|
83
83
|
name = ask("Name for AWS keychain (default: 'aws'): ")
|
84
84
|
name = "aws" if name == ""
|
85
85
|
|
86
|
+
shell_arguments = ask("Shell arguments (default: '--login'): ")
|
87
|
+
shell_arguments = "--login" if shell_arguments == ""
|
88
|
+
|
86
89
|
puts "The OS will now ask you for a password to protect your keychain. Choose wisely."
|
87
90
|
keychain = Keychain.create(name)
|
88
91
|
keychain.lock_interval = 300
|
89
92
|
keychain.lock_on_sleep = true
|
90
93
|
|
91
|
-
$prefs = { 'aws_keychain_name' => name }
|
94
|
+
$prefs = { 'aws_keychain_name' => name, 'shell_arguments' => shell_arguments }
|
92
95
|
File.new(AwsKeychainUtil::PREFS_FILE, "w").write JSON.dump($prefs)
|
93
96
|
|
94
97
|
puts "Your AWS keychain has been created and configured to auto-lock after"
|
@@ -185,7 +188,9 @@ when 'shell'
|
|
185
188
|
exit 1
|
186
189
|
end
|
187
190
|
|
191
|
+
prefs = AwsKeychainUtil.prefs
|
188
192
|
item, token = get_item_from_args_for_command('shell')
|
193
|
+
|
189
194
|
aws_env = {}
|
190
195
|
aws_env['AWS_ACCESS_KEY_ID'] = aws_env['AWS_ACCESS_KEY'] = item.attributes[:account]
|
191
196
|
aws_env['AWS_SECRET_ACCESS_KEY'] = aws_env['AWS_SECRET_KEY'] = item.password
|
@@ -194,9 +199,16 @@ when 'shell'
|
|
194
199
|
aws_env['AWS_SECURITY_TOKEN'] = token.password
|
195
200
|
end
|
196
201
|
|
197
|
-
|
198
|
-
|
199
|
-
|
202
|
+
if ARGV.empty?
|
203
|
+
aws_env['RPROMPT'] = "(aws #{item.attributes[:label]})" # zsh only
|
204
|
+
if prefs['shell_arguments']
|
205
|
+
exec(aws_env, ENV['SHELL'], prefs['shell_arguments'])
|
206
|
+
else
|
207
|
+
exec(aws_env)
|
208
|
+
end
|
209
|
+
else
|
210
|
+
exec(aws_env, *ARGV)
|
211
|
+
end
|
200
212
|
|
201
213
|
else
|
202
214
|
puts "Usage: #{$0} <command> <arguments>"
|
data/lib/aws-keychain-util.rb
CHANGED
@@ -3,11 +3,15 @@ module AwsKeychainUtil
|
|
3
3
|
|
4
4
|
def self.load_keychain
|
5
5
|
keychain = if File.exist? PREFS_FILE
|
6
|
-
prefs =
|
6
|
+
prefs = self.prefs
|
7
7
|
Keychain.open(prefs['aws_keychain_name'])
|
8
8
|
else
|
9
9
|
Keychain.default
|
10
10
|
end
|
11
11
|
keychain
|
12
12
|
end
|
13
|
+
|
14
|
+
def self.prefs
|
15
|
+
JSON.parse(File.read(PREFS_FILE))
|
16
|
+
end
|
13
17
|
end
|
metadata
CHANGED
@@ -1,62 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-keychain-util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.10
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Zach Wily
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-
|
11
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: ruby-keychain
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: highline
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
|
-
name: aws-sdk
|
42
|
+
name: aws-sdk-v1
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
description: Helps manage a keychain of AWS credentials on OS X.
|
@@ -67,7 +60,7 @@ executables:
|
|
67
60
|
extensions: []
|
68
61
|
extra_rdoc_files: []
|
69
62
|
files:
|
70
|
-
- .gitignore
|
63
|
+
- ".gitignore"
|
71
64
|
- Gemfile
|
72
65
|
- LICENSE.txt
|
73
66
|
- README.md
|
@@ -78,27 +71,26 @@ files:
|
|
78
71
|
- lib/aws-keychain-util/credential_provider.rb
|
79
72
|
homepage: ''
|
80
73
|
licenses: []
|
74
|
+
metadata: {}
|
81
75
|
post_install_message:
|
82
76
|
rdoc_options: []
|
83
77
|
require_paths:
|
84
78
|
- lib
|
85
79
|
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
-
none: false
|
87
80
|
requirements:
|
88
|
-
- -
|
81
|
+
- - ">="
|
89
82
|
- !ruby/object:Gem::Version
|
90
83
|
version: '0'
|
91
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
-
none: false
|
93
85
|
requirements:
|
94
|
-
- -
|
86
|
+
- - ">="
|
95
87
|
- !ruby/object:Gem::Version
|
96
88
|
version: '0'
|
97
89
|
requirements: []
|
98
90
|
rubyforge_project:
|
99
|
-
rubygems_version:
|
91
|
+
rubygems_version: 2.2.2
|
100
92
|
signing_key:
|
101
|
-
specification_version:
|
93
|
+
specification_version: 4
|
102
94
|
summary: Helps manage a keychain of AWS credentials on OS X.
|
103
95
|
test_files: []
|
104
96
|
has_rdoc:
|