~tribaal/txaws/xss-hardening

« back to all changes in this revision

Viewing changes to txaws/testing/payload.py

  • Committer: Duncan McGreggor
  • Date: 2009-11-22 02:20:42 UTC
  • mto: (44.3.2 484858-s3-scripts)
  • mto: This revision was merged to the branch mainline in revision 52.
  • Revision ID: duncan@canonical.com-20091122022042-4zi231hxni1z53xd
* Updated the LICENSE file with copyright information.
* Updated the README with license information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from txaws import version
 
1
from txaws.version import aws_api
2
2
 
3
3
 
4
4
sample_required_describe_instances_result = """\
9
9
    <item>
10
10
      <reservationId>r-cf24b1a6</reservationId>
11
11
      <ownerId>123456789012</ownerId>
12
 
      <groupSet/>
 
12
      <groupSet>
 
13
        <item>
 
14
          <groupId>default</groupId>
 
15
        </item>
 
16
      </groupSet>
13
17
      <instancesSet>
14
18
        <item>
15
19
          <instanceId>i-abcdef01</instanceId>
18
22
            <code>16</code>
19
23
            <name>running</name>
20
24
          </instanceState>
21
 
          <groupSet>
22
 
            <item>
23
 
              <groupId>sg-64f9eb08</groupId>
24
 
              <groupName>default</groupName>
25
 
            </item>
26
 
          </groupSet>
27
 
          <privateDnsName>domU-12-31-39-03-15-11.compute-1.internal\
28
 
</privateDnsName>
 
25
          <privateDnsName>domU-12-31-39-03-15-11.compute-1.internal</privateDnsName>
29
26
          <dnsName>ec2-75-101-245-65.compute-1.amazonaws.com</dnsName>
30
 
          <privateIpAddress>10.0.0.1</privateIpAddress>
31
 
          <ipAddress>75.101.245.65</ipAddress>
32
27
          <instanceType>c1.xlarge</instanceType>
33
28
          <launchTime>2009-04-27T02:23:18.000Z</launchTime>
34
29
          <placement>
39
34
    </item>
40
35
  </reservationSet>
41
36
</DescribeInstancesResponse>
42
 
""" % (version.ec2_api,)
 
37
""" % (aws_api,)
43
38
 
44
39
 
45
40
sample_describe_instances_result = """\
50
45
    <item>
51
46
      <reservationId>r-cf24b1a6</reservationId>
52
47
      <ownerId>123456789012</ownerId>
53
 
      <groupSet/>
 
48
      <groupSet>
 
49
        <item>
 
50
          <groupId>default</groupId>
 
51
        </item>
 
52
      </groupSet>
54
53
      <instancesSet>
55
54
        <item>
56
55
          <instanceId>i-abcdef01</instanceId>
59
58
            <code>16</code>
60
59
            <name>running</name>
61
60
          </instanceState>
62
 
          <privateDnsName>domU-12-31-39-03-15-11.compute-1.internal\
63
 
</privateDnsName>
 
61
          <privateDnsName>domU-12-31-39-03-15-11.compute-1.internal</privateDnsName>
64
62
          <dnsName>ec2-75-101-245-65.compute-1.amazonaws.com</dnsName>
65
 
          <privateIpAddress>10.0.0.1</privateIpAddress>
66
 
          <ipAddress>75.101.245.65</ipAddress>
67
63
          <reason/>
68
 
          <groupSet>
69
 
            <item>
70
 
              <groupId>sg-64f9eb08</groupId>
71
 
              <groupName>default</groupName>
72
 
            </item>
73
 
          </groupSet>
74
64
          <keyName>keyname</keyName>
75
65
          <amiLaunchIndex>0</amiLaunchIndex>
76
66
          <productCodes>
88
78
    </item>
89
79
  </reservationSet>
90
80
</DescribeInstancesResponse>
91
 
""" % (version.ec2_api,)
 
81
""" % (aws_api,)
92
82
 
93
83
 
