restless-sdk 0.1.0 → 0.2.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.
- checksums.yaml +4 -4
- data/CONFORMANCE.md +13 -8
- data/LICENSE +18 -0
- data/README.md +66 -6
- data/exe/restless-conformance +1 -1
- data/install.md +35 -9
- data/lib/restless/capture.rb +86 -5
- data/lib/restless/client.rb +29 -1
- data/lib/restless/conformance.rb +43 -1
- data/lib/restless/injection.rb +31 -16
- data/lib/restless/rack.rb +54 -8
- data/lib/restless/sampling.rb +225 -0
- data/lib/restless/settings.rb +7 -4
- data/lib/restless/uploader.rb +53 -1
- data/lib/restless/version.rb +2 -2
- data/lib/restless.rb +2 -1
- data/spec/VECTORS_VERSION +1 -1
- data/spec/vectors/debug-injection.json +219 -0
- data/spec/vectors/fingerprint.json +1 -1
- data/spec/vectors/har.json +1 -1
- data/spec/vectors/mask.json +1 -1
- data/spec/vectors/recovery-slug.json +1 -1
- data/spec/vectors/redact.json +1 -1
- data/spec/vectors/request-id.json +1 -1
- data/spec/vectors/sampling.json +738 -0
- metadata +10 -10
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$generated": "GENERATED FILE - do not edit by hand. Inputs live in spec/cases.ts; run `npm run spec:vectors` to regenerate.",
|
|
3
|
+
"$contract": "spec/CONTRACT.md",
|
|
4
|
+
"specVersion": "1.1.0",
|
|
5
|
+
"cases": [
|
|
6
|
+
{
|
|
7
|
+
"id": "inject/2xx-headers-only",
|
|
8
|
+
"requirement": "INJECT-001",
|
|
9
|
+
"op": "debugInjection",
|
|
10
|
+
"input": {
|
|
11
|
+
"status": 200,
|
|
12
|
+
"requestId": "9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
13
|
+
"portalUrl": "https://acme.restlessdocs.com",
|
|
14
|
+
"method": "GET",
|
|
15
|
+
"path": "/car/{id}"
|
|
16
|
+
},
|
|
17
|
+
"expected": {
|
|
18
|
+
"headers": {
|
|
19
|
+
"x-log-url": "https://acme.restlessdocs.com/logs/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
20
|
+
"x-debug": "npx api debug 9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f"
|
|
21
|
+
},
|
|
22
|
+
"debug": null
|
|
23
|
+
},
|
|
24
|
+
"note": "Headers on every status; the body object stays 4xx/5xx only."
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "inject/2xx-301",
|
|
28
|
+
"requirement": "INJECT-001",
|
|
29
|
+
"op": "debugInjection",
|
|
30
|
+
"input": {
|
|
31
|
+
"status": 301,
|
|
32
|
+
"requestId": "9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
33
|
+
"portalUrl": "https://acme.restlessdocs.com"
|
|
34
|
+
},
|
|
35
|
+
"expected": {
|
|
36
|
+
"headers": {
|
|
37
|
+
"x-log-url": "https://acme.restlessdocs.com/logs/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
38
|
+
"x-debug": "npx api debug 9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f"
|
|
39
|
+
},
|
|
40
|
+
"debug": null
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"id": "inject/4xx-full",
|
|
45
|
+
"requirement": "INJECT-002",
|
|
46
|
+
"op": "debugInjection",
|
|
47
|
+
"input": {
|
|
48
|
+
"status": 404,
|
|
49
|
+
"requestId": "9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
50
|
+
"portalUrl": "https://acme.restlessdocs.com",
|
|
51
|
+
"method": "GET",
|
|
52
|
+
"path": "/car/{id}"
|
|
53
|
+
},
|
|
54
|
+
"expected": {
|
|
55
|
+
"headers": {
|
|
56
|
+
"x-log-url": "https://acme.restlessdocs.com/logs/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
57
|
+
"x-debug": "npx api debug 9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f"
|
|
58
|
+
},
|
|
59
|
+
"debug": {
|
|
60
|
+
"log": "https://acme.restlessdocs.com/logs/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
61
|
+
"cli": "npx api debug 9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
62
|
+
"recovery": "For the accepted parameters and next steps, fetch https://acme.restlessdocs.com/p/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f/get-car-id.md"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"note": "Both URLs share the portal origin."
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "inject/5xx-full",
|
|
69
|
+
"requirement": "INJECT-002",
|
|
70
|
+
"op": "debugInjection",
|
|
71
|
+
"input": {
|
|
72
|
+
"status": 500,
|
|
73
|
+
"requestId": "9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
74
|
+
"portalUrl": "https://acme.restlessdocs.com",
|
|
75
|
+
"method": "POST",
|
|
76
|
+
"path": "/orders"
|
|
77
|
+
},
|
|
78
|
+
"expected": {
|
|
79
|
+
"headers": {
|
|
80
|
+
"x-log-url": "https://acme.restlessdocs.com/logs/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
81
|
+
"x-debug": "npx api debug 9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f"
|
|
82
|
+
},
|
|
83
|
+
"debug": {
|
|
84
|
+
"log": "https://acme.restlessdocs.com/logs/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
85
|
+
"cli": "npx api debug 9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
86
|
+
"recovery": "For the accepted parameters and next steps, fetch https://acme.restlessdocs.com/p/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f/post-orders.md"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"id": "inject/no-portal-2xx",
|
|
92
|
+
"requirement": "INJECT-006",
|
|
93
|
+
"op": "debugInjection",
|
|
94
|
+
"input": {
|
|
95
|
+
"status": 200,
|
|
96
|
+
"requestId": "9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f"
|
|
97
|
+
},
|
|
98
|
+
"expected": {
|
|
99
|
+
"headers": {
|
|
100
|
+
"x-debug": "npx api debug 9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f"
|
|
101
|
+
},
|
|
102
|
+
"debug": null
|
|
103
|
+
},
|
|
104
|
+
"note": "No portal origin: x-debug only, and never a URL on the ingest host."
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"id": "inject/no-portal-4xx",
|
|
108
|
+
"requirement": "INJECT-006",
|
|
109
|
+
"op": "debugInjection",
|
|
110
|
+
"input": {
|
|
111
|
+
"status": 404,
|
|
112
|
+
"requestId": "9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
113
|
+
"method": "GET",
|
|
114
|
+
"path": "/car/{id}"
|
|
115
|
+
},
|
|
116
|
+
"expected": {
|
|
117
|
+
"headers": {
|
|
118
|
+
"x-debug": "npx api debug 9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f"
|
|
119
|
+
},
|
|
120
|
+
"debug": null
|
|
121
|
+
},
|
|
122
|
+
"note": "No portal origin means no debug object at all, so no dig-in line."
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"id": "inject/prefix",
|
|
126
|
+
"requirement": "INJECT-002",
|
|
127
|
+
"op": "debugInjection",
|
|
128
|
+
"input": {
|
|
129
|
+
"status": 404,
|
|
130
|
+
"requestId": "9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
131
|
+
"prefix": "TST",
|
|
132
|
+
"portalUrl": "https://acme.restlessdocs.com"
|
|
133
|
+
},
|
|
134
|
+
"expected": {
|
|
135
|
+
"headers": {
|
|
136
|
+
"x-log-url": "https://acme.restlessdocs.com/logs/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
137
|
+
"x-debug": "npx api debug TST-9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f"
|
|
138
|
+
},
|
|
139
|
+
"debug": {
|
|
140
|
+
"log": "https://acme.restlessdocs.com/logs/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
141
|
+
"cli": "npx api debug TST-9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
142
|
+
"recovery": "For the accepted parameters and next steps, fetch https://acme.restlessdocs.com/p/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f/unknown.md"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"note": "x-log-url carries the RAW id; only the CLI hint is prefixed."
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"id": "inject/authored-recovery",
|
|
149
|
+
"requirement": "INJECT-004",
|
|
150
|
+
"op": "debugInjection",
|
|
151
|
+
"input": {
|
|
152
|
+
"status": 402,
|
|
153
|
+
"requestId": "9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
154
|
+
"portalUrl": "https://acme.restlessdocs.com",
|
|
155
|
+
"recovery": "Try another card.",
|
|
156
|
+
"method": "POST",
|
|
157
|
+
"path": "/charge"
|
|
158
|
+
},
|
|
159
|
+
"expected": {
|
|
160
|
+
"headers": {
|
|
161
|
+
"x-log-url": "https://acme.restlessdocs.com/logs/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
162
|
+
"x-debug": "npx api debug 9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f"
|
|
163
|
+
},
|
|
164
|
+
"debug": {
|
|
165
|
+
"log": "https://acme.restlessdocs.com/logs/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
166
|
+
"cli": "npx api debug 9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
167
|
+
"recovery": "Try another card.\n\nFor the accepted parameters and next steps, fetch https://acme.restlessdocs.com/p/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f/post-charge.md"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"note": "The authored hint precedes the dig-in line, separated by a blank line."
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"id": "inject/unknown-slug",
|
|
174
|
+
"requirement": "INJECT-005",
|
|
175
|
+
"op": "debugInjection",
|
|
176
|
+
"input": {
|
|
177
|
+
"status": 404,
|
|
178
|
+
"requestId": "9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
179
|
+
"portalUrl": "https://acme.restlessdocs.com",
|
|
180
|
+
"method": "GET"
|
|
181
|
+
},
|
|
182
|
+
"expected": {
|
|
183
|
+
"headers": {
|
|
184
|
+
"x-log-url": "https://acme.restlessdocs.com/logs/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
185
|
+
"x-debug": "npx api debug 9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f"
|
|
186
|
+
},
|
|
187
|
+
"debug": {
|
|
188
|
+
"log": "https://acme.restlessdocs.com/logs/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
189
|
+
"cli": "npx api debug 9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
190
|
+
"recovery": "For the accepted parameters and next steps, fetch https://acme.restlessdocs.com/p/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f/unknown.md"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"id": "inject/trailing-slash-origin",
|
|
196
|
+
"requirement": "WIRE-023",
|
|
197
|
+
"op": "debugInjection",
|
|
198
|
+
"input": {
|
|
199
|
+
"status": 404,
|
|
200
|
+
"requestId": "9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
201
|
+
"portalUrl": "https://acme.restlessdocs.com",
|
|
202
|
+
"method": "GET",
|
|
203
|
+
"path": "/x"
|
|
204
|
+
},
|
|
205
|
+
"expected": {
|
|
206
|
+
"headers": {
|
|
207
|
+
"x-log-url": "https://acme.restlessdocs.com/logs/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
208
|
+
"x-debug": "npx api debug 9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f"
|
|
209
|
+
},
|
|
210
|
+
"debug": {
|
|
211
|
+
"log": "https://acme.restlessdocs.com/logs/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
212
|
+
"cli": "npx api debug 9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f",
|
|
213
|
+
"recovery": "For the accepted parameters and next steps, fetch https://acme.restlessdocs.com/p/9f18a0e2-1c3d-4b5a-8e7f-0a1b2c3d4e5f/get-x.md"
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"note": "The origin is stripped of trailing slashes on ingest (WIRE-023), so the SDK appends directly."
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$generated": "GENERATED FILE - do not edit by hand. Inputs live in spec/cases.ts; run `npm run spec:vectors` to regenerate.",
|
|
3
3
|
"$contract": "spec/CONTRACT.md",
|
|
4
|
-
"specVersion": "1.
|
|
4
|
+
"specVersion": "1.1.0",
|
|
5
5
|
"cases": [
|
|
6
6
|
{
|
|
7
7
|
"id": "fp/404-parameterized",
|
data/spec/vectors/har.json
CHANGED
data/spec/vectors/mask.json
CHANGED
data/spec/vectors/redact.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$generated": "GENERATED FILE - do not edit by hand. Inputs live in spec/cases.ts; run `npm run spec:vectors` to regenerate.",
|
|
3
3
|
"$contract": "spec/CONTRACT.md",
|
|
4
|
-
"specVersion": "1.
|
|
4
|
+
"specVersion": "1.1.0",
|
|
5
5
|
"cases": [
|
|
6
6
|
{
|
|
7
7
|
"id": "reqid/format-with-prefix",
|