@zintrust/workers 2.0.4 → 2.1.3
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/dist/build-manifest.json +545 -0
- package/dist/dashboard/workers-api.js +4 -3
- package/dist/helper/index.d.ts +5 -0
- package/dist/helper/index.js +51 -0
- package/dist/http/WorkerApiController.js +28 -3
- package/package.json +2 -2
- package/src/dashboard/workers-api.ts +4 -3
- package/src/helper/index.ts +60 -0
- package/src/http/WorkerApiController.ts +36 -3
- package/src/storage/WorkerStore.ts +1 -1
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zintrust/workers",
|
|
3
|
+
"version": "2.1.3",
|
|
4
|
+
"buildDate": "2026-05-27T03:58:26.073Z",
|
|
5
|
+
"buildEnvironment": {
|
|
6
|
+
"node": "v22.22.1",
|
|
7
|
+
"platform": "darwin",
|
|
8
|
+
"arch": "arm64"
|
|
9
|
+
},
|
|
10
|
+
"git": {
|
|
11
|
+
"commit": "c82f6263",
|
|
12
|
+
"branch": "release"
|
|
13
|
+
},
|
|
14
|
+
"package": {
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=20.0.0"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": [
|
|
19
|
+
"@opentelemetry/api",
|
|
20
|
+
"hot-shots",
|
|
21
|
+
"ioredis",
|
|
22
|
+
"prom-client",
|
|
23
|
+
"simple-statistics"
|
|
24
|
+
],
|
|
25
|
+
"peerDependencies": [
|
|
26
|
+
"@zintrust/core",
|
|
27
|
+
"@zintrust/queue-monitor",
|
|
28
|
+
"@zintrust/queue-redis"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"files": {
|
|
32
|
+
"AnomalyDetection.d.ts": {
|
|
33
|
+
"size": 2795,
|
|
34
|
+
"sha256": "b040ec01b09c539ec294b76ecd6602dff75c8c58e7c915732bc710c869232e51"
|
|
35
|
+
},
|
|
36
|
+
"AnomalyDetection.js": {
|
|
37
|
+
"size": 11102,
|
|
38
|
+
"sha256": "71a38555af08a60a14f411602a6548f5d46a7d97a6be8e89e313b093813984fc"
|
|
39
|
+
},
|
|
40
|
+
"AutoScaler.d.ts": {
|
|
41
|
+
"size": 3238,
|
|
42
|
+
"sha256": "750bcddc3ccb2747d883e9a2f503035144f753419c92c4f4bd5973baa8811b4c"
|
|
43
|
+
},
|
|
44
|
+
"AutoScaler.js": {
|
|
45
|
+
"size": 15949,
|
|
46
|
+
"sha256": "779a41c17d238e2d6341cc1e9f235fe04f2b81faf07f01a25c14203dededc41a"
|
|
47
|
+
},
|
|
48
|
+
"BroadcastWorker.d.ts": {
|
|
49
|
+
"size": 934,
|
|
50
|
+
"sha256": "ea5b05820fdd30d80f4483f476e400c78fa842ebbb29a442b2f1261dc0b2de8a"
|
|
51
|
+
},
|
|
52
|
+
"BroadcastWorker.js": {
|
|
53
|
+
"size": 1932,
|
|
54
|
+
"sha256": "d1a1631e1aafc0d9287b646d673d895ad43135b6e5402afe9bdffb1a06f6b356"
|
|
55
|
+
},
|
|
56
|
+
"CanaryController.d.ts": {
|
|
57
|
+
"size": 2750,
|
|
58
|
+
"sha256": "1a371a5b026858f3c50f8f9f64517dc113bdbd7d18120b0e28f2c723c9680afe"
|
|
59
|
+
},
|
|
60
|
+
"CanaryController.js": {
|
|
61
|
+
"size": 15398,
|
|
62
|
+
"sha256": "bcac59ac85f2d9c0455b5b8ecef8e9c3a8fd13b19ccab6ccc2e0067379c60d0f"
|
|
63
|
+
},
|
|
64
|
+
"ChaosEngineering.d.ts": {
|
|
65
|
+
"size": 2121,
|
|
66
|
+
"sha256": "83962b97a263e1824b86d5dc99ae6aae0d0535271e824525a9a251a51193cf69"
|
|
67
|
+
},
|
|
68
|
+
"ChaosEngineering.js": {
|
|
69
|
+
"size": 8697,
|
|
70
|
+
"sha256": "3e21e54904c34002be3c6efbe8ae60008634dca39b60cb4112a243582ca74af8"
|
|
71
|
+
},
|
|
72
|
+
"CircuitBreaker.d.ts": {
|
|
73
|
+
"size": 3007,
|
|
74
|
+
"sha256": "32a773512d6fd743affb19fd1a3e452ae208967a60f26cc932f6588191505e46"
|
|
75
|
+
},
|
|
76
|
+
"CircuitBreaker.js": {
|
|
77
|
+
"size": 11834,
|
|
78
|
+
"sha256": "3f97215f2efaee03f87ef13f4ebcc10edd517111b75e2457a3e8926f413eb001"
|
|
79
|
+
},
|
|
80
|
+
"ClusterLock.d.ts": {
|
|
81
|
+
"size": 2272,
|
|
82
|
+
"sha256": "b4626244ba2d460baceff300e18bcc1d03977f7048e27198b7506a58108ce963"
|
|
83
|
+
},
|
|
84
|
+
"ClusterLock.js": {
|
|
85
|
+
"size": 13656,
|
|
86
|
+
"sha256": "c717ace89063b1f499137481d4c491aa432b8ec478e0397a4941cf0a2a0f32d2"
|
|
87
|
+
},
|
|
88
|
+
"ComplianceManager.d.ts": {
|
|
89
|
+
"size": 5148,
|
|
90
|
+
"sha256": "41502b754cd71a8ddccfaceb8521299d016ba1d830ef7781ebfa99c69defa276"
|
|
91
|
+
},
|
|
92
|
+
"ComplianceManager.js": {
|
|
93
|
+
"size": 19779,
|
|
94
|
+
"sha256": "691f735c711699df300e0b8226ed76065d1ce43bf086b519c23a1b7861882cc0"
|
|
95
|
+
},
|
|
96
|
+
"DatacenterOrchestrator.d.ts": {
|
|
97
|
+
"size": 3532,
|
|
98
|
+
"sha256": "d0366dd0cf018bbc0d1dfff3b6ac0c5b6e5c3c12dd1469222c0e4f19f1230e80"
|
|
99
|
+
},
|
|
100
|
+
"DatacenterOrchestrator.js": {
|
|
101
|
+
"size": 14576,
|
|
102
|
+
"sha256": "d7a1d141822e5e0da0efe7d8960aa7c1b0763fbbac4137d8b5047591dcfa67f9"
|
|
103
|
+
},
|
|
104
|
+
"DeadLetterQueue.d.ts": {
|
|
105
|
+
"size": 3553,
|
|
106
|
+
"sha256": "c63f44497fbb6312cfbbe28c92c6976dc265e736d76579cbb26bd29e09e93959"
|
|
107
|
+
},
|
|
108
|
+
"DeadLetterQueue.js": {
|
|
109
|
+
"size": 20221,
|
|
110
|
+
"sha256": "8fa4ad2d83af2c3b3f651a2ea42b6792d27c4b6daa0b3a8035de4de585248bc3"
|
|
111
|
+
},
|
|
112
|
+
"HealthMonitor.d.ts": {
|
|
113
|
+
"size": 1485,
|
|
114
|
+
"sha256": "5767e2d2dba4f734baf34770e6128ee75ee2816eb114f5d2c398cc1be844d2ab"
|
|
115
|
+
},
|
|
116
|
+
"HealthMonitor.js": {
|
|
117
|
+
"size": 9703,
|
|
118
|
+
"sha256": "1ba2e3e99c48c563977e3ae36ecebff0e1deaa2381296a1ebc8e4e836b71b507"
|
|
119
|
+
},
|
|
120
|
+
"MultiQueueWorker.d.ts": {
|
|
121
|
+
"size": 2311,
|
|
122
|
+
"sha256": "45d2b0a22c187de40aaf8d26ec69b051ae1fc08eff0c200dd93ed03e2406c066"
|
|
123
|
+
},
|
|
124
|
+
"MultiQueueWorker.js": {
|
|
125
|
+
"size": 12155,
|
|
126
|
+
"sha256": "bddeba5715c69c6c52f22294c47fd6e66e78eeb779386ba81636696dcfe616bd"
|
|
127
|
+
},
|
|
128
|
+
"NotificationWorker.d.ts": {
|
|
129
|
+
"size": 952,
|
|
130
|
+
"sha256": "facdae5d7e82364ad9aab4398f8a3f8b5be8d8e9cb3aaa18fde76a88cd05b959"
|
|
131
|
+
},
|
|
132
|
+
"NotificationWorker.js": {
|
|
133
|
+
"size": 833,
|
|
134
|
+
"sha256": "942898be903425a8c76a1cf880e9cccb41472e6ae6b19934985da6fab263932f"
|
|
135
|
+
},
|
|
136
|
+
"Observability.d.ts": {
|
|
137
|
+
"size": 4287,
|
|
138
|
+
"sha256": "067f18ec8cd5a7d3a54478b54179b6cebb210ce9edd27cdbf6f6bd387cb39a6d"
|
|
139
|
+
},
|
|
140
|
+
"Observability.js": {
|
|
141
|
+
"size": 17470,
|
|
142
|
+
"sha256": "6d8f204454b2ff639ff4c0ec49a04481a8ad7df5c89fabd3a8f07c8a6d25eb09"
|
|
143
|
+
},
|
|
144
|
+
"PluginManager.d.ts": {
|
|
145
|
+
"size": 3263,
|
|
146
|
+
"sha256": "0e4f17a61d0e4f746af4104e84b5a154ebe8d4d1f55ee2fdd34940f0354105bf"
|
|
147
|
+
},
|
|
148
|
+
"PluginManager.js": {
|
|
149
|
+
"size": 13318,
|
|
150
|
+
"sha256": "6c2a197be571b81cae8016df7c681f53029f125260fb50a10c208a80c9694326"
|
|
151
|
+
},
|
|
152
|
+
"PriorityQueue.d.ts": {
|
|
153
|
+
"size": 3210,
|
|
154
|
+
"sha256": "4a3ef407f832a0cfbea19039a3aad3dbdbcf28cbd883fbbe4a429a0bd9bc8fb8"
|
|
155
|
+
},
|
|
156
|
+
"PriorityQueue.js": {
|
|
157
|
+
"size": 8958,
|
|
158
|
+
"sha256": "3f97bd591ccd8adaf67b2adc514004f4a65d407e68b555c0bdabf4210d2a6cf4"
|
|
159
|
+
},
|
|
160
|
+
"ResourceMonitor.d.ts": {
|
|
161
|
+
"size": 4019,
|
|
162
|
+
"sha256": "97e85eb898813f03871bd3bc0b9dbe67777feb198366b27b01a5281224135e79"
|
|
163
|
+
},
|
|
164
|
+
"ResourceMonitor.js": {
|
|
165
|
+
"size": 19684,
|
|
166
|
+
"sha256": "3ae42ff5538ccd3e1a83830281b497fd612bdafa17e06a69d6a9073ae945cbe6"
|
|
167
|
+
},
|
|
168
|
+
"SLAMonitor.d.ts": {
|
|
169
|
+
"size": 2727,
|
|
170
|
+
"sha256": "36a6dfc9937915e4fa4ec21b17358580affd6cce05607a3a2b5796e6038f0be6"
|
|
171
|
+
},
|
|
172
|
+
"SLAMonitor.js": {
|
|
173
|
+
"size": 10260,
|
|
174
|
+
"sha256": "64340fcc2e395cd52fef0e6d73551ec7a88964eaae806415ee2201aca10996cb"
|
|
175
|
+
},
|
|
176
|
+
"WorkerFactory.d.ts": {
|
|
177
|
+
"size": 7764,
|
|
178
|
+
"sha256": "ea53fa39f3cec0f5841cf1ff556a41a70747b40cc64e8c9190e10ff360acc786"
|
|
179
|
+
},
|
|
180
|
+
"WorkerFactory.js": {
|
|
181
|
+
"size": 111750,
|
|
182
|
+
"sha256": "61803d40f7ba42f9cf2b0b4b8c0a1c8f2ca2e1e0d1045e755299febb867caa6e"
|
|
183
|
+
},
|
|
184
|
+
"WorkerInit.d.ts": {
|
|
185
|
+
"size": 3284,
|
|
186
|
+
"sha256": "f902550cda7fca36f2db6297d39a4339ed6b5ff1c738da867233309cf0ca8fe1"
|
|
187
|
+
},
|
|
188
|
+
"WorkerInit.js": {
|
|
189
|
+
"size": 14576,
|
|
190
|
+
"sha256": "6a9a5977b2003924237784a9522195c65a1b7b779272967f861b6e73f531d956"
|
|
191
|
+
},
|
|
192
|
+
"WorkerMetrics.d.ts": {
|
|
193
|
+
"size": 3310,
|
|
194
|
+
"sha256": "82ade8313029af05b4230e7968108c8b530cd86a4e9a385fc31c4ccb36108746"
|
|
195
|
+
},
|
|
196
|
+
"WorkerMetrics.js": {
|
|
197
|
+
"size": 20709,
|
|
198
|
+
"sha256": "4249c995cccac30b25d78fa627c26dca98c2147d9729d824859ee57d1a269913"
|
|
199
|
+
},
|
|
200
|
+
"WorkerRegistry.d.ts": {
|
|
201
|
+
"size": 3949,
|
|
202
|
+
"sha256": "2a3ac9f9a41e147a0866ca95e553b15cb9ac1c3821d5d1175a7a39b16d82ab53"
|
|
203
|
+
},
|
|
204
|
+
"WorkerRegistry.js": {
|
|
205
|
+
"size": 12751,
|
|
206
|
+
"sha256": "2cc1b7473b6ace33769ef3dfd9a9ac083d41729c497ef590767989217a7a6c8e"
|
|
207
|
+
},
|
|
208
|
+
"WorkerShutdown.d.ts": {
|
|
209
|
+
"size": 1881,
|
|
210
|
+
"sha256": "84990e17667303d439abb3df4e0b127099df540aed820bbddf0ef53220493710"
|
|
211
|
+
},
|
|
212
|
+
"WorkerShutdown.js": {
|
|
213
|
+
"size": 7718,
|
|
214
|
+
"sha256": "a5960394b6ac9ad9b591befae9607f2ccdb5c70604e7449a6cec2aebafeeaaff"
|
|
215
|
+
},
|
|
216
|
+
"WorkerVersioning.d.ts": {
|
|
217
|
+
"size": 2881,
|
|
218
|
+
"sha256": "a3f1f9e518e8a46201b181679bb5d7a484da7c021b4b7cfd5653cf98fe36e995"
|
|
219
|
+
},
|
|
220
|
+
"WorkerVersioning.js": {
|
|
221
|
+
"size": 11000,
|
|
222
|
+
"sha256": "9aedd369e9a3e409845929da17e14975bbc53a3ed1f6eebf62b464dda170a5bb"
|
|
223
|
+
},
|
|
224
|
+
"config/workerConfig.d.ts": {
|
|
225
|
+
"size": 282,
|
|
226
|
+
"sha256": "4671566a0cba372852c049ba66f7671ec19f5db38b0eaed1815eb532e7d58109"
|
|
227
|
+
},
|
|
228
|
+
"config/workerConfig.js": {
|
|
229
|
+
"size": 3292,
|
|
230
|
+
"sha256": "f071a7f6c2f889355461c6573a433f961a93afdebc8c2a34a584578c73495799"
|
|
231
|
+
},
|
|
232
|
+
"createQueueWorker.d.ts": {
|
|
233
|
+
"size": 1031,
|
|
234
|
+
"sha256": "dacd49f6c112eba439bdd9bb457eea90daedbf32efc381cd3189ce562fa5b0a8"
|
|
235
|
+
},
|
|
236
|
+
"createQueueWorker.js": {
|
|
237
|
+
"size": 15004,
|
|
238
|
+
"sha256": "e41845c999b360d7803f04bc255636a74821eff3a406f1a9b60a3fd3edbde274"
|
|
239
|
+
},
|
|
240
|
+
"dashboard/index.d.ts": {
|
|
241
|
+
"size": 109,
|
|
242
|
+
"sha256": "4fea5fea7f7c1a49fbae855a3c3d8b3ad00c862af595dfa821b3d4e1d26e485e"
|
|
243
|
+
},
|
|
244
|
+
"dashboard/index.js": {
|
|
245
|
+
"size": 11,
|
|
246
|
+
"sha256": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"
|
|
247
|
+
},
|
|
248
|
+
"dashboard/types.d.ts": {
|
|
249
|
+
"size": 3357,
|
|
250
|
+
"sha256": "0139cbba2f8643a6a2fff96965c58d908c967b7db2c2498c575f5b82b726b26b"
|
|
251
|
+
},
|
|
252
|
+
"dashboard/types.js": {
|
|
253
|
+
"size": 11,
|
|
254
|
+
"sha256": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"
|
|
255
|
+
},
|
|
256
|
+
"dashboard/workers-api.d.ts": {
|
|
257
|
+
"size": 353,
|
|
258
|
+
"sha256": "8e0e04329e1119d8ae835dd4458efead084293bcc2c263c09dd5a19d467e5ca4"
|
|
259
|
+
},
|
|
260
|
+
"dashboard/workers-api.js": {
|
|
261
|
+
"size": 33075,
|
|
262
|
+
"sha256": "567dbd849ade85b49992f695dfa5ccf008bf035c01d9adeb5ce56a8f7134ab36"
|
|
263
|
+
},
|
|
264
|
+
"helper/index.d.ts": {
|
|
265
|
+
"size": 475,
|
|
266
|
+
"sha256": "d48c326e1087a72c948c25d1aa322492be33c67592414791802f4588553a56db"
|
|
267
|
+
},
|
|
268
|
+
"helper/index.js": {
|
|
269
|
+
"size": 1904,
|
|
270
|
+
"sha256": "b17a601d864c3a32150b82eeb875175b40588cb79cd70d9d2c8617e23d28a6b2"
|
|
271
|
+
},
|
|
272
|
+
"http/WorkerApiController.d.ts": {
|
|
273
|
+
"size": 1722,
|
|
274
|
+
"sha256": "6331098fcf4f369ffcf6173b1aeb4b76b62995b5e5d76a9f148985952b87a48d"
|
|
275
|
+
},
|
|
276
|
+
"http/WorkerApiController.js": {
|
|
277
|
+
"size": 12112,
|
|
278
|
+
"sha256": "a0b5fad8e141cf1c4550b77d38dc018866974e91ae58760d7204f3469e019e37"
|
|
279
|
+
},
|
|
280
|
+
"http/WorkerController.d.ts": {
|
|
281
|
+
"size": 16824,
|
|
282
|
+
"sha256": "48e9a6b0ec9d5821622e231f3ac6d6343eb86da30b4e95675f226f6c47d76996"
|
|
283
|
+
},
|
|
284
|
+
"http/WorkerController.js": {
|
|
285
|
+
"size": 51990,
|
|
286
|
+
"sha256": "c5d8f95f560df5a19dcefc2ee1e25ed1cba0194597323ff68ecc05a7dffeb2fd"
|
|
287
|
+
},
|
|
288
|
+
"http/WorkerMonitoringService.d.ts": {
|
|
289
|
+
"size": 302,
|
|
290
|
+
"sha256": "9817267882d71db55d692fc7092a1ed2aee99e379b238f82d600315c36f2ded8"
|
|
291
|
+
},
|
|
292
|
+
"http/WorkerMonitoringService.js": {
|
|
293
|
+
"size": 2796,
|
|
294
|
+
"sha256": "18e8ca62d1d296286181224d3b73c7b4d25b81661e1be4933ecd37513d0aa120"
|
|
295
|
+
},
|
|
296
|
+
"http/middleware/CustomValidation.d.ts": {
|
|
297
|
+
"size": 2272,
|
|
298
|
+
"sha256": "53128b2b35360ec70bf1723d616d7513fd51d5bc7299b5476235040ec756a436"
|
|
299
|
+
},
|
|
300
|
+
"http/middleware/CustomValidation.js": {
|
|
301
|
+
"size": 8869,
|
|
302
|
+
"sha256": "f72aaa1f68f628c32738de5b5aa67fd2c5b8f494e6b6fe9c7026f6d0ad1a41be"
|
|
303
|
+
},
|
|
304
|
+
"http/middleware/DatacenterValidator.d.ts": {
|
|
305
|
+
"size": 236,
|
|
306
|
+
"sha256": "e077974b14ec62cfea69880a625ab79c96e611f6c7240326de53f43ef30b1623"
|
|
307
|
+
},
|
|
308
|
+
"http/middleware/DatacenterValidator.js": {
|
|
309
|
+
"size": 3678,
|
|
310
|
+
"sha256": "d814fe449e762b99597c7b8858953f1f286a5a5e23345ff95ff44b73b1b86829"
|
|
311
|
+
},
|
|
312
|
+
"http/middleware/EditWorkerValidation.d.ts": {
|
|
313
|
+
"size": 379,
|
|
314
|
+
"sha256": "ff697ff850d7bf581f09e2a85158ef15c762cc112f892636c8877b710b68f399"
|
|
315
|
+
},
|
|
316
|
+
"http/middleware/EditWorkerValidation.js": {
|
|
317
|
+
"size": 2540,
|
|
318
|
+
"sha256": "cc9c412d7818e0b227908070281fa7620ee6758e09066a83200407784f6cc7f5"
|
|
319
|
+
},
|
|
320
|
+
"http/middleware/FeaturesValidator.d.ts": {
|
|
321
|
+
"size": 234,
|
|
322
|
+
"sha256": "5b18a31f377b1bbb33d0b357de0fd3d84cfe5494edcee7ad23b4559580669219"
|
|
323
|
+
},
|
|
324
|
+
"http/middleware/FeaturesValidator.js": {
|
|
325
|
+
"size": 2314,
|
|
326
|
+
"sha256": "564e1f7f55acbed8b9e634189d3fb9c4eb52a3f6fb85c40e86d3644db8cc8b24"
|
|
327
|
+
},
|
|
328
|
+
"http/middleware/InfrastructureValidator.d.ts": {
|
|
329
|
+
"size": 768,
|
|
330
|
+
"sha256": "c999738670cbd87af2a4efa79b55f8f08a41a82c6e43af77673c48d9b1b2db6c"
|
|
331
|
+
},
|
|
332
|
+
"http/middleware/InfrastructureValidator.js": {
|
|
333
|
+
"size": 8794,
|
|
334
|
+
"sha256": "d831d3a2b7abe5eb8ceb50b87ca35aa6084b3f78a67fd5022f6bf7fb6567977f"
|
|
335
|
+
},
|
|
336
|
+
"http/middleware/OptionsValidator.d.ts": {
|
|
337
|
+
"size": 233,
|
|
338
|
+
"sha256": "3bad3711078920bf536434a982d8a1cb53f3a3d06302fd638776e01497edb14b"
|
|
339
|
+
},
|
|
340
|
+
"http/middleware/OptionsValidator.js": {
|
|
341
|
+
"size": 4025,
|
|
342
|
+
"sha256": "6cef193c5bae7522ce891a4439e5cd4020c6da6ad187de6ff0b48e4733fb886d"
|
|
343
|
+
},
|
|
344
|
+
"http/middleware/PayloadSanitizer.d.ts": {
|
|
345
|
+
"size": 396,
|
|
346
|
+
"sha256": "665314938bc5da594676df02f2e0440b21cbea744e1a7ae297b0718d1d46fc6a"
|
|
347
|
+
},
|
|
348
|
+
"http/middleware/PayloadSanitizer.js": {
|
|
349
|
+
"size": 1587,
|
|
350
|
+
"sha256": "98fc33862a64def0a833c9165fcd9689ca0e6f22a2bacb7f94b1c78795c93154"
|
|
351
|
+
},
|
|
352
|
+
"http/middleware/ProcessorPathSanitizer.d.ts": {
|
|
353
|
+
"size": 239,
|
|
354
|
+
"sha256": "6d02f0327d27333f1e50d994e224b39d18fe52be3ece1537c737b5e125a42c99"
|
|
355
|
+
},
|
|
356
|
+
"http/middleware/ProcessorPathSanitizer.js": {
|
|
357
|
+
"size": 5281,
|
|
358
|
+
"sha256": "09164fc04272d65b294fd49372c7709e129d7434413891f4a73b6d9920a88f2d"
|
|
359
|
+
},
|
|
360
|
+
"http/middleware/QueueNameSanitizer.d.ts": {
|
|
361
|
+
"size": 235,
|
|
362
|
+
"sha256": "4f0eb91287dfeae6e6f4728913b1cc0d4418d9ccc7179b085b127614359ec3dc"
|
|
363
|
+
},
|
|
364
|
+
"http/middleware/QueueNameSanitizer.js": {
|
|
365
|
+
"size": 1831,
|
|
366
|
+
"sha256": "3396df1ab45e4dd749d5bf3102e8df86e8d967c11a8519e7e1ce1d59fa37901e"
|
|
367
|
+
},
|
|
368
|
+
"http/middleware/ValidateDriver.d.ts": {
|
|
369
|
+
"size": 331,
|
|
370
|
+
"sha256": "e68de3e55386d8dcd316f9f1c4a26429d56df9f06f319c700291e1eeadaf78e6"
|
|
371
|
+
},
|
|
372
|
+
"http/middleware/ValidateDriver.js": {
|
|
373
|
+
"size": 748,
|
|
374
|
+
"sha256": "2f95bb7177caf1f60e6e93236ee63bcee24255c690700859d548a21bc5b76236"
|
|
375
|
+
},
|
|
376
|
+
"http/middleware/VersionSanitizer.d.ts": {
|
|
377
|
+
"size": 233,
|
|
378
|
+
"sha256": "cd2e80b0acd31bf88f134bca746354c9f6d6c011e043e9ea0a55f73d23aada4a"
|
|
379
|
+
},
|
|
380
|
+
"http/middleware/VersionSanitizer.js": {
|
|
381
|
+
"size": 916,
|
|
382
|
+
"sha256": "a0ddf5266317ccd9f856614fbd5deb64e375ede8655e89acfe095a733009b49c"
|
|
383
|
+
},
|
|
384
|
+
"http/middleware/WorkerNameSanitizer.d.ts": {
|
|
385
|
+
"size": 236,
|
|
386
|
+
"sha256": "594eae29f4b2ad6b1ad43603f199fe2b578faf9bcddea23bdf073c05f2218745"
|
|
387
|
+
},
|
|
388
|
+
"http/middleware/WorkerNameSanitizer.js": {
|
|
389
|
+
"size": 1876,
|
|
390
|
+
"sha256": "7aa198cf6dece7a3e34de8073ba0d4c4b256b30a8471b3b13361fa56f329153c"
|
|
391
|
+
},
|
|
392
|
+
"http/middleware/WorkerValidationChain.d.ts": {
|
|
393
|
+
"size": 1215,
|
|
394
|
+
"sha256": "df7c9520f1b9de37273e1cf6b2ab6d8dbed0f22c415bb10e4cf1a04f68042544"
|
|
395
|
+
},
|
|
396
|
+
"http/middleware/WorkerValidationChain.js": {
|
|
397
|
+
"size": 8212,
|
|
398
|
+
"sha256": "c6a06c1e5ab72bf5f8c14dc23a979090e1389e6cb78d87543cd65d974a73815c"
|
|
399
|
+
},
|
|
400
|
+
"index.d.ts": {
|
|
401
|
+
"size": 2728,
|
|
402
|
+
"sha256": "e976381e6d2a2784754f13799b11a8511e63c799ef290930649c033c80b70981"
|
|
403
|
+
},
|
|
404
|
+
"index.js": {
|
|
405
|
+
"size": 2336,
|
|
406
|
+
"sha256": "488a61e9ac8a1dfb8ddeb57fd01db7f279e373668ce9ba3accbf5c85e0b99209"
|
|
407
|
+
},
|
|
408
|
+
"queueMonitorHistory.d.ts": {
|
|
409
|
+
"size": 433,
|
|
410
|
+
"sha256": "1ba25cf47b0cad83e92c7b6481d12de974b921d0e01fc4cf17fc833acdf8b8c8"
|
|
411
|
+
},
|
|
412
|
+
"queueMonitorHistory.js": {
|
|
413
|
+
"size": 2280,
|
|
414
|
+
"sha256": "28172b13fd7b03d7106838b182db0a6e3620a521a91f48cd816ca5522fb7ba27"
|
|
415
|
+
},
|
|
416
|
+
"register.d.ts": {
|
|
417
|
+
"size": 256,
|
|
418
|
+
"sha256": "07753654e043fd8ac0d42c4d74a26406929fc076c8c86b3d0513898c7da0d0aa"
|
|
419
|
+
},
|
|
420
|
+
"register.js": {
|
|
421
|
+
"size": 1626,
|
|
422
|
+
"sha256": "4c404dfb2df0ac42da904bf30cece14ddbe127b8408d1ded951bf60ca86d07a3"
|
|
423
|
+
},
|
|
424
|
+
"routes/workers.d.ts": {
|
|
425
|
+
"size": 503,
|
|
426
|
+
"sha256": "37b522f9b4498a3d5c3ee8006e796a9024e8606eedf9599922276f2d67293ece"
|
|
427
|
+
},
|
|
428
|
+
"routes/workers.js": {
|
|
429
|
+
"size": 6979,
|
|
430
|
+
"sha256": "7fc8d9de3045d335c0f3860a709a4e221cb394378075a8ebb7516ca7f18df16e"
|
|
431
|
+
},
|
|
432
|
+
"storage/WorkerStore.d.ts": {
|
|
433
|
+
"size": 1718,
|
|
434
|
+
"sha256": "2311e3619cfd039c7b136bfcaa4173f3029c1e191f6ed65eccae72b72bb753a3"
|
|
435
|
+
},
|
|
436
|
+
"storage/WorkerStore.js": {
|
|
437
|
+
"size": 10033,
|
|
438
|
+
"sha256": "2c58f725ee6dc71c0a0bdefecd9f70ac9117218bf9cbf3e73e4caa907795d11a"
|
|
439
|
+
},
|
|
440
|
+
"telemetry/api/TelemetryAPI.d.ts": {
|
|
441
|
+
"size": 1084,
|
|
442
|
+
"sha256": "bfc96bd00e3f18e33315b0a5f4454efbb2ba1320130559750e8ff8a6703d55ec"
|
|
443
|
+
},
|
|
444
|
+
"telemetry/api/TelemetryAPI.js": {
|
|
445
|
+
"size": 8595,
|
|
446
|
+
"sha256": "c59207bdd21b87f7674246cd6f3902ccb8ef247965c2458b59d40e8ecd9401cd"
|
|
447
|
+
},
|
|
448
|
+
"telemetry/api/TelemetryMonitoringService.d.ts": {
|
|
449
|
+
"size": 792,
|
|
450
|
+
"sha256": "182c6294b81ceae8b9892615bfd327b027d74d3320939c68a198df30735e617f"
|
|
451
|
+
},
|
|
452
|
+
"telemetry/api/TelemetryMonitoringService.js": {
|
|
453
|
+
"size": 4399,
|
|
454
|
+
"sha256": "08632a327623842899eec7b9bec1cf7b51f7bc99619e83864a92ab64a2171140"
|
|
455
|
+
},
|
|
456
|
+
"telemetry/components/AlertPanel.d.ts": {
|
|
457
|
+
"size": 53,
|
|
458
|
+
"sha256": "a36bdcaca7a8f947817eab06f9969c3b17de3bcfe33b97ebf9aea22805eac276"
|
|
459
|
+
},
|
|
460
|
+
"telemetry/components/AlertPanel.js": {
|
|
461
|
+
"size": 369,
|
|
462
|
+
"sha256": "cc44d0daa43658142404a5459df911533b367eaa1b7613fe12935539747ab857"
|
|
463
|
+
},
|
|
464
|
+
"telemetry/components/CostTracking.d.ts": {
|
|
465
|
+
"size": 55,
|
|
466
|
+
"sha256": "892b4ee586454058be37c4c3ee099e746b94cc57501bd6992310ab27ec146a46"
|
|
467
|
+
},
|
|
468
|
+
"telemetry/components/CostTracking.js": {
|
|
469
|
+
"size": 433,
|
|
470
|
+
"sha256": "fb2f8aea53276479c82ebff74124422a0992f4ca626e18a3c11338a352c33ed5"
|
|
471
|
+
},
|
|
472
|
+
"telemetry/components/ResourceUsageChart.d.ts": {
|
|
473
|
+
"size": 61,
|
|
474
|
+
"sha256": "c1e4b41879b3d499ba8e28d64ae3cc7a1a6b0bf6d8ae0fe417e756c1c73a4837"
|
|
475
|
+
},
|
|
476
|
+
"telemetry/components/ResourceUsageChart.js": {
|
|
477
|
+
"size": 332,
|
|
478
|
+
"sha256": "4ca6b0acf154f879e9222412f756b0824a35a03d60def0a78d1926a56b6d2385"
|
|
479
|
+
},
|
|
480
|
+
"telemetry/components/WorkerHealthChart.d.ts": {
|
|
481
|
+
"size": 60,
|
|
482
|
+
"sha256": "7287ab834c3c69d00e758f5d141d639af841b859437355ba81b5dd82208a00e9"
|
|
483
|
+
},
|
|
484
|
+
"telemetry/components/WorkerHealthChart.js": {
|
|
485
|
+
"size": 321,
|
|
486
|
+
"sha256": "14d7d15d37dc7d0d74536cc377abe454b76058558bc6e28e5459d0ce730fc8ec"
|
|
487
|
+
},
|
|
488
|
+
"telemetry/index.d.ts": {
|
|
489
|
+
"size": 489,
|
|
490
|
+
"sha256": "954f4903b1aaf6b4470d05978eb5d2003a05e64beff2aa0ba528d917e2a9599b"
|
|
491
|
+
},
|
|
492
|
+
"telemetry/index.js": {
|
|
493
|
+
"size": 2605,
|
|
494
|
+
"sha256": "14cfef3db1c1b42de1c121825e508f6f90b8376f87949ab798822862addfce36"
|
|
495
|
+
},
|
|
496
|
+
"telemetry/routes/dashboard.d.ts": {
|
|
497
|
+
"size": 219,
|
|
498
|
+
"sha256": "5140191207b5620500ac5e1edacefed65956a1ad88739695d545ea7d2b405243"
|
|
499
|
+
},
|
|
500
|
+
"telemetry/routes/dashboard.js": {
|
|
501
|
+
"size": 22912,
|
|
502
|
+
"sha256": "f6fb214ab5511fbeaeeece226d26f58a5ecf3c6adf64948a7ab3db9109e616ff"
|
|
503
|
+
},
|
|
504
|
+
"type.d.ts": {
|
|
505
|
+
"size": 1649,
|
|
506
|
+
"sha256": "1da3f8b22d549b1d7c16f264faeb1807806257e4ff03d32d8addb20c3aa3e42c"
|
|
507
|
+
},
|
|
508
|
+
"type.js": {
|
|
509
|
+
"size": 11,
|
|
510
|
+
"sha256": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"
|
|
511
|
+
},
|
|
512
|
+
"ui/BrandFavicon.d.ts": {
|
|
513
|
+
"size": 106,
|
|
514
|
+
"sha256": "4f10877579f9366819511e3af3d33728705a1476c5d56db9d5850e50b6cf9130"
|
|
515
|
+
},
|
|
516
|
+
"ui/BrandFavicon.js": {
|
|
517
|
+
"size": 1621,
|
|
518
|
+
"sha256": "d8bf6174015be96e62f76d66aec3e72d70ef88519841a6b422de6378d9f59086"
|
|
519
|
+
},
|
|
520
|
+
"ui/router/EmbeddedAssets.d.ts": {
|
|
521
|
+
"size": 124399,
|
|
522
|
+
"sha256": "b097f0060ac41398d2db3bd08e2f5ef3ff193086a400f350d70ec6669a890604"
|
|
523
|
+
},
|
|
524
|
+
"ui/router/EmbeddedAssets.js": {
|
|
525
|
+
"size": 124405,
|
|
526
|
+
"sha256": "449d6f20663173441c54a53870fd7d484f4a9682eef31c6f3b5218a2538590fb"
|
|
527
|
+
},
|
|
528
|
+
"ui/router/ui.d.ts": {
|
|
529
|
+
"size": 231,
|
|
530
|
+
"sha256": "ef9b0e251f6b34731d827fd2e2984518fe848a4fd8423792a084cb18728dac4f"
|
|
531
|
+
},
|
|
532
|
+
"ui/router/ui.js": {
|
|
533
|
+
"size": 9041,
|
|
534
|
+
"sha256": "cafd0c8fc03e7aa207c6fb88efa487443d82b71e42925d72f2ab374fa9a6054e"
|
|
535
|
+
},
|
|
536
|
+
"ui/types/worker-ui.d.ts": {
|
|
537
|
+
"size": 5562,
|
|
538
|
+
"sha256": "c732bd37f434c3e1c05042384f2a6ab286455ccba5eb6d5716f931e3699857e0"
|
|
539
|
+
},
|
|
540
|
+
"ui/types/worker-ui.js": {
|
|
541
|
+
"size": 94,
|
|
542
|
+
"sha256": "7e9f752c2a8eb29dab365b0c836bac90fa7d3567aaf961537d3aa782e85c884e"
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
@@ -4,6 +4,7 @@ import { Logger } from '@zintrust/core/logger';
|
|
|
4
4
|
import { WorkerFactory } from '../WorkerFactory.js';
|
|
5
5
|
import { WorkerMetrics as WorkerMetricsManager } from '../WorkerMetrics.js';
|
|
6
6
|
import { WorkerRegistry } from '../WorkerRegistry.js';
|
|
7
|
+
import { maskInfrastructurePasswords } from '../helper/index.js';
|
|
7
8
|
const DEFAULT_PAGE_SIZE = 100;
|
|
8
9
|
const MAX_PAGE_SIZE = 200;
|
|
9
10
|
// Helper for timeout handling
|
|
@@ -466,8 +467,8 @@ async function getRedisQueueData() {
|
|
|
466
467
|
try {
|
|
467
468
|
// Use existing queue monitor infrastructure
|
|
468
469
|
const { QueueMonitor } = await import('@zintrust/queue-monitor');
|
|
469
|
-
const { queueConfig } = await import('@zintrust/core/config');
|
|
470
|
-
const redisConfig =
|
|
470
|
+
const { queueConfig: FreshQeueConfig } = await import('@zintrust/core/config');
|
|
471
|
+
const redisConfig = FreshQeueConfig.drivers.redis;
|
|
471
472
|
if (redisConfig?.driver !== 'redis') {
|
|
472
473
|
throw ErrorFactory.createConfigError('Redis driver not configured');
|
|
473
474
|
}
|
|
@@ -707,7 +708,7 @@ function buildWorkerConfiguration(worker, persisted) {
|
|
|
707
708
|
activeStatus: persisted.activeStatus ?? true,
|
|
708
709
|
version: persisted.version ?? worker.version,
|
|
709
710
|
features: persisted.features ?? null,
|
|
710
|
-
infrastructure: persisted.infrastructure
|
|
711
|
+
infrastructure: maskInfrastructurePasswords(persisted.infrastructure),
|
|
711
712
|
datacenter: persisted.datacenter ?? null,
|
|
712
713
|
};
|
|
713
714
|
}
|
package/dist/helper/index.d.ts
CHANGED
|
@@ -3,3 +3,8 @@ import type { IRequest } from '@zintrust/core/http';
|
|
|
3
3
|
* Helper to get path parameter
|
|
4
4
|
*/
|
|
5
5
|
export declare const getParam: (req: IRequest, key: string) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Mask sensitive password fields in infrastructure data
|
|
8
|
+
* This masks both Redis and database passwords to prevent them from being exposed in API responses
|
|
9
|
+
*/
|
|
10
|
+
export declare const maskInfrastructurePasswords: (infrastructure: Record<string, unknown> | null | undefined) => Record<string, unknown> | null;
|
package/dist/helper/index.js
CHANGED
|
@@ -8,3 +8,54 @@ export const getParam = (req, key) => {
|
|
|
8
8
|
const params = req.params ?? {};
|
|
9
9
|
return params[key] ?? '';
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Mask password in a record if present
|
|
13
|
+
*/
|
|
14
|
+
const maskPassword = (obj) => {
|
|
15
|
+
if (typeof obj['password'] === 'string' && obj['password'].length > 0) {
|
|
16
|
+
obj['password'] = '******';
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Mask passwords in a nested connection object
|
|
21
|
+
*/
|
|
22
|
+
const maskConnectionPassword = (persistence) => {
|
|
23
|
+
if (typeof persistence['connection'] === 'object' && persistence['connection'] !== null) {
|
|
24
|
+
const connection = { ...persistence['connection'] };
|
|
25
|
+
maskPassword(connection);
|
|
26
|
+
persistence['connection'] = connection;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Mask Redis password in infrastructure data
|
|
31
|
+
*/
|
|
32
|
+
const maskRedisPassword = (masked) => {
|
|
33
|
+
if (typeof masked['redis'] === 'object' && masked['redis'] !== null) {
|
|
34
|
+
const redis = { ...masked['redis'] };
|
|
35
|
+
maskPassword(redis);
|
|
36
|
+
masked['redis'] = redis;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Mask persistence password in infrastructure data
|
|
41
|
+
*/
|
|
42
|
+
const maskPersistencePassword = (masked) => {
|
|
43
|
+
if (typeof masked['persistence'] === 'object' && masked['persistence'] !== null) {
|
|
44
|
+
const persistence = { ...masked['persistence'] };
|
|
45
|
+
maskPassword(persistence);
|
|
46
|
+
maskConnectionPassword(persistence);
|
|
47
|
+
masked['persistence'] = persistence;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Mask sensitive password fields in infrastructure data
|
|
52
|
+
* This masks both Redis and database passwords to prevent them from being exposed in API responses
|
|
53
|
+
*/
|
|
54
|
+
export const maskInfrastructurePasswords = (infrastructure) => {
|
|
55
|
+
if (!infrastructure)
|
|
56
|
+
return null;
|
|
57
|
+
const masked = { ...infrastructure };
|
|
58
|
+
maskRedisPassword(masked);
|
|
59
|
+
maskPersistencePassword(masked);
|
|
60
|
+
return masked;
|
|
61
|
+
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Logger } from '@zintrust/core/logger';
|
|
6
6
|
import { getWorkerDetails, getWorkers } from '../dashboard/workers-api.js';
|
|
7
|
-
import { getParam } from '../helper/index.js';
|
|
7
|
+
import { getParam, maskInfrastructurePasswords } from '../helper/index.js';
|
|
8
8
|
import { WorkerFactory } from '../WorkerFactory.js';
|
|
9
9
|
/**
|
|
10
10
|
* Helper to safely get a single string value from query params
|
|
@@ -76,7 +76,24 @@ export const listWorkers = async (req, res) => {
|
|
|
76
76
|
includeInactive: getBooleanParam(query, 'includeInactive', false),
|
|
77
77
|
};
|
|
78
78
|
const result = await getWorkers(queryParams);
|
|
79
|
-
|
|
79
|
+
// Mask passwords in infrastructure data for all workers
|
|
80
|
+
const maskedWorkers = result.workers.map((worker) => {
|
|
81
|
+
const maskedWorker = { ...worker };
|
|
82
|
+
if (maskedWorker.details?.configuration) {
|
|
83
|
+
maskedWorker.details = {
|
|
84
|
+
...maskedWorker.details,
|
|
85
|
+
configuration: {
|
|
86
|
+
...maskedWorker.details.configuration,
|
|
87
|
+
infrastructure: maskInfrastructurePasswords(maskedWorker.details.configuration['infrastructure']),
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return maskedWorker;
|
|
92
|
+
});
|
|
93
|
+
res.json({
|
|
94
|
+
...result,
|
|
95
|
+
workers: maskedWorkers,
|
|
96
|
+
});
|
|
80
97
|
}
|
|
81
98
|
catch (error) {
|
|
82
99
|
Logger.error('Error fetching workers:', error);
|
|
@@ -98,6 +115,7 @@ export const getWorkerDetailsHandler = async (req, res) => {
|
|
|
98
115
|
}
|
|
99
116
|
const driver = getQueryParam(req.getQuery?.() || {}, 'driver');
|
|
100
117
|
const details = await getWorkerDetails(name, driver);
|
|
118
|
+
// Password masking is already applied in buildWorkerConfiguration
|
|
101
119
|
res.json(details);
|
|
102
120
|
}
|
|
103
121
|
catch (error) {
|
|
@@ -195,6 +213,7 @@ const getWorkerJsonHandler = async (req, res) => {
|
|
|
195
213
|
code: 'WORKER_NOT_FOUND',
|
|
196
214
|
});
|
|
197
215
|
}
|
|
216
|
+
// Mask passwords in infrastructure data (already applied in buildWorkerConfiguration)
|
|
198
217
|
return res.json({
|
|
199
218
|
success: true,
|
|
200
219
|
data: worker,
|
|
@@ -231,9 +250,14 @@ const getWorkerDriverDataHandler = async (req, res) => {
|
|
|
231
250
|
code: 'WORKER_NOT_FOUND',
|
|
232
251
|
});
|
|
233
252
|
}
|
|
253
|
+
// Mask passwords in infrastructure data
|
|
254
|
+
const maskedData = {
|
|
255
|
+
...persistedData,
|
|
256
|
+
infrastructure: maskInfrastructurePasswords(persistedData['infrastructure']),
|
|
257
|
+
};
|
|
234
258
|
return res.json({
|
|
235
259
|
success: true,
|
|
236
|
-
data:
|
|
260
|
+
data: maskedData,
|
|
237
261
|
});
|
|
238
262
|
}
|
|
239
263
|
catch (error) {
|
|
@@ -281,6 +305,7 @@ const updateWorkerJsonHandler = async (req, res) => {
|
|
|
281
305
|
// For now, return the updated data as if it was updated
|
|
282
306
|
// In a real implementation, this would update the worker in the database
|
|
283
307
|
const updatedWorker = { ...existingWorker, ...workerData };
|
|
308
|
+
// Password masking is already applied in buildWorkerConfiguration via getWorkerDetails
|
|
284
309
|
return res.json({
|
|
285
310
|
success: true,
|
|
286
311
|
data: updatedWorker,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zintrust/workers",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Worker orchestration and background job management for ZinTrust.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -73,4 +73,4 @@
|
|
|
73
73
|
"prom-client": "^15.1.3",
|
|
74
74
|
"simple-statistics": "^7.8.9"
|
|
75
75
|
}
|
|
76
|
-
}
|
|
76
|
+
}
|
|
@@ -4,6 +4,7 @@ import { Logger } from '@zintrust/core/logger';
|
|
|
4
4
|
import { WorkerFactory } from '../WorkerFactory';
|
|
5
5
|
import { WorkerMetrics as WorkerMetricsManager } from '../WorkerMetrics';
|
|
6
6
|
import { WorkerRegistry } from '../WorkerRegistry';
|
|
7
|
+
import { maskInfrastructurePasswords } from '../helper';
|
|
7
8
|
import type { WorkerRecord } from '../storage/WorkerStore';
|
|
8
9
|
import type {
|
|
9
10
|
GetWorkersQuery,
|
|
@@ -615,9 +616,9 @@ async function getRedisQueueData(): Promise<QueueData> {
|
|
|
615
616
|
try {
|
|
616
617
|
// Use existing queue monitor infrastructure
|
|
617
618
|
const { QueueMonitor } = await import('@zintrust/queue-monitor');
|
|
618
|
-
const { queueConfig } = await import('@zintrust/core/config');
|
|
619
|
+
const { queueConfig: FreshQeueConfig } = await import('@zintrust/core/config');
|
|
619
620
|
|
|
620
|
-
const redisConfig =
|
|
621
|
+
const redisConfig = FreshQeueConfig.drivers.redis;
|
|
621
622
|
if (redisConfig?.driver !== 'redis') {
|
|
622
623
|
throw ErrorFactory.createConfigError('Redis driver not configured');
|
|
623
624
|
}
|
|
@@ -912,7 +913,7 @@ function buildWorkerConfiguration(
|
|
|
912
913
|
activeStatus: persisted.activeStatus ?? true,
|
|
913
914
|
version: persisted.version ?? worker.version,
|
|
914
915
|
features: persisted.features ?? null,
|
|
915
|
-
infrastructure: persisted.infrastructure
|
|
916
|
+
infrastructure: maskInfrastructurePasswords(persisted.infrastructure),
|
|
916
917
|
datacenter: persisted.datacenter ?? null,
|
|
917
918
|
};
|
|
918
919
|
}
|
package/src/helper/index.ts
CHANGED
|
@@ -9,3 +9,63 @@ export const getParam = (req: IRequest, key: string): string => {
|
|
|
9
9
|
const params = (req.params as Record<string, string> | undefined) ?? {};
|
|
10
10
|
return params[key] ?? '';
|
|
11
11
|
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Mask password in a record if present
|
|
15
|
+
*/
|
|
16
|
+
const maskPassword = (obj: Record<string, unknown>): void => {
|
|
17
|
+
if (typeof obj['password'] === 'string' && obj['password'].length > 0) {
|
|
18
|
+
obj['password'] = '******';
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Mask passwords in a nested connection object
|
|
24
|
+
*/
|
|
25
|
+
const maskConnectionPassword = (persistence: Record<string, unknown>): void => {
|
|
26
|
+
if (typeof persistence['connection'] === 'object' && persistence['connection'] !== null) {
|
|
27
|
+
const connection = { ...(persistence['connection'] as Record<string, unknown>) };
|
|
28
|
+
maskPassword(connection);
|
|
29
|
+
persistence['connection'] = connection;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Mask Redis password in infrastructure data
|
|
35
|
+
*/
|
|
36
|
+
const maskRedisPassword = (masked: Record<string, unknown>): void => {
|
|
37
|
+
if (typeof masked['redis'] === 'object' && masked['redis'] !== null) {
|
|
38
|
+
const redis = { ...(masked['redis'] as Record<string, unknown>) };
|
|
39
|
+
maskPassword(redis);
|
|
40
|
+
masked['redis'] = redis;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Mask persistence password in infrastructure data
|
|
46
|
+
*/
|
|
47
|
+
const maskPersistencePassword = (masked: Record<string, unknown>): void => {
|
|
48
|
+
if (typeof masked['persistence'] === 'object' && masked['persistence'] !== null) {
|
|
49
|
+
const persistence = { ...(masked['persistence'] as Record<string, unknown>) };
|
|
50
|
+
maskPassword(persistence);
|
|
51
|
+
maskConnectionPassword(persistence);
|
|
52
|
+
masked['persistence'] = persistence;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Mask sensitive password fields in infrastructure data
|
|
58
|
+
* This masks both Redis and database passwords to prevent them from being exposed in API responses
|
|
59
|
+
*/
|
|
60
|
+
export const maskInfrastructurePasswords = (
|
|
61
|
+
infrastructure: Record<string, unknown> | null | undefined
|
|
62
|
+
): Record<string, unknown> | null => {
|
|
63
|
+
if (!infrastructure) return null;
|
|
64
|
+
|
|
65
|
+
const masked = { ...infrastructure };
|
|
66
|
+
|
|
67
|
+
maskRedisPassword(masked);
|
|
68
|
+
maskPersistencePassword(masked);
|
|
69
|
+
|
|
70
|
+
return masked;
|
|
71
|
+
};
|
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
WorkerStatus,
|
|
14
14
|
} from '../dashboard/types';
|
|
15
15
|
import { getWorkerDetails, getWorkers } from '../dashboard/workers-api';
|
|
16
|
-
import { getParam } from '../helper';
|
|
16
|
+
import { getParam, maskInfrastructurePasswords } from '../helper';
|
|
17
17
|
import { WorkerFactory } from '../WorkerFactory';
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -116,7 +116,28 @@ export const listWorkers = async (req: IRequest, res: IResponse): Promise<void>
|
|
|
116
116
|
};
|
|
117
117
|
|
|
118
118
|
const result = await getWorkers(queryParams);
|
|
119
|
-
|
|
119
|
+
|
|
120
|
+
// Mask passwords in infrastructure data for all workers
|
|
121
|
+
const maskedWorkers = result.workers.map((worker) => {
|
|
122
|
+
const maskedWorker = { ...worker };
|
|
123
|
+
if (maskedWorker.details?.configuration) {
|
|
124
|
+
maskedWorker.details = {
|
|
125
|
+
...maskedWorker.details,
|
|
126
|
+
configuration: {
|
|
127
|
+
...maskedWorker.details.configuration,
|
|
128
|
+
infrastructure: maskInfrastructurePasswords(
|
|
129
|
+
maskedWorker.details.configuration['infrastructure'] as Record<string, unknown> | null
|
|
130
|
+
),
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
return maskedWorker;
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
res.json({
|
|
138
|
+
...result,
|
|
139
|
+
workers: maskedWorkers,
|
|
140
|
+
});
|
|
120
141
|
} catch (error) {
|
|
121
142
|
Logger.error('Error fetching workers:', error);
|
|
122
143
|
res.status(500).json({
|
|
@@ -138,6 +159,8 @@ export const getWorkerDetailsHandler = async (req: IRequest, res: IResponse): Pr
|
|
|
138
159
|
}
|
|
139
160
|
const driver = getQueryParam(req.getQuery?.() || {}, 'driver');
|
|
140
161
|
const details = await getWorkerDetails(name, driver);
|
|
162
|
+
|
|
163
|
+
// Password masking is already applied in buildWorkerConfiguration
|
|
141
164
|
res.json(details);
|
|
142
165
|
} catch (error) {
|
|
143
166
|
if (error instanceof Error && error.message.includes('not found')) {
|
|
@@ -239,6 +262,7 @@ const getWorkerJsonHandler = async (req: IRequest, res: IResponse): Promise<void
|
|
|
239
262
|
});
|
|
240
263
|
}
|
|
241
264
|
|
|
265
|
+
// Mask passwords in infrastructure data (already applied in buildWorkerConfiguration)
|
|
242
266
|
return res.json({
|
|
243
267
|
success: true,
|
|
244
268
|
data: worker,
|
|
@@ -279,9 +303,17 @@ const getWorkerDriverDataHandler = async (req: IRequest, res: IResponse): Promis
|
|
|
279
303
|
});
|
|
280
304
|
}
|
|
281
305
|
|
|
306
|
+
// Mask passwords in infrastructure data
|
|
307
|
+
const maskedData = {
|
|
308
|
+
...persistedData,
|
|
309
|
+
infrastructure: maskInfrastructurePasswords(
|
|
310
|
+
persistedData['infrastructure'] as Record<string, unknown> | null
|
|
311
|
+
),
|
|
312
|
+
};
|
|
313
|
+
|
|
282
314
|
return res.json({
|
|
283
315
|
success: true,
|
|
284
|
-
data:
|
|
316
|
+
data: maskedData,
|
|
285
317
|
});
|
|
286
318
|
} catch (error) {
|
|
287
319
|
Logger.error('Failed to get worker driver data', error);
|
|
@@ -337,6 +369,7 @@ const updateWorkerJsonHandler = async (req: IRequest, res: IResponse): Promise<v
|
|
|
337
369
|
// In a real implementation, this would update the worker in the database
|
|
338
370
|
const updatedWorker = { ...existingWorker, ...workerData };
|
|
339
371
|
|
|
372
|
+
// Password masking is already applied in buildWorkerConfiguration via getWorkerDetails
|
|
340
373
|
return res.json({
|
|
341
374
|
success: true,
|
|
342
375
|
data: updatedWorker,
|
|
@@ -256,7 +256,7 @@ export const DbWorkerStore = Object.freeze({
|
|
|
256
256
|
if (options?.limit) query.limit(options.limit);
|
|
257
257
|
if (options?.offset) query.offset(options.offset);
|
|
258
258
|
const rows = await query.get<Record<string, unknown>>();
|
|
259
|
-
return rows.map((element) => deserializeDbWorker(element));
|
|
259
|
+
return rows.map((element: Record<string, unknown>) => deserializeDbWorker(element));
|
|
260
260
|
},
|
|
261
261
|
async get(name: string): Promise<WorkerRecord | null> {
|
|
262
262
|
const row = await db.table(table).where('name', '=', name).first<Record<string, unknown>>();
|