94
84
sample_run_instances_result = """\
96
86
<RunInstancesResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
97
87
  <reservationId>r-47a5402e</reservationId>
98
88
  <ownerId>495219933132</ownerId>
99
 
  <groupSet/>
 
89
  <groupSet>
 
90
    <item>
 
91
      <groupId>default</groupId>
 
92
    </item>
 
93
  </groupSet>
100
94
  <instancesSet>
101
95
    <item>
102
96
      <instanceId>i-2ba64342</instanceId>
103
97
      <imageId>ami-60a54009</imageId>
104
98
      <instanceState>
105
99
        <code>0</code>
106
 
        <name>pending</name>
 
100
    <name>pending</name>
107
101
      </instanceState>
108
102
      <privateDnsName></privateDnsName>
109
103
      <dnsName></dnsName>
111
105
       <amiLaunchIndex>0</amiLaunchIndex>
112
106
      <instanceType>m1.small</instanceType>
113
107
      <launchTime>2007-08-07T11:51:50.000Z</launchTime>
114
 
      <groupSet>
115
 
        <item>
116
 
          <groupId>sg-64f9eb08</groupId>
117
 
          <groupName>default</groupName>
118
 
        </item>
119
 
      </groupSet>
120
108
      <placement>
121
109
        <availabilityZone>us-east-1b</availabilityZone>
122
110
      </placement>
126
114
      <imageId>ami-60a54009</imageId>
127
115
      <instanceState>
128
116
        <code>0</code>
129
 
        <name>pending</name>
 
117
    <name>pending</name>
130
118
      </instanceState>
131
119
      <privateDnsName></privateDnsName>
132
120
      <dnsName></dnsName>
134
122
      <amiLaunchIndex>1</amiLaunchIndex>
135
123
      <instanceType>m1.small</instanceType>
136
124
      <launchTime>2007-08-07T11:51:50.000Z</launchTime>
137
 
      <groupSet>
138
 
        <item>
139
 
          <groupId>sg-64f9eb08</groupId>
140
 
          <groupName>default</groupName>
141
 
        </item>
142
 
      </groupSet>
143
125
      <placement>
144
126
        <availabilityZone>us-east-1b</availabilityZone>
145
127
      </placement>
157
139
      <amiLaunchIndex>2</amiLaunchIndex>
158
140
      <instanceType>m1.small</instanceType>
159
141
      <launchTime>2007-08-07T11:51:50.000Z</launchTime>
160
 
      <groupSet>
161
 
        <item>
162
 
          <groupId>sg-64f9eb08</groupId>
163
 
          <groupName>default</groupName>
164
 
        </item>
165
 
      </groupSet>
166
142
      <placement>
167
143
        <availabilityZone>us-east-1b</availabilityZone>
168
144
      </placement>
169
145
    </item>
170
146
  </instancesSet>
171
147
</RunInstancesResponse>
172
 
""" % (version.ec2_api,)
 
148
""" % (aws_api,)
173
149
 
174
150
sample_terminate_instances_result = """\
175
151
<?xml version="1.0"?>
177
153
  <instancesSet>
178
154
    <item>
179
155
      <instanceId>i-1234</instanceId>
180
 
      <currentState>
 
156
      <shutdownState>
181
157
        <code>32</code>
182
158
        <name>shutting-down</name>
183
 
      </currentState>
 
159
      </shutdownState>
184
160
      <previousState>
185
161
        <code>16</code>
186
162
        <name>running</name>
188
164
    </item>
189
165
    <item>
190
166
      <instanceId>i-5678</instanceId>
191
 
      <currentState>
 
167
      <shutdownState>
192
168
        <code>32</code>
193
169
        <name>shutting-down</name>
194
 
      </currentState>
 
170
      </shutdownState>
195
171
      <previousState>
196
172
        <code>32</code>
197
173
        <name>shutting-down</name>
199
175
    </item>
200
176
  </instancesSet>
201
177
</TerminateInstancesResponse>
202
 
""" % (version.ec2_api,)
203
 
 
204
 
 
205
 
sample_describe_security_groups_with_openstack = """\
206
 
<?xml version="1.0"?>
207
 
<DescribeSecurityGroupsResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
208
 
  <requestId>7d4e4dbd-0a33-4d3a-864a-b5ce0f1c9cbf</requestId>
209
 
  <securityGroupInfo>
210
 
    <item>
211
 
      <ipPermissions>
212
 
        <item>
213
 
          <toPort>22</toPort>
214
 
          <ipProtocol>tcp</ipProtocol>
215
 
          <ipRanges>
216
 
             <item><cidrIp>0.0.0.0/0</cidrIp></item>
217
 
          </ipRanges>
218
 
          <groups/>
219
 
          <fromPort>22</fromPort>
220
 
        </item>
221
 
        <item>
222
 
         <toPort/>
223
 
         <ipProtocol/>
224
 
         <ipRanges/>
225
 
         <groups>
226
 
            <item>
227
 
              <groupName>WebServers</groupName>
228
 
              <userId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</userId>
229
 
            </item>
230
 
         </groups>
231
 
         <fromPort/>
232
 
        </item>
233
 
      </ipPermissions>
234
 
      <groupId>sg-a1a1a1</groupId>
235
 
      <groupName>WebServers</groupName>
236
 
      <groupDescription>Web servers</groupDescription>
237
 
      <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId>
238
 
    </item>
239
 
  </securityGroupInfo>
240
 
</DescribeSecurityGroupsResponse>
241
 
""" % (version.ec2_api,)
 
178
""" % (aws_api,)
 
179
 
242
180
 
243
181
sample_describe_security_groups_result = """\
244
182
<?xml version="1.0"?>
247
185
  <securityGroupInfo>
248
186
    <item>
249
187
      <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId>
250
 
      <groupId>sg-a1a1a1</groupId>
251
188
      <groupName>WebServers</groupName>
252
189
      <groupDescription>Web Servers</groupDescription>
253
190
      <ipPermissions>
266
203
    </item>
267
204
  </securityGroupInfo>
268
205
</DescribeSecurityGroupsResponse>
269
 
""" % (version.ec2_api,)
 
206
""" % (aws_api,)
270
207
 
271
208
 
272
209
sample_describe_security_groups_multiple_result = """\
276
213
  <securityGroupInfo>
