@push.rocks/smartnftables 2.5.1 → 2.6.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.
Files changed (65) hide show
  1. package/changelog.md +19 -0
  2. package/dist_rust/smartnftables_linux_amd64_musl +0 -0
  3. package/dist_rust/smartnftables_linux_amd64_musl.tsrust-build.json +5 -5
  4. package/dist_rust/smartnftables_linux_arm64_musl +0 -0
  5. package/dist_rust/smartnftables_linux_arm64_musl.tsrust-build.json +5 -5
  6. package/dist_ts/00_commitinfo_data.js +1 -1
  7. package/dist_ts/managed.egress.types.d.ts +44 -0
  8. package/native-notices/crates/memchr-2.8.3/unlicense +24 -0
  9. package/native-notices/manifest.json +566 -344
  10. package/native-notices/readme.md +40 -34
  11. package/native-notices/runtime/gcc/gpl-3.0.txt +674 -0
  12. package/native-notices/runtime/gcc/runtime-library-exception-3.1.txt +73 -0
  13. package/native-notices/{rust-standard-library/dependency-notices.html → rust/copyright-library.html} +185 -991
  14. package/native-notices/rust/crates/adler2-2.0.1/license-0bsd +12 -0
  15. package/native-notices/rust/crates/adler2-2.0.1/license-apache +201 -0
  16. package/native-notices/rust/crates/adler2-2.0.1/license-mit +23 -0
  17. package/native-notices/rust/crates/memchr-2.7.6/copying +3 -0
  18. package/native-notices/rust/crates/memchr-2.7.6/license-mit +21 -0
  19. package/native-notices/rust/crates/memchr-2.7.6/unlicense +24 -0
  20. package/native-notices/rust/crates/miniz_oxide-0.8.9/license +25 -0
  21. package/native-notices/{rust-standard-library/llvm-libunwind-license.txt → rust/crates/miniz_oxide-0.8.9/license-apache.md} +11 -145
  22. package/native-notices/rust/crates/miniz_oxide-0.8.9/license-mit.md +24 -0
  23. package/native-notices/rust/crates/miniz_oxide-0.8.9/license-zlib.md +14 -0
  24. package/native-notices/{rust-standard-library → rust/crates/object-0.37.3}/license-apache +25 -0
  25. package/native-notices/{rust-standard-library → rust/crates/object-0.37.3}/license-mit +1 -1
  26. package/native-notices/rust/licenses/apache-2.0.txt +73 -0
  27. package/native-notices/rust/licenses/bsd-2-clause.txt +9 -0
  28. package/native-notices/rust/licenses/cc-by-sa-4.0.txt +427 -0
  29. package/native-notices/rust/licenses/gcc-exception-3.1.txt +30 -0
  30. package/native-notices/rust/licenses/gpl-2.0-only.txt +133 -0
  31. package/native-notices/rust/licenses/gpl-3.0-or-later.txt +202 -0
  32. package/native-notices/rust/licenses/isc.txt +7 -0
  33. package/native-notices/rust/licenses/llvm-exception.txt +15 -0
  34. package/native-notices/rust/licenses/mit.txt +9 -0
  35. package/native-notices/rust/licenses/ncsa.txt +29 -0
  36. package/native-notices/rust/licenses/ofl-1.1.txt +43 -0
  37. package/native-notices/{rust-standard-library/unicode-license.txt → rust/licenses/unicode-3.0.txt} +1 -1
  38. package/package.json +4 -5
  39. package/readme.md +149 -5
  40. package/rust/src/egress.compile.rs +2 -0
  41. package/rust/src/egress.host.rs +88 -1
  42. package/rust/src/egress.hostgrant.rs +13 -13
  43. package/rust/src/egress.poolguard.rs +45 -0
  44. package/rust/src/egress.router.rs +3 -1
  45. package/rust/src/egress.rs +122 -6
  46. package/rust/src/egress.workloadgrant.rs +88 -0
  47. package/rust/src/egress_hostgrant_tests.rs +47 -29
  48. package/rust/src/egress_localplatform_tests.rs +204 -0
  49. package/rust/src/egress_localport_tests.rs +264 -0
  50. package/rust/src/egress_workloadgrant_tests.rs +314 -0
  51. package/rust/src/owner.rs +8 -1
  52. package/rust/src/owner_hostgrant_traffic_tests.rs +9 -4
  53. package/rust/src/owner_identity_tests.rs +62 -0
  54. package/rust/src/owner_localplatform_tests.rs +274 -0
  55. package/rust/src/owner_localport_tests.rs +241 -0
  56. package/rust/src/owner_tests.rs +9 -0
  57. package/rust/src/owner_workloadgrant_tests.rs +278 -0
  58. package/ts/00_commitinfo_data.ts +1 -1
  59. package/ts/managed.egress.types.ts +46 -0
  60. package/native-notices/rust-standard-library/cargo.lock +0 -522
  61. package/scripts/check-native-notices.mjs +0 -27
  62. /package/native-notices/{rust-standard-library/musl-1.2.5-copyright.txt → runtime/musl-1.2.5/copyright} +0 -0
  63. /package/native-notices/{rust-standard-library → rust}/compiler-builtins-license.txt +0 -0
  64. /package/native-notices/{rust-standard-library/addr2line-0.25.1-license-apache → rust/crates/addr2line-0.25.1/license-apache} +0 -0
  65. /package/native-notices/{rust-standard-library/addr2line-0.25.1-license-mit → rust/crates/addr2line-0.25.1/license-mit} +0 -0
