castrum 0.9.10 → 0.9.11
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/Cargo.lock +132 -91
- package/Cargo.toml +14 -4
- package/README.md +5 -2
- package/castrum.darwin-arm64.node +0 -0
- package/castrum.darwin-x64.node +0 -0
- package/castrum.linux-arm64-gnu.node +0 -0
- package/castrum.linux-arm64-musl.node +0 -0
- package/castrum.linux-x64-gnu.node +0 -0
- package/castrum.linux-x64-musl.node +0 -0
- package/castrum.linux-x64-v3-gnu.node +0 -0
- package/castrum.win32-x64-msvc.node +0 -0
- package/docs/FFI_BUN_GUIDE.md +8 -4
- package/docs/HOW_TO_ADD_AN_OP.md +12 -9
- package/docs/REPO_MAP.md +10 -6
- package/docs/ai/TREE.md +3 -1
- package/package.json +3 -2
- package/rust/ffi/crypto.rs +224 -197
- package/rust/ffi/hashing.rs +68 -51
- package/rust/ffi/http.rs +33 -24
- package/rust/ffi/ingress.rs +13 -12
- package/rust/ffi/metrics.rs +8 -7
- package/rust/ffi/payload.rs +26 -23
- package/rust/ffi/probe.rs +18 -11
- package/rust/ffi/route.rs +6 -5
- package/rust/ffi/task.rs +14 -11
- package/rust/ffi/tests.rs +95 -0
- package/rust/ffi/util.rs +13 -0
- package/rust/ffi/validators.rs +36 -29
- package/rust/http/http_date.rs +4 -0
- package/rust/panic_safety.rs +191 -0
- package/rust/proptest_suite.rs +131 -1
- package/rust/util/bytes.rs +32 -0
package/Cargo.lock
CHANGED
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
# It is not intended for manual editing.
|
|
3
3
|
version = 4
|
|
4
4
|
|
|
5
|
-
[[package]]
|
|
6
|
-
name = "adler2"
|
|
7
|
-
version = "2.0.1"
|
|
8
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
-
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
|
|
10
|
-
|
|
11
5
|
[[package]]
|
|
12
6
|
name = "ahash"
|
|
13
7
|
version = "0.8.12"
|
|
@@ -78,9 +72,9 @@ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
|
|
|
78
72
|
|
|
79
73
|
[[package]]
|
|
80
74
|
name = "aws-lc-rs"
|
|
81
|
-
version = "1.
|
|
75
|
+
version = "1.18.1"
|
|
82
76
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
83
|
-
checksum = "
|
|
77
|
+
checksum = "b281d307588d634de920874890732659e2e7672f72b5e10e81badc1a8a83621e"
|
|
84
78
|
dependencies = [
|
|
85
79
|
"aws-lc-sys",
|
|
86
80
|
"untrusted",
|
|
@@ -89,9 +83,9 @@ dependencies = [
|
|
|
89
83
|
|
|
90
84
|
[[package]]
|
|
91
85
|
name = "aws-lc-sys"
|
|
92
|
-
version = "0.
|
|
86
|
+
version = "0.45.0"
|
|
93
87
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
94
|
-
checksum = "
|
|
88
|
+
checksum = "9bff6c3b54fad79a2e60b8102caf565819711497c1f5f092f49508e2f5c31b27"
|
|
95
89
|
dependencies = [
|
|
96
90
|
"cc",
|
|
97
91
|
"cmake",
|
|
@@ -100,12 +94,6 @@ dependencies = [
|
|
|
100
94
|
"pkg-config",
|
|
101
95
|
]
|
|
102
96
|
|
|
103
|
-
[[package]]
|
|
104
|
-
name = "base64"
|
|
105
|
-
version = "0.22.1"
|
|
106
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
107
|
-
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
|
|
108
|
-
|
|
109
97
|
[[package]]
|
|
110
98
|
name = "base64"
|
|
111
99
|
version = "0.23.1"
|
|
@@ -120,13 +108,13 @@ checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
|
|
|
120
108
|
|
|
121
109
|
[[package]]
|
|
122
110
|
name = "bcrypt"
|
|
123
|
-
version = "0.
|
|
111
|
+
version = "0.19.3"
|
|
124
112
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
125
|
-
checksum = "
|
|
113
|
+
checksum = "a0cd0bd35a28836d528d2b58ad499bc3c5641d59379421b1be9eeb0c2f2b912a"
|
|
126
114
|
dependencies = [
|
|
127
|
-
"base64
|
|
115
|
+
"base64",
|
|
128
116
|
"blowfish",
|
|
129
|
-
"getrandom 0.
|
|
117
|
+
"getrandom 0.4.3",
|
|
130
118
|
"subtle",
|
|
131
119
|
"zeroize",
|
|
132
120
|
]
|
|
@@ -146,6 +134,12 @@ version = "0.8.0"
|
|
|
146
134
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
147
135
|
checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
|
|
148
136
|
|
|
137
|
+
[[package]]
|
|
138
|
+
name = "bitflags"
|
|
139
|
+
version = "1.3.2"
|
|
140
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
141
|
+
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
|
142
|
+
|
|
149
143
|
[[package]]
|
|
150
144
|
name = "bitflags"
|
|
151
145
|
version = "2.13.1"
|
|
@@ -172,9 +166,9 @@ dependencies = [
|
|
|
172
166
|
|
|
173
167
|
[[package]]
|
|
174
168
|
name = "blowfish"
|
|
175
|
-
version = "0.
|
|
169
|
+
version = "0.10.0"
|
|
176
170
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
177
|
-
checksum = "
|
|
171
|
+
checksum = "62ce3946557b35e71d1bbe07ec385073ce9eda05043f95de134eb578fcf1a298"
|
|
178
172
|
dependencies = [
|
|
179
173
|
"byteorder",
|
|
180
174
|
"cipher",
|
|
@@ -233,11 +227,11 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
|
|
|
233
227
|
|
|
234
228
|
[[package]]
|
|
235
229
|
name = "castrum"
|
|
236
|
-
version = "0.9.
|
|
230
|
+
version = "0.9.11"
|
|
237
231
|
dependencies = [
|
|
238
232
|
"argon2",
|
|
239
233
|
"aws-lc-rs",
|
|
240
|
-
"base64
|
|
234
|
+
"base64",
|
|
241
235
|
"bcrypt",
|
|
242
236
|
"brotli",
|
|
243
237
|
"core_affinity",
|
|
@@ -297,11 +291,11 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"
|
|
|
297
291
|
|
|
298
292
|
[[package]]
|
|
299
293
|
name = "cipher"
|
|
300
|
-
version = "0.
|
|
294
|
+
version = "0.5.2"
|
|
301
295
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
302
|
-
checksum = "
|
|
296
|
+
checksum = "e8cf2a2c93cd704877c0858356ed03480ff301ee950b43f1cbe4573b088bfa6c"
|
|
303
297
|
dependencies = [
|
|
304
|
-
"crypto-common",
|
|
298
|
+
"crypto-common 0.2.2",
|
|
305
299
|
"inout",
|
|
306
300
|
]
|
|
307
301
|
|
|
@@ -316,9 +310,9 @@ dependencies = [
|
|
|
316
310
|
|
|
317
311
|
[[package]]
|
|
318
312
|
name = "convert_case"
|
|
319
|
-
version = "0.
|
|
313
|
+
version = "0.12.0"
|
|
320
314
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
321
|
-
checksum = "
|
|
315
|
+
checksum = "1af709f1f33454bf52eadfc8c78b3b9ef9cb26fb54d16dc9cd9a7299f899fd1b"
|
|
322
316
|
dependencies = [
|
|
323
317
|
"unicode-segmentation",
|
|
324
318
|
]
|
|
@@ -387,6 +381,15 @@ dependencies = [
|
|
|
387
381
|
"typenum",
|
|
388
382
|
]
|
|
389
383
|
|
|
384
|
+
[[package]]
|
|
385
|
+
name = "crypto-common"
|
|
386
|
+
version = "0.2.2"
|
|
387
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
388
|
+
checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453"
|
|
389
|
+
dependencies = [
|
|
390
|
+
"hybrid-array",
|
|
391
|
+
]
|
|
392
|
+
|
|
390
393
|
[[package]]
|
|
391
394
|
name = "ctor"
|
|
392
395
|
version = "1.0.10"
|
|
@@ -399,6 +402,46 @@ version = "2.11.0"
|
|
|
399
402
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
400
403
|
checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8"
|
|
401
404
|
|
|
405
|
+
[[package]]
|
|
406
|
+
name = "defmt"
|
|
407
|
+
version = "0.3.100"
|
|
408
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
409
|
+
checksum = "f0963443817029b2024136fc4dd07a5107eb8f977eaf18fcd1fdeb11306b64ad"
|
|
410
|
+
dependencies = [
|
|
411
|
+
"defmt 1.1.1",
|
|
412
|
+
]
|
|
413
|
+
|
|
414
|
+
[[package]]
|
|
415
|
+
name = "defmt"
|
|
416
|
+
version = "1.1.1"
|
|
417
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
418
|
+
checksum = "e2953bfe4f93bbd20cc71198842756f77d161884c99ebbabc41d80231ded88d1"
|
|
419
|
+
dependencies = [
|
|
420
|
+
"bitflags 1.3.2",
|
|
421
|
+
"defmt-macros",
|
|
422
|
+
]
|
|
423
|
+
|
|
424
|
+
[[package]]
|
|
425
|
+
name = "defmt-macros"
|
|
426
|
+
version = "1.1.1"
|
|
427
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
428
|
+
checksum = "bad9c72e7ca2137e0dc3813245a0d282fd6daad32fd800af018306a9169b5fe8"
|
|
429
|
+
dependencies = [
|
|
430
|
+
"defmt-parser",
|
|
431
|
+
"proc-macro2",
|
|
432
|
+
"quote",
|
|
433
|
+
"syn 2.0.119",
|
|
434
|
+
]
|
|
435
|
+
|
|
436
|
+
[[package]]
|
|
437
|
+
name = "defmt-parser"
|
|
438
|
+
version = "1.0.0"
|
|
439
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
440
|
+
checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e"
|
|
441
|
+
dependencies = [
|
|
442
|
+
"thiserror",
|
|
443
|
+
]
|
|
444
|
+
|
|
402
445
|
[[package]]
|
|
403
446
|
name = "digest"
|
|
404
447
|
version = "0.10.7"
|
|
@@ -406,7 +449,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
|
406
449
|
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
|
|
407
450
|
dependencies = [
|
|
408
451
|
"block-buffer",
|
|
409
|
-
"crypto-common",
|
|
452
|
+
"crypto-common 0.1.7",
|
|
410
453
|
"subtle",
|
|
411
454
|
]
|
|
412
455
|
|
|
@@ -480,10 +523,13 @@ dependencies = [
|
|
|
480
523
|
|
|
481
524
|
[[package]]
|
|
482
525
|
name = "faster-hex"
|
|
483
|
-
version = "0.
|
|
526
|
+
version = "0.10.1"
|
|
484
527
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
485
|
-
checksum = "
|
|
528
|
+
checksum = "04839bdf9d8c10f66806fad16b852fc72aab80873aebc3cb69d85b4fa41543ed"
|
|
486
529
|
dependencies = [
|
|
530
|
+
"autocfg",
|
|
531
|
+
"defmt 0.3.100",
|
|
532
|
+
"heapless",
|
|
487
533
|
"serde",
|
|
488
534
|
]
|
|
489
535
|
|
|
@@ -513,11 +559,11 @@ checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
|
|
|
513
559
|
|
|
514
560
|
[[package]]
|
|
515
561
|
name = "flate2"
|
|
516
|
-
version = "1.1.
|
|
562
|
+
version = "1.1.10"
|
|
517
563
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
518
|
-
checksum = "
|
|
564
|
+
checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb"
|
|
519
565
|
dependencies = [
|
|
520
|
-
"
|
|
566
|
+
"crc32fast",
|
|
521
567
|
"zlib-rs",
|
|
522
568
|
]
|
|
523
569
|
|
|
@@ -658,17 +704,6 @@ dependencies = [
|
|
|
658
704
|
"version_check",
|
|
659
705
|
]
|
|
660
706
|
|
|
661
|
-
[[package]]
|
|
662
|
-
name = "getrandom"
|
|
663
|
-
version = "0.2.17"
|
|
664
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
665
|
-
checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
|
|
666
|
-
dependencies = [
|
|
667
|
-
"cfg-if",
|
|
668
|
-
"libc",
|
|
669
|
-
"wasi",
|
|
670
|
-
]
|
|
671
|
-
|
|
672
707
|
[[package]]
|
|
673
708
|
name = "getrandom"
|
|
674
709
|
version = "0.3.4"
|
|
@@ -694,6 +729,15 @@ dependencies = [
|
|
|
694
729
|
"r-efi 6.0.0",
|
|
695
730
|
]
|
|
696
731
|
|
|
732
|
+
[[package]]
|
|
733
|
+
name = "hash32"
|
|
734
|
+
version = "0.3.1"
|
|
735
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
736
|
+
checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606"
|
|
737
|
+
dependencies = [
|
|
738
|
+
"byteorder",
|
|
739
|
+
]
|
|
740
|
+
|
|
697
741
|
[[package]]
|
|
698
742
|
name = "hashbrown"
|
|
699
743
|
version = "0.17.1"
|
|
@@ -705,6 +749,16 @@ dependencies = [
|
|
|
705
749
|
"foldhash",
|
|
706
750
|
]
|
|
707
751
|
|
|
752
|
+
[[package]]
|
|
753
|
+
name = "heapless"
|
|
754
|
+
version = "0.8.0"
|
|
755
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
756
|
+
checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad"
|
|
757
|
+
dependencies = [
|
|
758
|
+
"hash32",
|
|
759
|
+
"stable_deref_trait",
|
|
760
|
+
]
|
|
761
|
+
|
|
708
762
|
[[package]]
|
|
709
763
|
name = "heck"
|
|
710
764
|
version = "0.5.0"
|
|
@@ -732,6 +786,15 @@ version = "1.10.1"
|
|
|
732
786
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
733
787
|
checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
|
|
734
788
|
|
|
789
|
+
[[package]]
|
|
790
|
+
name = "hybrid-array"
|
|
791
|
+
version = "0.4.15"
|
|
792
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
793
|
+
checksum = "27f864f10dfb56725ce5ce5472bc52252c8f93a4ab86327122cebf62c5f59a17"
|
|
794
|
+
dependencies = [
|
|
795
|
+
"typenum",
|
|
796
|
+
]
|
|
797
|
+
|
|
735
798
|
[[package]]
|
|
736
799
|
name = "icu_collections"
|
|
737
800
|
version = "2.2.0"
|
|
@@ -847,18 +910,18 @@ dependencies = [
|
|
|
847
910
|
|
|
848
911
|
[[package]]
|
|
849
912
|
name = "inout"
|
|
850
|
-
version = "0.
|
|
913
|
+
version = "0.2.2"
|
|
851
914
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
852
|
-
checksum = "
|
|
915
|
+
checksum = "4250ce6452e92010fdf7268ccc5d14faa80bb12fc741938534c58f16804e03c7"
|
|
853
916
|
dependencies = [
|
|
854
|
-
"
|
|
917
|
+
"hybrid-array",
|
|
855
918
|
]
|
|
856
919
|
|
|
857
920
|
[[package]]
|
|
858
921
|
name = "ipnet"
|
|
859
|
-
version = "2.12.
|
|
922
|
+
version = "2.12.2"
|
|
860
923
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
861
|
-
checksum = "
|
|
924
|
+
checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0"
|
|
862
925
|
|
|
863
926
|
[[package]]
|
|
864
927
|
name = "itoa"
|
|
@@ -993,9 +1056,9 @@ dependencies = [
|
|
|
993
1056
|
|
|
994
1057
|
[[package]]
|
|
995
1058
|
name = "lru"
|
|
996
|
-
version = "0.18.
|
|
1059
|
+
version = "0.18.5"
|
|
997
1060
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
998
|
-
checksum = "
|
|
1061
|
+
checksum = "ef9ac18847474e638e3702b76c65d4eb93428471a74778ef0f1be711717f89b5"
|
|
999
1062
|
dependencies = [
|
|
1000
1063
|
"hashbrown",
|
|
1001
1064
|
]
|
|
@@ -1045,24 +1108,14 @@ dependencies = [
|
|
|
1045
1108
|
|
|
1046
1109
|
[[package]]
|
|
1047
1110
|
name = "minijinja"
|
|
1048
|
-
version = "2.
|
|
1111
|
+
version = "2.24.0"
|
|
1049
1112
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1050
|
-
checksum = "
|
|
1113
|
+
checksum = "86886cf6dbf4e614b19c9a1eec9775f021869d7eadde0fc73921a81b90c9b4c9"
|
|
1051
1114
|
dependencies = [
|
|
1052
1115
|
"memo-map",
|
|
1053
1116
|
"serde",
|
|
1054
1117
|
]
|
|
1055
1118
|
|
|
1056
|
-
[[package]]
|
|
1057
|
-
name = "miniz_oxide"
|
|
1058
|
-
version = "0.8.9"
|
|
1059
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1060
|
-
checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"
|
|
1061
|
-
dependencies = [
|
|
1062
|
-
"adler2",
|
|
1063
|
-
"simd-adler32",
|
|
1064
|
-
]
|
|
1065
|
-
|
|
1066
1119
|
[[package]]
|
|
1067
1120
|
name = "munge"
|
|
1068
1121
|
version = "0.4.7"
|
|
@@ -1085,11 +1138,11 @@ dependencies = [
|
|
|
1085
1138
|
|
|
1086
1139
|
[[package]]
|
|
1087
1140
|
name = "napi"
|
|
1088
|
-
version = "3.
|
|
1141
|
+
version = "3.13.0"
|
|
1089
1142
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1090
|
-
checksum = "
|
|
1143
|
+
checksum = "3b12638855cec016784a7e17cc4ecbdee7ca8b0a3456aa50640d0ee5ed1a42f8"
|
|
1091
1144
|
dependencies = [
|
|
1092
|
-
"bitflags",
|
|
1145
|
+
"bitflags 2.13.1",
|
|
1093
1146
|
"ctor",
|
|
1094
1147
|
"futures",
|
|
1095
1148
|
"libc",
|
|
@@ -1103,15 +1156,15 @@ dependencies = [
|
|
|
1103
1156
|
|
|
1104
1157
|
[[package]]
|
|
1105
1158
|
name = "napi-build"
|
|
1106
|
-
version = "2.
|
|
1159
|
+
version = "2.6.0"
|
|
1107
1160
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1108
|
-
checksum = "
|
|
1161
|
+
checksum = "b899b545d3aa6dca985939059f258c5488d34e4ecf39c274e20009748f4b846d"
|
|
1109
1162
|
|
|
1110
1163
|
[[package]]
|
|
1111
1164
|
name = "napi-derive"
|
|
1112
|
-
version = "3.6.
|
|
1165
|
+
version = "3.6.5"
|
|
1113
1166
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1114
|
-
checksum = "
|
|
1167
|
+
checksum = "350057056a30368aa76c11a0d406b0aa61321710be2c36656ab4f6efe0b785a2"
|
|
1115
1168
|
dependencies = [
|
|
1116
1169
|
"convert_case",
|
|
1117
1170
|
"ctor",
|
|
@@ -1123,9 +1176,9 @@ dependencies = [
|
|
|
1123
1176
|
|
|
1124
1177
|
[[package]]
|
|
1125
1178
|
name = "napi-derive-backend"
|
|
1126
|
-
version = "6.
|
|
1179
|
+
version = "6.1.3"
|
|
1127
1180
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1128
|
-
checksum = "
|
|
1181
|
+
checksum = "4c1c87a71568f3fe5c736b10878ff55064b250bb4ea4b48c8055713e07b9e463"
|
|
1129
1182
|
dependencies = [
|
|
1130
1183
|
"convert_case",
|
|
1131
1184
|
"proc-macro2",
|
|
@@ -1136,9 +1189,9 @@ dependencies = [
|
|
|
1136
1189
|
|
|
1137
1190
|
[[package]]
|
|
1138
1191
|
name = "napi-sys"
|
|
1139
|
-
version = "3.
|
|
1192
|
+
version = "3.4.0"
|
|
1140
1193
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1141
|
-
checksum = "
|
|
1194
|
+
checksum = "e22a4f25c16a5c5411d987cd6fbd48313522ae1789ade2d6dd3efdc6d40a0fc8"
|
|
1142
1195
|
dependencies = [
|
|
1143
1196
|
"libloading",
|
|
1144
1197
|
]
|
|
@@ -1389,7 +1442,7 @@ checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744"
|
|
|
1389
1442
|
dependencies = [
|
|
1390
1443
|
"bit-set",
|
|
1391
1444
|
"bit-vec",
|
|
1392
|
-
"bitflags",
|
|
1445
|
+
"bitflags 2.13.1",
|
|
1393
1446
|
"num-traits",
|
|
1394
1447
|
"rand",
|
|
1395
1448
|
"rand_chacha",
|
|
@@ -1526,7 +1579,7 @@ version = "0.5.18"
|
|
|
1526
1579
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1527
1580
|
checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
|
|
1528
1581
|
dependencies = [
|
|
1529
|
-
"bitflags",
|
|
1582
|
+
"bitflags 2.13.1",
|
|
1530
1583
|
]
|
|
1531
1584
|
|
|
1532
1585
|
[[package]]
|
|
@@ -1642,7 +1695,7 @@ version = "1.1.4"
|
|
|
1642
1695
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1643
1696
|
checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"
|
|
1644
1697
|
dependencies = [
|
|
1645
|
-
"bitflags",
|
|
1698
|
+
"bitflags 2.13.1",
|
|
1646
1699
|
"errno",
|
|
1647
1700
|
"libc",
|
|
1648
1701
|
"linux-raw-sys",
|
|
@@ -1740,12 +1793,6 @@ version = "2.0.1"
|
|
|
1740
1793
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1741
1794
|
checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
|
|
1742
1795
|
|
|
1743
|
-
[[package]]
|
|
1744
|
-
name = "simd-adler32"
|
|
1745
|
-
version = "0.3.10"
|
|
1746
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1747
|
-
checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"
|
|
1748
|
-
|
|
1749
1796
|
[[package]]
|
|
1750
1797
|
name = "simdutf8"
|
|
1751
1798
|
version = "0.1.5"
|
|
@@ -2022,12 +2069,6 @@ dependencies = [
|
|
|
2022
2069
|
"libc",
|
|
2023
2070
|
]
|
|
2024
2071
|
|
|
2025
|
-
[[package]]
|
|
2026
|
-
name = "wasi"
|
|
2027
|
-
version = "0.11.1+wasi-snapshot-preview1"
|
|
2028
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2029
|
-
checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
|
|
2030
|
-
|
|
2031
2072
|
[[package]]
|
|
2032
2073
|
name = "wasip2"
|
|
2033
2074
|
version = "1.0.4+wasi-0.2.12"
|
package/Cargo.toml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "castrum"
|
|
3
3
|
# Keep in sync with package.json "version" (single source of truth: the npm package).
|
|
4
|
-
version = "0.9.
|
|
4
|
+
version = "0.9.11"
|
|
5
5
|
edition = "2021"
|
|
6
6
|
# Keep in sync with package.json "license" (cargo-deny rejects a crate with no
|
|
7
7
|
# license expression).
|
|
@@ -86,7 +86,10 @@ xxhash-rust = { version = "0.8", features = ["xxh3"] }
|
|
|
86
86
|
# with byte-exact semantics parity vs our HEX_VAL_LUT (case-insensitive decode,
|
|
87
87
|
# reject [^0-9a-fA-F], odd-length error) — verified exhaustively (65,536 pairs).
|
|
88
88
|
# Replaces the per-byte table loops that lost ~3-6x to Buffer.toString("hex").
|
|
89
|
-
|
|
89
|
+
# 0.10.1+ carries the RUSTSEC-2026-0306 fix (the unbounded AVX2 read in
|
|
90
|
+
# `hex_decode_unchecked`; 0.3.0..=0.10.0 are affected); keep this requirement at
|
|
91
|
+
# or above the fixed release so `cargo deny` / OSV stay green.
|
|
92
|
+
faster-hex = "0.10.1"
|
|
90
93
|
ipnet = "2"
|
|
91
94
|
# 0.18.2+ carries the RUSTSEC-2026-0253 fix (0.16.x is affected); keep this
|
|
92
95
|
# requirement at or above the fixed release so `cargo deny` / OSV stay green.
|
|
@@ -109,7 +112,7 @@ num-cmp = "0.1"
|
|
|
109
112
|
# argon2id password hashing (password-hash/rand features are default-on).
|
|
110
113
|
argon2 = "0.5"
|
|
111
114
|
# bcrypt password hashing (pure-Rust, Blowfish-based).
|
|
112
|
-
bcrypt = "0.
|
|
115
|
+
bcrypt = "0.19"
|
|
113
116
|
# PBKDF2-HMAC-SHA256 (RustCrypto) — pure-Rust KDF.
|
|
114
117
|
pbkdf2 = "0.12"
|
|
115
118
|
# sha2 is consumed ONLY by pbkdf2 (digest 0.10). Do NOT bump to 0.11: that
|
|
@@ -120,7 +123,14 @@ sha2 = "0.10"
|
|
|
120
123
|
# HTML templating (fast, safe, no eval).
|
|
121
124
|
minijinja = "2"
|
|
122
125
|
# gzip via the memory-safe zlib-rs backend (pure Rust, no C).
|
|
123
|
-
|
|
126
|
+
# `runtime_detection` is REQUIRED: flate2 1.1.10 moved `zlib-rs/std` (zlib-rs's
|
|
127
|
+
# runtime CPU-feature detection, i.e. its SIMD dispatch) behind this opt-in
|
|
128
|
+
# feature, which only `default` enables. Building with `default-features =
|
|
129
|
+
# false` and `zlib-rs` alone silently drops to zlib-rs's scalar path — measured
|
|
130
|
+
# 5.5x slower gzipCompress (16 MiB: ~2.2 s vs ~0.4 s in a debug build). Do NOT
|
|
131
|
+
# remove it, and do NOT lower the version: 1.1.9 did not have the feature (it
|
|
132
|
+
# hard-enabled `zlib-rs/std`).
|
|
133
|
+
flate2 = { version = "1.1.10", default-features = false, features = ["zlib-rs", "runtime_detection"] }
|
|
124
134
|
# brotli compression (pure Rust port).
|
|
125
135
|
brotli = "8"
|
|
126
136
|
|
package/README.md
CHANGED
|
@@ -187,8 +187,11 @@ For coverage floors, the typecheck/test configs, and the full test matrix, see
|
|
|
187
187
|
## Publishing
|
|
188
188
|
|
|
189
189
|
The package ships **all platform addons in a single tarball**. Push a `v*` tag
|
|
190
|
-
and
|
|
191
|
-
|
|
190
|
+
and `.github/workflows/release.yml` verifies the tag against
|
|
191
|
+
`package.json`/`Cargo.toml`, runs the quality gates, builds every platform
|
|
192
|
+
through the reusable `build-addons.yml`, publishes to npm with provenance, and
|
|
193
|
+
attaches the same `.node` files + `SHA256SUMS` to a GitHub release. Or use
|
|
194
|
+
`bun run release:manual` for a quick single-platform release:
|
|
192
195
|
|
|
193
196
|
```bash
|
|
194
197
|
bun run release minor # bump + verify + commit + tag (CI publishes)
|
|
Binary file
|
package/castrum.darwin-x64.node
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/FFI_BUN_GUIDE.md
CHANGED
|
@@ -351,10 +351,14 @@ callbacks — keep it that way.
|
|
|
351
351
|
These are not optional — they are what make the C-ABI surface safe on Bun (no
|
|
352
352
|
napi-style unwind guard exists for raw `extern "C"`).
|
|
353
353
|
|
|
354
|
-
1.
|
|
355
|
-
|
|
356
|
-
panic unwinding through `extern "C"`
|
|
357
|
-
what happened under
|
|
354
|
+
1. **Guard every export body with `c_abi!`** (`rust/ffi/util.rs`, which wraps
|
|
355
|
+
`panic_guard` / `std::panic::catch_unwind`; `AssertUnwindSafe` for captured
|
|
356
|
+
`&mut [u8]`). An uncaught panic unwinding through `extern "C"` is undefined
|
|
357
|
+
behaviour and kills the whole Bun process — this is what happened under
|
|
358
|
+
`11-concurrent-burst`. Use `panic_guard` directly only for a sub-expression
|
|
359
|
+
that should fall back while the rest of the body continues. The
|
|
360
|
+
`every_c_abi_export_is_panic_guarded` test fails the build if a new
|
|
361
|
+
`#[no_mangle]` export has neither.
|
|
358
362
|
2. **Bind-time self-test for EVERY new symbol** (`src/native/ffi/selfTest`).
|
|
359
363
|
`bun:ffi` is experimental upstream; the self-test + napi fallback is the
|
|
360
364
|
safety net. No symbol ships without a self-test vector.
|
package/docs/HOW_TO_ADD_AN_OP.md
CHANGED
|
@@ -84,9 +84,13 @@ mod tests {
|
|
|
84
84
|
## 2. Expose it over the C ABI (bun:ffi primary)
|
|
85
85
|
|
|
86
86
|
Add the `#[no_mangle] extern "C"` export in `rust/ffi/<domain>.rs`. Every
|
|
87
|
-
|
|
88
|
-
(
|
|
89
|
-
`extern "C"` and kill the process.
|
|
87
|
+
export body **must** be wrapped in the `c_abi!(fallback, { ... })` macro
|
|
88
|
+
(`rust/ffi/util.rs`), which runs it under `panic_guard`/`catch_unwind` so an
|
|
89
|
+
uncaught panic can't unwind through `extern "C"` and kill the process. Use
|
|
90
|
+
`panic_guard` directly only for a sub-expression that should fall back while the
|
|
91
|
+
rest of the body continues. `ffi/tests.rs`'s
|
|
92
|
+
`every_c_abi_export_is_panic_guarded` fails the build if a new export is
|
|
93
|
+
unprotected.
|
|
90
94
|
|
|
91
95
|
Rules (see `docs/FFI_BUN_GUIDE.md` for the full contract):
|
|
92
96
|
- Keep signatures **scalar + `(ptr,len)`** — no struct-by-value, no variadics.
|
|
@@ -117,10 +121,9 @@ Rules (see `docs/FFI_BUN_GUIDE.md` for the full contract):
|
|
|
117
121
|
#[no_mangle]
|
|
118
122
|
pub unsafe extern "C" fn castrum_fnv1a64(data: *const u8, len: usize) -> u64 {
|
|
119
123
|
if data.is_null() { return 0; }
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
)
|
|
124
|
+
c_abi!(0, {
|
|
125
|
+
crate::crypto::hashing::fnv1a64_bytes(std::slice::from_raw_parts(data, len))
|
|
126
|
+
})
|
|
124
127
|
}
|
|
125
128
|
```
|
|
126
129
|
|
|
@@ -204,8 +207,8 @@ bun run bench:startup # if you touched the transport/loade
|
|
|
204
207
|
## Checklist
|
|
205
208
|
|
|
206
209
|
- [ ] Pure-Rust core in the right domain folder with `#[cfg(test)] mod tests`
|
|
207
|
-
- [ ] `#[no_mangle] extern "C"` export with `
|
|
208
|
-
|
|
210
|
+
- [ ] `#[no_mangle] extern "C"` export with `c_abi!` + null checks + correct
|
|
211
|
+
`u64_fast`/cstring ABI
|
|
209
212
|
- [ ] Symbol in the `ffi.ts` dlopen map + `BunFFI` interface method
|
|
210
213
|
- [ ] Per-domain `selfTest*` vector in the same `ffi/build/*.ts` file
|
|
211
214
|
- [ ] Public `rust.*` wrapper with JSDoc (+ `*Into` pooled variant if hot)
|
package/docs/REPO_MAP.md
CHANGED
|
@@ -291,12 +291,16 @@ consumed.
|
|
|
291
291
|
|
|
292
292
|
- Package name `castrum` (unscoped, public). Native binary name `castrum`
|
|
293
293
|
(declared in package.json `napi.binaryName` + Cargo.toml — keep in sync).
|
|
294
|
-
- **Multi-platform (recommended)**: push a `v*` tag → `.github/workflows/
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
294
|
+
- **Multi-platform (recommended)**: push a `v*` tag → `.github/workflows/release.yml`.
|
|
295
|
+
It verifies the tag matches `package.json`/`Cargo.toml`/`Cargo.lock`, runs
|
|
296
|
+
fmt/clippy/tests + the JS gates, then calls the reusable
|
|
297
|
+
`.github/workflows/build-addons.yml` (the same matrix CI uses) to build every
|
|
298
|
+
platform addon. The `publish` job downloads them into `./artifacts`, stages
|
|
299
|
+
them, and runs `npm publish` (npm Trusted Publishing / OIDC — preferred, no
|
|
300
|
+
long-lived token; the job also targets the `NPM_TOKEN` environment as a
|
|
301
|
+
fallback secret. Needs the Trusted Publisher configured on npmjs.com).
|
|
302
|
+
A final job creates the GitHub release with the `.node` files + `SHA256SUMS`.
|
|
303
|
+
CI itself no longer publishes (or runs on tags), so the two cannot race.
|
|
300
304
|
- **Manual single-platform**: `bun run release:manual`
|
|
301
305
|
(syncs package.json ↔ Cargo.toml ↔ CHANGELOG, tags, builds, publishes with
|
|
302
306
|
`CASTRUM_PUBLISH_ALLOW_PARTIAL=1`). `--dry-run` plans only.
|
package/docs/ai/TREE.md
CHANGED
|
@@ -1057,8 +1057,10 @@ docs/
|
|
|
1057
1057
|
│ ├─ bug_report.md
|
|
1058
1058
|
│ └─ feature_request.md
|
|
1059
1059
|
├─ workflows/
|
|
1060
|
+
│ ├─ build-addons.yml # reusable multi-platform addon matrix (ci + release)
|
|
1060
1061
|
│ ├─ ci.yml
|
|
1061
|
-
│
|
|
1062
|
+
│ ├─ codeql.yml
|
|
1063
|
+
│ └─ release.yml # v* tag: verify → build → npm publish → GitHub release
|
|
1062
1064
|
├─ codeql-config.yml
|
|
1063
1065
|
├─ dependabot.yml
|
|
1064
1066
|
└─ PULL_REQUEST_TEMPLATE.md
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "castrum",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Enterprise-grade Bun + Rust runtime: Rust-accelerated FFI primitives, a production-grade HTTP ingress pipeline, validation, hashing, and JSON processing with benchmark-grade performance.",
|
|
6
6
|
"type": "module",
|
|
@@ -158,7 +158,8 @@
|
|
|
158
158
|
"@napi-rs/cli": {
|
|
159
159
|
"typescript": "6.0.3"
|
|
160
160
|
},
|
|
161
|
-
"hyperid": "^4.0.0"
|
|
161
|
+
"hyperid": "^4.0.0",
|
|
162
|
+
"fast-uri": "^3.1.8"
|
|
162
163
|
},
|
|
163
164
|
"engines": {
|
|
164
165
|
"bun": ">=1.1.0",
|