277
214
    <item>
278
215
      <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId>
279
 
      <groupId>sg-a1a1a1</groupId>
280
216
      <groupName>MessageServers</groupName>
281
217
      <groupDescription>Message Servers</groupDescription>
282
218
      <ipPermissions>
295
231
    </item>
296
232
    <item>
297
233
      <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId>
298
 
      <groupId>sg-c3c3c3</groupId>
299
234
      <groupName>WebServers</groupName>
300
235
      <groupDescription>Web Servers</groupDescription>
301
236
      <ipPermissions>
311
246
          </ipRanges>
312
247
        </item>
313
248
        <item>
314
 
          <ipProtocol>tcp</ipProtocol>
315
 
          <fromPort>0</fromPort>
316
 
          <toPort>65535</toPort>
317
 
          <groups>
318
 
            <item>
319
 
              <userId>group-user-id</userId>
320
 
              <groupName>group-name1</groupName>
321
 
            </item>
322
 
          </groups>
323
 
          <ipRanges />
324
 
        </item>
325
 
        <item>
326
 
          <ipProtocol>udp</ipProtocol>
327
 
          <fromPort>0</fromPort>
328
 
          <toPort>65535</toPort>
329
 
          <groups>
330
 
            <item>
331
 
              <userId>group-user-id</userId>
332
 
              <groupName>group-name1</groupName>
333
 
            </item>
334
 
          </groups>
335
 
          <ipRanges />
336
 
        </item>
337
 
        <item>
338
 
          <ipProtocol>icmp</ipProtocol>
339
 
          <fromPort>-1</fromPort>
340
 
          <toPort>-1</toPort>
341
 
          <groups>
342
 
            <item>
343
 
              <userId>group-user-id</userId>
344
 
              <groupName>group-name1</groupName>
345
 
            </item>
346
 
          </groups>
347
 
          <ipRanges />
348
 
        </item>
349
 
        <item>
350
 
          <ipProtocol>tcp</ipProtocol>
351
 
          <fromPort>0</fromPort>
352
 
          <toPort>65535</toPort>
353
 
          <groups>
354
 
            <item>
355
 
              <userId>group-user-id</userId>
356
 
              <groupName>group-name2</groupName>
357
 
            </item>
358
 
          </groups>
359
 
          <ipRanges />
360
 
        </item>
361
 
        <item>
362
 
          <ipProtocol>udp</ipProtocol>
363
 
          <fromPort>0</fromPort>
364
 
          <toPort>65535</toPort>
365
 
          <groups>
366
 
            <item>
367
 
              <userId>group-user-id</userId>
368
 
              <groupName>group-name2</groupName>
369
 
            </item>
370
 
          </groups>
371
 
          <ipRanges />
372
 
        </item>
373
 
        <item>
374
 
          <ipProtocol>icmp</ipProtocol>
375
 
          <fromPort>-1</fromPort>
376
 
          <toPort>-1</toPort>
377
 
          <groups>
378
 
            <item>
379
 
              <userId>group-user-id</userId>
380
 
              <groupName>group-name2</groupName>
381
 
            </item>
382
 
          </groups>
383
 
          <ipRanges />
 
249
          <ipProtocol>udp</ipProtocol>
 
250
          <fromPort>81</fromPort>
 
251
          <toPort>81</toPort>
 
252
          <groups>
 
253
            <item>
 
254
              <userId>group-user-id</userId>
 
255
              <groupName>group-name</groupName>
 
256
            </item>
 
257
          </groups>
 
258
          <ipRanges>
 
259
            <item>
 
260
              <cidrIp>0.0.0.0/16</cidrIp>
 
261
            </item>
 
262
          </ipRanges>
384
263
        </item>
385
264
      </ipPermissions>
386
265
    </item>
387
266
  </securityGroupInfo>
388
267
</DescribeSecurityGroupsResponse>
389
 
""" % (version.ec2_api,)
390
 
 
391
 
 
392
 
sample_describe_security_groups_multiple_groups = """\
393
 
<?xml version="1.0"?>
394
 
<DescribeSecurityGroupsResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
395
 
<requestId>481987ac-07e2-4f34-99b9-38bcce029ce9</requestId>
396
 
<securityGroupInfo>
397
 
  <item>
398
 
    <ownerId>170743011661</ownerId>
399
 
    <groupName>web/ssh</groupName>
400
 
    <groupDescription>Web and SSH access</groupDescription>
401
 
    <ipPermissions>
402
 
      <item>
403
 
        <ipProtocol>icmp</ipProtocol>
404
 
        <fromPort>-1</fromPort>
405
 
        <toPort>-1</toPort>
406
 
        <groups>
407
 
          <item>
408
 
            <userId>170723411662</userId>
409
 
            <groupName>default</groupName>
410
 
          </item>
411
 
          <item>
412
 
            <userId>175723011368</userId>
413
 
            <groupName>test1</groupName>
414
 
          </item>
415
 
        </groups>
416
 
        <ipRanges/>
417
 
      </item>
418
 
      <item>
419
 
        <ipProtocol>tcp</ipProtocol>