@@ -1,522 +0,0 @@
1
- # This file is automatically @generated by Cargo.
2
- # It is not intended for manual editing.
3
- version = 4
4
-
5
- [[package]]
6
- name = "addr2line"
7
- version = "0.25.1"
8
- source = "registry+https://github.com/rust-lang/crates.io-index"
9
- checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b"
10
- dependencies = [
11
- "gimli",
12
- "rustc-std-workspace-alloc",
13
- "rustc-std-workspace-core",
14
- ]
15
-
16
- [[package]]
17
- name = "adler2"
18
- version = "2.0.1"
19
- source = "registry+https://github.com/rust-lang/crates.io-index"
20
- checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
21
- dependencies = [
22
- "rustc-std-workspace-core",
23
- ]
24
-
25
- [[package]]
26
- name = "alloc"
27
- version = "0.0.0"
28
- dependencies = [
29
- "compiler_builtins",
30
- "core",
31
- ]
32
-
33
- [[package]]
34
- name = "alloctests"
35
- version = "0.0.0"
36
- dependencies = [
37
- "rand",
38
- "rand_xorshift",
39
- ]
40
-
41
- [[package]]
42
- name = "cc"
43
- version = "1.2.0"
44
- source = "registry+https://github.com/rust-lang/crates.io-index"
45
- checksum = "1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8"
46
- dependencies = [
47
- "shlex",
48
- ]
49
-
50
- [[package]]
51
- name = "cfg-if"
52
- version = "1.0.4"
53
- source = "registry+https://github.com/rust-lang/crates.io-index"
54
- checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
55
- dependencies = [
56
- "rustc-std-workspace-core",
57
- ]
58
-
59
- [[package]]
60
- name = "compiler_builtins"
61
- version = "0.1.160"
62
- dependencies = [
63
- "cc",
64
- "core",
65
- ]
66
-
67
- [[package]]
68
- name = "core"
69
- version = "0.0.0"
70
-
71
- [[package]]
72
- name = "coretests"
73
- version = "0.0.0"
74
- dependencies = [
75
- "rand",
76
- "rand_xorshift",
77
- ]
78
-
79
- [[package]]
80
- name = "dlmalloc"
81
- version = "0.2.11"
82
- source = "registry+https://github.com/rust-lang/crates.io-index"
83
- checksum = "06cdfe340b16dd990c54cce79743613fa09fbb16774f33a77c9fd196f8f3fa30"
84
- dependencies = [
85
- "cfg-if",
86
- "libc",
87
- "rustc-std-workspace-core",
88
- "windows-sys",
89
- ]
90
-
91
- [[package]]
92
- name = "foldhash"
93
- version = "0.2.0"
94
- source = "registry+https://github.com/rust-lang/crates.io-index"
95
- checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
96
-
97
- [[package]]
98
- name = "fortanix-sgx-abi"
99
- version = "0.6.1"
100
- source = "registry+https://github.com/rust-lang/crates.io-index"
101
- checksum = "5efc85edd5b83e8394f4371dd0da6859dff63dd387dab8568fece6af4cde6f84"
102
- dependencies = [
103
- "rustc-std-workspace-core",
104
- ]
105
-
106
- [[package]]
107
- name = "getopts"
108
- version = "0.2.24"
109
- source = "registry+https://github.com/rust-lang/crates.io-index"
110
- checksum = "cfe4fbac503b8d1f88e6676011885f34b7174f46e59956bba534ba83abded4df"
111
- dependencies = [
112
- "rustc-std-workspace-core",
113
- "rustc-std-workspace-std",
114
- ]
115
-
116
- [[package]]
117
- name = "gimli"
118
- version = "0.32.3"
119
- source = "registry+https://github.com/rust-lang/crates.io-index"
120
- checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7"
121
- dependencies = [
122
- "rustc-std-workspace-alloc",
123
- "rustc-std-workspace-core",
124
- ]
125
-
126
- [[package]]
127
- name = "hashbrown"
128
- version = "0.16.1"
129
- source = "registry+https://github.com/rust-lang/crates.io-index"
130
- checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
131
- dependencies = [
132
- "foldhash",
133
- "rustc-std-workspace-alloc",
134
- "rustc-std-workspace-core",
135
- ]
136
-
137
- [[package]]
138
- name = "hermit-abi"
139
- version = "0.5.2"
140
- source = "registry+https://github.com/rust-lang/crates.io-index"
141
- checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c"
142
- dependencies = [
143
- "rustc-std-workspace-alloc",
144
- "rustc-std-workspace-core",
145
- ]
146
-
147
- [[package]]
148
- name = "libc"
149
- version = "0.2.178"
150
- source = "registry+https://github.com/rust-lang/crates.io-index"
151
- checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091"
152
- dependencies = [
153
- "rustc-std-workspace-core",
154
- ]
155
-
156
- [[package]]
157
- name = "memchr"
158
- version = "2.7.6"
159
- source = "registry+https://github.com/rust-lang/crates.io-index"
160
- checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273"
161
- dependencies = [
162
- "rustc-std-workspace-core",
163
- ]
164
-
165
- [[package]]
166
- name = "miniz_oxide"
167
- version = "0.8.9"
168
- source = "registry+https://github.com/rust-lang/crates.io-index"
169
- checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
170
- dependencies = [
171
- "adler2",
172
- "rustc-std-workspace-alloc",
173
- "rustc-std-workspace-core",
174
- ]
175
-
176
- [[package]]
177
- name = "moto-rt"
178
- version = "0.16.0"
179
- source = "registry+https://github.com/rust-lang/crates.io-index"
180
- checksum = "29aea9f7dfeb258e030a84e0ec38a9c2ec2063d4f45eb2db31445cfc40b3dba1"
181
- dependencies = [
182
- "rustc-std-workspace-alloc",
183
- "rustc-std-workspace-core",
184
- ]
185
-
186
- [[package]]
187
- name = "object"
188
- version = "0.37.3"
189
- source = "registry+https://github.com/rust-lang/crates.io-index"
190
- checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe"
191
- dependencies = [
192
- "memchr",
193
- "rustc-std-workspace-alloc",
194
- "rustc-std-workspace-core",
195
- ]
196
-
197
- [[package]]
198
- name = "panic_abort"
199
- version = "0.0.0"
200
- dependencies = [
201
- "alloc",
202
- "libc",
203
- "rustc-std-workspace-core",
204
- ]
205
-
206
- [[package]]
207
- name = "panic_unwind"
208
- version = "0.0.0"
209
- dependencies = [
210
- "alloc",
211
- "libc",
212
- "rustc-std-workspace-core",
213
- "unwind",
214
- ]
215
-
216
- [[package]]
217
- name = "proc_macro"
218
- version = "0.0.0"
219
- dependencies = [
220
- "core",
221
- "rustc-literal-escaper",
222
- "std",
223
- ]
224
-
225
- [[package]]
226
- name = "profiler_builtins"
227
- version = "0.0.0"
228
- dependencies = [
229
- "cc",
230
- ]
231
-
232
- [[package]]
233
- name = "r-efi"
234
- version = "5.3.0"
235
- source = "registry+https://github.com/rust-lang/crates.io-index"
236
- checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
237
- dependencies = [
238
- "rustc-std-workspace-core",
239
- ]
240
-
241
- [[package]]
242
- name = "r-efi-alloc"
243
- version = "2.1.0"
244
- source = "registry+https://github.com/rust-lang/crates.io-index"
245
- checksum = "dc2f58ef3ca9bb0f9c44d9aa8537601bcd3df94cc9314a40178cadf7d4466354"
246
- dependencies = [
247
- "r-efi",
248
- "rustc-std-workspace-core",
249
- ]
250
-
251
- [[package]]
252
- name = "rand"
253
- version = "0.9.2"
254
- source = "registry+https://github.com/rust-lang/crates.io-index"
255
- checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
256
- dependencies = [
257
- "rand_core",
258
- ]
259
-
260
- [[package]]
261
- name = "rand_core"
262
- version = "0.9.3"
263
- source = "registry+https://github.com/rust-lang/crates.io-index"
264
- checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
265
-
266
- [[package]]
267
- name = "rand_xorshift"
268
- version = "0.4.0"
269
- source = "registry+https://github.com/rust-lang/crates.io-index"
270
- checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a"
271
- dependencies = [
272
- "rand_core",
273
- ]
274
-
275
- [[package]]
276
- name = "rustc-demangle"
277
- version = "0.1.27"
278
- source = "registry+https://github.com/rust-lang/crates.io-index"
279
- checksum = "b50b8869d9fc858ce7266cce0194bd74df58b9d0e3f6df3a9fc8eb470d95c09d"
280
- dependencies = [
281
- "rustc-std-workspace-core",
282
- ]
283
-
284
- [[package]]
285
- name = "rustc-literal-escaper"
286
- version = "0.0.7"
287
- source = "registry+https://github.com/rust-lang/crates.io-index"
288
- checksum = "8be87abb9e40db7466e0681dc8ecd9dcfd40360cb10b4c8fe24a7c4c3669b198"
289
- dependencies = [
290
- "rustc-std-workspace-core",
291
- ]
292
-
293
- [[package]]
294
- name = "rustc-std-workspace-alloc"
295
- version = "1.99.0"
296
- dependencies = [
297
- "alloc",
298
- ]
299
-
300
- [[package]]
301
- name = "rustc-std-workspace-core"
302
- version = "1.99.0"
303
- dependencies = [
304
- "compiler_builtins",
305
- "core",
306
- ]
307
-
308
- [[package]]
309
- name = "rustc-std-workspace-std"
310
- version = "1.99.0"
311
- dependencies = [
312
- "std",
313
- ]
314
-
315
- [[package]]
316
- name = "shlex"
317
- version = "1.3.0"
318
- source = "registry+https://github.com/rust-lang/crates.io-index"
319
- checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
320
-
321
- [[package]]
322
- name = "std"
323
- version = "0.0.0"
324
- dependencies = [
325
- "addr2line",
326
- "alloc",
327
- "cfg-if",
328
- "core",
329
- "dlmalloc",
330
- "fortanix-sgx-abi",
331
- "hashbrown",
332
- "hermit-abi",
333
- "libc",
334
- "miniz_oxide",
335
- "moto-rt",
336
- "object",
337
- "panic_abort",
338
- "panic_unwind",
339
- "r-efi",
340
- "r-efi-alloc",
341
- "rand",
342
- "rand_xorshift",
343
- "rustc-demangle",
344
- "std_detect",
345
- "unwind",
346
- "vex-sdk",
347
- "wasi 0.11.1+wasi-snapshot-preview1",
348
- "wasi 0.14.4+wasi-0.2.4",
349
- "windows-link 0.0.0",
350
- ]
351
-
352
- [[package]]
353
- name = "std_detect"
354
- version = "0.1.5"
355
- dependencies = [
356
- "libc",
357
- "rustc-std-workspace-alloc",
358
- "rustc-std-workspace-core",
359
- ]
360
-
361
- [[package]]
362
- name = "sysroot"
363
- version = "0.0.0"
364
- dependencies = [
365
- "proc_macro",
366
- "profiler_builtins",
367
- "std",
368
- "test",
369
- ]
370
-
371
- [[package]]
372
- name = "test"
373
- version = "0.0.0"
374
- dependencies = [
375
- "core",
376
- "getopts",
377
- "libc",
378
- "std",
379
- ]
380
-
381
- [[package]]
382
- name = "unwind"
383
- version = "0.0.0"
384
- dependencies = [
385
- "libc",
386
- "rustc-std-workspace-core",
387
- "unwinding",
388
- ]
389
-
390
- [[package]]
391
- name = "unwinding"
392
- version = "0.2.8"
393
- source = "registry+https://github.com/rust-lang/crates.io-index"
394
- checksum = "60612c845ef41699f39dc8c5391f252942c0a88b7d15da672eff0d14101bbd6d"
395
- dependencies = [
396
- "gimli",
397
- "rustc-std-workspace-core",
398
- ]
399
-
400
- [[package]]
401
- name = "vex-sdk"
402
- version = "0.27.1"
403
- source = "registry+https://github.com/rust-lang/crates.io-index"
404
- checksum = "79e5fe15afde1305478b35e2cb717fff59f485428534cf49cfdbfa4723379bf6"
405
- dependencies = [
406
- "rustc-std-workspace-core",
407
- ]
408
-
409
- [[package]]
410
- name = "wasi"
411
- version = "0.11.1+wasi-snapshot-preview1"
412
- source = "registry+https://github.com/rust-lang/crates.io-index"
413
- checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
414
- dependencies = [
415
- "rustc-std-workspace-alloc",
416
- "rustc-std-workspace-core",
417
- ]
418
-
419
- [[package]]
420
- name = "wasi"
421
- version = "0.14.4+wasi-0.2.4"
422
- source = "registry+https://github.com/rust-lang/crates.io-index"
423
- checksum = "88a5f4a424faf49c3c2c344f166f0662341d470ea185e939657aaff130f0ec4a"
424
- dependencies = [
425
- "rustc-std-workspace-alloc",
426
- "rustc-std-workspace-core",
427
- "wit-bindgen",
428
- ]
429
-
430
- [[package]]
431
- name = "windows-link"
432
- version = "0.0.0"
433
-
434
- [[package]]
435
- name = "windows-link"
436
- version = "0.2.1"
437
- source = "registry+https://github.com/rust-lang/crates.io-index"
438
- checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
439
-
440
- [[package]]
441
- name = "windows-sys"
442
- version = "0.60.2"
443
- source = "registry+https://github.com/rust-lang/crates.io-index"
444
- checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
445
- dependencies = [
446
- "windows-targets",
447
- ]
448
-
449
- [[package]]
450
- name = "windows-targets"
451
- version = "0.53.5"
452
- source = "registry+https://github.com/rust-lang/crates.io-index"
453
- checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
454
- dependencies = [
455
- "windows-link 0.2.1",
456
- "windows_aarch64_gnullvm",
457
- "windows_aarch64_msvc",
458
- "windows_i686_gnu",
459
- "windows_i686_gnullvm",
460
- "windows_i686_msvc",
461
- "windows_x86_64_gnu",
462
- "windows_x86_64_gnullvm",
463
- "windows_x86_64_msvc",
464
- ]
465
-
466
- [[package]]
467
- name = "windows_aarch64_gnullvm"
468
- version = "0.53.1"
469
- source = "registry+https://github.com/rust-lang/crates.io-index"
470
- checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
471
-
472
- [[package]]
473
- name = "windows_aarch64_msvc"
474
- version = "0.53.1"
475
- source = "registry+https://github.com/rust-lang/crates.io-index"
476
- checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
477
-
478
- [[package]]
479
- name = "windows_i686_gnu"
480
- version = "0.53.1"
481
- source = "registry+https://github.com/rust-lang/crates.io-index"
482
- checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
483
-
484
- [[package]]
485
- name = "windows_i686_gnullvm"
486
- version = "0.53.1"
487
- source = "registry+https://github.com/rust-lang/crates.io-index"
488
- checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
489
-
490
- [[package]]
491
- name = "windows_i686_msvc"
492
- version = "0.53.1"
493
- source = "registry+https://github.com/rust-lang/crates.io-index"
494
- checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
495
-
496
- [[package]]
497
- name = "windows_x86_64_gnu"
498
- version = "0.53.1"
499
- source = "registry+https://github.com/rust-lang/crates.io-index"
500
- checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
501
-
502
- [[package]]
503
- name = "windows_x86_64_gnullvm"
504
- version = "0.53.1"
505
- source = "registry+https://github.com/rust-lang/crates.io-index"
506
- checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
507
-
508
- [[package]]
509
- name = "windows_x86_64_msvc"
510
- version = "0.53.1"
511
- source = "registry+https://github.com/rust-lang/crates.io-index"
512
- checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
513
-
514
- [[package]]
515
- name = "wit-bindgen"
516
- version = "0.45.1"
517
- source = "registry+https://github.com/rust-lang/crates.io-index"
518
- checksum = "5c573471f125075647d03df72e026074b7203790d41351cd6edc96f46bcccd36"
519
- dependencies = [
520
- "rustc-std-workspace-alloc",
521
- "rustc-std-workspace-core",
522
- ]
@@ -1,27 +0,0 @@
1
- import { readFileSync } from 'node:fs';
2
- import { createHash } from 'node:crypto';
3
- import { execFileSync } from 'node:child_process';
4
- import { resolve, relative } from 'node:path';
5
-
6
- const root = resolve(import.meta.dirname, '..');
7
- const notices = resolve(root, 'native-notices');
8
- const manifest = JSON.parse(readFileSync(resolve(notices, 'manifest.json'), 'utf8'));
9
- const digest = (path) => createHash('sha256').update(readFileSync(path)).digest('hex');
10
- const requireEqual = (actual, expected, label) => {
11
- if (actual !== expected) throw new Error(`Native notice inventory mismatch: ${label}; refresh and review notices before distribution.`);
12
- };
13
- requireEqual(digest(resolve(root, 'rust/Cargo.lock')), manifest.cargoLockSha256, 'Cargo.lock');
14
- requireEqual(execFileSync('rustc', ['-vV'], { encoding: 'utf8' }).trim(), manifest.rustc, 'Rust compiler');
15
- const sysroot = execFileSync('rustc', ['--print', 'sysroot'], { encoding: 'utf8' }).trim();
16
- requireEqual(digest(resolve(sysroot, 'share/doc/rust/COPYRIGHT.html')), manifest.toolchainCopyrightSha256, 'toolchain copyright');
17
- for (const [name, hash] of Object.entries(manifest.noticeHashes)) {
18
- const path = resolve(notices, name);
19
- if (relative(notices, path).startsWith('..')) throw new Error('Invalid notice inventory path.');
20
- requireEqual(digest(path), hash, name);
21
- }
22
- for (const [name, hash] of Object.entries(manifest.runtimeArtifactHashes)) {
23
- const path = resolve(sysroot, name);
24
- if (relative(sysroot, path).startsWith('..')) throw new Error('Invalid runtime inventory path.');
25
- requireEqual(digest(path), hash, name);
26
- }
27
- console.log('Native notices match the locked crates and qualified Rust runtime artifacts.');