aws_cred_vault 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws_cred_vault.rb +1 -0
- data/lib/aws_cred_vault/account.rb +6 -1
- data/lib/aws_cred_vault/bastion.rb +13 -0
- data/lib/aws_cred_vault/toml.rb +4 -0
- data/lib/aws_cred_vault/version.rb +1 -1
- data/spec/files/accounts.toml +4 -0
- data/spec/lib/aws_cred_vault/account_spec.rb +5 -0
- data/spec/lib/aws_cred_vault/bastion_spec.rb +17 -0
- data/spec/lib/aws_cred_vault/toml_spec.rb +4 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d9d56e1d59f3ab426bd86a7e8be6f798eaeff7d
|
4
|
+
data.tar.gz: 1c526ff5a6431e08e549331c17d6e4b785cc3f88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6397cf5d3f0c655cc687cffd81abd82c2756567e042ac73f6b4992fd2b0c4156d664df258823b7347b99313da7d349d01dc8904bde3ac04fec57c669f82bb72
|
7
|
+
data.tar.gz: 8541839aef257de2a588d12320cc6a81d316e761b65f906baafdbb37405c12b972112fa1018771d29381a220239b97967a19c36d1686dcd776f4f4f609390f73
|
data/lib/aws_cred_vault.rb
CHANGED
@@ -2,14 +2,19 @@ require_relative 'user'
|
|
2
2
|
|
3
3
|
module AwsCredVault
|
4
4
|
class Account
|
5
|
-
attr_reader :name, :users
|
5
|
+
attr_reader :name, :users, :bastions
|
6
6
|
def initialize name
|
7
7
|
@name = name
|
8
8
|
@users = []
|
9
|
+
@bastions = []
|
9
10
|
end
|
10
11
|
|
11
12
|
def add_user user
|
12
13
|
@users << user
|
13
14
|
end
|
15
|
+
|
16
|
+
def add_bastion bastion
|
17
|
+
@bastions << bastion
|
18
|
+
end
|
14
19
|
end
|
15
20
|
end
|
data/lib/aws_cred_vault/toml.rb
CHANGED
@@ -19,6 +19,10 @@ module AwsCredVault
|
|
19
19
|
account = Account.new name
|
20
20
|
user_list.each do |name, credentials|
|
21
21
|
account.add_user User.new name, credentials["access_key"], credentials["secret"]
|
22
|
+
|
23
|
+
(credentials["bastion"] || []).each do |env, host|
|
24
|
+
account.add_bastion Bastion.new env, host
|
25
|
+
end
|
22
26
|
end
|
23
27
|
account
|
24
28
|
end
|
data/spec/files/accounts.toml
CHANGED
@@ -19,4 +19,9 @@ describe AwsCredVault::Account do
|
|
19
19
|
expect { subject }.to change {account.users.length}.by(1)
|
20
20
|
end
|
21
21
|
end
|
22
|
+
|
23
|
+
describe '#add_bastion' do
|
24
|
+
let(:account) { AwsCredVault::Account.new 'test' }
|
25
|
+
let(:user) { AwsCredVault::User.new 'test_user', 'id', 'key' }
|
26
|
+
end
|
22
27
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe AwsCredVault::Bastion do
|
4
|
+
let(:bastion) { described_class.new 'test_name', 'bastion.example.org' }
|
5
|
+
|
6
|
+
describe '#name' do
|
7
|
+
it 'has the right name' do
|
8
|
+
expect(bastion.name).to eq 'test_name'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
describe '#host' do
|
13
|
+
it 'has the right host' do
|
14
|
+
expect(bastion.host).to eq 'bastion.example.org'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -33,6 +33,10 @@ describe AwsCredVault::Toml do
|
|
33
33
|
it 'creates the right secret' do
|
34
34
|
expect(subject.first.users.first.secret).to eq 'zealot!'
|
35
35
|
end
|
36
|
+
|
37
|
+
it 'has the right bastions' do
|
38
|
+
expect(subject.first.bastions.first.name).to eq "staging"
|
39
|
+
end
|
36
40
|
end
|
37
41
|
|
38
42
|
describe '#add_account' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws_cred_vault
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clarke Brunsdon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: toml
|
@@ -95,11 +95,13 @@ files:
|
|
95
95
|
- aws_cred_vault.gemspec
|
96
96
|
- lib/aws_cred_vault.rb
|
97
97
|
- lib/aws_cred_vault/account.rb
|
98
|
+
- lib/aws_cred_vault/bastion.rb
|
98
99
|
- lib/aws_cred_vault/toml.rb
|
99
100
|
- lib/aws_cred_vault/user.rb
|
100
101
|
- lib/aws_cred_vault/version.rb
|
101
102
|
- spec/files/accounts.toml
|
102
103
|
- spec/lib/aws_cred_vault/account_spec.rb
|
104
|
+
- spec/lib/aws_cred_vault/bastion_spec.rb
|
103
105
|
- spec/lib/aws_cred_vault/toml_spec.rb
|
104
106
|
- spec/lib/aws_cred_vault/user_spec.rb
|
105
107
|
- spec/lib/aws_cred_vault_spec.rb
|
@@ -124,13 +126,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
126
|
version: '0'
|
125
127
|
requirements: []
|
126
128
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.
|
129
|
+
rubygems_version: 2.4.5.1
|
128
130
|
signing_key:
|
129
131
|
specification_version: 4
|
130
132
|
summary: Stores your amazon credentials for multiple IAM accounts.
|
131
133
|
test_files:
|
132
134
|
- spec/files/accounts.toml
|
133
135
|
- spec/lib/aws_cred_vault/account_spec.rb
|
136
|
+
- spec/lib/aws_cred_vault/bastion_spec.rb
|
134
137
|
- spec/lib/aws_cred_vault/toml_spec.rb
|
135
138
|
- spec/lib/aws_cred_vault/user_spec.rb
|
136
139
|
- spec/lib/aws_cred_vault_spec.rb
|