420
 
        <fromPort>1</fromPort>
421
 
        <toPort>65535</toPort>
422
 
        <groups>
423
 
          <item>
424
 
            <userId>170723411662</userId>
425
 
            <groupName>default</groupName>
426
 
          </item>
427
 
          <item>
428
 
            <userId>175723011368</userId>
429
 
            <groupName>test1</groupName>
430
 
          </item>
431
 
        </groups>
432
 
        <ipRanges/>
433
 
      </item>
434
 
      <item>
435
 
        <ipProtocol>udp</ipProtocol>
436
 
        <fromPort>1</fromPort>
437
 
        <toPort>65535</toPort>
438
 
        <groups>
439
 
          <item>
440
 
            <userId>170723411662</userId>
441
 
            <groupName>default</groupName>
442
 
          </item>
443
 
          <item>
444
 
            <userId>175723011368</userId>
445
 
            <groupName>test1</groupName>
446
 
          </item>
447
 
        </groups>
448
 
        <ipRanges/>
449
 
      </item>
450
 
      <item>
451
 
        <ipProtocol>tcp</ipProtocol>
452
 
        <fromPort>22</fromPort>
453
 
        <toPort>22</toPort>
454
 
        <groups/>
455
 
        <ipRanges>
456
 
          <item>
457
 
            <cidrIp>0.0.0.0/0</cidrIp>
458
 
          </item>
459
 
        </ipRanges>
460
 
      </item>
461
 
      <item>
462
 
        <ipProtocol>tcp</ipProtocol>
463
 
        <fromPort>80</fromPort>
464
 
        <toPort>80</toPort>
465
 
        <groups/>
466
 
        <ipRanges>
467
 
          <item>
468
 
            <cidrIp>0.0.0.0/0</cidrIp>
469
 
          </item>
470
 
        </ipRanges>
471
 
      </item>
472
 
    </ipPermissions>
473
 
  </item>
474
 
</securityGroupInfo>
475
 
</DescribeSecurityGroupsResponse>
476
 
""" % (version.ec2_api,)
 
268
""" % (aws_api,)
477
269
 
478
270
 
479
271
sample_create_security_group = """\
480
272
<CreateSecurityGroupResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
481
273
  <return>true</return>
482
 
  <groupId>sg-1a2b3c4d</groupId>
483
274
</CreateSecurityGroupResponse>
484
 
""" % (version.ec2_api,)
 
275
""" % (aws_api,)
485
276
 
486
277
 
487
278
sample_duplicate_create_security_group_result = """\
514
305
<DeleteSecurityGroupResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
515
306
  <return>true</return>
516
307
</DeleteSecurityGroupResponse>
517
 
""" % (version.ec2_api,)
 
308
""" % (aws_api,)
518
309
 
519
310
 
520
311
sample_delete_security_group_failure = """\
523
314
  <Errors>
524
315
    <Error>
525
316
      <Code>InvalidGroup.InUse</Code>
526
 
      <Message>Group groupID1:GroupReferredTo is used by groups: \
527
 
groupID2:UsingGroup</Message>
 
317
      <Message>Group groupID1:GroupReferredTo is used by groups: groupID2:UsingGroup</Message>
528
318
    </Error>
529
319
  </Errors>
530
320
  <RequestID>9a6df05f-9c27-47aa-81d8-6619689210cc</RequestID>
533
323
 
534
324
 
535
325
sample_authorize_security_group = """\
536
 
<AuthorizeSecurityGroupIngressResponse\
537
 
 xmlns="http://ec2.amazonaws.com/doc/%s/">
 
326
<AuthorizeSecurityGroupIngressResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
538
327
  <return>true</return>
539
328
</AuthorizeSecurityGroupIngressResponse>
540
 
""" % (version.ec2_api,)
 
329
""" % (aws_api,)
541
330
 
542
331
 
543
332
sample_revoke_security_group = """\
544
333
<RevokeSecurityGroupIngressResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
545
334
  <return>true</return>
546
335
</RevokeSecurityGroupIngressResponse>
547
 
""" % (version.ec2_api,)
 
336
""" % (aws_api,)
548
337
 
549
338
 
550
339
sample_describe_volumes_result = """\
571
360
    </item>
572
361
  </volumeSet>
573
362
</DescribeVolumesResponse>
574
 
""" % (version.ec2_api,)
 
363
""" % (aws_api,)
575
364
 
576
365
 
577
366
sample_describe_snapshots_result = """\
587
376
    </item>
588
377
  </snapshotSet>
589
378
</DescribeSnapshotsResponse>
590
 
""" % (version.ec2_api,)
 
379
""" % (aws_api,)
591
380
 
592
381
 
593
382
sample_create_volume_result = """\
600
389
  <availabilityZone>us-east-1a</availabilityZone>
601
390
  <snapshotId></snapshotId>
602
391
</CreateVolumeResponse>
603
 
""" % (version.ec2_api,)
 
392
""" % (aws_api,)
604
393
 
605
394
 
606
395
sample_delete_volume_result = """\
608
397
<DeleteVolumeResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
609
398
  <return>true</return>
610
399
</DeleteVolumeResponse>
611
 
""" % (version.ec2_api,)
 
