This repository has been archived by the owner on Mar 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
awsv4-runscope-sample.json
101 lines (101 loc) · 3.59 KB
/
awsv4-runscope-sample.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{
"trigger_url": "https://api.runscope.com/radar/bb5ff31b-9ffc-44a2-9fe7-a2563892fef3/trigger",
"name": "Signature Version 4",
"version": "1.0",
"exported_at": 1496896256,
"steps": [
{
"url": "http://s3.amazonaws.com",
"variables": [],
"args": {},
"step_type": "request",
"auth": {},
"fragment": "",
"note": "",
"headers": {},
"assertions": [
{
"comparison": "equal_number",
"value": 200,
"source": "response_status"
}
],
"scripts": [],
"multipart_form": [],
"before_scripts": [
"var opts = {service: 's3', path: request.path};\nvar awsObj = aws4.sign(opts, {accessKeyId: variables.get(\"AWS_ACCESS_KEY_ID\"), secretAccessKey: variables.get(\"AWS_SECRET_ACCESS_KEY\")});\n\nfor (var header in awsObj.headers) {\n request.headers[header] = awsObj.headers[header];\n}"
],
"data": "",
"method": "GET"
},
{
"url": "http://s3.amazonaws.com/hitchikers-guide-to-the-galaxy?list-type=2&delimiter=f",
"variables": [],
"multipart_form": [],
"step_type": "request",
"auth": {},
"fragment": "",
"note": "",
"headers": {},
"assertions": [
{
"comparison": "equal_number",
"value": 200,
"source": "response_status"
}
],
"scripts": [],
"before_scripts": [
"var splitURL = request.url.split(/\\/+/g);\nvar fullPath = \"/\"+splitURL[splitURL.length-1];\nlog(fullPath);\n\nvar opts = {service: 's3', path: fullPath};\nvar awsObj = aws4.sign(opts, {accessKeyId: variables.get(\"AWS_ACCESS_KEY_ID\"), secretAccessKey: variables.get(\"AWS_SECRET_ACCESS_KEY\")});\n\nlog(awsObj);\n\nfor (var header in awsObj.headers) {\n request.headers[header] = awsObj.headers[header];\n}"
],
"method": "GET"
},
{
"headers": {},
"url": "http://s3.amazonaws.com/hitchikers-guide-to-the-galaxy/dont-panic.txt",
"variables": [],
"multipart_form": [],
"step_type": "request",
"auth": {},
"note": "",
"fragment": "",
"assertions": [
{
"comparison": "equal_number",
"value": 200,
"source": "response_status"
}
],
"scripts": [],
"before_scripts": [
"var opts = {service: 's3', path: request.path};\nvar awsObj = aws4.sign(opts, {accessKeyId: variables.get(\"AWS_ACCESS_KEY_ID\"), secretAccessKey: variables.get(\"AWS_SECRET_ACCESS_KEY\")});\n\nfor (var header in awsObj.headers) {\n request.headers[header] = awsObj.headers[header];\n}"
],
"method": "GET"
},
{
"body": "Test Body",
"form": {},
"headers": {},
"url": "http://s3.amazonaws.com/hitchikers-guide-to-the-galaxy/file.txt",
"variables": [],
"multipart_form": [],
"step_type": "request",
"auth": {},
"note": "",
"fragment": "",
"assertions": [
{
"comparison": "equal_number",
"value": 200,
"source": "response_status"
}
],
"scripts": [],
"before_scripts": [
"var opts = {service: 's3', path: request.path, method: request.method, body: request.body};\nvar awsObj = aws4.sign(opts, {accessKeyId: variables.get(\"AWS_ACCESS_KEY_ID\"), secretAccessKey: variables.get(\"AWS_SECRET_ACCESS_KEY\")});\nlog(awsObj);\nfor (var header in awsObj.headers) {\n request.headers[header] = awsObj.headers[header];\n}\nlog(request.headers);"
],
"method": "PUT"
}
],
"description": ""
}