stratus 1.0.0
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/History.txt +2 -0
- data/LICENSE +20 -0
- data/README.markdown +102 -0
- data/Rakefile +50 -0
- data/VERSION +1 -0
- data/bin/iamsh +27 -0
- data/bin/iamsh-setup +9 -0
- data/lib/stratus.rb +4 -0
- data/lib/stratus/aws.rb +4 -0
- data/lib/stratus/aws/iam.rb +599 -0
- data/lib/stratus/aws/iam/client.rb +18 -0
- data/lib/stratus/aws/iam/group.rb +12 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +9 -0
- data/spec/stratus/aws/iam/client_spec.rb +43 -0
- data/spec/stratus/aws/iam/group_spec.rb +21 -0
- data/spec/stratus/aws/iam_spec.rb +1224 -0
- data/spec/stratus_spec.rb +4 -0
- metadata +146 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
module Stratus::AWS::IAM
|
2
|
+
class Client
|
3
|
+
def initialize(access_key_id, secret_access_key)
|
4
|
+
@base = Stratus::AWS::IAM::Base.new(access_key_id, secret_access_key)
|
5
|
+
end
|
6
|
+
|
7
|
+
# @return [Array<Stratus::AWS::IAM::Group>]
|
8
|
+
def groups
|
9
|
+
groups = []
|
10
|
+
|
11
|
+
@base.list_groups['ListGroupsResult']['Groups']['member'].each do |i|
|
12
|
+
groups << Group.new(i)
|
13
|
+
end
|
14
|
+
|
15
|
+
return groups
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../../lib/stratus')
|
3
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../../lib/stratus/aws')
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../../lib/stratus/aws/iam')
|
5
|
+
|
6
|
+
class IAMBaseStub
|
7
|
+
def list_groups
|
8
|
+
{"ListGroupsResult"=>
|
9
|
+
{"IsTruncated"=>"false",
|
10
|
+
"Groups"=>
|
11
|
+
{"member"=>
|
12
|
+
[{"GroupId"=>"AGPAI5CJDQYAAILTSCKWM",
|
13
|
+
"Arn"=>"arn:aws:iam::763958113208:group/Administrator",
|
14
|
+
"Path"=>"/",
|
15
|
+
"GroupName"=>"Administrator"},
|
16
|
+
{"GroupId"=>"AGPAJXMNNTLP6O6CIWNCW",
|
17
|
+
"Arn"=>"arn:aws:iam::763958113208:group/Developer/Developer",
|
18
|
+
"Path"=>"/Developer/",
|
19
|
+
"GroupName"=>"Developer"}]}},
|
20
|
+
"ResponseMetadata"=>{"RequestId"=>"b2fc292f-c09e-11df-b52e-932157311353"},
|
21
|
+
"xmlns"=>"https://iam.amazonaws.com/doc/2010-05-08/"}
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "Stratus::AWS::IAM::Client::Base" do
|
26
|
+
before(:each) do
|
27
|
+
Stratus::AWS::IAM::Base.should_receive(:new).and_return(IAMBaseStub.new)
|
28
|
+
@iam = Stratus::AWS::IAM::Client.new('aaa', 'bbb')
|
29
|
+
end
|
30
|
+
|
31
|
+
context "#groups" do
|
32
|
+
it "should return a list of groups" do
|
33
|
+
@iam.groups.should have(2).groups
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should contain a group which has group attributes" do
|
37
|
+
@iam.groups.first.group_id.should == 'AGPAI5CJDQYAAILTSCKWM'
|
38
|
+
@iam.groups.first.arn.should == 'arn:aws:iam::763958113208:group/Administrator'
|
39
|
+
@iam.groups.first.path.should == '/'
|
40
|
+
@iam.groups.first.group_name.should == 'Administrator'
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../../lib/stratus')
|
3
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../../lib/stratus/aws')
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../../lib/stratus/aws/iam')
|
5
|
+
|
6
|
+
describe "Stratus::AWS::IAM::Group" do
|
7
|
+
context "#initialize" do
|
8
|
+
it "should store parameters as attributes with camelized attribute name" do
|
9
|
+
group = Stratus::AWS::IAM::Group.new({
|
10
|
+
'GroupId' => 'AGPAI5CJDQYAAILTSCKWM',
|
11
|
+
"Arn" => "arn:aws:iam::763958113208:group/Administrator",
|
12
|
+
"Path" => "/",
|
13
|
+
"GroupName" => "Test",
|
14
|
+
})
|
15
|
+
group.group_id = 'AGPAI5CJDQYAAILTSCKWM'
|
16
|
+
group.arn = 'arn:aws:iam::763958113208:group/Administrator'
|
17
|
+
group.path = '/'
|
18
|
+
group.group_name = 'Test'
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,1224 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../lib/stratus')
|
3
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../lib/stratus/aws')
|
4
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../lib/stratus/aws/iam')
|
5
|
+
|
6
|
+
describe "Stratus::AWS::IAM::Base" do
|
7
|
+
before(:each) do
|
8
|
+
@iam = Stratus::AWS::IAM::Base.new('aaa', 'bbb')
|
9
|
+
end
|
10
|
+
|
11
|
+
context "#get_group" do
|
12
|
+
before(:each) do
|
13
|
+
response = stub(RestClient::Response, :code => '200', :to_str => get_group_response, :empty? => false)
|
14
|
+
RestClient.stub!(:get).and_return(response)
|
15
|
+
end
|
16
|
+
|
17
|
+
it "must be able to get a intended group attributes." do
|
18
|
+
result = @iam.get_group(:group_name => 'NewGroup1')
|
19
|
+
result.should have_key('GetGroupResult')
|
20
|
+
result['GetGroupResult'].should have_key('Users')
|
21
|
+
result['GetGroupResult'].should have_key('Group')
|
22
|
+
users = result['GetGroupResult']['Users']
|
23
|
+
users.should be_nil
|
24
|
+
group = result['GetGroupResult']['Group']
|
25
|
+
group.should have_key('GroupId')
|
26
|
+
group.should have_key('GroupName')
|
27
|
+
group.should have_key('Path')
|
28
|
+
group.should have_key('Arn')
|
29
|
+
end
|
30
|
+
|
31
|
+
it "must raise ArgumentError if the group_name parameter haven't been passed." do
|
32
|
+
lambda { @iam.get_group }.should raise_error(ArgumentError)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
context "#create_group" do
|
38
|
+
before(:each) do
|
39
|
+
response = stub(RestClient::Response, :code => '200', :to_str => create_group_response, :empty? => false)
|
40
|
+
RestClient.stub!(:get).and_return(response)
|
41
|
+
end
|
42
|
+
|
43
|
+
it "must be able to create a new group" do
|
44
|
+
result = @iam.create_group(:group_name => 'NewGroup1')
|
45
|
+
result.should have_key('CreateGroupResult')
|
46
|
+
result['CreateGroupResult'].should have_key('Group')
|
47
|
+
group = result['CreateGroupResult']['Group']
|
48
|
+
group.should have_key('GroupId')
|
49
|
+
group.should have_key('GroupName')
|
50
|
+
group.should have_key('Path')
|
51
|
+
group.should have_key('Arn')
|
52
|
+
end
|
53
|
+
|
54
|
+
it "must raise ArgumentError if the group_name parameter haven't been passed." do
|
55
|
+
lambda { @iam.create_group }.should raise_error(ArgumentError)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
context "#delete_group" do
|
60
|
+
before(:each) do
|
61
|
+
response = stub(RestClient::Response, :code => '200', :to_str => delete_group_response, :empty? => false)
|
62
|
+
RestClient.stub!(:get).and_return(response)
|
63
|
+
end
|
64
|
+
|
65
|
+
it "must be able to delete a intended group" do
|
66
|
+
result = @iam.delete_group(:group_name => 'NewGroup1')
|
67
|
+
result.should have_key('ResponseMetadata')
|
68
|
+
end
|
69
|
+
|
70
|
+
it "must raise ArgumentError if the group_name parameter haven't been passed." do
|
71
|
+
lambda { @iam.delete_group }.should raise_error(ArgumentError)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
it "#list_groups" do
|
76
|
+
response = stub(RestClient::Response, :code => '200', :to_str => list_groups_response, :empty? => false)
|
77
|
+
RestClient.stub!(:get).and_return(response)
|
78
|
+
result = @iam.list_groups
|
79
|
+
result['ListGroupsResult']['Groups']['member'].should have(1).groups
|
80
|
+
end
|
81
|
+
|
82
|
+
context "#update_group" do
|
83
|
+
before(:each) do
|
84
|
+
response = stub(RestClient::Response, :code => '200', :to_str => update_group_response, :empty? => false)
|
85
|
+
RestClient.stub!(:get).and_return(response)
|
86
|
+
end
|
87
|
+
|
88
|
+
it "must be able to update the intended group attributes" do
|
89
|
+
result = @iam.update_group(:group_name => 'Group1', :new_group_name => 'NewGroup1')
|
90
|
+
result.should have_key('ResponseMetadata')
|
91
|
+
|
92
|
+
# The Amazon IAM UpdateGroup API is work,
|
93
|
+
# But the response does not have a UpdateGroupResult tag.
|
94
|
+
# Is this a Amazon's documentation or implementation Bug?
|
95
|
+
#
|
96
|
+
#result.should have_key('UpdateGroupResult')
|
97
|
+
end
|
98
|
+
|
99
|
+
it "must raise ArgumentError if the :group_name option haven't been passed." do
|
100
|
+
lambda { @iam.update_group }.should raise_error(ArgumentError)
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
context "#add_user_to_group" do
|
105
|
+
before(:each) do
|
106
|
+
response = stub(RestClient::Response, :code => '200', :to_str => add_user_to_group_response, :empty? => false)
|
107
|
+
RestClient.stub!(:get).and_return(response)
|
108
|
+
end
|
109
|
+
|
110
|
+
it "must be able to add the new user to the group" do
|
111
|
+
result = @iam.add_user_to_group(:group_name => 'Group1', :user_name => 'User1')
|
112
|
+
result.should have_key('ResponseMetadata')
|
113
|
+
end
|
114
|
+
|
115
|
+
it "must raise ArgumentError if the :group_name option haven't been passed." do
|
116
|
+
lambda { @iam.add_user_to_group(:group_name => 'Group1') }.should raise_error(ArgumentError)
|
117
|
+
end
|
118
|
+
|
119
|
+
it "must raise ArgumentError if the :user_name option haven't been passed." do
|
120
|
+
lambda { @iam.add_user_to_group(:user_name => 'User1') }.should raise_error(ArgumentError)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
context "#remove_user_from_group" do
|
125
|
+
before(:each) do
|
126
|
+
response = stub(RestClient::Response, :code => '200', :to_str => remove_user_from_group_response, :empty? => false)
|
127
|
+
RestClient.stub!(:get).and_return(response)
|
128
|
+
end
|
129
|
+
|
130
|
+
it "must be able to remove the new user to the group" do
|
131
|
+
result = @iam.remove_user_from_group(:group_name => 'Group1', :user_name => 'User1')
|
132
|
+
result.should have_key('ResponseMetadata')
|
133
|
+
end
|
134
|
+
|
135
|
+
it "must raise ArgumentError if the :group_name option haven't been passed." do
|
136
|
+
lambda { @iam.remove_user_from_group(:group_name => 'Group1') }.should raise_error(ArgumentError)
|
137
|
+
end
|
138
|
+
|
139
|
+
it "must raise ArgumentError if the :user_name option haven't been passed." do
|
140
|
+
lambda { @iam.remove_user_from_group(:user_name => 'User1') }.should raise_error(ArgumentError)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
context "#get_user" do
|
145
|
+
before(:each) do
|
146
|
+
response = stub(RestClient::Response, :code => '200', :to_str => get_user_response, :empty? => false)
|
147
|
+
RestClient.stub!(:get).and_return(response)
|
148
|
+
end
|
149
|
+
|
150
|
+
it "must be able to get a user attributes" do
|
151
|
+
result = @iam.get_user
|
152
|
+
result.should have_key('GetUserResult')
|
153
|
+
result['GetUserResult'].should have_key('User')
|
154
|
+
user = result['GetUserResult']['User']
|
155
|
+
user['UserId'].should_not be_nil
|
156
|
+
user['Arn'].should_not be_nil
|
157
|
+
|
158
|
+
# if the user that just getting attributes is not created by the CreateUser API,
|
159
|
+
# GetUser API result does not have following keys.
|
160
|
+
user['UserName'].should be_nil
|
161
|
+
user['Path'].should be_nil
|
162
|
+
end
|
163
|
+
|
164
|
+
context "if :user_name option passed" do
|
165
|
+
before(:each) do
|
166
|
+
response = stub(RestClient::Response, :code => '200', :to_str => get_user_response(:with_user_name => true), :empty? => false)
|
167
|
+
RestClient.stub!(:get).and_return(response)
|
168
|
+
end
|
169
|
+
|
170
|
+
it "must be able to get a user attributes" do
|
171
|
+
result = @iam.get_user(:user_name => 'User1')
|
172
|
+
result.should have_key('GetUserResult')
|
173
|
+
result['GetUserResult'].should have_key('User')
|
174
|
+
user = result['GetUserResult']['User']
|
175
|
+
user['UserId'].should_not be_nil
|
176
|
+
user['Arn'].should_not be_nil
|
177
|
+
user['UserName'].should_not be_nil
|
178
|
+
user['Path'].should_not be_nil
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
it "must call the 'call_api' internally without 'UserName' parameter if :user_name option not given" do
|
183
|
+
@iam.should_receive(:call_api).with('GetUser', {}).once.and_return(get_user_response)
|
184
|
+
@iam.get_user
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
context "#create_user" do
|
189
|
+
before(:each) do
|
190
|
+
response = stub(RestClient::Response, :code => '200', :to_str => create_user_response, :empty? => false)
|
191
|
+
RestClient.stub!(:get).and_return(response)
|
192
|
+
end
|
193
|
+
|
194
|
+
it "must be able to create a new user" do
|
195
|
+
result = @iam.create_user(:user_name => 'NewUser')
|
196
|
+
user = result['CreateUserResult']['User']
|
197
|
+
user.should_not be_nil
|
198
|
+
user['UserId'].should == 'AIDAI6PGTVSCYFGUNXK4G'
|
199
|
+
user['Path'].should == '/'
|
200
|
+
user['UserName'].should == 'NewUser'
|
201
|
+
user['Arn'].should == 'arn:aws:iam::832248165982:user/NewUser'
|
202
|
+
end
|
203
|
+
|
204
|
+
it "must raise ArgumentError if the user_name parameter haven't been passed." do
|
205
|
+
lambda { @iam.create_user }.should raise_error(ArgumentError)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
context "#delete_user" do
|
210
|
+
before(:each) do
|
211
|
+
response = stub(RestClient::Response, :code => '200', :to_str => delete_user_response, :empty? => false)
|
212
|
+
RestClient.stub!(:get).and_return(response)
|
213
|
+
end
|
214
|
+
|
215
|
+
it "must be able to delete a existing user" do
|
216
|
+
result = @iam.delete_user(:user_name => 'NewUser')
|
217
|
+
result.should have_key('ResponseMetadata')
|
218
|
+
result['ResponseMetadata'].should have_key('RequestId')
|
219
|
+
end
|
220
|
+
|
221
|
+
it "must raise ArgumentError if the user_name parameter haven't been passed." do
|
222
|
+
lambda { @iam.delete_user }.should raise_error(ArgumentError)
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
context "#list_users" do
|
227
|
+
before(:each) do
|
228
|
+
response = stub(RestClient::Response, :code => '200', :to_str => list_users_response, :empty? => false)
|
229
|
+
RestClient.stub!(:get).and_return(response)
|
230
|
+
end
|
231
|
+
|
232
|
+
it "must be able to list existing users" do
|
233
|
+
result = @iam.list_users
|
234
|
+
result.should have_key('ListUsersResult')
|
235
|
+
result['ListUsersResult'].should have_key('Users')
|
236
|
+
result['ListUsersResult']['Users'].should have_key('member')
|
237
|
+
users = result['ListUsersResult']['Users']['member']
|
238
|
+
users.should be_kind_of(Array)
|
239
|
+
users.each do |user|
|
240
|
+
user['UserId'].should_not be_empty
|
241
|
+
user['Path'].should == '/'
|
242
|
+
user['UserName'].should_not be_empty
|
243
|
+
user['Arn'].should_not be_empty
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
context "#list_groups_for_user" do
|
249
|
+
before(:each) do
|
250
|
+
response = stub(RestClient::Response, :code => '200', :to_str => list_groups_for_user_response, :empty? => false)
|
251
|
+
RestClient.stub!(:get).and_return(response)
|
252
|
+
end
|
253
|
+
|
254
|
+
it "must be able to get groups for the intended user" do
|
255
|
+
result = @iam.list_groups_for_user(:user_name => 'User1')
|
256
|
+
result.should have_key('ListGroupsForUserResult')
|
257
|
+
result['ListGroupsForUserResult'].should have_key('Groups')
|
258
|
+
result['ListGroupsForUserResult']['Groups'].should be_nil
|
259
|
+
end
|
260
|
+
|
261
|
+
it "must raise ArgumentError if the :user_name option haven't been passed." do
|
262
|
+
lambda { @iam.list_groups_for_user }.should raise_error(ArgumentError)
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
context "#update_user" do
|
267
|
+
before(:each) do
|
268
|
+
response = stub(RestClient::Response, :code => '200', :to_str => update_user_response, :empty? => false)
|
269
|
+
RestClient.stub!(:get).and_return(response)
|
270
|
+
end
|
271
|
+
|
272
|
+
it "must be able to update the intended user attributes" do
|
273
|
+
result = @iam.update_user(:user_name => 'User1', :new_user_name => 'NewUser1')
|
274
|
+
result.should have_key('ResponseMetadata')
|
275
|
+
|
276
|
+
# The Amazon IAM UpdateUser API is work,
|
277
|
+
# But the response does not have a UpdateUserResult tag.
|
278
|
+
# Is this a Amazon's documentation or implementation Bug?
|
279
|
+
#
|
280
|
+
#result.should have_key('UpdateUserResult')
|
281
|
+
end
|
282
|
+
|
283
|
+
it "must raise ArgumentError if the :user_name option haven't been passed." do
|
284
|
+
lambda { @iam.update_user }.should raise_error(ArgumentError)
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
288
|
+
context "#create_access_key" do
|
289
|
+
before(:each) do
|
290
|
+
response = stub(RestClient::Response, :code => '200', :to_str => create_access_key_response, :empty? => false)
|
291
|
+
RestClient.stub!(:get).and_return(response)
|
292
|
+
end
|
293
|
+
|
294
|
+
it "must be able to create a new access key" do
|
295
|
+
result = @iam.create_access_key(:user_name => 'User1')
|
296
|
+
result.should have_key('CreateAccessKeyResult')
|
297
|
+
result['CreateAccessKeyResult'].should have_key('AccessKey')
|
298
|
+
result['CreateAccessKeyResult']['AccessKey'].should_not be_nil
|
299
|
+
end
|
300
|
+
|
301
|
+
it "must call the 'call_api' internally without 'UserName' parameter if :user_name option not given" do
|
302
|
+
@iam.should_receive(:call_api).with('CreateAccessKey', {}).once.and_return(create_access_key_response)
|
303
|
+
@iam.create_access_key
|
304
|
+
end
|
305
|
+
end
|
306
|
+
|
307
|
+
context "#delete_access_key" do
|
308
|
+
before(:each) do
|
309
|
+
response = stub(RestClient::Response, :code => '200', :to_str => delete_access_key_response, :empty? => false)
|
310
|
+
RestClient.stub!(:get).and_return(response)
|
311
|
+
end
|
312
|
+
|
313
|
+
it "must be able to delete a intended access key" do
|
314
|
+
result = @iam.delete_access_key(:access_key_id => 'AKIAXXXXXXXXXXXXXXXX', :user_id => 'User1')
|
315
|
+
result.should have_key('ResponseMetadata')
|
316
|
+
end
|
317
|
+
|
318
|
+
it "must raise ArgumentError if the :access_key_id option haven't been passed." do
|
319
|
+
lambda { @iam.delete_access_key }.should raise_error(ArgumentError)
|
320
|
+
end
|
321
|
+
|
322
|
+
it "must call the 'call_api' internally without 'UserName' parameter if :user_name option not given" do
|
323
|
+
@iam.should_receive(:call_api).with(
|
324
|
+
'DeleteAccessKey', {'AccessKeyId' => 'AKIAXXXXXXXXXXXXXXXX'}
|
325
|
+
).once.and_return(delete_access_key_response)
|
326
|
+
@iam.delete_access_key(:access_key_id => 'AKIAXXXXXXXXXXXXXXXX')
|
327
|
+
end
|
328
|
+
end
|
329
|
+
|
330
|
+
context "#update_access_key" do
|
331
|
+
before(:each) do
|
332
|
+
response = stub(RestClient::Response, :code => '200', :to_str => update_access_key_response, :empty? => false)
|
333
|
+
RestClient.stub!(:get).and_return(response)
|
334
|
+
end
|
335
|
+
|
336
|
+
it "must be able to update a intended access key" do
|
337
|
+
result = @iam.update_access_key(:access_key_id => 'AKIAXXXXXXXXXXXXXXXX', :status => 'Active', :user_id => 'User1')
|
338
|
+
result.should have_key('ResponseMetadata')
|
339
|
+
end
|
340
|
+
|
341
|
+
it "must raise ArgumentError if the :access_key_id option haven't been passed." do
|
342
|
+
lambda {
|
343
|
+
@iam.update_access_key(:user_name => 'User1', :status => 'Active')
|
344
|
+
}.should raise_error(ArgumentError)
|
345
|
+
end
|
346
|
+
|
347
|
+
it "must raise ArgumentError if the :status option haven't been passed." do
|
348
|
+
lambda {
|
349
|
+
@iam.update_access_key(:user_name => 'User1', :access_key_id => 'AKIAXXXXXXXXXXXXXXXX')
|
350
|
+
}.should raise_error(ArgumentError)
|
351
|
+
end
|
352
|
+
|
353
|
+
it "must raise ArgumentError if invalid :status option have been passed." do
|
354
|
+
lambda {
|
355
|
+
@iam.update_access_key(:user_name => 'User1', :access_key_id => 'AKIAXXXXXXXXXXXXXXXX', :status => 'active')
|
356
|
+
@iam.update_access_key(:user_name => 'User1', :access_key_id => 'AKIAXXXXXXXXXXXXXXXX', :status => :active)
|
357
|
+
@iam.update_access_key(:user_name => 'User1', :access_key_id => 'AKIAXXXXXXXXXXXXXXXX', :status => 'Active')
|
358
|
+
}.should_not raise_error(ArgumentError)
|
359
|
+
lambda {
|
360
|
+
@iam.update_access_key(:user_name => 'User1', :access_key_id => 'AKIAXXXXXXXXXXXXXXXX', :status => 'XXXX')
|
361
|
+
}.should raise_error(ArgumentError)
|
362
|
+
end
|
363
|
+
|
364
|
+
it "must call the 'call_api' internally without 'UserName' parameter if :user_name option not given" do
|
365
|
+
@iam.should_receive(:call_api).with(
|
366
|
+
'UpdateAccessKey', {'AccessKeyId' => 'AKIAXXXXXXXXXXXXXXXX', 'Status' => 'Inactive'}
|
367
|
+
).once.and_return(update_access_key_response)
|
368
|
+
@iam.update_access_key(:access_key_id => 'AKIAXXXXXXXXXXXXXXXX', :status => :inactive)
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
372
|
+
context "#list_access_keys" do
|
373
|
+
before(:each) do
|
374
|
+
response = stub(RestClient::Response, :code => '200', :to_str => list_access_keys_response, :empty? => false)
|
375
|
+
RestClient.stub!(:get).and_return(response)
|
376
|
+
end
|
377
|
+
|
378
|
+
it "must be able to get a list of access keys" do
|
379
|
+
result = @iam.list_access_keys(:user_name => 'User1')
|
380
|
+
result.should have_key('ListAccessKeysResult')
|
381
|
+
result['ListAccessKeysResult'].should have_key('AccessKeyMetadata')
|
382
|
+
result['ListAccessKeysResult']['AccessKeyMetadata'].should have_key('member')
|
383
|
+
result['ListAccessKeysResult']['AccessKeyMetadata']['member'].should be_kind_of(Array)
|
384
|
+
result['ListAccessKeysResult']['AccessKeyMetadata']['member'].each do |key|
|
385
|
+
key['UserName'].should_not be_nil
|
386
|
+
key['AccessKeyId'].should_not be_nil
|
387
|
+
key['Status'].should_not be_nil
|
388
|
+
end
|
389
|
+
end
|
390
|
+
|
391
|
+
it "must call the 'call_api' internally without 'UserName' parameter if :user_name option not given" do
|
392
|
+
@iam.should_receive(:call_api).with('ListAccessKeys', {}).once.and_return(list_access_keys_response)
|
393
|
+
@iam.list_access_keys
|
394
|
+
end
|
395
|
+
end
|
396
|
+
|
397
|
+
context "#get_group_policy" do
|
398
|
+
before(:each) do
|
399
|
+
response = stub(RestClient::Response, :code => '200', :to_str => get_group_policy_response, :empty? => false)
|
400
|
+
RestClient.stub!(:get).and_return(response)
|
401
|
+
end
|
402
|
+
|
403
|
+
it "must be able to get a intended group policy" do
|
404
|
+
result = @iam.get_group_policy(:group_name => 'Group1', :policy_name => 'Policy1')
|
405
|
+
result.should have_key('GetGroupPolicyResult')
|
406
|
+
result['GetGroupPolicyResult'].should have_key('GroupName')
|
407
|
+
result['GetGroupPolicyResult'].should have_key('PolicyName')
|
408
|
+
result['GetGroupPolicyResult'].should have_key('PolicyDocument')
|
409
|
+
result['GetGroupPolicyResult']['GroupName'].should_not be_empty
|
410
|
+
result['GetGroupPolicyResult']['PolicyName'].should_not be_empty
|
411
|
+
result['GetGroupPolicyResult']['PolicyDocument'].should_not be_empty
|
412
|
+
end
|
413
|
+
|
414
|
+
it "must raise ArgumentError if the :group_name option haven't been passed." do
|
415
|
+
lambda {
|
416
|
+
@iam.get_group_policy(:policy_name => 'Policy1')
|
417
|
+
}.should raise_error(ArgumentError)
|
418
|
+
end
|
419
|
+
|
420
|
+
it "must raise ArgumentError if the :policy_name option haven't been passed." do
|
421
|
+
lambda {
|
422
|
+
@iam.get_group_policy(:group_name => 'Group1')
|
423
|
+
}.should raise_error(ArgumentError)
|
424
|
+
end
|
425
|
+
end
|
426
|
+
|
427
|
+
context "#put_group_policy" do
|
428
|
+
before(:each) do
|
429
|
+
@policy = '{"Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}'
|
430
|
+
response = stub(RestClient::Response, :code => '200', :to_str => put_group_policy_response, :empty? => false)
|
431
|
+
RestClient.stub!(:get).and_return(response)
|
432
|
+
end
|
433
|
+
|
434
|
+
it "must be able to put a new group policy" do
|
435
|
+
result = @iam.put_group_policy(:group_name => 'Group1', :policy_name => 'Policy1', :policy_document => @policy)
|
436
|
+
result.should have_key('ResponseMetadata')
|
437
|
+
end
|
438
|
+
|
439
|
+
it "must raise ArgumentError if the :group_name option haven't been passed." do
|
440
|
+
lambda {
|
441
|
+
@iam.put_group_policy(:policy_name => 'Policy1', :policy_document => @policy)
|
442
|
+
}.should raise_error(ArgumentError)
|
443
|
+
end
|
444
|
+
|
445
|
+
it "must raise ArgumentError if the :policy_name option haven't been passed." do
|
446
|
+
lambda {
|
447
|
+
@iam.put_group_policy(:group_name => 'Group1', :policy_document => @policy)
|
448
|
+
}.should raise_error(ArgumentError)
|
449
|
+
end
|
450
|
+
|
451
|
+
it "must raise ArgumentError if the :policy_document option haven't been passed." do
|
452
|
+
lambda {
|
453
|
+
@iam.put_group_policy(:group_name => 'Group1', :policy_name => 'Policy1')
|
454
|
+
}.should raise_error(ArgumentError)
|
455
|
+
end
|
456
|
+
end
|
457
|
+
|
458
|
+
context "#delete_group_policy" do
|
459
|
+
before(:each) do
|
460
|
+
response = stub(RestClient::Response, :code => '200', :to_str => delete_group_policy_response, :empty? => false)
|
461
|
+
RestClient.stub!(:get).and_return(response)
|
462
|
+
end
|
463
|
+
|
464
|
+
it "must be able to delete intended group policy" do
|
465
|
+
result = @iam.delete_group_policy(:group_name => 'Group1', :policy_name => 'Policy1')
|
466
|
+
result.should have_key('ResponseMetadata')
|
467
|
+
end
|
468
|
+
|
469
|
+
it "must raise ArgumentError if the :group_name option haven't been passed." do
|
470
|
+
lambda {
|
471
|
+
@iam.delete_group_policy(:policy_name => 'Policy1')
|
472
|
+
}.should raise_error(ArgumentError)
|
473
|
+
end
|
474
|
+
|
475
|
+
it "must raise ArgumentError if the :policy_name option haven't been passed." do
|
476
|
+
lambda {
|
477
|
+
@iam.delete_group_policy(:group_name => 'Group1')
|
478
|
+
}.should raise_error(ArgumentError)
|
479
|
+
end
|
480
|
+
end
|
481
|
+
|
482
|
+
context "#list_group_policies" do
|
483
|
+
before(:each) do
|
484
|
+
response = stub(RestClient::Response, :code => '200', :to_str => list_group_policies_response, :empty? => false)
|
485
|
+
RestClient.stub!(:get).and_return(response)
|
486
|
+
end
|
487
|
+
|
488
|
+
it "must be able to get a list of group policies" do
|
489
|
+
result = @iam.list_group_policies(:group_name => 'Group1')
|
490
|
+
result.should have_key('ListGroupPoliciesResult')
|
491
|
+
result['ListGroupPoliciesResult'].should have_key('PolicyNames')
|
492
|
+
result['ListGroupPoliciesResult']['PolicyNames'].should have_key('member')
|
493
|
+
result['ListGroupPoliciesResult']['PolicyNames']['member'].should be_kind_of(Array)
|
494
|
+
result['ListGroupPoliciesResult']['PolicyNames']['member'].each do |policy_name|
|
495
|
+
policy_name.should_not be_nil
|
496
|
+
end
|
497
|
+
end
|
498
|
+
|
499
|
+
it "must raise ArgumentError if the :group_name option haven't been passed." do
|
500
|
+
lambda {
|
501
|
+
@iam.list_group_policies
|
502
|
+
}.should raise_error(ArgumentError)
|
503
|
+
end
|
504
|
+
end
|
505
|
+
|
506
|
+
context "#get_user_policy" do
|
507
|
+
before(:all) { require 'json' }
|
508
|
+
before(:each) do
|
509
|
+
response = stub(RestClient::Response, :code => '200', :to_str => get_user_policy_response, :empty? => false)
|
510
|
+
RestClient.stub!(:get).and_return(response)
|
511
|
+
end
|
512
|
+
|
513
|
+
it "must be able to get a intended user policy" do
|
514
|
+
result = @iam.get_user_policy(:user_name => 'User1', :policy_name => 'Policy1')
|
515
|
+
result.should have_key('GetUserPolicyResult')
|
516
|
+
result['GetUserPolicyResult'].should have_key('UserName')
|
517
|
+
result['GetUserPolicyResult'].should have_key('PolicyName')
|
518
|
+
result['GetUserPolicyResult'].should have_key('PolicyDocument')
|
519
|
+
result['GetUserPolicyResult']['UserName'].should_not be_empty
|
520
|
+
result['GetUserPolicyResult']['PolicyName'].should_not be_empty
|
521
|
+
result['GetUserPolicyResult']['PolicyDocument'].should_not be_empty
|
522
|
+
end
|
523
|
+
|
524
|
+
it "must return a policy document formated by JSON" do
|
525
|
+
result = @iam.get_user_policy(:user_name => 'User1', :policy_name => 'Policy1')
|
526
|
+
lambda {
|
527
|
+
policy = JSON.parse(result['GetUserPolicyResult']['PolicyDocument'])
|
528
|
+
policy.should have_key('Statement')
|
529
|
+
}.should_not raise_error(JSON::ParserError)
|
530
|
+
end
|
531
|
+
|
532
|
+
it "must raise ArgumentError if the :user_name option haven't been passed." do
|
533
|
+
lambda {
|
534
|
+
@iam.get_user_policy(:policy_name => 'Policy1')
|
535
|
+
}.should raise_error(ArgumentError)
|
536
|
+
end
|
537
|
+
|
538
|
+
it "must raise ArgumentError if the :policy_name option haven't been passed." do
|
539
|
+
lambda {
|
540
|
+
@iam.get_user_policy(:user_name => 'User1')
|
541
|
+
}.should raise_error(ArgumentError)
|
542
|
+
end
|
543
|
+
end
|
544
|
+
|
545
|
+
context "#put_user_policy" do
|
546
|
+
before(:each) do
|
547
|
+
@policy = '{"Statement":[{"Effect":"Allow","Action":"*","Resource":"*"}]}'
|
548
|
+
response = stub(RestClient::Response, :code => '200', :to_str => put_user_policy_response, :empty? => false)
|
549
|
+
RestClient.stub!(:get).and_return(response)
|
550
|
+
end
|
551
|
+
|
552
|
+
it "must be able to put a new user policy" do
|
553
|
+
result = @iam.put_user_policy(:user_name => 'User1', :policy_name => 'Policy1', :policy_document => @policy)
|
554
|
+
result.should have_key('ResponseMetadata')
|
555
|
+
end
|
556
|
+
|
557
|
+
it "must raise ArgumentError if the :user_name option haven't been passed." do
|
558
|
+
lambda {
|
559
|
+
@iam.put_user_policy(:policy_name => 'Policy1', :policy_document => @policy)
|
560
|
+
}.should raise_error(ArgumentError)
|
561
|
+
end
|
562
|
+
|
563
|
+
it "must raise ArgumentError if the :policy_name option haven't been passed." do
|
564
|
+
lambda {
|
565
|
+
@iam.put_user_policy(:user_name => 'User1', :policy_document => @policy)
|
566
|
+
}.should raise_error(ArgumentError)
|
567
|
+
end
|
568
|
+
|
569
|
+
it "must raise ArgumentError if the :policy_document option haven't been passed." do
|
570
|
+
lambda {
|
571
|
+
@iam.put_user_policy(:user_name => 'User1', :policy_name => 'Policy1')
|
572
|
+
}.should raise_error(ArgumentError)
|
573
|
+
end
|
574
|
+
end
|
575
|
+
|
576
|
+
context "#delete_user_policy" do
|
577
|
+
before(:each) do
|
578
|
+
response = stub(RestClient::Response, :code => '200', :to_str => delete_user_policy_response, :empty? => false)
|
579
|
+
RestClient.stub!(:get).and_return(response)
|
580
|
+
end
|
581
|
+
|
582
|
+
it "must be able to delete intended user policy" do
|
583
|
+
result = @iam.delete_user_policy(:user_name => 'User1', :policy_name => 'Policy1')
|
584
|
+
result.should have_key('ResponseMetadata')
|
585
|
+
end
|
586
|
+
|
587
|
+
it "must raise ArgumentError if the :user_name option haven't been passed." do
|
588
|
+
lambda {
|
589
|
+
@iam.delete_user_policy(:policy_name => 'Policy1')
|
590
|
+
}.should raise_error(ArgumentError)
|
591
|
+
end
|
592
|
+
|
593
|
+
it "must raise ArgumentError if the :policy_name option haven't been passed." do
|
594
|
+
lambda {
|
595
|
+
@iam.delete_user_policy(:user_name => 'User1')
|
596
|
+
}.should raise_error(ArgumentError)
|
597
|
+
end
|
598
|
+
end
|
599
|
+
|
600
|
+
context "#list_user_policies" do
|
601
|
+
before(:each) do
|
602
|
+
response = stub(RestClient::Response, :code => '200', :to_str => list_user_policies_response, :empty? => false)
|
603
|
+
RestClient.stub!(:get).and_return(response)
|
604
|
+
end
|
605
|
+
|
606
|
+
it "must be able to get a list of user policies" do
|
607
|
+
result = @iam.list_user_policies(:user_name => 'User1')
|
608
|
+
result.should have_key('ListUserPoliciesResult')
|
609
|
+
result['ListUserPoliciesResult'].should have_key('PolicyNames')
|
610
|
+
result['ListUserPoliciesResult']['PolicyNames'].should have_key('member')
|
611
|
+
result['ListUserPoliciesResult']['PolicyNames']['member'].should be_kind_of(Array)
|
612
|
+
result['ListUserPoliciesResult']['PolicyNames']['member'].each do |policy_name|
|
613
|
+
policy_name.should_not be_nil
|
614
|
+
end
|
615
|
+
end
|
616
|
+
|
617
|
+
it "must raise ArgumentError if the :user_name option haven't been passed." do
|
618
|
+
lambda {
|
619
|
+
@iam.list_user_policies
|
620
|
+
}.should raise_error(ArgumentError)
|
621
|
+
end
|
622
|
+
end
|
623
|
+
|
624
|
+
context "#upload_signing_certificate" do
|
625
|
+
before(:each) do
|
626
|
+
@response = stub(RestClient::Response, :code => '200', :to_str => upload_signing_certificate_response, :empty? => false)
|
627
|
+
RestClient.stub!(:post).and_return(@response)
|
628
|
+
end
|
629
|
+
|
630
|
+
it "must be able to upload a new certification" do
|
631
|
+
RestClient.should_not_receive(:get)
|
632
|
+
RestClient.should_receive(:post).and_return(@response)
|
633
|
+
result = @iam.upload_signing_certificate(:user_name => 'User1', :certificate_body => dummy_certificate)
|
634
|
+
result.should have_key('UploadSigningCertificateResult')
|
635
|
+
result['UploadSigningCertificateResult'].should have_key('Certificate')
|
636
|
+
result['UploadSigningCertificateResult']['Certificate'].should have_key('CertificateBody')
|
637
|
+
result['UploadSigningCertificateResult']['Certificate']['CertificateBody'].gsub(/^ +/, "").should == dummy_certificate
|
638
|
+
end
|
639
|
+
|
640
|
+
it "must raise ArgumentError if the :certificate_body option haven't been passed." do
|
641
|
+
lambda {
|
642
|
+
@iam.upload_signing_certificate(:user_name => 'User1')
|
643
|
+
}.should raise_error(ArgumentError)
|
644
|
+
end
|
645
|
+
|
646
|
+
it "must call the 'call_api' internally without 'UserName' parameter if :user_name option not given" do
|
647
|
+
@iam.should_receive(:call_api).with(
|
648
|
+
'UploadSigningCertificate', {'CertificateBody' => dummy_certificate}
|
649
|
+
).once.and_return(upload_signing_certificate_response)
|
650
|
+
@iam.upload_signing_certificate(:certificate_body => dummy_certificate)
|
651
|
+
end
|
652
|
+
end
|
653
|
+
|
654
|
+
context "#update_signing_certificate" do
|
655
|
+
before(:each) do
|
656
|
+
response = stub(RestClient::Response, :code => '200', :to_str => update_signing_certificate_response, :empty? => false)
|
657
|
+
RestClient.stub!(:get).and_return(response)
|
658
|
+
end
|
659
|
+
|
660
|
+
it "must be able to update a intended certificate" do
|
661
|
+
result = @iam.update_signing_certificate(:certificate_id => 'PBEX2T7R5DA3SVZHQDK2HQ2G3ZOP7SYA', :status => 'Active', :user_id => 'User1')
|
662
|
+
result.should have_key('ResponseMetadata')
|
663
|
+
end
|
664
|
+
|
665
|
+
it "must raise ArgumentError if the :certificate_id option haven't been passed." do
|
666
|
+
lambda {
|
667
|
+
@iam.update_signing_certificate(:user_name => 'User1', :status => 'Active')
|
668
|
+
}.should raise_error(ArgumentError)
|
669
|
+
end
|
670
|
+
|
671
|
+
it "must raise ArgumentError if the :status option haven't been passed." do
|
672
|
+
lambda {
|
673
|
+
@iam.update_signing_certificate(:user_name => 'User1', :certificate_id => 'PBEX2T7R5DA3SVZHQDK2HQ2G3ZOP7SYA')
|
674
|
+
}.should raise_error(ArgumentError)
|
675
|
+
end
|
676
|
+
|
677
|
+
it "must call the 'call_api' internally without 'UserName' parameter if :user_name option not given" do
|
678
|
+
@iam.should_receive(:call_api).with(
|
679
|
+
'UpdateSigningCertificate', {'CertificateId' => 'PBEX2T7R5DA3SVZHQDK2HQ2G3ZOP7SYA', 'Status' => 'Active'}
|
680
|
+
).once.and_return(update_signing_certificate_response)
|
681
|
+
@iam.update_signing_certificate(:certificate_id => 'PBEX2T7R5DA3SVZHQDK2HQ2G3ZOP7SYA', :status => :active)
|
682
|
+
end
|
683
|
+
end
|
684
|
+
|
685
|
+
context "#delete_signing_certificate" do
|
686
|
+
before(:each) do
|
687
|
+
response = stub(RestClient::Response, :code => '200', :to_str => delete_signing_certificate_response, :empty? => false)
|
688
|
+
RestClient.stub!(:get).and_return(response)
|
689
|
+
end
|
690
|
+
|
691
|
+
it "must be able to delete a intended certificate" do
|
692
|
+
result = @iam.delete_signing_certificate(:certificate_id => 'PBEX2T7R5DA3SVZHQDK2HQ2G3ZOP7SYA', :user_id => 'User1')
|
693
|
+
result.should have_key('ResponseMetadata')
|
694
|
+
end
|
695
|
+
|
696
|
+
it "must raise ArgumentError if the :certificate_id option haven't been passed." do
|
697
|
+
lambda {
|
698
|
+
@iam.delete_signing_certificate(:user_name => 'User1')
|
699
|
+
}.should raise_error(ArgumentError)
|
700
|
+
end
|
701
|
+
|
702
|
+
it "must call the 'call_api' internally without 'UserName' parameter if :user_name option not given" do
|
703
|
+
@iam.should_receive(:call_api).with(
|
704
|
+
'DeleteSigningCertificate', {'CertificateId' => 'PBEX2T7R5DA3SVZHQDK2HQ2G3ZOP7SYA'}
|
705
|
+
).once.and_return(delete_signing_certificate_response)
|
706
|
+
@iam.delete_signing_certificate(:certificate_id => 'PBEX2T7R5DA3SVZHQDK2HQ2G3ZOP7SYA')
|
707
|
+
end
|
708
|
+
end
|
709
|
+
|
710
|
+
context "#list_signing_certificates" do
|
711
|
+
before(:each) do
|
712
|
+
response = stub(RestClient::Response, :code => '200', :to_str => list_signing_certificates_response, :empty? => false)
|
713
|
+
RestClient.stub!(:get).and_return(response)
|
714
|
+
end
|
715
|
+
|
716
|
+
it "must be able to get a list of certificates" do
|
717
|
+
result = @iam.list_signing_certificates(:user_name => 'User1')
|
718
|
+
result.should have_key('ListSigningCertificatesResult')
|
719
|
+
result['ListSigningCertificatesResult'].should have_key('Certificates')
|
720
|
+
result['ListSigningCertificatesResult']['Certificates'].should have_key('member')
|
721
|
+
result['ListSigningCertificatesResult']['Certificates']['member'].should be_kind_of(Array)
|
722
|
+
result['ListSigningCertificatesResult']['Certificates']['member'].each do |certificate|
|
723
|
+
certificate.should have_key('CertificateId')
|
724
|
+
end
|
725
|
+
end
|
726
|
+
|
727
|
+
it "must call the 'call_api' method internally without 'UserName' parameter if :user_name option not given" do
|
728
|
+
@iam.should_receive(:call_api).with('ListSigningCertificates', {}).once.and_return(list_signing_certificates_response)
|
729
|
+
@iam.list_signing_certificates()
|
730
|
+
end
|
731
|
+
|
732
|
+
it "must call the 'call_api' method internally with 'Marker' parameter if :marker option given" do
|
733
|
+
@iam.should_receive(:call_api).with(
|
734
|
+
'ListSigningCertificates', {'Marker' => 'marker'}
|
735
|
+
).once.and_return(list_signing_certificates_response)
|
736
|
+
result = @iam.list_signing_certificates(:marker => 'marker')
|
737
|
+
end
|
738
|
+
|
739
|
+
it "must call the 'call_api' method internally with 'MaxItems' parameter if :max_items option given" do
|
740
|
+
@iam.should_receive(:call_api).with(
|
741
|
+
'ListSigningCertificates', {'MaxItems' => 10}
|
742
|
+
).once.and_return(list_signing_certificates_response)
|
743
|
+
@iam.list_signing_certificates(:max_items => 10)
|
744
|
+
end
|
745
|
+
|
746
|
+
it "must call the 'call_api' method internally with 'Marker' and 'MaxItems' parameter if :marker and :max_items option given" do
|
747
|
+
@iam.should_receive(:call_api).with(
|
748
|
+
'ListSigningCertificates', {'Marker' => 'marker', 'MaxItems' => 10}
|
749
|
+
).once.and_return(list_signing_certificates_response)
|
750
|
+
@iam.list_signing_certificates(:marker => 'marker', :max_items => 10)
|
751
|
+
end
|
752
|
+
end
|
753
|
+
|
754
|
+
def get_group_response
|
755
|
+
return <<-RES
|
756
|
+
<GetGroupResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
757
|
+
<GetGroupResult>
|
758
|
+
<Users/>
|
759
|
+
<IsTruncated>false</IsTruncated>
|
760
|
+
<Group>
|
761
|
+
<GroupId>AGPAIDO7XVSF6MYKVGFIA</GroupId>
|
762
|
+
<GroupName>NewGroup1</GroupName>
|
763
|
+
<Path>/</Path>
|
764
|
+
<Arn>arn:aws:iam::832248165982:group/NewGroup1</Arn>
|
765
|
+
</Group>
|
766
|
+
</GetGroupResult>
|
767
|
+
<ResponseMetadata>
|
768
|
+
<RequestId>ea3adc94-ba45-11df-a356-3d1e141e353d</RequestId>
|
769
|
+
</ResponseMetadata>
|
770
|
+
</GetGroupResponse>
|
771
|
+
RES
|
772
|
+
end
|
773
|
+
|
774
|
+
def create_group_response
|
775
|
+
return <<-RES
|
776
|
+
<CreateGroupResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
777
|
+
<CreateGroupResult>
|
778
|
+
<Group>
|
779
|
+
<GroupId>AGPAJHLP6LD46WOZLH64A</GroupId>
|
780
|
+
<GroupName>NewGroup1</GroupName>
|
781
|
+
<Path>/</Path>
|
782
|
+
<Arn>arn:aws:iam::832248165982:group/NewGroup1</Arn>
|
783
|
+
</Group>
|
784
|
+
</CreateGroupResult>
|
785
|
+
<ResponseMetadata>
|
786
|
+
<RequestId>496c3bad-ba3f-11df-a8c6-9f6df870c6f2</RequestId>
|
787
|
+
</ResponseMetadata>
|
788
|
+
</CreateGroupResponse>
|
789
|
+
RES
|
790
|
+
end
|
791
|
+
|
792
|
+
def delete_group_response
|
793
|
+
return <<-RES
|
794
|
+
<DeleteGroupResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
795
|
+
<ResponseMetadata>
|
796
|
+
<RequestId>06b3f9ae-ba42-11df-89f0-69aaa229db19</RequestId>
|
797
|
+
</ResponseMetadata>
|
798
|
+
</DeleteGroupResponse>
|
799
|
+
RES
|
800
|
+
end
|
801
|
+
|
802
|
+
def list_groups_response
|
803
|
+
[
|
804
|
+
'<ListGroupsResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">',
|
805
|
+
'<ListGroupsResult>',
|
806
|
+
'<IsTruncated>false</IsTruncated>',
|
807
|
+
'<Groups>',
|
808
|
+
'<member>',
|
809
|
+
'<GroupId>AGPAIBHPCA4Z3Y2HAR3SE</GroupId>',
|
810
|
+
'<GroupName>Development</GroupName>',
|
811
|
+
'<Path>/</Path>',
|
812
|
+
'<Arn>arn:aws:iam::326454305199:group/Development</Arn>',
|
813
|
+
'</member>',
|
814
|
+
'</Groups>',
|
815
|
+
'</ListGroupsResult>',
|
816
|
+
'<ResponseMetadata>',
|
817
|
+
'<RequestId>944a9b23-b97a-11df-996e-e7c1660b9998</RequestId>',
|
818
|
+
'</ResponseMetadata>',
|
819
|
+
'</ListGroupsResponse>',
|
820
|
+
].join("\n")
|
821
|
+
end
|
822
|
+
|
823
|
+
def update_group_response
|
824
|
+
return <<-RES
|
825
|
+
<UpdateGroupResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
826
|
+
<ResponseMetadata>
|
827
|
+
<RequestId>46f03346-ba49-11df-a1ef-f7061c8dca90</RequestId>
|
828
|
+
</ResponseMetadata>
|
829
|
+
</UpdateGroupResponse>
|
830
|
+
RES
|
831
|
+
end
|
832
|
+
|
833
|
+
def add_user_to_group_response
|
834
|
+
return <<-RES
|
835
|
+
<AddUserToGroupResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
836
|
+
<ResponseMetadata>
|
837
|
+
<RequestId>f4606eb1-ba4e-11df-92f8-89ed818707d9</RequestId>
|
838
|
+
</ResponseMetadata>
|
839
|
+
</AddUserToGroupResponse>
|
840
|
+
RES
|
841
|
+
end
|
842
|
+
|
843
|
+
def remove_user_from_group_response
|
844
|
+
return <<-RES
|
845
|
+
<RemoveUserFromGroupResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
846
|
+
<ResponseMetadata>
|
847
|
+
<RequestId>8294a061-ba51-11df-a518-4f7d9054fd5f</RequestId>
|
848
|
+
</ResponseMetadata>
|
849
|
+
</RemoveUserFromGroupResponse>
|
850
|
+
RES
|
851
|
+
end
|
852
|
+
|
853
|
+
def create_user_response
|
854
|
+
return <<-RES
|
855
|
+
<CreateUserResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">$
|
856
|
+
<CreateUserResult>$
|
857
|
+
<User>$
|
858
|
+
<UserId>AIDAI6PGTVSCYFGUNXK4G</UserId>$
|
859
|
+
<Path>/</Path>$
|
860
|
+
<UserName>NewUser</UserName>$
|
861
|
+
<Arn>arn:aws:iam::832248165982:user/NewUser</Arn>$
|
862
|
+
</User>$
|
863
|
+
</CreateUserResult>$
|
864
|
+
<ResponseMetadata>$
|
865
|
+
<RequestId>dfeceb17-b98c-11df-aaf3-4191ccb1dcaa</RequestId>$
|
866
|
+
</ResponseMetadata>$
|
867
|
+
</CreateUserResponse>$
|
868
|
+
RES
|
869
|
+
end
|
870
|
+
|
871
|
+
def delete_user_response
|
872
|
+
return <<-RES
|
873
|
+
<DeleteUserResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
874
|
+
<ResponseMetadata>
|
875
|
+
<RequestId>2a91c5c6-b99b-11df-92f8-89ed818707d9</RequestId>
|
876
|
+
</ResponseMetadata>
|
877
|
+
</DeleteUserResponse>
|
878
|
+
RES
|
879
|
+
end
|
880
|
+
|
881
|
+
def list_users_response
|
882
|
+
return <<-RES
|
883
|
+
<ListUsersResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
884
|
+
<ListUsersResult>
|
885
|
+
<Users>
|
886
|
+
<member>
|
887
|
+
<UserId>AIDAJPTEYQSGQ525SOKXW</UserId>
|
888
|
+
<Path>/</Path>
|
889
|
+
<UserName>NewUser</UserName>
|
890
|
+
<Arn>arn:aws:iam::832248165982:user/NewUser</Arn>
|
891
|
+
</member>
|
892
|
+
</Users>
|
893
|
+
<IsTruncated>false</IsTruncated>
|
894
|
+
</ListUsersResult>
|
895
|
+
<ResponseMetadata>
|
896
|
+
<RequestId>6332d0e4-b99e-11df-a1ef-f7061c8dca90</RequestId>
|
897
|
+
</ResponseMetadata>
|
898
|
+
</ListUsersResponse>
|
899
|
+
RES
|
900
|
+
end
|
901
|
+
|
902
|
+
def get_user_response(options = {:with_user_name => false})
|
903
|
+
if options[:with_user_name]
|
904
|
+
return <<-RES
|
905
|
+
"<GetUserResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
906
|
+
<GetUserResult>
|
907
|
+
<User>
|
908
|
+
<UserId>AIDAJEDM3GIZBSIR6SSHK</UserId>
|
909
|
+
<Path>/</Path>
|
910
|
+
<UserName>User1</UserName>
|
911
|
+
<Arn>arn:aws:iam::832248165982:user/User1</Arn>
|
912
|
+
</User>
|
913
|
+
</GetUserResult>
|
914
|
+
<ResponseMetadata>
|
915
|
+
<RequestId>6a98020f-ba24-11df-aaf3-4191ccb1dcaa</RequestId>
|
916
|
+
</ResponseMetadata>
|
917
|
+
</GetUserResponse>
|
918
|
+
RES
|
919
|
+
end
|
920
|
+
|
921
|
+
return <<-RES
|
922
|
+
<GetUserResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
923
|
+
<GetUserResult>
|
924
|
+
<User>
|
925
|
+
<UserId>832248165982</UserId>
|
926
|
+
<Arn>arn:aws:iam::832248165982:root</Arn>
|
927
|
+
</User>
|
928
|
+
</GetUserResult>
|
929
|
+
<ResponseMetadata>
|
930
|
+
<RequestId>e8f05387-ba23-11df-89f0-69aaa229db19</RequestId>
|
931
|
+
</ResponseMetadata>
|
932
|
+
</GetUserResponse>
|
933
|
+
RES
|
934
|
+
end
|
935
|
+
|
936
|
+
def list_groups_for_user_response
|
937
|
+
return <<-RES
|
938
|
+
<ListGroupsForUserResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
939
|
+
<ListGroupsForUserResult>
|
940
|
+
<IsTruncated>false</IsTruncated>
|
941
|
+
<Groups/>
|
942
|
+
</ListGroupsForUserResult>
|
943
|
+
<ResponseMetadata>
|
944
|
+
<RequestId>bf42415e-ba29-11df-a1ef-f7061c8dca90</RequestId>
|
945
|
+
</ResponseMetadata>
|
946
|
+
</ListGroupsForUserResponse>
|
947
|
+
RES
|
948
|
+
end
|
949
|
+
|
950
|
+
def update_user_response
|
951
|
+
return <<-RES
|
952
|
+
<UpdateUserResponse xmlns=\"https://iam.amazonaws.com/doc/2010-05-08/\">
|
953
|
+
<ResponseMetadata>
|
954
|
+
<RequestId>5e00d1d4-ba31-11df-b738-6709d34e9585</RequestId>
|
955
|
+
</ResponseMetadata>
|
956
|
+
</UpdateUserResponse>
|
957
|
+
RES
|
958
|
+
end
|
959
|
+
|
960
|
+
def create_access_key_response
|
961
|
+
return <<-RES
|
962
|
+
<CreateAccessKeyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
963
|
+
<CreateAccessKeyResult>
|
964
|
+
<AccessKey>
|
965
|
+
<SecretAccessKey>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</SecretAccessKey>
|
966
|
+
<Status>Active</Status>
|
967
|
+
<AccessKeyId>AKIAXXXXXXXXXXXXXXXX</AccessKeyId>
|
968
|
+
<UserName>User1</UserName>
|
969
|
+
<CreateDate>2010-09-07T07:53:29.546Z</CreateDate>
|
970
|
+
</AccessKey>
|
971
|
+
</CreateAccessKeyResult>
|
972
|
+
<ResponseMetadata>
|
973
|
+
<RequestId>00ee559f-ba55-11df-92f8-89ed818707d9</RequestId>
|
974
|
+
</ResponseMetadata>
|
975
|
+
</CreateAccessKeyResponse>
|
976
|
+
RES
|
977
|
+
end
|
978
|
+
|
979
|
+
def delete_access_key_response
|
980
|
+
return <<-RES
|
981
|
+
<DeleteAccessKeyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
982
|
+
<ResponseMetadata>
|
983
|
+
<RequestId>cf5417f0-ba57-11df-996e-e7c1660b9998</RequestId>
|
984
|
+
</ResponseMetadata>
|
985
|
+
</DeleteAccessKeyResponse>
|
986
|
+
RES
|
987
|
+
end
|
988
|
+
|
989
|
+
def update_access_key_response
|
990
|
+
return <<-RES
|
991
|
+
<UpdateAccessKeyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
992
|
+
<ResponseMetadata>
|
993
|
+
<RequestId>dfbe66c0-ba63-11df-a356-3d1e141e353d</RequestId>
|
994
|
+
</ResponseMetadata>
|
995
|
+
</UpdateAccessKeyResponse>
|
996
|
+
RES
|
997
|
+
end
|
998
|
+
|
999
|
+
def list_access_keys_response
|
1000
|
+
return <<-RES
|
1001
|
+
<ListAccessKeysResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
1002
|
+
<ListAccessKeysResult>
|
1003
|
+
<IsTruncated>false</IsTruncated>
|
1004
|
+
<AccessKeyMetadata>
|
1005
|
+
<member>
|
1006
|
+
<Status>Active</Status>
|
1007
|
+
<AccessKeyId>AKIAXXXXXXXXXXXXXXXX</AccessKeyId>
|
1008
|
+
<UserName>User1</UserName>
|
1009
|
+
<CreateDate>2010-09-07T08:43:17Z</CreateDate>
|
1010
|
+
</member>
|
1011
|
+
</AccessKeyMetadata>
|
1012
|
+
</ListAccessKeysResult>
|
1013
|
+
<ResponseMetadata>
|
1014
|
+
<RequestId>f9460529-ba5b-11df-996e-e7c1660b9998</RequestId>
|
1015
|
+
</ResponseMetadata>
|
1016
|
+
</ListAccessKeysResponse>
|
1017
|
+
RES
|
1018
|
+
end
|
1019
|
+
|
1020
|
+
def get_group_policy_response
|
1021
|
+
return <<-RES
|
1022
|
+
<GetGroupPolicyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
1023
|
+
<GetGroupPolicyResult>
|
1024
|
+
<PolicyName>Policy1</PolicyName>
|
1025
|
+
<GroupName>Group1</GroupName>
|
1026
|
+
<PolicyDocument>%7B%22Statement%22%3A%5B%7B%22Resource%22%3A%22%2A%22%2C%22Effect%22%3A%22Allow%22%2C%22Action%22%3A%22%2A%22%7D%5D%7D</PolicyDocument>
|
1027
|
+
</GetGroupPolicyResult>
|
1028
|
+
<ResponseMetadata>
|
1029
|
+
<RequestId>84c5d59b-baec-11df-b3cb-6d0722822344</RequestId>
|
1030
|
+
</ResponseMetadata>
|
1031
|
+
</GetGroupPolicyResponse>
|
1032
|
+
RES
|
1033
|
+
end
|
1034
|
+
|
1035
|
+
def put_group_policy_response
|
1036
|
+
return <<-RES
|
1037
|
+
<PutGroupPolicyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
1038
|
+
<ResponseMetadata>
|
1039
|
+
<RequestId>676431f9-bae9-11df-996e-e7c1660b9998</RequestId>
|
1040
|
+
</ResponseMetadata>
|
1041
|
+
</PutGroupPolicyResponse>
|
1042
|
+
RES
|
1043
|
+
end
|
1044
|
+
|
1045
|
+
def delete_group_policy_response
|
1046
|
+
return <<-RES
|
1047
|
+
<DeleteGroupPolicyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
1048
|
+
<ResponseMetadata>
|
1049
|
+
<RequestId>27686694-bb08-11df-a8c6-9f6df870c6f2</RequestId>
|
1050
|
+
</ResponseMetadata>
|
1051
|
+
</DeleteGroupPolicyResponse>
|
1052
|
+
RES
|
1053
|
+
end
|
1054
|
+
|
1055
|
+
def list_group_policies_response
|
1056
|
+
return <<-RES
|
1057
|
+
<ListGroupPoliciesResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
1058
|
+
<ListGroupPoliciesResult>
|
1059
|
+
<PolicyNames>
|
1060
|
+
<member>Policy1</member>
|
1061
|
+
</PolicyNames>
|
1062
|
+
<IsTruncated>false</IsTruncated>
|
1063
|
+
</ListGroupPoliciesResult>
|
1064
|
+
<ResponseMetadata>
|
1065
|
+
<RequestId>a8528a43-bb0b-11df-b3cb-6d0722822344</RequestId>
|
1066
|
+
</ResponseMetadata>
|
1067
|
+
</ListGroupPoliciesResponse>
|
1068
|
+
RES
|
1069
|
+
end
|
1070
|
+
|
1071
|
+
def get_user_policy_response
|
1072
|
+
return <<-RES
|
1073
|
+
<GetUserPolicyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
1074
|
+
<GetUserPolicyResult>
|
1075
|
+
<PolicyName>Policy1</PolicyName>
|
1076
|
+
<UserName>User1</UserName>
|
1077
|
+
<PolicyDocument>%7B%22Statement%22%3A%5B%7B%22Resource%22%3A%22%2A%22%2C%22Effect%22%3A%22Allow%22%2C%22Action%22%3A%22%2A%22%7D%5D%7D</PolicyDocument>
|
1078
|
+
</GetUserPolicyResult>
|
1079
|
+
<ResponseMetadata>
|
1080
|
+
<RequestId>c8a77c43-bb0e-11df-a518-4f7d9054fd5f</RequestId>
|
1081
|
+
</ResponseMetadata>
|
1082
|
+
</GetUserPolicyResponse>
|
1083
|
+
RES
|
1084
|
+
end
|
1085
|
+
|
1086
|
+
def put_user_policy_response
|
1087
|
+
return <<-RES
|
1088
|
+
<PutUserPolicyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
1089
|
+
<ResponseMetadata>
|
1090
|
+
<RequestId>ec1ca2cb-bb0e-11df-996e-e7c1660b9998</RequestId>
|
1091
|
+
</ResponseMetadata>
|
1092
|
+
</PutUserPolicyResponse>
|
1093
|
+
RES
|
1094
|
+
end
|
1095
|
+
|
1096
|
+
def delete_user_policy_response
|
1097
|
+
return <<-RES
|
1098
|
+
<DeleteUserPolicyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
1099
|
+
<ResponseMetadata>
|
1100
|
+
<RequestId>83c49d29-bb12-11df-996e-e7c1660b9998</RequestId>
|
1101
|
+
</ResponseMetadata>
|
1102
|
+
</DeleteUserPolicyResponse>
|
1103
|
+
RES
|
1104
|
+
end
|
1105
|
+
|
1106
|
+
def list_user_policies_response
|
1107
|
+
return <<-RES
|
1108
|
+
<ListUserPoliciesResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
1109
|
+
<ListUserPoliciesResult>
|
1110
|
+
<PolicyNames>
|
1111
|
+
<member>Policy1</member>
|
1112
|
+
</PolicyNames>
|
1113
|
+
<IsTruncated>false</IsTruncated>
|
1114
|
+
</ListUserPoliciesResult>
|
1115
|
+
<ResponseMetadata>
|
1116
|
+
<RequestId>b84ad9d2-bb13-11df-aaf3-4191ccb1dcaa</RequestId>
|
1117
|
+
</ResponseMetadata>
|
1118
|
+
</ListUserPoliciesResponse>
|
1119
|
+
RES
|
1120
|
+
end
|
1121
|
+
|
1122
|
+
def upload_signing_certificate_response
|
1123
|
+
return <<-RES
|
1124
|
+
<UploadSigningCertificateResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
1125
|
+
<UploadSigningCertificateResult>
|
1126
|
+
<Certificate>
|
1127
|
+
<Status>Active</Status>
|
1128
|
+
<CertificateId>PBEX2T7R5DA3SVZHQDK2HQ2G3ZOP7SYA</CertificateId>
|
1129
|
+
<UserName>User1</UserName>
|
1130
|
+
<CertificateBody>-----BEGIN CERTIFICATE-----
|
1131
|
+
MIIBrjCCAVigAwIBAgIJAJAOioXmW9VvMA0GCSqGSIb3DQEBBQUAMBwxGjAYBgNV
|
1132
|
+
BAMTEU5vcmloaXRvIFlvc2hpb2thMB4XDTEwMDkwODA5MDgyM1oXDTEwMTAwODA5
|
1133
|
+
MDgyM1owHDEaMBgGA1UEAxMRTm9yaWhpdG8gWW9zaGlva2EwXDANBgkqhkiG9w0B
|
1134
|
+
AQEFAANLADBIAkEA0IDAJgXhdMhjLEiG1TMOZgeInMGidxVn0jukTZujWZ2iawpr
|
1135
|
+
B+Qgw4AOvfOOif1ZAzJ2N4Y3DOyuuEYTZhQ+nQIDAQABo30wezAdBgNVHQ4EFgQU
|
1136
|
+
7+EbzgqFJ5H4f+F8tVVclyuhAnswTAYDVR0jBEUwQ4AU7+EbzgqFJ5H4f+F8tVVc
|
1137
|
+
lyuhAnuhIKQeMBwxGjAYBgNVBAMTEU5vcmloaXRvIFlvc2hpb2thggkAkA6KheZb
|
1138
|
+
1W8wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAANBAHumka+fYPGm15+8m4kq
|
1139
|
+
go6GPf+b8JYNClRmsus93/YdLSJJeXdTvaCcnBQWJCXaQ5UCr1qZ5Kiu9+0/Vk34
|
1140
|
+
nXg=
|
1141
|
+
-----END CERTIFICATE-----
|
1142
|
+
</CertificateBody>
|
1143
|
+
<UploadDate>2010-09-08T09:24:47Z</UploadDate>
|
1144
|
+
</Certificate>
|
1145
|
+
</UploadSigningCertificateResult>
|
1146
|
+
<ResponseMetadata>
|
1147
|
+
<RequestId>c6d0939c-bb2b-11df-a1ef-f7061c8dca90</RequestId>
|
1148
|
+
</ResponseMetadata>
|
1149
|
+
</UploadSigningCertificateResponse>
|
1150
|
+
RES
|
1151
|
+
end
|
1152
|
+
|
1153
|
+
def dummy_certificate
|
1154
|
+
return <<-EOF
|
1155
|
+
-----BEGIN CERTIFICATE-----
|
1156
|
+
MIIBrjCCAVigAwIBAgIJAJAOioXmW9VvMA0GCSqGSIb3DQEBBQUAMBwxGjAYBgNV
|
1157
|
+
BAMTEU5vcmloaXRvIFlvc2hpb2thMB4XDTEwMDkwODA5MDgyM1oXDTEwMTAwODA5
|
1158
|
+
MDgyM1owHDEaMBgGA1UEAxMRTm9yaWhpdG8gWW9zaGlva2EwXDANBgkqhkiG9w0B
|
1159
|
+
AQEFAANLADBIAkEA0IDAJgXhdMhjLEiG1TMOZgeInMGidxVn0jukTZujWZ2iawpr
|
1160
|
+
B+Qgw4AOvfOOif1ZAzJ2N4Y3DOyuuEYTZhQ+nQIDAQABo30wezAdBgNVHQ4EFgQU
|
1161
|
+
7+EbzgqFJ5H4f+F8tVVclyuhAnswTAYDVR0jBEUwQ4AU7+EbzgqFJ5H4f+F8tVVc
|
1162
|
+
lyuhAnuhIKQeMBwxGjAYBgNVBAMTEU5vcmloaXRvIFlvc2hpb2thggkAkA6KheZb
|
1163
|
+
1W8wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAANBAHumka+fYPGm15+8m4kq
|
1164
|
+
go6GPf+b8JYNClRmsus93/YdLSJJeXdTvaCcnBQWJCXaQ5UCr1qZ5Kiu9+0/Vk34
|
1165
|
+
nXg=
|
1166
|
+
-----END CERTIFICATE-----
|
1167
|
+
EOF
|
1168
|
+
end
|
1169
|
+
|
1170
|
+
def update_signing_certificate_response
|
1171
|
+
return <<-RES
|
1172
|
+
<UpdateSigningCertificateResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
1173
|
+
<ResponseMetadata>
|
1174
|
+
<RequestId>02945b3a-bb32-11df-a8c6-9f6df870c6f2</RequestId>
|
1175
|
+
</ResponseMetadata>
|
1176
|
+
</UpdateSigningCertificateResponse>
|
1177
|
+
RES
|
1178
|
+
end
|
1179
|
+
|
1180
|
+
def delete_signing_certificate_response
|
1181
|
+
return <<-RES
|
1182
|
+
<DeleteSigningCertificateResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
1183
|
+
<ResponseMetadata>
|
1184
|
+
<RequestId>2113a2d0-bbaf-11df-b3cb-6d0722822344</RequestId>
|
1185
|
+
</ResponseMetadata>
|
1186
|
+
</DeleteSigningCertificateResponse>
|
1187
|
+
RES
|
1188
|
+
end
|
1189
|
+
|
1190
|
+
def list_signing_certificates_response
|
1191
|
+
return <<-RES
|
1192
|
+
<ListSigningCertificatesResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
|
1193
|
+
<ListSigningCertificatesResult>
|
1194
|
+
<IsTruncated>false</IsTruncated>
|
1195
|
+
<Certificates>
|
1196
|
+
<member>
|
1197
|
+
<Status>Active</Status>
|
1198
|
+
<CertificateId>PBEX2T7R5DA3SVZHQDK2HQ2G3ZOP7SYA</CertificateId>
|
1199
|
+
<UserName>User1</UserName>
|
1200
|
+
<CertificateBody>-----BEGIN CERTIFICATE-----
|
1201
|
+
MIIBrjCCAVigAwIBAgIJAJAOioXmW9VvMA0GCSqGSIb3DQEBBQUAMBwxGjAYBgNV
|
1202
|
+
BAMTEU5vcmloaXRvIFlvc2hpb2thMB4XDTEwMDkwODA5MDgyM1oXDTEwMTAwODA5
|
1203
|
+
MDgyM1owHDEaMBgGA1UEAxMRTm9yaWhpdG8gWW9zaGlva2EwXDANBgkqhkiG9w0B
|
1204
|
+
AQEFAANLADBIAkEA0IDAJgXhdMhjLEiG1TMOZgeInMGidxVn0jukTZujWZ2iawpr
|
1205
|
+
B+Qgw4AOvfOOif1ZAzJ2N4Y3DOyuuEYTZhQ+nQIDAQABo30wezAdBgNVHQ4EFgQU
|
1206
|
+
7+EbzgqFJ5H4f+F8tVVclyuhAnswTAYDVR0jBEUwQ4AU7+EbzgqFJ5H4f+F8tVVc
|
1207
|
+
lyuhAnuhIKQeMBwxGjAYBgNVBAMTEU5vcmloaXRvIFlvc2hpb2thggkAkA6KheZb
|
1208
|
+
1W8wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAANBAHumka+fYPGm15+8m4kq
|
1209
|
+
go6GPf+b8JYNClRmsus93/YdLSJJeXdTvaCcnBQWJCXaQ5UCr1qZ5Kiu9+0/Vk34
|
1210
|
+
nXg=
|
1211
|
+
-----END CERTIFICATE-----
|
1212
|
+
</CertificateBody>
|
1213
|
+
<UploadDate>2010-09-08T09:24:47Z</UploadDate>
|
1214
|
+
</member>
|
1215
|
+
</Certificates>
|
1216
|
+
</ListSigningCertificatesResult>
|
1217
|
+
<ResponseMetadata>
|
1218
|
+
<RequestId>20a2a122-bb2f-11df-a8c6-9f6df870c6f2</RequestId>
|
1219
|
+
</ResponseMetadata>
|
1220
|
+
</ListSigningCertificatesResponse>
|
1221
|
+
RES
|
1222
|
+
end
|
1223
|
+
end
|
1224
|
+
|