400
""" % (aws_api,)
612
401
 
613
402
 
614
403
sample_create_snapshot_result = """\
620
409
  <startTime>2008-05-07T12:51:50.000Z</startTime>
621
410
  <progress></progress>
622
411
</CreateSnapshotResponse>
623
 
""" % (version.ec2_api,)
 
412
""" % (aws_api,)
624
413
 
625
414
 
626
415
sample_delete_snapshot_result = """\
628
417
<DeleteSnapshotResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
629
418
  <return>true</return>
630
419
</DeleteSnapshotResponse>
631
 
""" % (version.ec2_api,)
 
420
""" % (aws_api,)
632
421
 
633
422
 
634
423
sample_attach_volume_result = """\
640
429
  <status>attaching</status>
641
430
  <attachTime>2008-05-07T11:51:50.000Z</attachTime>
642
431
</AttachVolumeResponse>
643
 
""" % (version.ec2_api,)
 
432
""" % (aws_api,)
644
433
 
645
434
 
646
435
sample_ec2_error_message = """\
681
470
  <keySet>
682
471
    <item>
683
472
      <keyName>gsg-keypair</keyName>
684
 
      <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:\
685
 
ca:9f:f5:f1:6f</keyFingerprint>
 
473
      <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f</keyFingerprint>
686
474
    </item>
687
475
  </keySet>
688
476
</DescribeKeyPairsResponse>
689
 
""" % (version.ec2_api,)
 
477
""" % (aws_api,)
690
478
 
691
479
 
692
480
sample_multiple_describe_keypairs_result = """\
695
483
  <keySet>
696
484
    <item>
697
485
      <keyName>gsg-keypair-1</keyName>
698
 
      <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:\
699
 
ca:9f:f5:f1:6f</keyFingerprint>
 
486
      <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f</keyFingerprint>
700
487
    </item>
701
488
    <item>
702
489
      <keyName>gsg-keypair-2</keyName>
703
 
      <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:\
704
 
ca:9f:f5:f1:70</keyFingerprint>
 
490
      <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:70</keyFingerprint>
705
491
    </item>
706
492
  </keySet>
707
493
</DescribeKeyPairsResponse>
708
 
""" % (version.ec2_api,)
 
494
""" % (aws_api,)
709
495
 
710
496
 
711
497
sample_create_keypair_result = """\
712
498
<?xml version="1.0"?>
713
499
<CreateKeyPairResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
714
500
  <keyName>example-key-name</keyName>
715
 
  <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:\
716
 
ca:9f:f5:f1:6f</keyFingerprint>
 
501
  <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f</keyFingerprint>
717
502
  <keyMaterial>-----BEGIN RSA PRIVATE KEY-----
718
503
MIIEoQIBAAKCAQBuLFg5ujHrtm1jnutSuoO8Xe56LlT+HM8v/xkaa39EstM3/aFxTHgElQiJLChp
719
504
HungXQ29VTc8rc1bW0lkdi23OH5eqkMHGhvEwqa0HWASUMll4o3o/IX+0f2UcPoKCOVUR+jx71Sg
738
523
2ERKKdwz0ZL9SWq6VTdhr/5G994CK72fy5WhyERbDjUIdHaK3M849JJuf8cSrvSb4g==
739
524
-----END RSA PRIVATE KEY-----</keyMaterial>
740
525
</CreateKeyPairResponse>
741
 
""" % (version.ec2_api,)
 
526
""" % (aws_api,)
742
527
 
743
528
 
744
529
sample_delete_keypair_true_result = """\
746
531
<DeleteKeyPair xmlns="http://ec2.amazonaws.com/doc/%s/">
747
532
  <return>true</return>
748
533
</DeleteKeyPair>
749
 
""" % (version.ec2_api,)
 
534
""" % (aws_api,)
750
535
 
751
536
 
752
537
sample_delete_keypair_false_result = """\
754
539
<DeleteKeyPair xmlns="http://ec2.amazonaws.com/doc/%s/">
755
540
  <return>false</return>
756
541
</DeleteKeyPair>
757
 
""" % (version.ec2_api,)
 
542
""" % (aws_api,)
758
543
 
759
544
 
760
545
sample_delete_keypair_no_result = """\
761
546
<?xml version="1.0"?>
762
547
<DeleteKeyPair xmlns="http://ec2.amazonaws.com/doc/%s/">
763
548
</DeleteKeyPair>
764
 
""" % (version.ec2_api,)
 
549
""" % (aws_api,)
765
550
 
766
551
 
767
552
sample_duplicate_keypair_result = """\
778
563
"""
779
564
 
780
565
 
781
 
sample_import_keypair_result = """\
782
 
<?xml version="1.0"?>
783
 
<ImportKeyPairResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
784
 
  <keyName>example-key-name</keyName>
785
 
  <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:\
786
 
ca:9f:f5:f1:6f</keyFingerprint>
787
 
</ImportKeyPairResponse>
788
 
""" % (version.ec2_api,)
789
 
 
790
 
 
791
566
sample_allocate_address_result = """\
792
567
<?xml version="1.0"?>
793
568
<AllocateAddressResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
794
569
  <publicIp>67.202.55.255</publicIp>
795
570
</AllocateAddressResponse>
796
 
""" % (version.ec2_api,)
 
