[Fix] Version Bump, Checks, tests CQ
Some checks failed
CI / checks (push) Failing after 2m54s

This commit is contained in:
Alex Emmet 2026-08-13 21:18:55 +02:00
commit e939714557
34 changed files with 5752 additions and 628 deletions

View file

@ -1,5 +1,5 @@
[env]
MTP_TYPE_MAPS = { value = "example-type-maps.yaml", relative = true }
MTP_TYPE_MAPS = { value = "example/type-maps.yaml", relative = true }
# web-sys's WebTransport* bindings are behind unstable APIs, gated by this cfg.
# Scoped to the wasm32 target so it applies to the wasm crate however cargo is

View file

@ -43,7 +43,7 @@ jobs:
node test/e2ee.mjs
pnpm run test:secrets
pnpm run test:types
pnpm run check:boundary
pnpm run test:boundary
(
cd example

376
Cargo.lock generated
View file

@ -61,7 +61,7 @@ dependencies = [
"nom",
"num-traits",
"rusticata-macros",
"thiserror 2.0.19",
"thiserror 2.0.20",
"time",
]
@ -96,7 +96,7 @@ checksum = "ae36dc4177970ef04fde5178d3e2429882def40e57a451f919c098f72baa6cec"
dependencies = [
"proc-macro2",
"quote",
"syn 3.0.2",
"syn 3.0.3",
]
[[package]]
@ -113,9 +113,9 @@ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
[[package]]
name = "aws-lc-rs"
version = "1.17.3"
version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00bdb5da18dac48ca2cc7cd4a98e533e8635a58e2361d13a1a4ee3888e0d72f1"
checksum = "ce2b2dcc879c3bae0d371e77c99f2238400ef24ec001394befa67b6e543add9e"
dependencies = [
"aws-lc-sys",
"untrusted 0.7.1",
@ -124,9 +124,9 @@ dependencies = [
[[package]]
name = "aws-lc-sys"
version = "0.43.0"
version = "0.44.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43103168cc76fe62678a375e722fc9cb3a0146159ac5828bc4f0dfd755c2224c"
checksum = "f09fae7be8bb3174e05c6afdb34199e6dc0c7c04ba9fa237b1967adfbde27483"
dependencies = [
"cc",
"cmake",
@ -141,6 +141,12 @@ version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "base64"
version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5"
[[package]]
name = "base64ct"
version = "1.8.3"
@ -215,9 +221,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]]
name = "cc"
version = "1.3.0"
version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8"
checksum = "5d262e149917187838d5b42777c8253bcb64500067342904e7d429499a6f277e"
dependencies = [
"find-msvc-tools",
"jobserver",
@ -318,12 +324,6 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "const-oid"
version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
[[package]]
name = "const-oid"
version = "0.10.2"
@ -413,8 +413,23 @@ dependencies = [
"cfg-if",
"cpufeatures 0.2.17",
"curve25519-dalek-derive",
"digest 0.10.7",
"fiat-crypto",
"fiat-crypto 0.2.9",
"rustc_version",
"subtle",
"zeroize",
]
[[package]]
name = "curve25519-dalek"
version = "5.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5eed333089e2e1c1ac8c6c0398e5e2497b4c9926ca6d0365ed1e099afa5bc23"
dependencies = [
"cfg-if",
"cpufeatures 0.3.0",
"curve25519-dalek-derive",
"digest 0.11.3",
"fiat-crypto 0.3.0",
"rustc_version",
"subtle",
"zeroize",
@ -433,20 +448,9 @@ dependencies = [
[[package]]
name = "data-encoding"
version = "2.11.0"
version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8"
[[package]]
name = "der"
version = "0.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
dependencies = [
"const-oid 0.9.6",
"pem-rfc7468",
"zeroize",
]
checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06"
[[package]]
name = "der"
@ -454,7 +458,8 @@ version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a69dedd701da44b0536442edf09c81a64b0ab97a7a4a5e3d1971f00027cbc63d"
dependencies = [
"const-oid 0.10.2",
"const-oid",
"pem-rfc7468",
"zeroize",
]
@ -496,20 +501,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"
dependencies = [
"block-buffer 0.12.1",
"const-oid 0.10.2",
"const-oid",
"crypto-common 0.2.2",
"ctutils",
]
[[package]]
name = "displaydoc"
version = "0.2.6"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f"
checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
"syn 3.0.3",
]
[[package]]
@ -520,24 +525,25 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
[[package]]
name = "ed25519"
version = "2.2.3"
version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53"
checksum = "29fcf32e6c73d1079f83ab4d782de2d81620346a5f38c6237a86a22f8368980a"
dependencies = [
"pkcs8 0.10.2",
"signature 2.2.0",
"pkcs8",
"signature",
]
[[package]]
name = "ed25519-dalek"
version = "2.2.0"
version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9"
checksum = "6ebaa1a2bf1290ab3bfe5a7b771d050ebffab2711c19a81691c683a5144a25de"
dependencies = [
"curve25519-dalek",
"curve25519-dalek 5.0.0",
"ed25519",
"serde",
"sha2 0.10.9",
"sha2",
"signature",
"subtle",
"zeroize",
]
@ -583,10 +589,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d"
[[package]]
name = "find-msvc-tools"
version = "0.1.9"
name = "fiat-crypto"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
checksum = "64cd1e32ddd350061ae6edb1b082d7c54915b5c672c389143b9a63403a109f24"
[[package]]
name = "find-msvc-tools"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26b73573e6edcd2af0cdf47bd6cb58f0b3839491263c314eaad1ccf24430e1de"
[[package]]
name = "fnv"
@ -632,9 +644,9 @@ dependencies = [
[[package]]
name = "futures-channel"
version = "0.3.33"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "262590f4fe6afeb0bc83be1daa64e52657fe185690a958af7f3ad0e92085c5ae"
checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"
dependencies = [
"futures-core",
"futures-sink",
@ -642,9 +654,9 @@ dependencies = [
[[package]]
name = "futures-core"
version = "0.3.33"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7"
checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
[[package]]
name = "futures-executor"
@ -659,38 +671,38 @@ dependencies = [
[[package]]
name = "futures-io"
version = "0.3.33"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4577ecaa3c4f96589d473f679a71b596316f6641bc350038b962a5daf0085d7a"
checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
[[package]]
name = "futures-macro"
version = "0.3.33"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d6d3cde68c518367be28956066ddfef33813991b77a55005a69dae04bf3b10b"
checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
"syn 3.0.3",
]
[[package]]
name = "futures-sink"
version = "0.3.33"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e34418ac499d6305c2fb5ad0ed2f6ac998c5f8ca209b4510f7f94242c647e307"
checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"
[[package]]
name = "futures-task"
version = "0.3.33"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109"
checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
[[package]]
name = "futures-util"
version = "0.3.33"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa"
checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
dependencies = [
"futures-channel",
"futures-core",
@ -908,9 +920,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
[[package]]
name = "hybrid-array"
version = "0.4.13"
version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "818356c5132c1fede50f837ca96afbe78ff42413047f4abb886217845e1b6c8c"
checksum = "707114b52a152fa7bdb290cd7cd5912d9467273b6d74e21b8d81aca1f8533f6b"
dependencies = [
"ctutils",
"typenum",
@ -1092,7 +1104,7 @@ dependencies = [
"jni-sys",
"log",
"simd_cesu8",
"thiserror 2.0.19",
"thiserror 2.0.20",
"walkdir",
"windows-link",
]
@ -1177,9 +1189,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "libc"
version = "0.2.186"
version = "0.2.189"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66"
checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
[[package]]
name = "libm"
@ -1253,14 +1265,14 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "add6b9d92e496f16f4526d68ff29da1483aba4b119baeab8bed3b9e3544a6f3d"
dependencies = [
"const-oid 0.10.2",
"const-oid",
"crypto-common 0.2.2",
"ctutils",
"hybrid-array",
"module-lattice",
"pkcs8 0.11.0",
"pkcs8",
"shake",
"signature 3.0.0",
"signature",
]
[[package]]
@ -1302,7 +1314,7 @@ dependencies = [
[[package]]
name = "mtp"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"mtp-client",
"mtp-codec",
@ -1313,66 +1325,66 @@ dependencies = [
"mtp-transport",
"mtp-type-map",
"mtp-webserver",
"rand 0.10.2",
"rand",
"rcgen",
"tokio",
]
[[package]]
name = "mtp-client"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"mtp-codec",
"mtp-common",
"mtp-crypto",
"mtp-host",
"mtp-transport",
"rand 0.10.2",
"rand",
"rcgen",
"tokio",
]
[[package]]
name = "mtp-codec"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"base64",
"base64 0.23.1",
"byteorder",
"mtp-common",
"mtp-crypto",
"mtp-type-map",
"rand 0.10.2",
"thiserror 2.0.19",
"rand",
"thiserror 2.0.20",
]
[[package]]
name = "mtp-common"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"quinn",
"rustls",
"thiserror 2.0.19",
"thiserror 2.0.20",
"wtransport",
]
[[package]]
name = "mtp-crypto"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"aes-gcm",
"base64",
"base64 0.22.1",
"chacha20poly1305",
"ed25519-dalek",
"getrandom 0.4.3",
"hkdf",
"ml-dsa",
"mlkem-tls",
"rand 0.10.2",
"rand",
"rand_core 0.6.4",
"rcgen",
"rustls",
"serde",
"sha2 0.11.0",
"sha2",
"thiserror 1.0.69",
"time",
"tokio",
@ -1381,24 +1393,24 @@ dependencies = [
[[package]]
name = "mtp-files"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"argon2",
"mtp-crypto",
"rand 0.10.2",
"thiserror 1.0.69",
"rand",
"thiserror 2.0.20",
"zeroize",
]
[[package]]
name = "mtp-host"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"mtp-codec",
"mtp-common",
"mtp-crypto",
"mtp-transport",
"rand 0.8.7",
"rand",
"tokio",
"tracing",
"wtransport",
@ -1406,17 +1418,17 @@ dependencies = [
[[package]]
name = "mtp-transport"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"async-trait",
"mtp-codec",
"mtp-common",
"mtp-crypto",
"rand 0.10.2",
"rand",
"rcgen",
"rustls",
"rustls-native-certs",
"sha2 0.11.0",
"sha2",
"tokio",
"tracing",
"wtransport",
@ -1425,7 +1437,7 @@ dependencies = [
[[package]]
name = "mtp-type-map"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"serde",
"serde_yaml",
@ -1433,7 +1445,7 @@ dependencies = [
[[package]]
name = "mtp-wasm"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"console_error_panic_hook",
"futures-channel",
@ -1456,7 +1468,7 @@ dependencies = [
[[package]]
name = "mtp-webserver"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"async-trait",
"bytes",
@ -1473,10 +1485,10 @@ dependencies = [
"mtp-host",
"mtp-transport",
"quinn",
"rand 0.10.2",
"rand",
"rcgen",
"rustls",
"thiserror 2.0.19",
"thiserror 2.0.20",
"tokio",
"tokio-rustls",
"tokio-stream",
@ -1520,9 +1532,9 @@ checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441"
[[package]]
name = "num-integer"
version = "0.1.46"
version = "0.1.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f"
checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"
dependencies = [
"num-traits",
]
@ -1616,15 +1628,15 @@ version = "3.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be"
dependencies = [
"base64",
"base64 0.22.1",
"serde_core",
]
[[package]]
name = "pem-rfc7468"
version = "0.7.0"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412"
checksum = "a6305423e0e7738146434843d1694d621cce767262b2a86910beab705e4493d9"
dependencies = [
"base64ct",
]
@ -1641,24 +1653,14 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
[[package]]
name = "pkcs8"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
dependencies = [
"der 0.7.10",
"spki 0.7.3",
]
[[package]]
name = "pkcs8"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "451913da69c775a56034ea8d9003d27ee8948e12443eae7c038ba100a4f21cb7"
dependencies = [
"der 0.8.1",
"spki 0.8.0",
"der",
"spki",
]
[[package]]
@ -1692,9 +1694,9 @@ dependencies = [
[[package]]
name = "portable-atomic"
version = "1.14.0"
version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d20d5497ef88037a52ff98267d066e7f11fcc5e99bbfbd58a42336193aacec3"
checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
[[package]]
name = "potential_utf"
@ -1711,15 +1713,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
[[package]]
name = "ppv-lite86"
version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
dependencies = [
"zerocopy",
]
[[package]]
name = "proc-macro2"
version = "1.0.107"
@ -1744,7 +1737,7 @@ dependencies = [
"rustc-hash",
"rustls",
"socket2",
"thiserror 2.0.19",
"thiserror 2.0.20",
"tokio",
"tracing",
"web-time",
@ -1761,7 +1754,7 @@ dependencies = [
"fastbloom",
"getrandom 0.4.3",
"lru-slab",
"rand 0.10.2",
"rand",
"rand_pcg",
"ring",
"rustc-hash",
@ -1769,7 +1762,7 @@ dependencies = [
"rustls-pki-types",
"rustls-platform-verifier",
"slab",
"thiserror 2.0.19",
"thiserror 2.0.20",
"tinyvec",
"tracing",
"web-time",
@ -1804,17 +1797,6 @@ version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
[[package]]
name = "rand"
version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a"
dependencies = [
"libc",
"rand_chacha",
"rand_core 0.6.4",
]
[[package]]
name = "rand"
version = "0.10.2"
@ -1826,16 +1808,6 @@ dependencies = [
"rand_core 0.10.1",
]
[[package]]
name = "rand_chacha"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [
"ppv-lite86",
"rand_core 0.6.4",
]
[[package]]
name = "rand_core"
version = "0.6.4"
@ -1862,9 +1834,9 @@ dependencies = [
[[package]]
name = "rcgen"
version = "0.14.8"
version = "0.14.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57f6d249aad744e274e682777a50283a225a32705394ee6d5fcc01efa25e4055"
checksum = "091e7a8e7d86e6feb87a27ce8e2cba29d49eff9507afeebefab7eeb2ca667fb4"
dependencies = [
"aws-lc-rs",
"pem",
@ -1952,9 +1924,9 @@ dependencies = [
[[package]]
name = "rustls-pki-types"
version = "1.15.0"
version = "1.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "764899a24af3980067ee14bc143654f297b22eaebfe3c7b6b211920a5a59b046"
checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96"
dependencies = [
"web-time",
"zeroize",
@ -1989,9 +1961,9 @@ checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f"
[[package]]
name = "rustls-webpki"
version = "0.103.13"
version = "0.103.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e"
checksum = "0527518605e68109d875e248ea259b6758801cf165e4b2c2733ae3b51f12535a"
dependencies = [
"aws-lc-rs",
"ring",
@ -2091,7 +2063,7 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
dependencies = [
"proc-macro2",
"quote",
"syn 3.0.2",
"syn 3.0.3",
]
[[package]]
@ -2120,17 +2092,6 @@ dependencies = [
"unsafe-libyaml",
]
[[package]]
name = "sha2"
version = "0.10.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283"
dependencies = [
"cfg-if",
"cpufeatures 0.2.17",
"digest 0.10.7",
]
[[package]]
name = "sha2"
version = "0.11.0"
@ -2188,15 +2149,6 @@ dependencies = [
"libc",
]
[[package]]
name = "signature"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de"
dependencies = [
"rand_core 0.6.4",
]
[[package]]
name = "signature"
version = "3.0.0"
@ -2251,16 +2203,6 @@ dependencies = [
"windows-sys 0.61.2",
]
[[package]]
name = "spki"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d"
dependencies = [
"base64ct",
"der 0.7.10",
]
[[package]]
name = "spki"
version = "0.8.0"
@ -2268,7 +2210,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d9efca8738c78ee9484207732f728b1ef517bbb1833d6fc0879ca898a522f6f"
dependencies = [
"base64ct",
"der 0.8.1",
"der",
]
[[package]]
@ -2302,9 +2244,9 @@ dependencies = [
[[package]]
name = "syn"
version = "3.0.2"
version = "3.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a207d6d6a2b7fc470b80443726053f18a2481b7e1eee970597051596567987a3"
checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3"
dependencies = [
"proc-macro2",
"quote",
@ -2333,11 +2275,11 @@ dependencies = [
[[package]]
name = "thiserror"
version = "2.0.19"
version = "2.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09a43598840e33d5b0331f38c5e30d13bb11c11210a4b58f0d9b18a5a5eefcd9"
checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f"
dependencies = [
"thiserror-impl 2.0.19",
"thiserror-impl 2.0.20",
]
[[package]]
@ -2353,13 +2295,13 @@ dependencies = [
[[package]]
name = "thiserror-impl"
version = "2.0.19"
version = "2.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43cbfe0cf76104d42a574802844187e84a305e531ed54455f11fbde0f10541cd"
checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af"
dependencies = [
"proc-macro2",
"quote",
"syn 3.0.2",
"syn 3.0.3",
]
[[package]]
@ -2373,9 +2315,9 @@ dependencies = [
[[package]]
name = "time"
version = "0.3.54"
version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e1d5e639ff6bab73cb6885cc7e7b1de96c3f32c68ec55f3952614bec1092244"
checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134"
dependencies = [
"deranged",
"num-conv",
@ -2445,13 +2387,13 @@ dependencies = [
[[package]]
name = "tokio-macros"
version = "2.7.1"
version = "2.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6328af13490e73a9b4694030fafd93f8c8c6a9dede33e821c3fc63eddf8042ba"
checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
"syn 3.0.3",
]
[[package]]
@ -2855,9 +2797,9 @@ checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
[[package]]
name = "wtransport"
version = "0.7.1"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea4aacf790813ee1956751491800537f4e04af7557b7b370501ccbfbc85963e4"
checksum = "b4273ce3157a3262a68665f8d3f20a0ac0c5b8a69ffd67f05ae986832ebec036"
dependencies = [
"bytes",
"pem",
@ -2866,9 +2808,9 @@ dependencies = [
"rustls",
"rustls-native-certs",
"rustls-pki-types",
"sha2 0.11.0",
"sha2",
"socket2",
"thiserror 2.0.19",
"thiserror 2.0.20",
"time",
"tokio",
"tracing",
@ -2879,13 +2821,13 @@ dependencies = [
[[package]]
name = "wtransport-proto"
version = "0.7.1"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5867c629e4252f7439d82315923daaf27f4fa442410d51b78ab93ef4c432a11"
checksum = "aad9059572c7dbd6901ccef37f3b7321678cd708dcf58a64b1921dbeab7bfede"
dependencies = [
"httlib-huffman",
"octets",
"thiserror 2.0.19",
"thiserror 2.0.20",
"url",
]
@ -2895,7 +2837,7 @@ version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277"
dependencies = [
"curve25519-dalek",
"curve25519-dalek 4.1.3",
"rand_core 0.6.4",
"serde",
"zeroize",
@ -2916,7 +2858,7 @@ dependencies = [
"oid-registry",
"ring",
"rusticata-macros",
"thiserror 2.0.19",
"thiserror 2.0.20",
"time",
]
@ -2953,26 +2895,6 @@ dependencies = [
"synstructure",
]
[[package]]
name = "zerocopy"
version = "0.8.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5a105cd7b140f6eeec8acff2ea38135d3cab283ada58540f629fe51e46696eb"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
version = "0.8.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fe976fb70c78cd64cccfe3a6fc142244e8a77b70959b30faf9d0ac37ee228eb"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
]
[[package]]
name = "zerofrom"
version = "0.1.8"

View file

@ -45,24 +45,24 @@ resolver = "3"
# =============================================================================
[package]
name = "mtp"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
[dependencies]
# --- always-on core ---
mtp-common = { version = "0.2.0", path = "common" }
mtp-type-map = { version = "0.2.0", path = "type-map" }
mtp-codec = { version = "0.2.0", path = "codec" }
mtp-common = { version = "0.3.0", path = "common" }
mtp-type-map = { version = "0.3.0", path = "type-map" }
mtp-codec = { version = "0.3.0", path = "codec" }
# --- optional, behind features ---
mtp-crypto = { version = "0.2.0", path = "crypto", optional = true, features = [
mtp-crypto = { version = "0.3.0", path = "crypto", optional = true, features = [
"serde",
"mlkem-tls",
] }
mtp-host = { version = "0.2.0", path = "host", optional = true }
mtp-client = { version = "0.2.0", path = "client", optional = true }
mtp-files = { version = "0.2.0", path = "files", optional = true }
mtp-webserver = { version = "0.2.0", path = "mtp-webserver", optional = true }
mtp-transport = { version = "0.2.0", path = "transport", optional = true }
mtp-host = { version = "0.3.0", path = "host", optional = true }
mtp-client = { version = "0.3.0", path = "client", optional = true }
mtp-files = { version = "0.3.0", path = "files", optional = true }
mtp-webserver = { version = "0.3.0", path = "mtp-webserver", optional = true }
mtp-transport = { version = "0.3.0", path = "transport", optional = true }
[features]
# Serialization

View file

@ -1,19 +1,19 @@
[package]
name = "mtp-client"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
[dependencies]
mtp-common = { version = "0.2.0", path = "../common" }
mtp-codec = { version = "0.2.0", path = "../codec", features = ["registry"] }
mtp-transport = { version = "0.2.0", path = "../transport" }
mtp-crypto = { version = "0.2.0", path = "../crypto", optional = true }
mtp-common = { version = "0.3.0", path = "../common" }
mtp-codec = { version = "0.3.0", path = "../codec", features = ["registry"] }
mtp-transport = { version = "0.3.0", path = "../transport" }
mtp-crypto = { version = "0.3.0", path = "../crypto", optional = true }
rand = "0.10.1"
tokio = { version = "1", features = ["rt", "sync", "time"] }
[dev-dependencies]
mtp-host = { version = "0.2.0", path = "../host" }
mtp-transport = { version = "0.2.0", path = "../transport", features = ["host"] }
mtp-host = { version = "0.3.0", path = "../host" }
mtp-transport = { version = "0.3.0", path = "../transport", features = ["host"] }
rcgen = "0.14"
[features]

1991
codec/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,12 +1,12 @@
[package]
name = "mtp-codec"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
[dependencies]
mtp-type-map = { version = "0.2.0", path = "../type-map" }
mtp-common = { version = "0.2.0", path = "../common" }
mtp-crypto = { version = "0.2.0", path = "../crypto", optional = true }
mtp-type-map = { version = "0.3.0", path = "../type-map" }
mtp-common = { version = "0.3.0", path = "../common" }
mtp-crypto = { version = "0.3.0", path = "../crypto", optional = true }
base64 = "0.23"
byteorder = "1.5"
rand = { version = "0.10.1", features = ["std", "std_rng"] }

View file

@ -643,13 +643,6 @@ mod tests {
Ed25519Signer::new(&keyring.sig_cl_secret_key).expect("Ed25519 signer")
}
fn relay_fixture_created_at_millis() -> u64 {
include_str!("../../fixtures/relay-created-at-ms.txt")
.trim()
.parse()
.expect("relay timestamp fixture must be an unsigned integer")
}
fn relay_frame_with_version(
version: Option<u64>,
include_v1_fields: bool,
@ -780,20 +773,20 @@ mod tests {
}
#[test]
fn relay_fixture_encodes_created_at_as_exact_milliseconds() {
fn relay_created_at_preserves_exact_milliseconds() {
let sender = Keyring::generate();
let recipient = Keyring::generate();
let signer = ed_signer(&sender);
let created_at = relay_fixture_created_at_millis();
let created_at = 1_720_000_000_123;
let frame = SealedRelayBuilder::new(
"ProtectedMessage",
DataValue::Str("fixture content".into()),
DataValue::Str("timestamp content".into()),
11,
42,
42,
&signer,
)
.message_id("relay-created-at-ms-fixture")
.message_id("relay-created-at-millis")
.created_at(created_at)
.metadata_recipients(vec![recipient.public_key_bundle()])
.content_recipients(vec![recipient.public_key_bundle()])

1469
common/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
[package]
name = "mtp-common"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
[dependencies]

1405
crypto/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
[package]
name = "mtp-crypto"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
[package.metadata.cargo-machete]

View file

@ -120,6 +120,7 @@ The `storage` option supplies the credential adapter. The adapter stores the cli
`sessionStorage` and `encryptedSecretProvider` are separate caller-managed
stores. The latter exchanges `MTPEncryptedSecretRecord` values through
`set`, `get`, and `delete`; the `MTPClient` convenience methods are named
`setEncryptedSecret`, `getEncryptedSecret`, and `deleteEncryptedSecret`.
`MTPSessionManager` does not automatically route session state through the
provider. If session material must be encrypted at rest, the caller must make
@ -637,12 +638,40 @@ config.free();
Raw callbacks receive parsed frames, not application-specific SDK objects:
```typescript
interface ParsedEncryptedValue {
kind: "encrypted";
encryptionType: number;
purpose: number;
recipientCount: number;
encoded: Uint8Array;
}
interface ParsedSignedValue {
kind: "signed";
signatureType: number;
purpose: number;
signerId: bigint;
value: ParsedDataValue;
}
type ParsedDataValue =
| boolean
| number
| bigint
| string
| Uint8Array
| ParsedDataValue[]
| { [key: string]: ParsedDataValue }
| ParsedEncryptedValue
| ParsedSignedValue
| null;
interface ParsedFrame {
id?: number;
type: string;
sender?: bigint;
receiver?: bigint;
data: Record<string, unknown>;
data: ParsedDataValue;
raw: Uint8Array;
}
```

441
example/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
[package]
name = "client"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
[[bin]]
@ -8,7 +8,7 @@ name = "client"
path = "src/main.rs"
[dependencies]
mtp = { version = "0.2.0", path = "../../", features = ["client", "crypto", "files", "pipes", "raw"] }
mtp = { version = "0.3.0", path = "../../", features = ["client", "crypto", "files", "pipes", "raw"] }
tokio = { version = "1", features = ["full"] }
rand = "0.10.1"
tracing-subscriber = "0.3.23"

View file

@ -1,7 +1,7 @@
[package]
name = "keygen"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
[dependencies]
mtp = { version = "0.2.0", path = "../../", features = ["files", "raw"] }
mtp = { version = "0.3.0", path = "../../", features = ["files", "raw"] }

View file

@ -1,6 +1,6 @@
[package]
name = "server"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
[[bin]]
@ -8,7 +8,7 @@ name = "server"
path = "src/main.rs"
[dependencies]
mtp = { version = "0.2.0", path = "../../", features = ["crypto", "tls", "web-server", "files", "pipes", "raw"] }
mtp = { version = "0.3.0", path = "../../", features = ["crypto", "tls", "web-server", "files", "pipes", "raw"] }
tokio = { version = "1", features = ["full"] }
http = "1"
serde_json = { version = "1" }

View file

@ -1,7 +1,7 @@
{
"name": "mtp-web-client",
"private": true,
"version": "0.2.0",
"version": "0.3.0",
"type": "module",
"packageManager": "pnpm@11.8.0",
"scripts": {

View file

@ -1,12 +1,12 @@
[package]
name = "mtp-files"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
[dependencies]
# Only the plain key types (`Keyring`, `PublicKeyBundle`, `CryptoError`) are
# needed here; those are always compiled, so no crypto features are required.
mtp-crypto = { version = "0.2.0", path = "../crypto", default-features = false, features = ["chacha20poly1305", "hkdf"] }
mtp-crypto = { version = "0.3.0", path = "../crypto", default-features = false, features = ["chacha20poly1305", "hkdf"] }
argon2 = "0.5"
rand = "0.10.2"
@ -16,3 +16,8 @@ zeroize = "1.9"
[features]
# Plain private-key files are only needed by migration tooling and tests.
raw = []
[dev-dependencies]
# Enable suite implementations for bundle-loading tests without adding them to
# the normal files-library dependency surface.
mtp-crypto = { version = "0.3.0", path = "../crypto", features = ["mlkem-tls"] }

View file

@ -347,7 +347,7 @@ mod tests {
#[test]
fn bundle_save_load_roundtrip() -> Result<(), Box<dyn std::error::Error>> {
let path = temp_path(BUNDLE_EXTENSION);
let bundle = sample_keyring().public_key_bundle();
let bundle = Keyring::generate().public_key_bundle();
save_public_key_bundle(&bundle, &path)?;
let loaded = load_public_key_bundle(&path)?;
assert_eq!(bundle.as_bytes(), loaded.as_bytes());
@ -358,7 +358,8 @@ mod tests {
#[test]
fn loading_bundle_as_keyring_fails_on_magic() -> Result<(), Box<dyn std::error::Error>> {
let path = temp_path(BUNDLE_EXTENSION);
save_public_key_bundle(&sample_keyring().public_key_bundle(), &path)?;
let bundle = Keyring::generate().public_key_bundle();
save_public_key_bundle(&bundle, &path)?;
assert!(matches!(
load_keyring(&path, b"passphrase"),
Err(FileError::BadMagic { .. })

View file

@ -73,7 +73,7 @@
pnpm run test:e2e
pnpm run test:secrets
pnpm run test:types
pnpm run check:boundary
pnpm run test:boundary
pnpm --filter mtp-web-client run build
'';
};

View file

@ -1,13 +1,13 @@
[package]
name = "mtp-host"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
[dependencies]
mtp-common = { version = "0.2.0", path = "../common" }
mtp-codec = { version = "0.2.0", path = "../codec", features = ["registry"] }
mtp-transport = { version = "0.2.0", path = "../transport", features = ["host"] }
mtp-crypto = { version = "0.2.0", path = "../crypto", optional = true }
mtp-common = { version = "0.3.0", path = "../common" }
mtp-codec = { version = "0.3.0", path = "../codec", features = ["registry"] }
mtp-transport = { version = "0.3.0", path = "../transport", features = ["host"] }
mtp-crypto = { version = "0.3.0", path = "../crypto", optional = true }
rand = "0.10"
tokio = { version = "1", features = ["macros", "rt", "time", "sync"] }
tracing = "0.1"

View file

@ -1,14 +1,14 @@
[package]
name = "mtp-webserver"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
[dependencies]
mtp-common = { version = "0.2.0", path = "../common" }
mtp-codec = { version = "0.2.0", path = "../codec", features = ["registry"] }
mtp-host = { version = "0.2.0", path = "../host" }
mtp-transport = { version = "0.2.0", path = "../transport" }
mtp-crypto = { version = "0.2.0", path = "../crypto" }
mtp-common = { version = "0.3.0", path = "../common" }
mtp-codec = { version = "0.3.0", path = "../codec", features = ["registry"] }
mtp-host = { version = "0.3.0", path = "../host" }
mtp-transport = { version = "0.3.0", path = "../transport" }
mtp-crypto = { version = "0.3.0", path = "../crypto" }
bytes = "1"
http = "1"
tokio = { version = "1", features = ["io-util", "macros", "net", "rt", "sync", "time"] }

View file

@ -1,6 +1,6 @@
{
"name": "mtp",
"version": "0.2.0",
"version": "0.3.0",
"description": "MTP TypeScript SDK",
"type": "module",
"packageManager": "pnpm@11.8.0",
@ -32,12 +32,16 @@
"Cargo.lock",
"dist/",
"README.md",
"codec/Cargo.lock",
"codec/Cargo.toml",
"codec/src/",
"common/Cargo.lock",
"common/Cargo.toml",
"common/src/",
"crypto/Cargo.lock",
"crypto/Cargo.toml",
"crypto/src/",
"type-map/Cargo.lock",
"type-map/Cargo.toml",
"type-map/build.rs",
"type-map/reserved.json",
@ -50,15 +54,19 @@
],
"scripts": {
"example": "pnpm install && pnpm run build:all && nix develop .#autoStart",
"build": "MTP_TYPE_MAPS=$PWD/example-type-maps.yaml RUSTFLAGS='--cfg web_sys_unstable_apis' wasm-pack build wasm --target web --out-dir pkg --release && tsc",
"clean": "rm -rf dist wasm/pkg mtp-*.tgz",
"build:wasm": "MTP_TYPE_MAPS=$PWD/example-type-maps.yaml wasm-pack build wasm --target web --out-dir pkg --release && rm -f wasm/pkg/.gitignore",
"build:ts": "rm -rf dist && tsc",
"build": "pnpm run build:wasm && pnpm run build:ts",
"pack": "pnpm run clean && pnpm run build && pnpm pack",
"build:all": "nix run .#build-all",
"dup": "jscpd --pattern '**/*.{rs,ts}' --ignore 'target/**' --ignore 'wasm/pkg/**' --ignore '.git/**' --min-lines 8 --min-tokens 80 --threshold 4 --reporters console --noTips .",
"test:e2e": "tsc && node test/e2ee.mjs",
"test:secrets": "tsc && node --test --test-isolation=none test/encrypted-secret.mjs",
"test:types": "tsc -p tsconfig.type-tests.json --noEmit",
"test:vite": "tsc && node test/vite-type-map.mjs",
"test": "pnpm run test:e2e && pnpm run test:secrets && pnpm run test:types && pnpm run test:vite",
"check:boundary": "node scripts/check-mtp-boundary.mjs"
"test:boundary": "node --test test/package-boundary.mjs",
"test": "pnpm run test:e2e && pnpm run test:secrets && pnpm run test:types && pnpm run test:vite && pnpm run test:boundary"
},
"devDependencies": {
"@types/node": "^26.0.1",

217
pnpm-lock.yaml generated
View file

@ -19,8 +19,8 @@ importers:
specifier: 4.2.5
version: 4.2.5
typescript:
specifier: ^6.0.3
version: 6.0.3
specifier: ^7.0.0
version: 7.0.2
example/web-client:
dependencies:
@ -29,8 +29,8 @@ importers:
version: link:../..
devDependencies:
typescript:
specifier: ^6.0.3
version: 6.0.3
specifier: ^7.0.0
version: 7.0.2
vite:
specifier: ^8.1.0
version: 8.1.0(@types/node@26.0.1)(yaml@2.9.0)
@ -210,6 +210,126 @@ packages:
'@types/sarif@2.1.7':
resolution: {integrity: sha512-kRz0VEkJqWLf1LLVN4pT1cg1Z9wAuvI6L97V3m2f5B76Tg8d413ddvLBPTEHAZJlnn4XSvu0FkZtViCQGVyrXQ==}
'@typescript/typescript-aix-ppc64@7.0.2':
resolution: {integrity: sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==}
engines: {node: '>=16.20.0'}
cpu: [ppc64]
os: [aix]
'@typescript/typescript-darwin-arm64@7.0.2':
resolution: {integrity: sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [darwin]
'@typescript/typescript-darwin-x64@7.0.2':
resolution: {integrity: sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [darwin]
'@typescript/typescript-freebsd-arm64@7.0.2':
resolution: {integrity: sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [freebsd]
'@typescript/typescript-freebsd-x64@7.0.2':
resolution: {integrity: sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [freebsd]
'@typescript/typescript-linux-arm64@7.0.2':
resolution: {integrity: sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [linux]
'@typescript/typescript-linux-arm@7.0.2':
resolution: {integrity: sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==}
engines: {node: '>=16.20.0'}
cpu: [arm]
os: [linux]
'@typescript/typescript-linux-loong64@7.0.2':
resolution: {integrity: sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==}
engines: {node: '>=16.20.0'}
cpu: [loong64]
os: [linux]
'@typescript/typescript-linux-mips64el@7.0.2':
resolution: {integrity: sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==}
engines: {node: '>=16.20.0'}
cpu: [mips64el]
os: [linux]
'@typescript/typescript-linux-ppc64@7.0.2':
resolution: {integrity: sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==}
engines: {node: '>=16.20.0'}
cpu: [ppc64]
os: [linux]
'@typescript/typescript-linux-riscv64@7.0.2':
resolution: {integrity: sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==}
engines: {node: '>=16.20.0'}
cpu: [riscv64]
os: [linux]
'@typescript/typescript-linux-s390x@7.0.2':
resolution: {integrity: sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==}
engines: {node: '>=16.20.0'}
cpu: [s390x]
os: [linux]
'@typescript/typescript-linux-x64@7.0.2':
resolution: {integrity: sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [linux]
'@typescript/typescript-netbsd-arm64@7.0.2':
resolution: {integrity: sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [netbsd]
'@typescript/typescript-netbsd-x64@7.0.2':
resolution: {integrity: sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [netbsd]
'@typescript/typescript-openbsd-arm64@7.0.2':
resolution: {integrity: sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [openbsd]
'@typescript/typescript-openbsd-x64@7.0.2':
resolution: {integrity: sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [openbsd]
'@typescript/typescript-sunos-x64@7.0.2':
resolution: {integrity: sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [sunos]
'@typescript/typescript-win32-arm64@7.0.2':
resolution: {integrity: sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [win32]
'@typescript/typescript-win32-x64@7.0.2':
resolution: {integrity: sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [win32]
acorn@7.4.1:
resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==}
engines: {node: '>=0.4.0'}
@ -690,9 +810,9 @@ packages:
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
typescript@6.0.3:
resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==}
engines: {node: '>=14.17'}
typescript@7.0.2:
resolution: {integrity: sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==}
engines: {node: '>=16.20.0'}
hasBin: true
undici-types@8.3.0:
@ -917,6 +1037,66 @@ snapshots:
'@types/sarif@2.1.7': {}
'@typescript/typescript-aix-ppc64@7.0.2':
optional: true
'@typescript/typescript-darwin-arm64@7.0.2':
optional: true
'@typescript/typescript-darwin-x64@7.0.2':
optional: true
'@typescript/typescript-freebsd-arm64@7.0.2':
optional: true
'@typescript/typescript-freebsd-x64@7.0.2':
optional: true
'@typescript/typescript-linux-arm64@7.0.2':
optional: true
'@typescript/typescript-linux-arm@7.0.2':
optional: true
'@typescript/typescript-linux-loong64@7.0.2':
optional: true
'@typescript/typescript-linux-mips64el@7.0.2':
optional: true
'@typescript/typescript-linux-ppc64@7.0.2':
optional: true
'@typescript/typescript-linux-riscv64@7.0.2':
optional: true
'@typescript/typescript-linux-s390x@7.0.2':
optional: true
'@typescript/typescript-linux-x64@7.0.2':
optional: true
'@typescript/typescript-netbsd-arm64@7.0.2':
optional: true
'@typescript/typescript-netbsd-x64@7.0.2':
optional: true
'@typescript/typescript-openbsd-arm64@7.0.2':
optional: true
'@typescript/typescript-openbsd-x64@7.0.2':
optional: true
'@typescript/typescript-sunos-x64@7.0.2':
optional: true
'@typescript/typescript-win32-arm64@7.0.2':
optional: true
'@typescript/typescript-win32-x64@7.0.2':
optional: true
acorn@7.4.1: {}
ansi-regex@5.0.1: {}
@ -1408,7 +1588,28 @@ snapshots:
tslib@2.8.1:
optional: true
typescript@6.0.3: {}
typescript@7.0.2:
optionalDependencies:
'@typescript/typescript-aix-ppc64': 7.0.2
'@typescript/typescript-darwin-arm64': 7.0.2
'@typescript/typescript-darwin-x64': 7.0.2
'@typescript/typescript-freebsd-arm64': 7.0.2
'@typescript/typescript-freebsd-x64': 7.0.2
'@typescript/typescript-linux-arm': 7.0.2
'@typescript/typescript-linux-arm64': 7.0.2
'@typescript/typescript-linux-loong64': 7.0.2
'@typescript/typescript-linux-mips64el': 7.0.2
'@typescript/typescript-linux-ppc64': 7.0.2
'@typescript/typescript-linux-riscv64': 7.0.2
'@typescript/typescript-linux-s390x': 7.0.2
'@typescript/typescript-linux-x64': 7.0.2
'@typescript/typescript-netbsd-arm64': 7.0.2
'@typescript/typescript-netbsd-x64': 7.0.2
'@typescript/typescript-openbsd-arm64': 7.0.2
'@typescript/typescript-openbsd-x64': 7.0.2
'@typescript/typescript-sunos-x64': 7.0.2
'@typescript/typescript-win32-arm64': 7.0.2
'@typescript/typescript-win32-x64': 7.0.2
undici-types@8.3.0: {}

View file

@ -64,7 +64,9 @@ function devServerPath(root: string, filePath: string) {
export async function hashPackageInputs(root = packageRoot) {
const hash = crypto.createHash("sha256");
const inputs = [
"Cargo.lock",
"wasm/Cargo.toml",
"wasm/.cargo/config.toml",
"wasm/src",
"common/Cargo.toml",
"common/src",

View file

@ -9,16 +9,9 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
const wasmPath = path.resolve(__dirname, "../wasm/pkg/mtp_wasm_bg.wasm");
const wasmBytes = fs.readFileSync(wasmPath);
const wasmModule = new WebAssembly.Module(wasmBytes);
initSync(wasmModule);
initSync({ module: wasmModule });
const relayFixtureCreatedAtMillis = BigInt(
fs
.readFileSync(
path.resolve(__dirname, "../fixtures/relay-created-at-ms.txt"),
"utf8",
)
.trim(),
);
const relayCreatedAtMillis = 1720000000123n;
const sdk = await import("../dist/sdk/index.js");
const { MTPRatchet } = await import("../dist/sdk/ratchet.js");
@ -2383,7 +2376,7 @@ await describe("Relay API invariants", async () => {
assert.equal(content.data.ExampleType, "inherited-policy");
});
await it("reports the shared relay CreatedAt fixture as bigint", async () => {
await it("preserves relay CreatedAt milliseconds as bigint", async () => {
const senderKeyring = sdk.crypto.generateKeyring();
const recipientKeyring = sdk.crypto.generateKeyring();
const frame = sdk.codec.decode(
@ -2394,7 +2387,7 @@ await describe("Relay API invariants", async () => {
42n,
42n,
"message-generic",
relayFixtureCreatedAtMillis,
relayCreatedAtMillis,
bindings.encode_data_value({ ExampleType: "opaque-to-content-only-relays" }),
senderKeyring,
bindings.mtp_protection_signature_suite_dual(),
@ -2418,7 +2411,7 @@ await describe("Relay API invariants", async () => {
assert.equal(metadata.signerId, 11n);
assert.equal(metadata.finalRecipientId, 42n);
assert.equal(metadata.messageId, "message-generic");
assert.equal(metadata.createdAt, relayFixtureCreatedAtMillis);
assert.equal(metadata.createdAt, relayCreatedAtMillis);
assert.deepEqual(metadata.metadata, {
ExampleType: "opaque-to-content-only-relays",
});
@ -2430,7 +2423,7 @@ await describe("Relay API invariants", async () => {
signerId: 11n,
finalRecipientId: 42n,
messageId: "message-generic",
createdAt: relayFixtureCreatedAtMillis,
createdAt: relayCreatedAtMillis,
metadata: { ExampleType: "opaque-to-content-only-relays" },
});
});

81
test/package-boundary.mjs Normal file
View file

@ -0,0 +1,81 @@
import { access, readFile } from "node:fs/promises";
import assert from "node:assert/strict";
import path from "node:path";
import { test } from "node:test";
import { fileURLToPath } from "node:url";
const repositoryRoot = path.resolve(
path.dirname(fileURLToPath(import.meta.url)),
"..",
);
async function requireFile(relativePath) {
try {
await access(path.join(repositoryRoot, relativePath));
} catch {
assert.fail(`missing release file: ${relativePath}`);
}
}
async function readJson(relativePath) {
return JSON.parse(
await readFile(path.join(repositoryRoot, relativePath), "utf8"),
);
}
test("published package boundary contains all release entry points", async () => {
const packageJson = await readJson("package.json");
const wasmPackageJson = await readJson("wasm/pkg/package.json");
for (const relativePath of [
"dist/raw/index.js",
"dist/raw/index.d.ts",
"dist/sdk/index.js",
"dist/sdk/index.d.ts",
"dist/type-map/index.js",
"dist/type-map/index.d.ts",
"dist/vite/index.js",
"dist/vite/index.d.ts",
"wasm/pkg/mtp_wasm.js",
"wasm/pkg/mtp_wasm.d.ts",
"wasm/pkg/mtp_wasm_bg.wasm",
]) {
await requireFile(relativePath);
}
let wasmIgnoreExists = true;
try {
await access(path.join(repositoryRoot, "wasm/pkg/.gitignore"));
} catch {
wasmIgnoreExists = false;
}
assert.equal(
wasmIgnoreExists,
false,
"wasm/pkg/.gitignore would cause npm pack to omit the WASM files",
);
assert.equal(
packageJson.version,
wasmPackageJson.version,
"package and WASM versions must match",
);
const rawModule = await readFile(
path.join(repositoryRoot, "dist/raw/index.js"),
"utf8",
);
assert.match(
rawModule,
/\.\.\/\.\.\/wasm\/pkg\/mtp_wasm\.js/,
"dist/raw must point at the packaged WASM module",
);
for (const target of Object.values(packageJson.exports)) {
const entry = typeof target === "string" ? target : target.import;
await requireFile(entry.replace(/^\.\//, ""));
if (typeof target === "object" && target.types) {
await requireFile(target.types.replace(/^\.\//, ""));
}
}
});

View file

@ -1,12 +1,12 @@
[package]
name = "mtp-transport"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
[dependencies]
mtp-codec = { version = "0.2.0", path = "../codec" }
mtp-common = { version = "0.2.0", path = "../common" }
mtp-crypto = { version = "0.2.0", path = "../crypto" }
mtp-codec = { version = "0.3.0", path = "../codec" }
mtp-common = { version = "0.3.0", path = "../common" }
mtp-crypto = { version = "0.3.0", path = "../crypto" }
wtransport = { version = "0.7.1", default-features = false, features = [
"aws-lc-rs",
"quinn",

View file

@ -7,12 +7,11 @@
"emitDeclarationOnly": false,
"outDir": "dist",
"rootDir": "src",
"baseUrl": ".",
"types": ["node"],
"ignoreDeprecations": "6.0",
"paths": {
"mtp/raw": ["src/raw/index.ts"],
"mtp/type-map": ["src/type-map/index.ts"],
"mtp/raw": ["./src/raw/index.ts"],
"mtp/type-map": ["./src/type-map/index.ts"],
},
"strict": true,
"noImplicitAny": false,

126
type-map/Cargo.lock generated
View file

@ -3,5 +3,127 @@
version = 4
[[package]]
name = "type-map"
version = "0.2.0"
name = "equivalent"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]]
name = "hashbrown"
version = "0.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
[[package]]
name = "indexmap"
version = "2.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"
dependencies = [
"equivalent",
"hashbrown",
]
[[package]]
name = "itoa"
version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
[[package]]
name = "mtp-type-map"
version = "0.3.0"
dependencies = [
"serde",
"serde_yaml",
]
[[package]]
name = "proc-macro2"
version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
dependencies = [
"proc-macro2",
]
[[package]]
name = "ryu"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
[[package]]
name = "serde"
version = "1.0.229"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba"
dependencies = [
"serde_core",
"serde_derive",
]
[[package]]
name = "serde_core"
version = "1.0.229"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.229"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "serde_yaml"
version = "0.9.34+deprecated"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
dependencies = [
"indexmap",
"itoa",
"ryu",
"serde",
"unsafe-libyaml",
]
[[package]]
name = "syn"
version = "3.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "unicode-ident"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
[[package]]
name = "unsafe-libyaml"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861"

View file

@ -1,6 +1,6 @@
[package]
name = "mtp-type-map"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
build = "build.rs"

View file

@ -1,6 +1,6 @@
[package]
name = "mtp-wasm"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
[package.metadata.cargo-machete]
@ -21,13 +21,13 @@ wasm-tracing = "2.1"
hex = "0.4"
getrandom = { version = "0.4.0", features = ["js"] }
getrandom = { version = "0.2.17", features = ["js"] }
getrandom-v04 = { package = "getrandom", version = "0.4.3", features = ["wasm_js"] }
mtp-common = { version = "0.2.0", path = "../common" }
mtp-type-map = { version = "0.2.0", path = "../type-map" }
mtp-codec = { version = "0.2.0", path = "../codec", features = ["crypto", "pipes", "registry"] }
mtp-crypto = { version = "0.2.0", path = "../crypto", features = ["wasm"] }
mtp-common = { version = "0.3.0", path = "../common" }
mtp-type-map = { version = "0.3.0", path = "../type-map" }
mtp-codec = { version = "0.3.0", path = "../codec", features = ["crypto", "pipes", "registry"] }
mtp-crypto = { version = "0.3.0", path = "../crypto", features = ["wasm"] }
zeroize = "1.9"
wasm-bindgen-test = "0.3.76"

View file

@ -13,6 +13,11 @@ export interface DisposableWasmObject {
export type StateChangeCallback = (state: ConnectionState) => void;
export type MessageCallback = (frame: ParsedFrame) => void;
export type ErrorCallback = (error: string) => void;
export interface PipeRequest {
pipeId: number;
description: string;
}
export type PipeRequestCallback = (request: PipeRequest) => void;
export interface Ed25519GenerateResult {
signer: WasmEd25519Signer;
@ -104,6 +109,34 @@ export class WasmChaCha20Poly1305 implements DisposableWasmObject {
encrypt(plaintext: Uint8Array, aad: Uint8Array): Uint8Array;
}
export class PipeReader implements DisposableWasmObject {
private constructor();
free(): void;
[Symbol.dispose](): void;
read(): Promise<Uint8Array | null>;
pipe_id(): number;
description(): string;
}
export class PipeWriter implements DisposableWasmObject {
private constructor();
free(): void;
[Symbol.dispose](): void;
write(data: Uint8Array): Promise<void>;
close(): Promise<void>;
abort(): void;
pipe_id(): number;
}
export class WasmPipeHandle implements DisposableWasmObject {
private constructor();
free(): void;
[Symbol.dispose](): void;
wait(): Promise<PipeWriter | null>;
readonly pipe_id: number;
readonly description: string;
}
export interface KemEncapsulateResult {
shared_secret: Uint8Array;
ciphertext: Uint8Array;
@ -126,12 +159,13 @@ export class WasmKemKeypair implements DisposableWasmObject {
export class WasmClient implements DisposableWasmObject {
constructor(
on_state_change: StateChangeCallback,
on_message: MessageCallback,
on_error: ErrorCallback,
on_state_change?: StateChangeCallback | null,
on_message?: MessageCallback | null,
on_error?: ErrorCallback | null,
);
free(): void;
[Symbol.dispose](): void;
accept_pipe(pipe_id: number): Promise<PipeReader>;
auth_connect(
config: ConnectionConfig,
host_public_key_bytes: Uint8Array,
@ -145,6 +179,9 @@ export class WasmClient implements DisposableWasmObject {
): Promise<bigint>;
connect(config: ConnectionConfig): Promise<void>;
disconnect(): void;
create_pipe(description: string): Promise<WasmPipeHandle>;
deny_pipe(pipe_id: number): Promise<void>;
set_on_pipe_request(callback?: PipeRequestCallback): void;
request(
frame: Uint8Array,
response_type?: string | null,
@ -176,6 +213,7 @@ export class WasmKeyring implements DisposableWasmObject {
static from_bytes(bytes: Uint8Array): WasmKeyring;
public_key_bundle(): WasmPublicKeyBundle;
to_bytes(): Uint8Array;
validate_encryption(): void;
validate_full(): void;
}