fog-bouncer 0.2.3 → 0.2.4
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.
- data/.travis.yml +4 -0
- data/lib/fog/bouncer/group.rb +1 -2
- data/lib/fog/bouncer/group_manager.rb +2 -0
- data/lib/fog/bouncer/security.rb +15 -0
- data/lib/fog/bouncer/version.rb +1 -1
- data/spec/fog/bouncer/security_spec.rb +13 -0
- metadata +2 -2
data/.travis.yml
CHANGED
@@ -32,6 +32,10 @@ matrix:
|
|
32
32
|
- secure: "UXDtqnEW0BUtATes/xYIHFFXwGsIJbxMs4dNb6yC2KplHUSenx/RhgVMnRhF\nvSBCFuTPXHHHQKg8SgrxRJe3M841sKZxfSkRJ2PYMoW1qNEhF86EMxvrMDfg\nQ6PM5SDRk3u1PiGNdVlgeRVKFKOTnBaySTGDRVBnTZmK/iYHv5A="
|
33
33
|
- secure: "jzm0Mn03H2wVsJbk+JxbZ0y2ptrMXKdfAs243W9Bd2PVg/no+CFxw7CDlvcT\n5IEB/3CFPTnbbFj0BMGa5hZFa6eSG4V4vKPRe5M10dx6807nho0G1xWHIj5b\nOok5u1YvDHuaZ6aGwo/oprMBRKh68mhgSYS/KfuFEdj689QVae4="
|
34
34
|
|
35
|
+
branches:
|
36
|
+
only:
|
37
|
+
- master
|
38
|
+
|
35
39
|
language: ruby
|
36
40
|
|
37
41
|
rvm:
|
data/lib/fog/bouncer/group.rb
CHANGED
@@ -23,10 +23,12 @@ module Fog
|
|
23
23
|
|
24
24
|
def clear
|
25
25
|
@security.groups.each do |group|
|
26
|
+
log clear: true, revoke: true, group_name: group.name
|
26
27
|
group.revoke
|
27
28
|
end
|
28
29
|
|
29
30
|
@security.groups.each do |group|
|
31
|
+
log clear: true, destroy: true, group_name: group.name
|
30
32
|
begin
|
31
33
|
group.destroy
|
32
34
|
rescue Fog::Compute::AWS::Error => exception
|
data/lib/fog/bouncer/security.rb
CHANGED
@@ -60,6 +60,13 @@ module Fog
|
|
60
60
|
GroupManager.new(self).clear
|
61
61
|
end
|
62
62
|
|
63
|
+
def clear_remote!
|
64
|
+
log clear_remote!: true
|
65
|
+
until groups.select { |g| g.remote? }.size == 1
|
66
|
+
clear_remote
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
63
70
|
private
|
64
71
|
|
65
72
|
def account(name, account_id)
|
@@ -88,6 +95,14 @@ module Fog
|
|
88
95
|
|
89
96
|
group
|
90
97
|
end
|
98
|
+
|
99
|
+
def self.log(data, &block)
|
100
|
+
Fog::Bouncer.log({ security: true }.merge(data), &block)
|
101
|
+
end
|
102
|
+
|
103
|
+
def log(data, &block)
|
104
|
+
self.class.log({ name: name }.merge(data), &block)
|
105
|
+
end
|
91
106
|
end
|
92
107
|
end
|
93
108
|
end
|
data/lib/fog/bouncer/version.rb
CHANGED
@@ -82,4 +82,17 @@ describe Fog::Bouncer::Security do
|
|
82
82
|
@doorlist.clear_remote
|
83
83
|
end
|
84
84
|
end
|
85
|
+
|
86
|
+
describe "#clear_remote!" do
|
87
|
+
before do
|
88
|
+
@doorlist.sync
|
89
|
+
@doorlist.clear_remote!
|
90
|
+
@fog.security_groups.reload
|
91
|
+
end
|
92
|
+
|
93
|
+
it "removes all groups except default" do
|
94
|
+
@fog.security_groups.size.must_equal 1
|
95
|
+
@fog.security_groups.first.name.must_equal "default"
|
96
|
+
end
|
97
|
+
end
|
85
98
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-bouncer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: clamp
|