571
""" % (aws_api,)
797
572
 
798
573
 
799
574
sample_release_address_result = """\
801
576
<ReleaseAddressResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
802
577
  <return>true</return>
803
578
</ReleaseAddressResponse>
804
 
""" % (version.ec2_api,)
 
579
""" % (aws_api,)
805
580
 
806
581
 
807
582
sample_associate_address_result = """\
809
584
<AssociateAddressResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
810
585
  <return>true</return>
811
586
</AssociateAddressResponse>
812
 
""" % (version.ec2_api,)
 
587
""" % (aws_api,)
813
588
 
814
589
 
815
590
sample_disassociate_address_result = """\
817
592
<DisassociateAddressResponse xmlns="http://ec2.amazonaws.com/doc/%s/">
818
593
  <return>true</return>
819
594
</DisassociateAddressResponse>
820
 
""" % (version.ec2_api,)
 
595
""" % (aws_api,)
821
596
 
822
597
 
823
598
sample_describe_addresses_result = """\
832
607
    </item>
833
608
  </addressesSet>
834
609
</DescribeAddressesResponse>
835
 
""" % (version.ec2_api,)
 
610
""" % (aws_api,)
836
611
 
837
612
 
838
613
sample_describe_availability_zones_single_result = """\
844
619
    </item>
845
620
  </availabilityZoneInfo>
846
621
</DescribeAvailabilityZonesResponse>
847
 
""" % (version.ec2_api,)
 
622
""" % (aws_api,)
848
623
 
849
624
 
850
625
sample_describe_availability_zones_multiple_results = """\
864
639
    </item>
865
640
  </availabilityZoneInfo>
866
641
</DescribeAvailabilityZonesResponse>
867
 
""" % (version.ec2_api,)
 
642
""" % (aws_api,)
868
643
 
869
644
 
870
645
sample_invalid_client_token_result = """\
873
648
  <Errors>
874
649
    <Error>
875
650
      <Code>InvalidClientTokenId</Code>
876
 
      <Message>The AWS Access Key Id you provided does not exist in our\
877
 
 records.</Message>
 
651
      <Message>The AWS Access Key Id you provided does not exist in our records.</Message>
878
652
    </Error>
879
653
  </Errors>
880
654
  <RequestID>47bfd77d-78d6-446d-be0d-f7621795dded</RequestID>
882
656
"""
883
657
 
884
658
 
 
659
sample_server_internal_error_result = """\
 
660
<?xml version="1.0" encoding="UTF-8"?>
 
661
<Error>
 
662
  <Code>InternalError</Code>
 
663
  <Message>We encountered an internal error. Please try again.</Message>
 
664
  <RequestID>A2A7E5395E27DFBB</RequestID>
 
665
  <HostID>f691zulHNsUqonsZkjhILnvWwD3ZnmOM4ObM1wXTc6xuS3GzPmjArp8QC/sGsn6K</HostID>
 
666
</Error>
 
667
"""
 
668
 
 
669
 
885
670
sample_restricted_resource_result = """\
886
671
<?xml version="1.0"?>
887
672
<Response>
894
679
  <RequestID>a99e832e-e6e0-416a-9a35-81798ea521b4</RequestID>
895
680
</Response>
896
681
"""
897
 
 
898
 
 
899
 
sample_server_internal_error_result = """\
900
 
<?xml version="1.0" encoding="UTF-8"?>
901
 
<Error>
902
 
  <Code>InternalError</Code>
903
 
  <Message>We encountered an internal error. Please try again.</Message>
904
 
  <RequestID>A2A7E5395E27DFBB</RequestID>
905
 
  <HostID>f691zulHNsUqonsZkjhILnvWwD3ZnmOM4ObM1wXTc6xuS3GzPmjArp8QC/sGsn6K\
906
 
</HostID>
907
 
</Error>
908
 
"""
909
 
 
910
 
 
911
 
sample_list_buckets_result = """\
912
 
<?xml version="1.0" encoding="UTF-8"?>
913
 
<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/%s/">
914
 
  <Owner>
915
 
    <ID>bcaf1ffd86f41caff1a493dc2ad8c2c281e37522a640e161ca5fb16fd081034f</ID>
916
 
    <DisplayName>webfile</DisplayName>
917
 
  </Owner>
918
 
  <Buckets>
919
 
    <Bucket>
920
 
      <Name>quotes</Name>
921
 
      <CreationDate>2006-02-03T16:45:09.000Z</CreationDate>
922
 
    </Bucket>
923
 
    <Bucket>
924
 
      <Name>samples</Name>
925
 
      <CreationDate>2006-02-03T16:41:58.000Z</CreationDate>
926
 
    </Bucket>
927
 
  </Buckets>
928
 
</ListAllMyBucketsResult>
929
 
""" % (version.s3_api,)
930
 
 
931
 
 
932
 
sample_get_bucket_result = """\
933
 
