Untrusted global scripts support

This commit is contained in:
mdecimus 2024-09-02 11:18:00 +02:00
parent 3e0946743d
commit c10a8827c6
20 changed files with 295 additions and 180 deletions

292
Cargo.lock generated
View file

@ -284,7 +284,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
"synstructure 0.13.1",
]
@ -307,7 +307,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -331,7 +331,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -353,18 +353,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
name = "async-trait"
version = "0.1.81"
version = "0.1.82"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -385,7 +385,7 @@ dependencies = [
"serde",
"serde_json",
"url",
"webpki-roots 0.26.3",
"webpki-roots 0.26.5",
]
[[package]]
@ -413,9 +413,9 @@ dependencies = [
[[package]]
name = "aws-region"
version = "0.25.4"
version = "0.25.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42fed2b9fca70f2908268d057a607f2a906f47edbf856ea8587de9038d264e22"
checksum = "e9aed3f9c7eac9be28662fdb3b0f4d1951e812f7c64fed4f0327ba702f459b3b"
dependencies = [
"thiserror",
]
@ -565,7 +565,7 @@ dependencies = [
"regex",
"rustc-hash 1.1.0",
"shlex",
"syn 2.0.75",
"syn 2.0.77",
"which",
]
@ -584,7 +584,7 @@ dependencies = [
"regex",
"rustc-hash 1.1.0",
"shlex",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -637,9 +637,9 @@ dependencies = [
[[package]]
name = "bitvec-nom2"
version = "0.2.0"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4863ce31b7ff8812568eaffe956024c824d845a1f9f08c329706166c357cae53"
checksum = "d988fcc40055ceaa85edc55875a08f8abd29018582647fd82ad6128dba14a5f0"
dependencies = [
"bitvec",
"nom",
@ -664,7 +664,7 @@ dependencies = [
"arrayvec",
"cc",
"cfg-if",
"constant_time_eq 0.3.0",
"constant_time_eq 0.3.1",
]
[[package]]
@ -735,7 +735,7 @@ dependencies = [
"proc-macro-crate",
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
"syn_derive",
]
@ -788,9 +788,9 @@ dependencies = [
[[package]]
name = "bytemuck"
version = "1.17.0"
version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fd4c6dcc3b0aea2f5c0b4b82c2b15fe39ddbc76041a310848f4706edf76bb31"
checksum = "773d90827bc3feecfb67fab12e24de0749aad83c74b9504ecde46237b5cd24e2"
[[package]]
name = "byteorder"
@ -855,9 +855,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.1.13"
version = "1.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48"
checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6"
dependencies = [
"jobserver",
"libc",
@ -991,7 +991,7 @@ dependencies = [
"heck 0.5.0",
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -1142,9 +1142,9 @@ dependencies = [
[[package]]
name = "const_panic"
version = "0.2.8"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6051f239ecec86fde3410901ab7860d458d160371533842974fc61f96d15879b"
checksum = "7782af8f90fe69a4bb41e460abe1727d493403d8b2cc43201a3a3e906b24379f"
[[package]]
name = "constant_time_eq"
@ -1154,9 +1154,9 @@ checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6"
[[package]]
name = "constant_time_eq"
version = "0.3.0"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2"
checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6"
[[package]]
name = "core-foundation"
@ -1349,7 +1349,7 @@ dependencies = [
"curve25519-dalek-derive",
"digest 0.10.7",
"fiat-crypto",
"rustc_version 0.4.0",
"rustc_version 0.4.1",
"subtle",
"zeroize",
]
@ -1362,7 +1362,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -1410,7 +1410,7 @@ dependencies = [
"proc-macro2",
"quote",
"strsim 0.11.1",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -1432,7 +1432,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806"
dependencies = [
"darling_core 0.20.10",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -1584,38 +1584,38 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
name = "derive_builder"
version = "0.20.0"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7"
checksum = "cd33f37ee6a119146a1781d3356a7c26028f83d779b2e04ecd45fdc75c76877b"
dependencies = [
"derive_builder_macro",
]
[[package]]
name = "derive_builder_core"
version = "0.20.0"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d"
checksum = "7431fa049613920234f22c47fdc33e6cf3ee83067091ea4277a3f8c4587aae38"
dependencies = [
"darling 0.20.10",
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
name = "derive_builder_macro"
version = "0.20.0"
version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b"
checksum = "4abae7035bf79b9877b779505d8cf3749285b80c43941eda66604841889451dc"
dependencies = [
"derive_builder_core",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -1713,7 +1713,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -1938,7 +1938,7 @@ dependencies = [
"heck 0.4.1",
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -2031,9 +2031,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
[[package]]
name = "flate2"
version = "1.0.32"
version = "1.0.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c0596c1eac1f9e04ed902702e9878208b336edc9d6fddc8a48387349bab3666"
checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253"
dependencies = [
"crc32fast",
"libz-sys",
@ -2124,7 +2124,7 @@ checksum = "f8db6653cbc621a3810d95d55bd342be3e71181d6df21a4eb29ef986202d3f9c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
"try_map",
]
@ -2140,54 +2140,58 @@ dependencies = [
[[package]]
name = "frunk"
version = "0.4.2"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11a351b59e12f97b4176ee78497dff72e4276fb1ceb13e19056aca7fa0206287"
checksum = "874b6a17738fc273ec753618bac60ddaeac48cb1d7684c3e7bd472e57a28b817"
dependencies = [
"frunk_core",
"frunk_derives",
"frunk_proc_macros",
"serde",
]
[[package]]
name = "frunk_core"
version = "0.4.2"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af2469fab0bd07e64ccf0ad57a1438f63160c69b2e57f04a439653d68eb558d6"
checksum = "3529a07095650187788833d585c219761114005d5976185760cf794d265b6a5c"
dependencies = [
"serde",
]
[[package]]
name = "frunk_derives"
version = "0.4.2"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0fa992f1656e1707946bbba340ad244f0814009ef8c0118eb7b658395f19a2e"
checksum = "e99b8b3c28ae0e84b604c75f721c21dc77afb3706076af5e8216d15fd1deaae3"
dependencies = [
"frunk_proc_macro_helpers",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
name = "frunk_proc_macro_helpers"
version = "0.1.2"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35b54add839292b743aeda6ebedbd8b11e93404f902c56223e51b9ec18a13d2c"
checksum = "05a956ef36c377977e512e227dcad20f68c2786ac7a54dacece3746046fea5ce"
dependencies = [
"frunk_core",
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
name = "frunk_proc_macros"
version = "0.1.2"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71b85a1d4a9a6b300b41c05e8e13ef2feca03e0334127f29eca9506a7fe13a93"
checksum = "67e86c2c9183662713fea27ea527aad20fb15fee635a71081ff91bf93df4dc51"
dependencies = [
"frunk_core",
"frunk_proc_macro_helpers",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -2252,7 +2256,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -2382,7 +2386,7 @@ dependencies = [
"futures-sink",
"futures-util",
"http 0.2.12",
"indexmap 2.4.0",
"indexmap 2.5.0",
"slab",
"tokio",
"tokio-util",
@ -2401,7 +2405,7 @@ dependencies = [
"futures-core",
"futures-sink",
"http 1.1.0",
"indexmap 2.4.0",
"indexmap 2.5.0",
"slab",
"tokio",
"tokio-util",
@ -2747,7 +2751,7 @@ dependencies = [
"tokio",
"tokio-rustls 0.26.0",
"tower-service",
"webpki-roots 0.26.3",
"webpki-roots 0.26.5",
]
[[package]]
@ -2921,7 +2925,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -3028,9 +3032,9 @@ dependencies = [
[[package]]
name = "indexmap"
version = "2.4.0"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c"
checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5"
dependencies = [
"equivalent",
"hashbrown 0.14.5",
@ -3309,7 +3313,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ee7893dab2e44ae5f9d0173f26ff4aa327c10b01b06a72b52dd9405b628640d"
dependencies = [
"indexmap 2.4.0",
"indexmap 2.5.0",
]
[[package]]
@ -3475,9 +3479,9 @@ dependencies = [
[[package]]
name = "libz-sys"
version = "1.1.19"
version = "1.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdc53a7799a7496ebc9fd29f31f7df80e83c9bda5299768af5f9e59eeea74647"
checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472"
dependencies = [
"cc",
"pkg-config",
@ -3624,7 +3628,7 @@ dependencies = [
"smtp-proto",
"tokio",
"tokio-rustls 0.26.0",
"webpki-roots 0.26.3",
"webpki-roots 0.26.5",
]
[[package]]
@ -3698,7 +3702,7 @@ checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -3836,7 +3840,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
"termcolor",
"thiserror",
]
@ -3875,7 +3879,7 @@ dependencies = [
"twox-hash",
"url",
"webpki",
"webpki-roots 0.26.3",
"webpki-roots 0.26.5",
]
[[package]]
@ -4064,9 +4068,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
[[package]]
name = "object"
version = "0.36.3"
version = "0.36.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9"
checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a"
dependencies = [
"memchr",
]
@ -4082,9 +4086,9 @@ dependencies = [
[[package]]
name = "oid-registry"
version = "0.7.0"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d"
checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9"
dependencies = [
"asn1-rs 0.6.2",
]
@ -4124,7 +4128,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -4361,7 +4365,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
dependencies = [
"fixedbitset",
"indexmap 2.4.0",
"indexmap 2.5.0",
]
[[package]]
@ -4404,7 +4408,7 @@ dependencies = [
"phf_shared 0.11.2",
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -4442,7 +4446,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -4572,12 +4576,12 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
[[package]]
name = "prettyplease"
version = "0.2.20"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e"
checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba"
dependencies = [
"proc-macro2",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -4615,9 +4619,9 @@ dependencies = [
[[package]]
name = "proc-macro-crate"
version = "3.1.0"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284"
checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b"
dependencies = [
"toml_edit",
]
@ -4671,9 +4675,9 @@ dependencies = [
[[package]]
name = "prost"
version = "0.13.1"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc"
checksum = "3b2ecbe40f08db5c006b5764a2645f7f3f141ce756412ac9e1dd6087e6d32995"
dependencies = [
"bytes",
"prost-derive",
@ -4681,15 +4685,15 @@ dependencies = [
[[package]]
name = "prost-derive"
version = "0.13.1"
version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca"
checksum = "acf0c195eebb4af52c752bec4f52f645da98b6e92077a04110c7f349477ae5ac"
dependencies = [
"anyhow",
"itertools 0.13.0",
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -4812,9 +4816,9 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.36"
version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
dependencies = [
"proc-macro2",
]
@ -4997,7 +5001,7 @@ dependencies = [
"pin-project-lite",
"rand",
"rustls 0.23.12",
"rustls-native-certs 0.7.2",
"rustls-native-certs 0.7.3",
"rustls-pemfile 2.1.3",
"rustls-pki-types",
"ryu",
@ -5007,7 +5011,7 @@ dependencies = [
"tokio-rustls 0.26.0",
"tokio-util",
"url",
"webpki-roots 0.26.3",
"webpki-roots 0.26.5",
]
[[package]]
@ -5162,7 +5166,7 @@ dependencies = [
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"webpki-roots 0.26.3",
"webpki-roots 0.26.5",
"windows-registry",
]
@ -5447,9 +5451,9 @@ dependencies = [
[[package]]
name = "rustc_version"
version = "0.4.0"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"
dependencies = [
"semver 1.0.23",
]
@ -5465,9 +5469,9 @@ dependencies = [
[[package]]
name = "rustix"
version = "0.38.34"
version = "0.38.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f"
checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f"
dependencies = [
"bitflags 2.6.0",
"errno",
@ -5497,7 +5501,7 @@ dependencies = [
"log",
"ring 0.17.8",
"rustls-pki-types",
"rustls-webpki 0.102.6",
"rustls-webpki 0.102.7",
"subtle",
"zeroize",
]
@ -5511,7 +5515,7 @@ dependencies = [
"once_cell",
"ring 0.17.8",
"rustls-pki-types",
"rustls-webpki 0.102.6",
"rustls-webpki 0.102.7",
"subtle",
"zeroize",
]
@ -5530,9 +5534,9 @@ dependencies = [
[[package]]
name = "rustls-native-certs"
version = "0.7.2"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04182dffc9091a404e0fc069ea5cd60e5b866c3adf881eff99a32d048242dffa"
checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5"
dependencies = [
"openssl-probe",
"rustls-pemfile 2.1.3",
@ -5578,9 +5582,9 @@ dependencies = [
[[package]]
name = "rustls-webpki"
version = "0.102.6"
version = "0.102.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e"
checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56"
dependencies = [
"ring 0.17.8",
"rustls-pki-types",
@ -5806,9 +5810,9 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.208"
version = "1.0.209"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2"
checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09"
dependencies = [
"serde_derive",
]
@ -5824,20 +5828,20 @@ dependencies = [
[[package]]
name = "serde_derive"
version = "1.0.208"
version = "1.0.209"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf"
checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
name = "serde_json"
version = "1.0.125"
version = "1.0.127"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed"
checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad"
dependencies = [
"itoa",
"memchr",
@ -5901,7 +5905,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -5977,9 +5981,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "sieve-rs"
version = "0.5.0"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e21701f587c62a8f18d7f4eeb705a7043163630b684ed8e51955ffc5cefe379f"
checksum = "28446db92d055bb4fb05c63fcdb25462d0826acec87180c1c0e4c3aaf69cc383"
dependencies = [
"ahash 0.8.11",
"bincode",
@ -6090,7 +6094,7 @@ dependencies = [
"tokio-rustls 0.26.0",
"trc",
"utils",
"webpki-roots 0.26.3",
"webpki-roots 0.26.5",
"x509-parser 0.16.0",
]
@ -6306,9 +6310,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.75"
version = "2.0.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9"
checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed"
dependencies = [
"proc-macro2",
"quote",
@ -6324,7 +6328,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -6362,7 +6366,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -6480,7 +6484,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -6560,9 +6564,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.39.3"
version = "1.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5"
checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998"
dependencies = [
"backtrace",
"bytes",
@ -6584,7 +6588,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -6669,7 +6673,7 @@ dependencies = [
"tokio",
"tokio-rustls 0.25.0",
"tungstenite 0.21.0",
"webpki-roots 0.26.3",
"webpki-roots 0.26.5",
]
[[package]]
@ -6705,20 +6709,20 @@ checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41"
[[package]]
name = "toml_edit"
version = "0.21.1"
version = "0.22.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1"
checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d"
dependencies = [
"indexmap 2.4.0",
"indexmap 2.5.0",
"toml_datetime",
"winnow",
]
[[package]]
name = "tonic"
version = "0.12.1"
version = "0.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38659f4a91aba8598d27821589f5db7dddd94601e7a01b1e485a50e5484c7401"
checksum = "c6f6ba989e4b2c58ae83d862d3a3e27690b6e3ae630d0deb59f3697f32aa88ad"
dependencies = [
"async-stream",
"async-trait",
@ -6810,7 +6814,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -7097,7 +7101,7 @@ dependencies = [
"tokio",
"tokio-rustls 0.26.0",
"trc",
"webpki-roots 0.26.3",
"webpki-roots 0.26.5",
"x509-parser 0.16.0",
]
@ -7181,7 +7185,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
"wasm-bindgen-shared",
]
@ -7215,7 +7219,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@ -7267,9 +7271,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1"
[[package]]
name = "webpki-roots"
version = "0.26.3"
version = "0.26.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd"
checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a"
dependencies = [
"rustls-pki-types",
]
@ -7543,9 +7547,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winnow"
version = "0.5.40"
version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876"
checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f"
dependencies = [
"memchr",
]
@ -7620,7 +7624,7 @@ dependencies = [
"der-parser 9.0.0",
"lazy_static",
"nom",
"oid-registry 0.7.0",
"oid-registry 0.7.1",
"rusticata-macros",
"thiserror",
"time",
@ -7667,7 +7671,7 @@ checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
"synstructure 0.13.1",
]
@ -7689,7 +7693,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -7709,7 +7713,7 @@ checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
"synstructure 0.13.1",
]
@ -7730,7 +7734,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -7752,7 +7756,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.75",
"syn 2.0.77",
]
[[package]]
@ -7764,14 +7768,14 @@ dependencies = [
"aes",
"arbitrary",
"bzip2",
"constant_time_eq 0.3.0",
"constant_time_eq 0.3.1",
"crc32fast",
"crossbeam-utils",
"deflate64",
"displaydoc",
"flate2",
"hmac 0.12.1",
"indexmap 2.4.0",
"indexmap 2.5.0",
"lzma-rs",
"memchr",
"pbkdf2",

View file

@ -29,7 +29,8 @@ pub struct Scripting {
pub from_name: IfBlock,
pub return_path: IfBlock,
pub sign: IfBlock,
pub scripts: AHashMap<String, Arc<Sieve>>,
pub trusted_scripts: AHashMap<String, Arc<Sieve>>,
pub untrusted_scripts: AHashMap<String, Arc<Sieve>>,
}
pub struct ScriptCache {
@ -279,8 +280,8 @@ impl Scripting {
.to_string();
trusted_runtime.set_local_hostname(hostname.clone());
// Parse scripts
let mut scripts = AHashMap::new();
// Parse trusted scripts
let mut trusted_scripts = AHashMap::new();
for id in config
.sub_keys("sieve.trusted.scripts", ".contents")
.map(|s| s.to_string())
@ -293,11 +294,34 @@ impl Scripting {
.as_bytes(),
) {
Ok(compiled) => {
scripts.insert(id, compiled.into());
trusted_scripts.insert(id, compiled.into());
}
Err(err) => config.new_build_error(
("sieve.trusted.scripts", id.as_str(), "contents"),
format!("Failed to compile Sieve script: {err}"),
format!("Failed to compile trusted Sieve script: {err}"),
),
}
}
// Parse untrusted scripts
let mut untrusted_scripts = AHashMap::new();
for id in config
.sub_keys("sieve.untrusted.scripts", ".contents")
.map(|s| s.to_string())
.collect::<Vec<_>>()
{
match untrusted_compiler.compile(
config
.value(("sieve.untrusted.scripts", id.as_str(), "contents"))
.unwrap()
.as_bytes(),
) {
Ok(compiled) => {
untrusted_scripts.insert(id, compiled.into());
}
Err(err) => config.new_build_error(
("sieve.untrusted.scripts", id.as_str(), "contents"),
format!("Failed to compile untrusted Sieve script: {err}"),
),
}
}
@ -334,7 +358,8 @@ impl Scripting {
)
},
),
scripts,
untrusted_scripts,
trusted_scripts,
}
}
}
@ -379,7 +404,8 @@ impl Default for Scripting {
"'ed25519-' + key_get('default', 'domain')]"
),
),
scripts: AHashMap::new(),
untrusted_scripts: AHashMap::new(),
trusted_scripts: AHashMap::new(),
}
}
}
@ -407,7 +433,8 @@ impl Clone for Scripting {
from_name: self.from_name.clone(),
return_path: self.return_path.clone(),
sign: self.sign.clone(),
scripts: self.scripts.clone(),
trusted_scripts: self.trusted_scripts.clone(),
untrusted_scripts: self.untrusted_scripts.clone(),
}
}
}

View file

@ -185,8 +185,20 @@ impl Core {
})
}
pub fn get_sieve_script(&self, name: &str, session_id: u64) -> Option<&Arc<Sieve>> {
self.sieve.scripts.get(name).or_else(|| {
pub fn get_trusted_sieve_script(&self, name: &str, session_id: u64) -> Option<&Arc<Sieve>> {
self.sieve.trusted_scripts.get(name).or_else(|| {
trc::event!(
Sieve(trc::SieveEvent::ScriptNotFound),
Id = name.to_string(),
SpanId = session_id,
);
None
})
}
pub fn get_untrusted_sieve_script(&self, name: &str, session_id: u64) -> Option<&Arc<Sieve>> {
self.sieve.untrusted_scripts.get(name).or_else(|| {
trc::event!(
Sieve(trc::SieveEvent::ScriptNotFound),
Id = name.to_string(),

View file

@ -64,7 +64,7 @@ impl JMAP {
match ctx.has_endpoint_access(&self.core).await {
StatusCode::OK => (),
status => {
// Allow lookup to avoid lockout
// Allow loopback address to avoid lockouts
if !session.remote_ip.is_loopback() {
return Ok(status.into_http_response());
}

View file

@ -46,7 +46,7 @@ impl JMAP {
path.get(1).and_then(|name| {
self.core
.sieve
.scripts
.trusted_scripts
.get(*name)
.map(|s| (s.clone(), name.to_string()))
}),

View file

@ -114,15 +114,26 @@ impl JMAP {
while let Some(event) = instance.run(input) {
match event {
Ok(event) => match event {
Event::IncludeScript { name, .. } => {
if let Ok(Some(script)) =
self.sieve_script_get_by_name(account_id, &name).await
{
input = Input::script(name, script);
} else {
input = false.into();
Event::IncludeScript { name, .. } => match &name {
sieve::Script::Personal(name_) => {
if let Ok(Some(script)) =
self.sieve_script_get_by_name(account_id, name_).await
{
input = Input::script(name, script);
} else {
input = false.into();
}
}
}
sieve::Script::Global(name_) => {
if let Some(script) =
self.core.get_untrusted_sieve_script(name_, session_id)
{
input = Input::script(name, script.clone());
} else {
input = false.into();
}
}
},
Event::MailboxExists {
mailboxes,
special_use,

View file

@ -543,7 +543,7 @@ impl<T: SessionStream> Session<T> {
.and_then(|name| {
self.core
.core
.get_sieve_script(&name, self.data.session_id)
.get_trusted_sieve_script(&name, self.data.session_id)
.map(|s| (s, name))
})
{

View file

@ -87,7 +87,7 @@ impl<T: SessionStream> Session<T> {
.and_then(|name| {
self.core
.core
.get_sieve_script(&name, self.data.session_id)
.get_trusted_sieve_script(&name, self.data.session_id)
.map(|s| (s, name))
})
{

View file

@ -156,7 +156,7 @@ impl<T: SessionStream> Session<T> {
.and_then(|name| {
self.core
.core
.get_sieve_script(&name, self.data.session_id)
.get_trusted_sieve_script(&name, self.data.session_id)
.map(|s| (s, name))
})
{

View file

@ -88,7 +88,7 @@ impl<T: SessionStream> Session<T> {
.and_then(|name| {
self.core
.core
.get_sieve_script(&name, self.data.session_id)
.get_trusted_sieve_script(&name, self.data.session_id)
.map(|s| (s.clone(), name))
});

View file

@ -92,7 +92,7 @@ impl<T: SessionStream> Session<T> {
.and_then(|name| {
self.core
.core
.get_sieve_script(&name, self.data.session_id)
.get_trusted_sieve_script(&name, self.data.session_id)
.map(|s| (s, name))
})
{

View file

@ -57,7 +57,7 @@ impl SMTP {
match result {
Ok(event) => match event {
Event::IncludeScript { name, optional } => {
if let Some(script) = self.core.sieve.scripts.get(name.as_str()) {
if let Some(script) = self.core.sieve.trusted_scripts.get(name.as_str()) {
input = Input::script(name, script.clone());
} else if optional {
input = false.into();

View file

@ -0,0 +1,5 @@
require ["include", "ihave"];
include :global "common";
error "'stop' within included script ignored or global include failed.";

View file

@ -344,17 +344,25 @@ impl DirectoryStore {
if self.is_postgresql() {
concat!(
"INSERT INTO accounts (name, secret, description, ",
"type, active) VALUES ($1, $2, $3, $4, true) ON CONFLICT (name) DO NOTHING"
"type, active) VALUES ($1, $2, $3, $4, true) ",
"ON CONFLICT (name) ",
"DO UPDATE SET secret = $2, description = $3, type = $4, active = true"
)
} else if self.is_mysql() {
concat!(
"INSERT IGNORE INTO accounts (name, secret, description, ",
"type, active) VALUES (?, ?, ?, ?, true)"
"INSERT INTO accounts (name, secret, description, ",
"type, active) VALUES (?, ?, ?, ?, true) ",
"ON DUPLICATE KEY UPDATE ",
"secret = VALUES(secret), description = VALUES(description), ",
"type = VALUES(type), active = true"
)
} else {
concat!(
"INSERT OR IGNORE INTO accounts (name, secret, description, ",
"type, active) VALUES (?, ?, ?, ?, true)"
"INSERT INTO accounts (name, secret, description, ",
"type, active) VALUES (?, ?, ?, ?, true) ",
"ON CONFLICT(name) DO UPDATE SET ",
"secret = excluded.secret, description = excluded.description, ",
"type = excluded.type, active = true"
)
},
vec![

View file

@ -291,6 +291,13 @@ events = ["auth.*", "delivery.dsn*", "message-ingest.*"]
signature-key = "ovos-moles"
throttle = "100ms"
[sieve.untrusted.scripts."common"]
contents = '''
require "reject";
reject "Rejected from a global script.";
stop;
'''
"#;
#[tokio::test(flavor = "multi_thread")]

View file

@ -347,6 +347,40 @@ pub async fn test(params: &mut JMAPTest) {
)
.await;
// Run include global tests
client
.sieve_script_create(
"test_include_global",
get_script("test_include_global"),
true,
)
.await
.unwrap();
lmtp.ingest(
"bill@remote.org",
&["jdoe@example.com"],
concat!(
"From: bill@remote.org\r\n",
"Bcc: Undisclosed recipients;\r\n",
"Message-ID: <1234@example.com>\r\n",
"Subject: Holidays\r\n",
"\r\n",
"Remember to file your T.P.S. reports before ",
"going on holidays."
),
)
.await;
assert_message_delivery(
&mut smtp_rx,
MockMessage::new(
"<>",
["<bill@remote.org>"],
"@Rejected from a global script",
),
)
.await;
// Run enclose + redirect tests
client
.sieve_script_create(

View file

@ -260,7 +260,13 @@ async fn antispam() {
continue;
}*/
println!("===== {test_name} =====");
let script = core.core.sieve.scripts.get(test_name).cloned().unwrap();
let script = core
.core
.sieve
.trusted_scripts
.get(test_name)
.cloned()
.unwrap();
let contents = fs::read_to_string(base_path.join(format!("{test_name}.test"))).unwrap();
let mut lines = contents.lines();

View file

@ -166,7 +166,7 @@ async fn sieve_scripts() {
assert!(!session.init_conn().await);
// Run tests
for (name, script) in &core.core.sieve.scripts {
for (name, script) in &core.core.sieve.trusted_scripts {
if name.starts_with("stage_") || name.ends_with("_include") {
continue;
}

View file

@ -127,7 +127,6 @@ async fn sign_and_seal() {
// Enable logging
crate::enable_logging();
let tmp_dir = TempDir::new("smtp_sign_test", true);
let mut config = Config::new(tmp_dir.update_config(CONFIG.to_string() + SIGNATURES)).unwrap();
let stores = Stores::parse_all(&mut config).await;

View file

@ -30,12 +30,15 @@ const CONFIG: &str = r#"
[session.rcpt]
relay = true
[lookup.default]
domain = "example.org"
[report]
submitter = "'mx.example.org'"
[report.dmarc.aggregate]
from-name = "'DMARC Report'"
from-address = "'reports@example.org'"
from-address = "'reports@' + key_get('default', 'domain')"
org-name = "'Foobar, Inc.'"
contact-info = "'https://foobar.org/contact'"
send = "daily"
@ -49,7 +52,6 @@ async fn report_dmarc() {
// Enable logging
crate::enable_logging();
// Create scheduler
let mut local = TestServer::new(
"smtp_report_dmarc_test",