1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2024-12-29 12:04:35 +01:00

Merge branch 'up-ruma' into 'master'

Upgrade Ruma

See merge request famedly/conduit!77
This commit is contained in:
Timo Kösters 2021-05-08 07:46:26 +00:00
commit ad5e51dc25
10 changed files with 145 additions and 176 deletions

183
Cargo.lock generated
View file

@ -8,9 +8,9 @@ checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
version = "0.7.15" version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@ -211,7 +211,6 @@ dependencies = [
"serde_json", "serde_json",
"serde_yaml", "serde_yaml",
"sled", "sled",
"state-res",
"thiserror", "thiserror",
"tokio", "tokio",
"tracing", "tracing",
@ -277,9 +276,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-epoch" name = "crossbeam-epoch"
version = "0.9.3" version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12" checksum = "52fb27eab85b17fbb9f6fd667089e07d6a2eb8743d02639ee7f6a7a7729c9c94"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"crossbeam-utils", "crossbeam-utils",
@ -290,9 +289,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-utils" name = "crossbeam-utils"
version = "0.8.3" version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" checksum = "4feb231f0d4d6af81aed15928e58ecf5816aa62a2393e2c82f46973e92a9a278"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"cfg-if 1.0.0", "cfg-if 1.0.0",
@ -359,18 +358,18 @@ dependencies = [
[[package]] [[package]]
name = "directories" name = "directories"
version = "3.0.1" version = "3.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8fed639d60b58d0f53498ab13d26f621fd77569cc6edb031f4cc36a2ad9da0f" checksum = "e69600ff1703123957937708eb27f7a564e48885c537782722ed0ba3189ce1d7"
dependencies = [ dependencies = [
"dirs-sys", "dirs-sys",
] ]
[[package]] [[package]]
name = "dirs-sys" name = "dirs-sys"
version = "0.3.5" version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780"
dependencies = [ dependencies = [
"libc", "libc",
"redox_users", "redox_users",
@ -583,17 +582,6 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "getrandom"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce"
dependencies = [
"cfg-if 1.0.0",
"libc",
"wasi 0.9.0+wasi-snapshot-preview1",
]
[[package]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.2.2" version = "0.2.2"
@ -602,7 +590,7 @@ checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"libc", "libc",
"wasi 0.10.2+wasi-snapshot-preview1", "wasi",
] ]
[[package]] [[package]]
@ -623,9 +611,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
[[package]] [[package]]
name = "h2" name = "h2"
version = "0.3.2" version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc018e188373e2777d0ef2467ebff62a08e66c3f5857b23c8fbec3018210dc00" checksum = "825343c4eef0b63f541f8903f395dc5beb362a979b5799a84062527ef1e37726"
dependencies = [ dependencies = [
"bytes", "bytes",
"fnv", "fnv",
@ -914,9 +902,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.93" version = "0.2.94"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e"
[[package]] [[package]]
name = "linked-hash-map" name = "linked-hash-map"
@ -926,9 +914,9 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
[[package]] [[package]]
name = "lock_api" name = "lock_api"
version = "0.4.3" version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a3c91c24eae6777794bb1997ad98bbb87daf92890acab859f7eaa4320333176" checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb"
dependencies = [ dependencies = [
"scopeguard", "scopeguard",
] ]
@ -993,9 +981,9 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
[[package]] [[package]]
name = "memchr" name = "memchr"
version = "2.3.4" version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc"
[[package]] [[package]]
name = "memoffset" name = "memoffset"
@ -1203,7 +1191,7 @@ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"instant", "instant",
"libc", "libc",
"redox_syscall 0.2.6", "redox_syscall",
"smallvec", "smallvec",
"winapi", "winapi",
] ]
@ -1401,7 +1389,7 @@ version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
dependencies = [ dependencies = [
"getrandom 0.2.2", "getrandom",
] ]
[[package]] [[package]]
@ -1415,28 +1403,21 @@ dependencies = [
[[package]] [[package]]
name = "redox_syscall" name = "redox_syscall"
version = "0.1.57" version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" checksum = "742739e41cd49414de871ea5e549afb7e2a3ac77b589bcbebe8c82fab37147fc"
[[package]]
name = "redox_syscall"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8270314b5ccceb518e7e578952f0b72b88222d02e8f77f5ecf7abbb673539041"
dependencies = [ dependencies = [
"bitflags", "bitflags",
] ]
[[package]] [[package]]
name = "redox_users" name = "redox_users"
version = "0.3.5" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"
dependencies = [ dependencies = [
"getrandom 0.1.16", "getrandom",
"redox_syscall 0.1.57", "redox_syscall",
"rust-argon2",
] ]
[[package]] [[package]]
@ -1461,9 +1442,9 @@ dependencies = [
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.4.6" version = "1.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a26af418b574bd56588335b3a3659a65725d4e636eb1016c2f9e3b38c7cc759" checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@ -1482,9 +1463,9 @@ dependencies = [
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
version = "0.6.23" version = "0.6.25"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]] [[package]]
name = "remove_dir_all" name = "remove_dir_all"
@ -1634,7 +1615,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma" name = "ruma"
version = "0.0.3" version = "0.0.3"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"assign", "assign",
"js_int", "js_int",
@ -1649,12 +1630,13 @@ dependencies = [
"ruma-push-gateway-api", "ruma-push-gateway-api",
"ruma-serde", "ruma-serde",
"ruma-signatures", "ruma-signatures",
"ruma-state-res",
] ]
[[package]] [[package]]
name = "ruma-api" name = "ruma-api"
version = "0.17.0-alpha.4" version = "0.17.0-alpha.4"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"bytes", "bytes",
"http", "http",
@ -1670,7 +1652,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-api-macros" name = "ruma-api-macros"
version = "0.17.0-alpha.4" version = "0.17.0-alpha.4"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
@ -1681,7 +1663,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-appservice-api" name = "ruma-appservice-api"
version = "0.2.0-alpha.3" version = "0.2.0-alpha.3"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"ruma-api", "ruma-api",
"ruma-common", "ruma-common",
@ -1695,7 +1677,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-client-api" name = "ruma-client-api"
version = "0.10.0-alpha.3" version = "0.10.0-alpha.3"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"assign", "assign",
"bytes", "bytes",
@ -1715,11 +1697,10 @@ dependencies = [
[[package]] [[package]]
name = "ruma-common" name = "ruma-common"
version = "0.5.0" version = "0.5.0"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"indexmap", "indexmap",
"js_int", "js_int",
"maplit",
"ruma-identifiers", "ruma-identifiers",
"ruma-serde", "ruma-serde",
"serde", "serde",
@ -1731,7 +1712,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-events" name = "ruma-events"
version = "0.22.0-alpha.3" version = "0.22.0-alpha.3"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"js_int", "js_int",
"ruma-common", "ruma-common",
@ -1745,7 +1726,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-events-macros" name = "ruma-events-macros"
version = "0.22.0-alpha.3" version = "0.22.0-alpha.3"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
@ -1756,7 +1737,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-federation-api" name = "ruma-federation-api"
version = "0.1.0-alpha.2" version = "0.1.0-alpha.2"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"js_int", "js_int",
"ruma-api", "ruma-api",
@ -1771,7 +1752,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-identifiers" name = "ruma-identifiers"
version = "0.19.0" version = "0.19.0"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"paste", "paste",
"rand", "rand",
@ -1785,9 +1766,8 @@ dependencies = [
[[package]] [[package]]
name = "ruma-identifiers-macros" name = "ruma-identifiers-macros"
version = "0.19.0" version = "0.19.0"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"proc-macro2",
"quote", "quote",
"ruma-identifiers-validation", "ruma-identifiers-validation",
"syn", "syn",
@ -1796,12 +1776,12 @@ dependencies = [
[[package]] [[package]]
name = "ruma-identifiers-validation" name = "ruma-identifiers-validation"
version = "0.3.0" version = "0.3.0"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
[[package]] [[package]]
name = "ruma-identity-service-api" name = "ruma-identity-service-api"
version = "0.1.0-alpha.1" version = "0.1.0-alpha.1"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"js_int", "js_int",
"ruma-api", "ruma-api",
@ -1809,13 +1789,12 @@ dependencies = [
"ruma-identifiers", "ruma-identifiers",
"ruma-serde", "ruma-serde",
"serde", "serde",
"serde_json",
] ]
[[package]] [[package]]
name = "ruma-push-gateway-api" name = "ruma-push-gateway-api"
version = "0.1.0-alpha.1" version = "0.1.0-alpha.1"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"js_int", "js_int",
"ruma-api", "ruma-api",
@ -1830,7 +1809,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-serde" name = "ruma-serde"
version = "0.3.1" version = "0.3.1"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"bytes", "bytes",
"form_urlencoded", "form_urlencoded",
@ -1844,7 +1823,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-serde-macros" name = "ruma-serde-macros"
version = "0.3.1" version = "0.3.1"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
@ -1855,7 +1834,7 @@ dependencies = [
[[package]] [[package]]
name = "ruma-signatures" name = "ruma-signatures"
version = "0.7.0" version = "0.7.0"
source = "git+https://github.com/ruma/ruma?rev=8c286e78d41770fe431e7304cc2fe23e383793df#8c286e78d41770fe431e7304cc2fe23e383793df" source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [ dependencies = [
"base64 0.13.0", "base64 0.13.0",
"ring", "ring",
@ -1865,6 +1844,24 @@ dependencies = [
"untrusted", "untrusted",
] ]
[[package]]
name = "ruma-state-res"
version = "0.1.0"
source = "git+https://github.com/ruma/ruma?rev=71686ce8a4d1770a80de216080718fe9de7bd925#71686ce8a4d1770a80de216080718fe9de7bd925"
dependencies = [
"itertools 0.10.0",
"js_int",
"maplit",
"ruma-events",
"ruma-identifiers",
"ruma-serde",
"ruma-signatures",
"serde",
"serde_json",
"thiserror",
"tracing",
]
[[package]] [[package]]
name = "rust-argon2" name = "rust-argon2"
version = "0.8.3" version = "0.8.3"
@ -2165,20 +2162,6 @@ dependencies = [
"loom", "loom",
] ]
[[package]]
name = "state-res"
version = "0.1.0"
source = "git+https://github.com/ruma/state-res?rev=c20893e536bea4d17a9fe6af28428fb17169b56f#c20893e536bea4d17a9fe6af28428fb17169b56f"
dependencies = [
"itertools 0.10.0",
"log",
"maplit",
"ruma",
"serde",
"serde_json",
"thiserror",
]
[[package]] [[package]]
name = "stdweb" name = "stdweb"
version = "0.4.20" version = "0.4.20"
@ -2230,9 +2213,9 @@ checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0"
[[package]] [[package]]
name = "syn" name = "syn"
version = "1.0.70" version = "1.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9505f307c872bab8eb46f77ae357c8eba1fdacead58ee5a850116b1d7f82883" checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -2248,7 +2231,7 @@ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"libc", "libc",
"rand", "rand",
"redox_syscall 0.2.6", "redox_syscall",
"remove_dir_all", "remove_dir_all",
"winapi", "winapi",
] ]
@ -2448,9 +2431,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6"
[[package]] [[package]]
name = "tracing" name = "tracing"
version = "0.1.25" version = "0.1.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"pin-project-lite", "pin-project-lite",
@ -2471,9 +2454,9 @@ dependencies = [
[[package]] [[package]]
name = "tracing-core" name = "tracing-core"
version = "0.1.17" version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" checksum = "a9ff14f98b1a4b289c6248a023c1c2fa1491062964e9fed67ab29c4e4da4a052"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
] ]
@ -2514,9 +2497,9 @@ dependencies = [
[[package]] [[package]]
name = "tracing-subscriber" name = "tracing-subscriber"
version = "0.2.17" version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "705096c6f83bf68ea5d357a6aa01829ddbdac531b357b45abeca842938085baa" checksum = "aa5553bf0883ba7c9cbe493b085c29926bd41b66afc31ff72cf17ff4fb60dcd5"
dependencies = [ dependencies = [
"ansi_term", "ansi_term",
"chrono", "chrono",
@ -2646,9 +2629,9 @@ checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796"
[[package]] [[package]]
name = "unicode-xid" name = "unicode-xid"
version = "0.2.1" version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]] [[package]]
name = "untrusted" name = "untrusted"
@ -2658,9 +2641,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a"
[[package]] [[package]]
name = "url" name = "url"
version = "2.2.1" version = "2.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c"
dependencies = [ dependencies = [
"form_urlencoded", "form_urlencoded",
"idna", "idna",
@ -2684,12 +2667,6 @@ dependencies = [
"try-lock", "try-lock",
] ]
[[package]]
name = "wasi"
version = "0.9.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
[[package]] [[package]]
name = "wasi" name = "wasi"
version = "0.10.2+wasi-snapshot-preview1" version = "0.10.2+wasi-snapshot-preview1"

View file

@ -15,16 +15,9 @@ edition = "2018"
# Used to handle requests # Used to handle requests
# TODO: This can become optional as soon as proper configs are supported # TODO: This can become optional as soon as proper configs are supported
rocket = { git = "https://github.com/SergioBenitez/Rocket.git", rev = "801e04bd5369eb39e126c75f6d11e1e9597304d8", features = ["tls"] } # Used to handle requests rocket = { git = "https://github.com/SergioBenitez/Rocket.git", rev = "801e04bd5369eb39e126c75f6d11e1e9597304d8", features = ["tls"] } # Used to handle requests
#rocket = { git = "https://github.com/timokoesters/Rocket.git", branch = "empty_parameters", default-features = false, features = ["tls"] }
# Used for matrix spec type definitions and helpers # Used for matrix spec type definitions and helpers
ruma = { git = "https://github.com/ruma/ruma", rev = "8c286e78d41770fe431e7304cc2fe23e383793df", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "unstable-pre-spec", "unstable-exhaustive-types"] } ruma = { git = "https://github.com/ruma/ruma", rev = "71686ce8a4d1770a80de216080718fe9de7bd925", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-pre-spec", "unstable-exhaustive-types"] }
#ruma = { git = "https://github.com/timokoesters/ruma", rev = "220d5b4a76b3b781f7f8297fbe6b14473b04214b", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "unstable-pre-spec", "unstable-exhaustive-types"] }
#ruma = { path = "../ruma/ruma", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "unstable-pre-spec", "unstable-exhaustive-types"] }
# Used when doing state resolution
state-res = { git = "https://github.com/ruma/state-res", rev = "c20893e536bea4d17a9fe6af28428fb17169b56f", features = ["unstable-pre-spec"] }
#state-res = { path = "../state-res", features = ["unstable-pre-spec"] }
# Used for long polling and federation sender, should be the same as rocket::tokio # Used for long polling and federation sender, should be the same as rocket::tokio
tokio = "1.2.0" tokio = "1.2.0"

View file

@ -1,7 +1,4 @@
use std::{ use std::{collections::BTreeMap, convert::TryInto};
collections::BTreeMap,
convert::{TryFrom, TryInto},
};
use super::{State, DEVICE_ID_LENGTH, SESSION_ID_LENGTH, TOKEN_LENGTH}; use super::{State, DEVICE_ID_LENGTH, SESSION_ID_LENGTH, TOKEN_LENGTH};
use crate::{pdu::PduBuilder, utils, ConduitResult, Database, Error, Ruma}; use crate::{pdu::PduBuilder, utils, ConduitResult, Database, Error, Ruma};

View file

@ -25,9 +25,9 @@ use ruma::{
EventType, EventType,
}, },
serde::{to_canonical_value, CanonicalJsonObject, CanonicalJsonValue, Raw}, serde::{to_canonical_value, CanonicalJsonObject, CanonicalJsonValue, Raw},
state_res::{self, EventMap, RoomVersion},
uint, EventId, RoomId, RoomVersionId, ServerName, UserId, uint, EventId, RoomId, RoomVersionId, ServerName, UserId,
}; };
use state_res::EventMap;
use std::{ use std::{
collections::{BTreeMap, HashSet}, collections::{BTreeMap, HashSet},
convert::{TryFrom, TryInto}, convert::{TryFrom, TryInto},
@ -765,9 +765,11 @@ pub async fn invite_helper(
}; };
// If there was no create event yet, assume we are creating a version 6 room right now // If there was no create event yet, assume we are creating a version 6 room right now
let room_version = create_event_content.map_or(RoomVersionId::Version6, |create_event| { let room_version_id = create_event_content
create_event.room_version .map_or(RoomVersionId::Version6, |create_event| {
}); create_event.room_version
});
let room_version = RoomVersion::new(&room_version_id).expect("room version is supported");
let content = serde_json::to_value(MemberEventContent { let content = serde_json::to_value(MemberEventContent {
avatar_url: None, avatar_url: None,
@ -863,7 +865,7 @@ pub async fn invite_helper(
db.globals.server_name().as_str(), db.globals.server_name().as_str(),
db.globals.keypair(), db.globals.keypair(),
&mut pdu_json, &mut pdu_json,
&room_version, &room_version_id,
) )
.expect("event is valid, we just created it"); .expect("event is valid, we just created it");

View file

@ -1,6 +1,5 @@
use super::State; use super::State;
use crate::client_server::invite_helper; use crate::{client_server::invite_helper, pdu::PduBuilder, ConduitResult, Database, Error, Ruma};
use crate::{pdu::PduBuilder, ConduitResult, Database, Error, Ruma};
use log::info; use log::info;
use ruma::{ use ruma::{
api::client::{ api::client::{

View file

@ -31,7 +31,7 @@ pub async fn update_tag_route(
tags_event tags_event
.content .content
.tags .tags
.insert(body.tag.to_string(), body.tag_info.clone()); .insert(body.tag.clone().into(), body.tag_info.clone());
db.account_data.update( db.account_data.update(
Some(&body.room_id), Some(&body.room_id),
@ -65,7 +65,7 @@ pub async fn delete_tag_route(
tags: BTreeMap::new(), tags: BTreeMap::new(),
}, },
}); });
tags_event.content.tags.remove(&body.tag); tags_event.content.tags.remove(&body.tag.clone().into());
db.account_data.update( db.account_data.update(
Some(&body.room_id), Some(&body.room_id),

View file

@ -16,10 +16,10 @@ use ruma::{
}, },
push::{self, Action, Tweak}, push::{self, Action, Tweak},
serde::{CanonicalJsonObject, CanonicalJsonValue, Raw}, serde::{CanonicalJsonObject, CanonicalJsonValue, Raw},
state_res::{self, Event, RoomVersion, StateMap},
uint, EventId, RoomAliasId, RoomId, RoomVersionId, ServerName, UserId, uint, EventId, RoomAliasId, RoomId, RoomVersionId, ServerName, UserId,
}; };
use sled::IVec; use sled::IVec;
use state_res::{Event, StateMap};
use std::{ use std::{
collections::{BTreeMap, HashMap, HashSet}, collections::{BTreeMap, HashMap, HashSet},
@ -1236,9 +1236,11 @@ impl Rooms {
}; };
// If there was no create event yet, assume we are creating a version 6 room right now // If there was no create event yet, assume we are creating a version 6 room right now
let room_version = create_event_content.map_or(RoomVersionId::Version6, |create_event| { let room_version_id = create_event_content
create_event.room_version .map_or(RoomVersionId::Version6, |create_event| {
}); create_event.room_version
});
let room_version = RoomVersion::new(&room_version_id).expect("room version is supported");
let auth_events = self.get_auth_events( let auth_events = self.get_auth_events(
&room_id, &room_id,
@ -1326,14 +1328,14 @@ impl Rooms {
db.globals.server_name().as_str(), db.globals.server_name().as_str(),
db.globals.keypair(), db.globals.keypair(),
&mut pdu_json, &mut pdu_json,
&room_version, &room_version_id,
) )
.expect("event is valid, we just created it"); .expect("event is valid, we just created it");
// Generate event id // Generate event id
pdu.event_id = EventId::try_from(&*format!( pdu.event_id = EventId::try_from(&*format!(
"${}", "${}",
ruma::signatures::reference_hash(&pdu_json, &room_version) ruma::signatures::reference_hash(&pdu_json, &room_version_id)
.expect("ruma can calculate reference hashes") .expect("ruma can calculate reference hashes")
)) ))
.expect("ruma's reference hashes are valid event ids"); .expect("ruma's reference hashes are valid event ids");
@ -1868,8 +1870,8 @@ impl Rooms {
let (make_leave_response, remote_server) = make_leave_response_and_server?; let (make_leave_response, remote_server) = make_leave_response_and_server?;
let room_version = match make_leave_response.room_version { let room_version_id = match make_leave_response.room_version {
Some(room_version) if room_version == RoomVersionId::Version6 => room_version, Some(id @ RoomVersionId::Version6) => id,
_ => return Err(Error::BadServerResponse("Room version is not supported")), _ => return Err(Error::BadServerResponse("Room version is not supported")),
}; };
@ -1900,14 +1902,14 @@ impl Rooms {
db.globals.server_name().as_str(), db.globals.server_name().as_str(),
db.globals.keypair(), db.globals.keypair(),
&mut leave_event_stub, &mut leave_event_stub,
&room_version, &room_version_id,
) )
.expect("event is valid, we just created it"); .expect("event is valid, we just created it");
// Generate event id // Generate event id
let event_id = EventId::try_from(&*format!( let event_id = EventId::try_from(&*format!(
"${}", "${}",
ruma::signatures::reference_hash(&leave_event_stub, &room_version) ruma::signatures::reference_hash(&leave_event_stub, &room_version_id)
.expect("ruma can calculate reference hashes") .expect("ruma can calculate reference hashes")
)) ))
.expect("ruma's reference hashes are valid event ids"); .expect("ruma's reference hashes are valid event ids");

View file

@ -6,7 +6,7 @@ use ruma::{
AnyStrippedStateEvent, AnySyncRoomEvent, AnySyncStateEvent, EventType, StateEvent, AnyStrippedStateEvent, AnySyncRoomEvent, AnySyncStateEvent, EventType, StateEvent,
}, },
serde::{CanonicalJsonObject, CanonicalJsonValue, Raw}, serde::{CanonicalJsonObject, CanonicalJsonValue, Raw},
EventId, RoomId, RoomVersionId, ServerName, ServerSigningKeyId, UInt, UserId, state_res, EventId, RoomId, RoomVersionId, ServerName, ServerSigningKeyId, UInt, UserId,
}; };
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_json::json; use serde_json::json;
@ -213,7 +213,10 @@ impl PduEvent {
pub fn convert_to_outgoing_federation_event( pub fn convert_to_outgoing_federation_event(
mut pdu_json: CanonicalJsonObject, mut pdu_json: CanonicalJsonObject,
) -> Raw<ruma::events::pdu::Pdu> { ) -> Raw<ruma::events::pdu::Pdu> {
if let Some(CanonicalJsonValue::Object(unsigned)) = pdu_json.get_mut("unsigned") { if let Some(unsigned) = pdu_json
.get_mut("unsigned")
.and_then(|val| val.as_object_mut())
{
unsigned.remove("transaction_id"); unsigned.remove("transaction_id");
} }

View file

@ -271,41 +271,33 @@ where
http_request = http_request.header(header.name.as_str(), &*header.value); http_request = http_request.header(header.name.as_str(), &*header.value);
} }
match &mut json_body { if let Some(json_body) = json_body.as_mut().and_then(|val| val.as_object_mut()) {
Some(CanonicalJsonValue::Object(json_body)) => { let user_id = sender_user.clone().unwrap_or_else(|| {
let user_id = sender_user.clone().unwrap_or_else(|| { UserId::parse_with_server_name("", db.globals.server_name())
UserId::parse_with_server_name("", db.globals.server_name()) .expect("we know this is valid")
.expect("we know this is valid") });
});
if let Some(initial_request) = json_body if let Some(CanonicalJsonValue::Object(initial_request)) = json_body
.get("auth") .get("auth")
.and_then(|auth| auth.as_object()) .and_then(|auth| auth.as_object())
.and_then(|auth| auth.get("session")) .and_then(|auth| auth.get("session"))
.and_then(|session| session.as_str()) .and_then(|session| session.as_str())
.and_then(|session| { .and_then(|session| {
db.uiaa db.uiaa
.get_uiaa_request( .get_uiaa_request(
&user_id, &user_id,
&sender_device.clone().unwrap_or_else(|| "".into()), &sender_device.clone().unwrap_or_else(|| "".into()),
session, session,
) )
.ok() .ok()
.flatten() .flatten()
}) })
{ {
match initial_request { for (key, value) in initial_request {
CanonicalJsonValue::Object(initial_request) => { json_body.entry(key).or_insert(value);
for (key, value) in initial_request.into_iter() {
json_body.entry(key).or_insert(value);
}
}
_ => {}
}
} }
body = serde_json::to_vec(json_body).expect("value to bytes can't fail");
} }
_ => {} body = serde_json::to_vec(json_body).expect("value to bytes can't fail");
} }
let http_request = http_request.body(&*body).unwrap(); let http_request = http_request.body(&*body).unwrap();

View file

@ -35,9 +35,9 @@ use ruma::{
}, },
serde::Raw, serde::Raw,
signatures::{CanonicalJsonObject, CanonicalJsonValue}, signatures::{CanonicalJsonObject, CanonicalJsonValue},
state_res::{self, Event, EventMap, RoomVersion, StateMap},
uint, EventId, RoomId, RoomVersionId, ServerName, ServerSigningKeyId, UserId, uint, EventId, RoomId, RoomVersionId, ServerName, ServerSigningKeyId, UserId,
}; };
use state_res::{Event, EventMap, StateMap};
use std::{ use std::{
collections::{btree_map::Entry, BTreeMap, BTreeSet, HashSet}, collections::{btree_map::Entry, BTreeMap, BTreeSet, HashSet},
convert::{TryFrom, TryInto}, convert::{TryFrom, TryInto},
@ -745,12 +745,13 @@ pub fn handle_incoming_pdu<'a>(
.deserialize() .deserialize()
.map_err(|_| "Invalid PowerLevels event in db.".to_owned())?; .map_err(|_| "Invalid PowerLevels event in db.".to_owned())?;
let room_version = create_event_content.room_version; let room_version_id = &create_event_content.room_version;
let room_version = RoomVersion::new(room_version_id).expect("room version is supported");
let mut val = match ruma::signatures::verify_event( let mut val = match ruma::signatures::verify_event(
&*pub_key_map.read().map_err(|_| "RwLock is poisoned.")?, &*pub_key_map.read().map_err(|_| "RwLock is poisoned.")?,
&value, &value,
&room_version, room_version_id,
) { ) {
Err(e) => { Err(e) => {
// Drop // Drop
@ -760,7 +761,7 @@ pub fn handle_incoming_pdu<'a>(
Ok(ruma::signatures::Verified::Signatures) => { Ok(ruma::signatures::Verified::Signatures) => {
// Redact // Redact
warn!("Calculated hash does not match: {}", event_id); warn!("Calculated hash does not match: {}", event_id);
match ruma::signatures::redact(&value, &room_version) { match ruma::signatures::redact(&value, room_version_id) {
Ok(obj) => obj, Ok(obj) => obj,
Err(_) => return Err("Redaction failed".to_string()), Err(_) => return Err("Redaction failed".to_string()),
} }
@ -1162,7 +1163,7 @@ pub fn handle_incoming_pdu<'a>(
match state_res::StateResolution::resolve( match state_res::StateResolution::resolve(
&room_id, &room_id,
&room_version, room_version_id,
&fork_states &fork_states
.into_iter() .into_iter()
.map(|map| { .map(|map| {
@ -1718,9 +1719,12 @@ pub fn create_join_event_template_route<'a>(
}; };
// If there was no create event yet, assume we are creating a version 6 room right now // If there was no create event yet, assume we are creating a version 6 room right now
let room_version = create_event_content.map_or(RoomVersionId::Version6, |create_event| { let room_version = RoomVersion::new(
create_event.room_version &create_event_content.map_or(RoomVersionId::Version6, |create_event| {
}); create_event.room_version
}),
)
.expect("room version is supported");
let content = serde_json::to_value(MemberEventContent { let content = serde_json::to_value(MemberEventContent {
avatar_url: None, avatar_url: None,