<?xml version="1.0" encoding="UTF-8"?>
934
 
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/%s/">
935
 
  <Name>mybucket</Name>
936
 
  <Prefix>N</Prefix>
937
 
  <Marker>Ned</Marker>
938
 
  <MaxKeys>40</MaxKeys>
939
 
  <IsTruncated>false</IsTruncated>
940
 
  <Contents>
941
 
    <Key>Nelson</Key>
942
 
    <LastModified>2006-01-01T12:00:00.000Z</LastModified>
943
 
    <ETag>&quot;828ef3fdfa96f00ad9f27c383fc9ac7f&quot;</ETag>
944
 
    <Size>5</Size>
945
 
    <StorageClass>STANDARD</StorageClass>
946
 
    <Owner>
947
 
      <ID>bcaf1ffd86f41caff1a493dc2ad8c2c281e37522a640e161ca5fb16fd081034f</ID>
948
 
      <DisplayName>webfile</DisplayName>
949
 
     </Owner>
950
 
  </Contents>
951
 
  <Contents>
952
 
    <Key>Neo</Key>
953
 
    <LastModified>2006-01-01T12:00:00.000Z</LastModified>
954
 
    <ETag>&quot;828ef3fdfa96f00ad9f27c383fc9ac7f&quot;</ETag>
955
 
    <Size>4</Size>
956
 
    <StorageClass>STANDARD</StorageClass>
957
 
     <Owner>
958
 
      <ID>bcaf1ffd86f41caff1a493dc2ad8c2c281e37522a640e161ca5fb16fd081034f</ID>
959
 
      <DisplayName>webfile</DisplayName>
960
 
    </Owner>
961
 
 </Contents>
962
 
</ListBucketResult>
963
 
""" % (version.s3_api,)
964
 
 
965
 
 
966
 
sample_get_bucket_location_result = """\
967
 
<LocationConstraint xmlns="http://s3.amazonaws.com/doc/2006-03-01/">EU\
968
 
</LocationConstraint>
969
 
 
970
 
"""
971
 
sample_request_payment = """\
972
 
<?xml version="1.0" encoding="UTF-8"?>
973
 
<RequestPaymentConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
974
 
  <Payer>Requester</Payer>
975
 
</RequestPaymentConfiguration>
976
 
"""
977
 
 
978
 
sample_s3_signature_mismatch = """\
979
 
<?xml version="1.0" encoding="UTF-8"?>
980
 
<Error>
981
 
  <Code>SignatureDoesNotMatch</Code>
982
 
  <Message>The request signature we calculated does not match the signature\
983
 
 you provided. Check your key and signing method.</Message>
984
 
  <StringToSignBytes>47 45 54 0a 31 42 32 4d 32 59 38 41 73 67 54 70 67 41 6d\
985
 
 59 37 50 68 43 66 67 3d 3d 0a 0a 54 68 75 2c 20 30 35 20 4e 6f 76 20 32 30\
986
 
 30 39 20 32 31 3a 33 33 3a 32 39 20 47 4d 54 0a 2f</StringToSignBytes>
987
 
  <RequestId>AB9216C8640751B2</RequestId>
988
 
  <HostId>sAPBpmFdsOsgUUwtSLsiT6KIwP1mPbmrYY0xUoahzJE263qmABkTaqzGhHddgOq5\
989
 
</HostId>
990
 
  <SignatureProvided>ltowhdrbjaQ8dQc9VS5MxzJfsPJZi0BZHEzJC3r9pzU=
991
 
</SignatureProvided>
992
 
  <StringToSign>GET\n1B2M2Y8AsgTpgAmY7PhCfg==\n\nThu, 05 Nov 2009 21:33:29\
993
 
 GMT\n/</StringToSign>
994
 
  <AWSAccessKeyId>SOMEKEYID</AWSAccessKeyId>
995
 
</Error>
996
 
"""
997
 
 
998
 
 
999
 
sample_s3_invalid_access_key_result = """\
1000
 
<?xml version="1.0" encoding="UTF-8"?>
1001
 
<Error>
1002
 
  <Code>InvalidAccessKeyId</Code>
1003
 
  <Message>The AWS Access Key Id you provided does not exist in our records.\
1004
 
</Message>
1005
 
  <RequestId>0223AD81A94821CE</RequestId>
1006
 
  <HostId>HAw5g9P1VkN8ztgLKFTK20CY5LmCfTwXcSths1O7UQV6NuJx2P4tmFnpuOsziwOE\
1007
 
</HostId>
1008
 
  <AWSAccessKeyId>SOMEKEYID</AWSAccessKeyId>
1009
 
</Error>
1010
 
"""
1011
 
 
1012
 
sample_access_control_policy_result = """\
1013
 
<AccessControlPolicy>
1014
 
  <Owner>
1015
 
    <ID>8a6925ce4adf588a4f21c32aa37900beef</ID>
1016
 
    <DisplayName>baz@example.net</DisplayName>
1017
 
  </Owner>
1018
 
  <AccessControlList>
1019
 
    <Grant>
1020
 
      <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\
1021
 
 xsi:type="CanonicalUser">
