faultmesh 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.
- package/README.md +98 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +105 -0
- package/dist/dashboard/app.js +998 -0
- package/dist/dashboard/index.html +291 -0
- package/dist/dashboard/styles.css +1120 -0
- package/dist/engine/ControlApi.d.ts +24 -0
- package/dist/engine/ControlApi.js +269 -0
- package/dist/engine/FaultMeshProxy.d.ts +16 -0
- package/dist/engine/FaultMeshProxy.js +167 -0
- package/dist/engine/TelemetryHub.d.ts +16 -0
- package/dist/engine/TelemetryHub.js +67 -0
- package/dist/engine/ToxicPipeline.d.ts +22 -0
- package/dist/engine/ToxicPipeline.js +67 -0
- package/dist/scorer/ResilienceScorer.d.ts +13 -0
- package/dist/scorer/ResilienceScorer.js +330 -0
- package/dist/scorer/SecurityAuditor.d.ts +13 -0
- package/dist/scorer/SecurityAuditor.js +428 -0
- package/dist/scorer/TrafficStormAuditor.d.ts +10 -0
- package/dist/scorer/TrafficStormAuditor.js +261 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.js +169 -0
- package/dist/toxics/BandwidthToxic.d.ts +11 -0
- package/dist/toxics/BandwidthToxic.js +36 -0
- package/dist/toxics/BaseToxic.d.ts +11 -0
- package/dist/toxics/BaseToxic.js +19 -0
- package/dist/toxics/CorruptToxic.d.ts +11 -0
- package/dist/toxics/CorruptToxic.js +53 -0
- package/dist/toxics/CutToxic.d.ts +9 -0
- package/dist/toxics/CutToxic.js +31 -0
- package/dist/toxics/LatencyToxic.d.ts +13 -0
- package/dist/toxics/LatencyToxic.js +40 -0
- package/dist/toxics/StatusToxic.d.ts +9 -0
- package/dist/toxics/StatusToxic.js +22 -0
- package/dist/types.d.ts +123 -0
- package/dist/types.js +4 -0
- package/package.json +35 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>FaultMesh — Network Reliability & Security Testing Suite</title>
|
|
7
|
+
<link rel="stylesheet" href="styles.css">
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
|
|
11
|
+
<!-- Full-Width Header -->
|
|
12
|
+
<header class="app-header">
|
|
13
|
+
<div class="header-content">
|
|
14
|
+
<div class="header-left">
|
|
15
|
+
<span class="app-name">FaultMesh</span>
|
|
16
|
+
<span class="app-divider">/</span>
|
|
17
|
+
<span class="app-tagline">Automated API Resilience & Security Audit Engine</span>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="header-right">
|
|
20
|
+
<span class="proxy-status">Proxy on <strong>127.0.0.1:3001</strong> → Target on <strong>127.0.0.1:4000</strong></span>
|
|
21
|
+
<button id="themeToggle" class="btn-text">Switch Theme</button>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</header>
|
|
25
|
+
|
|
26
|
+
<!-- Main Full-Width Container -->
|
|
27
|
+
<main class="container">
|
|
28
|
+
|
|
29
|
+
<!-- ====================================================================
|
|
30
|
+
HERO SECTION: AUTOMATED AUDIT & DIAGNOSTICS SUITE (PRIMARY FEATURE)
|
|
31
|
+
==================================================================== -->
|
|
32
|
+
<section class="section-box audit-suite-card">
|
|
33
|
+
|
|
34
|
+
<!-- Suite Header & Mode Tabs -->
|
|
35
|
+
<div class="audit-header-bar">
|
|
36
|
+
<div class="audit-title-area">
|
|
37
|
+
<div class="badge-row">
|
|
38
|
+
<span class="suite-badge">PRIMARY AUDIT SUITE</span>
|
|
39
|
+
</div>
|
|
40
|
+
<h2 id="diagHeaderTitle">Automated API Resilience Benchmark</h2>
|
|
41
|
+
<p id="diagHeaderSubtitle">Automated 5-point test suite evaluating client resilience against network delay, throttling, cuts, corruptions, and 503 outages.</p>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div class="diag-tabs">
|
|
45
|
+
<button id="tabResilience" class="diag-tab active" type="button">Network Resilience (5 Checks)</button>
|
|
46
|
+
<button id="tabSecurity" class="diag-tab" type="button">Security & Protocol (7 Checks)</button>
|
|
47
|
+
<button id="tabStorm" class="diag-tab" type="button">Traffic Storms & DoS (4 Checks)</button>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<!-- Audit Banner: Score Summary & Action Runner -->
|
|
52
|
+
<div class="audit-banner">
|
|
53
|
+
<div class="score-summary">
|
|
54
|
+
<div class="score-pill">
|
|
55
|
+
<span id="scoreValue" class="score-number">--</span>
|
|
56
|
+
<span id="scoreGrade" class="score-label">UNTESTED</span>
|
|
57
|
+
</div>
|
|
58
|
+
<div class="score-text">
|
|
59
|
+
<strong id="scoreTitle">Ready to evaluate</strong>
|
|
60
|
+
<p id="scoreSubtitle">Select a target profile and click "Run Benchmark" to execute all 5 checks below.</p>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div class="diagnostics-actions">
|
|
65
|
+
<select id="testTargetProfile" class="form-input select-profile" title="Target App Profile">
|
|
66
|
+
<option value="resilient">Target: Resilient App (Grade A)</option>
|
|
67
|
+
<option value="fragile">Target: Fragile App (Grade F)</option>
|
|
68
|
+
</select>
|
|
69
|
+
<button id="btnRunDiagnostics" class="btn-primary btn-run-diagnostics">Run 5-Point Benchmark</button>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<!-- Test Checklist & Results Area (Informs all checks upfront!) -->
|
|
74
|
+
<div class="checklist-container">
|
|
75
|
+
<div class="checklist-header">
|
|
76
|
+
<span class="checklist-title">Verification Criteria</span>
|
|
77
|
+
<span id="checklistCountTag" class="count-tag">5 checks ready</span>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div id="diagnosticsResults" class="test-results-list">
|
|
81
|
+
<!-- Populated by JS upfront and updated on run -->
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
</section>
|
|
86
|
+
|
|
87
|
+
<!-- ====================================================================
|
|
88
|
+
WORKBENCH SECTION: MANUAL SIMULATION & RESPONSE INSPECTION
|
|
89
|
+
==================================================================== -->
|
|
90
|
+
<div class="workbench-section-header">
|
|
91
|
+
<div class="workbench-title-group">
|
|
92
|
+
<span class="workbench-badge">CHAOS SANDBOX</span>
|
|
93
|
+
<h3>Developer Workbench & Live Request Inspector</h3>
|
|
94
|
+
</div>
|
|
95
|
+
<p>Manual fault injection and single-request debugging environment. Inject custom conditions into <strong>http://localhost:3001</strong> or test ad-hoc endpoints.</p>
|
|
96
|
+
</div>
|
|
97
|
+
|
|
98
|
+
<div class="columns-grid">
|
|
99
|
+
|
|
100
|
+
<!-- Left Column: All Rule Adders & Active State -->
|
|
101
|
+
<div class="column">
|
|
102
|
+
<section class="section-box">
|
|
103
|
+
<div class="section-header">
|
|
104
|
+
<h2>Network Fault Simulator (Manual Injections)</h2>
|
|
105
|
+
<p>Inject real-world network conditions into all traffic passing through <strong>http://localhost:3001</strong>.</p>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<!-- 1-Click Presets -->
|
|
109
|
+
<div class="adder-subgroup">
|
|
110
|
+
<div class="subgroup-label">1-Click Quick Presets</div>
|
|
111
|
+
<div class="scenario-table">
|
|
112
|
+
<div class="scenario-row">
|
|
113
|
+
<div class="scenario-desc">
|
|
114
|
+
<strong>Slow Mobile Internet</strong>
|
|
115
|
+
<span>16 KB/s speed cap + 350ms delay.</span>
|
|
116
|
+
</div>
|
|
117
|
+
<button id="btnPresetSlowMobile" class="btn-secondary" title="Activate rule and send test request">Enable & Test</button>
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
<div class="scenario-row">
|
|
121
|
+
<div class="scenario-desc">
|
|
122
|
+
<strong>Connection Drop</strong>
|
|
123
|
+
<span>Abruptly closes socket after transferring 30 bytes.</span>
|
|
124
|
+
</div>
|
|
125
|
+
<button id="btnPresetDisconnect" class="btn-secondary" title="Activate rule and send test request">Enable & Test</button>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
<div class="scenario-row">
|
|
129
|
+
<div class="scenario-desc">
|
|
130
|
+
<strong>Server Outage (503)</strong>
|
|
131
|
+
<span>Forces proxy to return HTTP 503 Service Unavailable.</span>
|
|
132
|
+
</div>
|
|
133
|
+
<button id="btnPresetOutage" class="btn-secondary" title="Activate rule and send test request">Enable & Test</button>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
<div class="scenario-row">
|
|
137
|
+
<div class="scenario-desc">
|
|
138
|
+
<strong>Corrupted Response</strong>
|
|
139
|
+
<span>Truncates JSON payload to test client parsing resilience.</span>
|
|
140
|
+
</div>
|
|
141
|
+
<button id="btnPresetCorrupt" class="btn-secondary" title="Activate rule and send test request">Enable & Test</button>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<!-- Custom Rule Builder -->
|
|
147
|
+
<div class="adder-subgroup custom-rule-section">
|
|
148
|
+
<div class="subgroup-label">Custom Rule Builder</div>
|
|
149
|
+
<form id="customRuleForm" class="form-layout">
|
|
150
|
+
<div class="form-row">
|
|
151
|
+
<div class="form-field">
|
|
152
|
+
<label for="ruleTypeSelect">Condition</label>
|
|
153
|
+
<select id="ruleTypeSelect" class="form-input">
|
|
154
|
+
<option value="latency">Add Network Delay (Latency)</option>
|
|
155
|
+
<option value="bandwidth">Limit Bandwidth (Speed Throttling)</option>
|
|
156
|
+
<option value="cut">Drop Connection Mid-Download</option>
|
|
157
|
+
<option value="corrupt">Corrupt Data (Truncate JSON)</option>
|
|
158
|
+
<option value="status">Force HTTP Status Code</option>
|
|
159
|
+
</select>
|
|
160
|
+
</div>
|
|
161
|
+
|
|
162
|
+
<div class="form-field">
|
|
163
|
+
<label for="ruleDirectionSelect">Direction</label>
|
|
164
|
+
<select id="ruleDirectionSelect" class="form-input">
|
|
165
|
+
<option value="downstream">Responses (to client)</option>
|
|
166
|
+
<option value="upstream">Requests (to server)</option>
|
|
167
|
+
</select>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
<div id="dynamicRuleInputs" class="dynamic-row">
|
|
172
|
+
<!-- Rendered by JS -->
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
<button type="submit" class="btn-secondary btn-full">Add & Activate Rule</button>
|
|
176
|
+
</form>
|
|
177
|
+
</div>
|
|
178
|
+
</section>
|
|
179
|
+
|
|
180
|
+
<!-- Current Active Rules -->
|
|
181
|
+
<section class="section-box">
|
|
182
|
+
<div class="section-header header-with-badge">
|
|
183
|
+
<div>
|
|
184
|
+
<h2>Active Simulation Rules</h2>
|
|
185
|
+
<p>Rules currently altering traffic passing through the proxy.</p>
|
|
186
|
+
</div>
|
|
187
|
+
<div style="display: flex; align-items: center; gap: 8px;">
|
|
188
|
+
<span id="activeRulesCount" class="count-tag">0 active</span>
|
|
189
|
+
<button id="btnClearAllRules" class="btn-remove btn-sm" title="Clear all active rules">Reset All</button>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
|
|
193
|
+
<div id="activeRulesList" class="rules-list">
|
|
194
|
+
<div class="empty-state">No rules active. All traffic passes through normally.</div>
|
|
195
|
+
</div>
|
|
196
|
+
</section>
|
|
197
|
+
</div>
|
|
198
|
+
|
|
199
|
+
<!-- Right Column: Response Inspector -->
|
|
200
|
+
<div class="column">
|
|
201
|
+
<section id="responseInspector" class="section-box response-inspector-card">
|
|
202
|
+
<div class="section-header header-with-action">
|
|
203
|
+
<div>
|
|
204
|
+
<h2>Response Inspector (Live Testing)</h2>
|
|
205
|
+
<p>Inspect responses sent through middleman proxy (<code>http://localhost:3001</code>).</p>
|
|
206
|
+
</div>
|
|
207
|
+
<button id="btnCloseResponse" class="btn-text" title="Clear response viewer">Clear</button>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<!-- Test Action Bar (Endpoint Select + Send Button) -->
|
|
211
|
+
<div class="inspector-controls">
|
|
212
|
+
<select id="testEndpointSelect" class="form-input inspector-select">
|
|
213
|
+
<option value="/api/data">GET /api/data (Normal API)</option>
|
|
214
|
+
<option value="/api/users">GET /api/users (User Records)</option>
|
|
215
|
+
<option value="/api/crash">GET /api/crash (Crashing Server 500)</option>
|
|
216
|
+
</select>
|
|
217
|
+
<button id="btnSendTestRequest" class="btn-primary">Send Test Request</button>
|
|
218
|
+
</div>
|
|
219
|
+
|
|
220
|
+
<!-- Response Status & Metadata Bar -->
|
|
221
|
+
<div class="response-meta-bar">
|
|
222
|
+
<div class="meta-item">
|
|
223
|
+
<span class="meta-label">Status:</span>
|
|
224
|
+
<span id="respStatusBadge" class="status-pill">Ready</span>
|
|
225
|
+
</div>
|
|
226
|
+
<div class="meta-item">
|
|
227
|
+
<span class="meta-label">Time:</span>
|
|
228
|
+
<span id="respDuration" class="response-meta">-- ms</span>
|
|
229
|
+
</div>
|
|
230
|
+
<div class="meta-item">
|
|
231
|
+
<span id="respAppliedRule" class="response-meta-rule">Rule: None</span>
|
|
232
|
+
</div>
|
|
233
|
+
<div class="meta-item" style="margin-left: auto;">
|
|
234
|
+
<span id="activeRulesIndicator" class="active-rules-pill">Traffic: Normal</span>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
|
|
238
|
+
<!-- Feedback Status Text -->
|
|
239
|
+
<div id="testFeedback" class="test-status-text">Click "Send Test Request" or enable any scenario on the left to inspect responses.</div>
|
|
240
|
+
|
|
241
|
+
<!-- Formatted Response Payload Viewer -->
|
|
242
|
+
<div class="response-body-wrapper">
|
|
243
|
+
<pre id="responseBodyViewer" class="response-body-pre">(No response received yet. Select an endpoint above or click "Enable & Test" on any scenario on the left.)</pre>
|
|
244
|
+
</div>
|
|
245
|
+
|
|
246
|
+
<!-- Terminal Helper Footnote -->
|
|
247
|
+
<div class="inspector-footer">
|
|
248
|
+
<span>Terminal: <code>curl -i http://localhost:3001/api/data</code></span>
|
|
249
|
+
</div>
|
|
250
|
+
</section>
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
</div>
|
|
254
|
+
|
|
255
|
+
<!-- ====================================================================
|
|
256
|
+
BOTTOM FULL-WIDTH SECTION: LIVE TRAFFIC LOG
|
|
257
|
+
==================================================================== -->
|
|
258
|
+
<section class="section-box full-width-log-section">
|
|
259
|
+
<div class="section-header header-with-action">
|
|
260
|
+
<div>
|
|
261
|
+
<h2>Live Traffic Log</h2>
|
|
262
|
+
<p>Real-time HTTP requests routed through proxy (<code>127.0.0.1:3001</code>).</p>
|
|
263
|
+
</div>
|
|
264
|
+
<button id="btnClearLog" class="btn-text">Clear Log</button>
|
|
265
|
+
</div>
|
|
266
|
+
|
|
267
|
+
<div class="table-container full-width-table-container">
|
|
268
|
+
<table class="log-table">
|
|
269
|
+
<thead>
|
|
270
|
+
<tr>
|
|
271
|
+
<th style="width: 80px;">Method</th>
|
|
272
|
+
<th>Path</th>
|
|
273
|
+
<th style="width: 90px;">Status</th>
|
|
274
|
+
<th>Applied Rule</th>
|
|
275
|
+
<th style="width: 90px; text-align: right;">Time</th>
|
|
276
|
+
</tr>
|
|
277
|
+
</thead>
|
|
278
|
+
<tbody id="activityFeed">
|
|
279
|
+
<tr>
|
|
280
|
+
<td colspan="5" class="table-empty">Listening for requests through http://127.0.0.1:3001...</td>
|
|
281
|
+
</tr>
|
|
282
|
+
</tbody>
|
|
283
|
+
</table>
|
|
284
|
+
</div>
|
|
285
|
+
</section>
|
|
286
|
+
|
|
287
|
+
</main>
|
|
288
|
+
|
|
289
|
+
<script src="app.js"></script>
|
|
290
|
+
</body>
|
|
291
|
+
</html>
|