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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bd31d5b28a754179ef730b69de54aeb40d1b94bd
4
- data.tar.gz: 6761b582662bd4e81b046b0b47ea907f45d263f2
3
+ metadata.gz: 2d9d56e1d59f3ab426bd86a7e8be6f798eaeff7d
4
+ data.tar.gz: 1c526ff5a6431e08e549331c17d6e4b785cc3f88
5
5
  SHA512:
6
- metadata.gz: d11f10ddbd0257dd200682f622d121876ba40e887cba75f349499b5e35fd84d49d06fd4d331b4205df58d5ad60d7b0a04e0335c09e2d34fb88bcd112701649af
7
- data.tar.gz: 81a741a81333289d671c27a9c2a6d80f46efae1bad8ff45a27c61076ddded7d72285e095ef062d0f693b49b7303fb29db677bfe5d33abc52ddb8de52b9872d82
6
+ metadata.gz: e6397cf5d3f0c655cc687cffd81abd82c2756567e042ac73f6b4992fd2b0c4156d664df258823b7347b99313da7d349d01dc8904bde3ac04fec57c669f82bb72
7
+ data.tar.gz: 8541839aef257de2a588d12320cc6a81d316e761b65f906baafdbb37405c12b972112fa1018771d29381a220239b97967a19c36d1686dcd776f4f4f609390f73
@@ -1,5 +1,6 @@
1
1
  require "aws_cred_vault/version"
2
2
  require 'aws_cred_vault/account'
3
+ require 'aws_cred_vault/bastion'
3
4
  require 'aws_cred_vault/user'
4
5
  require 'aws_cred_vault/toml'
5
6
 
@@ -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
@@ -0,0 +1,13 @@
1
+
2
+ module AwsCredVault
3
+ class Bastion
4
+ attr_reader :name, :host
5
+
6
+ def initialize name, host
7
+ @name = name
8
+ @host = host
9
+ end
10
+
11
+ end
12
+
13
+ end
@@ -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
@@ -1,3 +1,3 @@
1
1
  module AwsCredVault
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -3,6 +3,10 @@
3
3
  access_key = "fenix"
4
4
  secret = "zealot!"
5
5
 
6
+ [accounts.protoss.fenix.bastion]
7
+ staging = "staging.bastion.example.com"
8
+ production = "prod.bastion.example.com"
9
+
6
10
  [accounts.protoss.tassadar]
7
11
  access_key = "tassadar"
8
12
  secret = "lightning!"
@@ -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.6
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: 2014-10-22 00:00:00.000000000 Z
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.2.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