1022
 
        <ID>8a6925ce4adf588a4f21c32aa379004fef</ID>
1023
 
        <DisplayName>foo@example.net</DisplayName>
1024
 
      </Grantee>
1025
 
      <Permission>FULL_CONTROL</Permission>
1026
 
    </Grant>
1027
 
    <Grant>
1028
 
      <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\
1029
 
 xsi:type="CanonicalUser">
1030
 
        <ID>8a6925ce4adf588a4f21c32aa37900feed</ID>
1031
 
        <DisplayName>bar@example.net</DisplayName>
1032
 
      </Grantee>
1033
 
      <Permission>READ</Permission>
1034
 
    </Grant>
1035
 
  </AccessControlList>
1036
 
</AccessControlPolicy>"""
1037
 
 
1038
 
sample_s3_get_bucket_lifecycle_result = """\
1039
 
<?xml version="1.0" encoding="UTF-8"?>
1040
 
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
1041
 
   <Rule>
1042
 
      <ID>30-day-log-deletion-rule</ID>
1043
 
      <Prefix>logs</Prefix>
1044
 
      <Status>Enabled</Status>
1045
 
      <Expiration>
1046
 
         <Days>30</Days>
1047
 
      </Expiration>
1048
 
   </Rule>
1049
 
</LifecycleConfiguration>"""
1050
 
 
1051
 
sample_s3_get_bucket_lifecycle_multiple_rules_result = """\
1052
 
<?xml version="1.0" encoding="UTF-8"?>
1053
 
<LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
1054
 
   <Rule>
1055
 
      <ID>30-day-log-deletion-rule</ID>
1056
 
      <Prefix>logs</Prefix>
1057
 
      <Status>Enabled</Status>
1058
 
      <Expiration>
1059
 
         <Days>30</Days>
1060
 
      </Expiration>
1061
 
   </Rule>
1062
 
   <Rule>
1063
 
      <ID>another-id</ID>
1064
 
      <Prefix>another-logs</Prefix>
1065
 
      <Status>Disabled</Status>
1066
 
      <Expiration>
1067
 
         <Days>37</Days>
1068
 
      </Expiration>
1069
 
   </Rule>
1070
 
</LifecycleConfiguration>"""
1071
 
 
1072
 
sample_s3_get_bucket_website_result = """\
1073
 
<?xml version="1.0" encoding="UTF-8"?>
1074
 
<WebsiteConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
1075
 
  <IndexDocument>
1076
 
    <Suffix>index.html</Suffix>
1077
 
  </IndexDocument>
1078
 
  <ErrorDocument>
1079
 
    <Key>404.html</Key>
1080
 
  </ErrorDocument>
1081
 
</WebsiteConfiguration>"""
1082
 
 
1083
 
sample_s3_get_bucket_website_no_error_result = """\
1084
 
<?xml version="1.0" encoding="UTF-8"?>
1085
 
<WebsiteConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
1086
 
  <IndexDocument>
1087
 
    <Suffix>index.html</Suffix>
1088
 
  </IndexDocument>
1089
 
</WebsiteConfiguration>"""
1090
 
 
1091
 
sample_s3_get_bucket_notification_result = """\
1092
 
<NotificationConfiguration />"""
1093
 
 
1094
 
sample_s3_get_bucket_notification_with_topic_result = """\
1095
 
<NotificationConfiguration>
1096
 
   <TopicConfiguration>
1097
 
       <Topic>arn:aws:sns:us-east-1:123456789012:myTopic</Topic>
1098
 
       <Event>s3:ReducedRedundancyLostObject</Event>
1099
 
   </TopicConfiguration>
1100
 
</NotificationConfiguration>"""
1101
 
 
1102
 
sample_s3_get_bucket_versioning_result = """\
1103
 
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"/>"""
1104
 
 
1105
 
sample_s3_get_bucket_versioning_enabled_result = """\
1106
 
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
1107
 
  <Status>Enabled</Status>
1108
 
</VersioningConfiguration>"""
1109
 
 
1110
 
sample_s3_get_bucket_versioning_mfa_disabled_result = """\
1111
 
<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
1112
 
  <Status>Enabled</Status>
1113
 
  <MfaDelete>Disabled</MfaDelete>
1114
 
</VersioningConfiguration>"""
1115
 
 
1116
 
sample_s3_init_multipart_upload_result = """\
1117
 
<InitiateMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
1118
 
  <Bucket>example-bucket</Bucket>
1119
 
  <Key>example-object</Key>
1120
 
  <UploadId>deadbeef</UploadId>
1121
 
</InitiateMultipartUploadResult>"""
1122
 
 
1123
 
sample_s3_complete_multipart_upload_result = """\
1124
 
<?xml version="1.0" encoding="UTF-8"?>
1125
 
<CompleteMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
1126
 
  <Location>http://example-bucket.s3.amazonaws.com/example-object</Location>
1127
 
  <Bucket>example-bucket</Bucket>
1128
 
  <Key>example-object</Key>
1129
 
  <ETag>"3858f62230ac3c915f300c664312c11f-9"</ETag>
1130
 
</CompleteMultipartUploadResult>"""