mirror of
https://git.verdigado.com/NB-Public/simple-wkd.git
synced 2024-10-30 01:25:53 +01:00
Remove sequoia-net dependency
This commit is contained in:
parent
d3888e74bc
commit
e62c174ca7
6 changed files with 64 additions and 371 deletions
347
backend/Cargo.lock
generated
347
backend/Cargo.lock
generated
|
@ -482,12 +482,6 @@ dependencies = [
|
|||
"syn 2.0.15",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "data-encoding"
|
||||
version = "2.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb"
|
||||
|
||||
[[package]]
|
||||
name = "derive_more"
|
||||
version = "0.99.17"
|
||||
|
@ -593,24 +587,6 @@ dependencies = [
|
|||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "endian-type"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d"
|
||||
|
||||
[[package]]
|
||||
name = "enum-as-inner"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "errno"
|
||||
version = "0.3.1"
|
||||
|
@ -693,15 +669,6 @@ dependencies = [
|
|||
"percent-encoding",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "futures-channel"
|
||||
version = "0.3.28"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "futures-core"
|
||||
version = "0.3.28"
|
||||
|
@ -714,17 +681,6 @@ version = "0.3.28"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964"
|
||||
|
||||
[[package]]
|
||||
name = "futures-macro"
|
||||
version = "0.3.28"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.15",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "futures-sink"
|
||||
version = "0.3.28"
|
||||
|
@ -745,7 +701,6 @@ checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533"
|
|||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-io",
|
||||
"futures-macro",
|
||||
"futures-task",
|
||||
"memchr",
|
||||
"pin-project-lite",
|
||||
|
@ -820,12 +775,6 @@ version = "0.12.3"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
|
||||
|
||||
[[package]]
|
||||
name = "heck"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
|
||||
|
||||
[[package]]
|
||||
name = "hermit-abi"
|
||||
version = "0.2.6"
|
||||
|
@ -863,17 +812,6 @@ dependencies = [
|
|||
"itoa",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "http-body"
|
||||
version = "0.4.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"http",
|
||||
"pin-project-lite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "http-range"
|
||||
version = "0.1.5"
|
||||
|
@ -892,43 +830,6 @@ version = "1.0.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"
|
||||
|
||||
[[package]]
|
||||
name = "hyper"
|
||||
version = "0.14.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"h2",
|
||||
"http",
|
||||
"http-body",
|
||||
"httparse",
|
||||
"httpdate",
|
||||
"itoa",
|
||||
"pin-project-lite",
|
||||
"socket2",
|
||||
"tokio",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
"want",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper-tls"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"hyper",
|
||||
"native-tls",
|
||||
"tokio",
|
||||
"tokio-native-tls",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "iana-time-zone"
|
||||
version = "0.1.56"
|
||||
|
@ -953,17 +854,6 @@ dependencies = [
|
|||
"cxx-build",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
|
||||
dependencies = [
|
||||
"matches",
|
||||
"unicode-bidi",
|
||||
"unicode-normalization",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "0.3.0"
|
||||
|
@ -1004,24 +894,6 @@ dependencies = [
|
|||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ipconfig"
|
||||
version = "0.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be"
|
||||
dependencies = [
|
||||
"socket2",
|
||||
"widestring",
|
||||
"winapi",
|
||||
"winreg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ipnet"
|
||||
version = "2.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f"
|
||||
|
||||
[[package]]
|
||||
name = "is-terminal"
|
||||
version = "0.4.7"
|
||||
|
@ -1113,7 +985,7 @@ dependencies = [
|
|||
"futures-util",
|
||||
"hostname",
|
||||
"httpdate",
|
||||
"idna 0.3.0",
|
||||
"idna",
|
||||
"mime",
|
||||
"native-tls",
|
||||
"nom",
|
||||
|
@ -1139,12 +1011,6 @@ dependencies = [
|
|||
"cc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "linked-hash-map"
|
||||
version = "0.5.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
|
||||
|
||||
[[package]]
|
||||
name = "linux-raw-sys"
|
||||
version = "0.3.4"
|
||||
|
@ -1188,27 +1054,12 @@ dependencies = [
|
|||
"cfg-if",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "lru-cache"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c"
|
||||
dependencies = [
|
||||
"linked-hash-map",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "match_cfg"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4"
|
||||
|
||||
[[package]]
|
||||
name = "matches"
|
||||
version = "0.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.5.0"
|
||||
|
@ -1279,15 +1130,6 @@ version = "1.0.4"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
|
||||
|
||||
[[package]]
|
||||
name = "nibble_vec"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43"
|
||||
dependencies = [
|
||||
"smallvec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "7.1.3"
|
||||
|
@ -1486,12 +1328,6 @@ dependencies = [
|
|||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quick-error"
|
||||
version = "1.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.26"
|
||||
|
@ -1507,16 +1343,6 @@ version = "0.4.7"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a24039f627d8285853cc90dcddf8c1ebfaa91f834566948872b225b9a28ed1b6"
|
||||
|
||||
[[package]]
|
||||
name = "radix_trie"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd"
|
||||
dependencies = [
|
||||
"endian-type",
|
||||
"nibble_vec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rand"
|
||||
version = "0.7.3"
|
||||
|
@ -1640,16 +1466,6 @@ version = "0.7.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c"
|
||||
|
||||
[[package]]
|
||||
name = "resolv-conf"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00"
|
||||
dependencies = [
|
||||
"hostname",
|
||||
"quick-error",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustc_version"
|
||||
version = "0.4.0"
|
||||
|
@ -1735,31 +1551,6 @@ version = "1.0.17"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed"
|
||||
|
||||
[[package]]
|
||||
name = "sequoia-net"
|
||||
version = "0.27.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "960f1ea77bf8b6f455285424257574d66fa29223e4286268017a4458cc29d33f"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.13.1",
|
||||
"futures-util",
|
||||
"http",
|
||||
"hyper",
|
||||
"hyper-tls",
|
||||
"libc",
|
||||
"native-tls",
|
||||
"percent-encoding",
|
||||
"sequoia-openpgp",
|
||||
"tempfile",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"trust-dns-client",
|
||||
"trust-dns-resolver",
|
||||
"url",
|
||||
"zbase32",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sequoia-openpgp"
|
||||
version = "1.14.0"
|
||||
|
@ -1773,7 +1564,7 @@ dependencies = [
|
|||
"dyn-clone",
|
||||
"foreign-types-shared",
|
||||
"getrandom 0.2.9",
|
||||
"idna 0.3.0",
|
||||
"idna",
|
||||
"lalrpop",
|
||||
"lalrpop-util",
|
||||
"lazy_static",
|
||||
|
@ -1874,7 +1665,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "simple-wkd"
|
||||
version = "0.1.0"
|
||||
version = "1.0.0"
|
||||
dependencies = [
|
||||
"actix-files",
|
||||
"actix-web",
|
||||
|
@ -1885,13 +1676,13 @@ dependencies = [
|
|||
"log",
|
||||
"once_cell",
|
||||
"rand 0.8.5",
|
||||
"sequoia-net",
|
||||
"sequoia-openpgp",
|
||||
"serde",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"toml",
|
||||
"url",
|
||||
"zbase32",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -2085,26 +1876,13 @@ dependencies = [
|
|||
"bytes",
|
||||
"libc",
|
||||
"mio",
|
||||
"num_cpus",
|
||||
"parking_lot",
|
||||
"pin-project-lite",
|
||||
"signal-hook-registry",
|
||||
"socket2",
|
||||
"tokio-macros",
|
||||
"windows-sys 0.45.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-macros"
|
||||
version = "2.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.15",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-native-tls"
|
||||
version = "0.3.1"
|
||||
|
@ -2163,12 +1941,6 @@ dependencies = [
|
|||
"winnow",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tower-service"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
|
||||
|
||||
[[package]]
|
||||
name = "tracing"
|
||||
version = "0.1.37"
|
||||
|
@ -2178,21 +1950,9 @@ dependencies = [
|
|||
"cfg-if",
|
||||
"log",
|
||||
"pin-project-lite",
|
||||
"tracing-attributes",
|
||||
"tracing-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-attributes"
|
||||
version = "0.1.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-core"
|
||||
version = "0.1.30"
|
||||
|
@ -2202,78 +1962,6 @@ dependencies = [
|
|||
"once_cell",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "trust-dns-client"
|
||||
version = "0.22.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c408c32e6a9dbb38037cece35740f2cf23c875d8ca134d33631cec83f74d3fe"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"data-encoding",
|
||||
"futures-channel",
|
||||
"futures-util",
|
||||
"lazy_static",
|
||||
"radix_trie",
|
||||
"rand 0.8.5",
|
||||
"thiserror",
|
||||
"time 0.3.20",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"trust-dns-proto",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "trust-dns-proto"
|
||||
version = "0.22.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"cfg-if",
|
||||
"data-encoding",
|
||||
"enum-as-inner",
|
||||
"futures-channel",
|
||||
"futures-io",
|
||||
"futures-util",
|
||||
"idna 0.2.3",
|
||||
"ipnet",
|
||||
"lazy_static",
|
||||
"openssl",
|
||||
"rand 0.8.5",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
"tinyvec",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "trust-dns-resolver"
|
||||
version = "0.22.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"futures-util",
|
||||
"ipconfig",
|
||||
"lazy_static",
|
||||
"lru-cache",
|
||||
"parking_lot",
|
||||
"resolv-conf",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"trust-dns-proto",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "try-lock"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
|
||||
|
||||
[[package]]
|
||||
name = "typenum"
|
||||
version = "1.16.0"
|
||||
|
@ -2329,7 +2017,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643"
|
||||
dependencies = [
|
||||
"form_urlencoded",
|
||||
"idna 0.3.0",
|
||||
"idna",
|
||||
"percent-encoding",
|
||||
"serde",
|
||||
]
|
||||
|
@ -2346,16 +2034,6 @@ version = "0.9.4"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||
|
||||
[[package]]
|
||||
name = "want"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0"
|
||||
dependencies = [
|
||||
"log",
|
||||
"try-lock",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.9.0+wasi-snapshot-preview1"
|
||||
|
@ -2428,12 +2106,6 @@ version = "0.2.84"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d"
|
||||
|
||||
[[package]]
|
||||
name = "widestring"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.9"
|
||||
|
@ -2630,15 +2302,6 @@ dependencies = [
|
|||
"memchr",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winreg"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d"
|
||||
dependencies = [
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "xxhash-rust"
|
||||
version = "0.8.6"
|
||||
|
|
|
@ -13,10 +13,10 @@ lettre = { version = "0.10.4", features = ["tokio1-native-tls"] }
|
|||
log = "0.4.17"
|
||||
once_cell = "1.17.1"
|
||||
rand = "0.8.5"
|
||||
sequoia-net = "0.27.0"
|
||||
sequoia-openpgp = { version = "1.14.0", default-features = false, features = ["crypto-openssl"] }
|
||||
serde = { version = "1.0.160", features = ["derive"] }
|
||||
thiserror = "1.0.40"
|
||||
tokio = { version = "1.27.0", features = ["time"] }
|
||||
toml = "0.7.3"
|
||||
url = { version = "2.3.1", features = ["serde"] }
|
||||
zbase32 = "0.1.2"
|
||||
|
|
|
@ -4,8 +4,8 @@ use log::{debug, error, warn};
|
|||
|
||||
use crate::errors::SpecialErrors;
|
||||
use crate::management::{delete_key, Action, Pending};
|
||||
use crate::settings::{MAILER, ROOT_FOLDER, SETTINGS};
|
||||
use crate::utils::{extract_domain, get_email_from_cert, parse_pem, read_file};
|
||||
use crate::settings::{MAILER, SETTINGS};
|
||||
use crate::utils::{get_email_from_cert, insert_key, parse_pem, read_file};
|
||||
use crate::{log_err, pending_path};
|
||||
use anyhow::Result;
|
||||
|
||||
|
@ -26,11 +26,7 @@ pub fn confirm_action(token: &str) -> Result<(Action, String)> {
|
|||
Action::Add => {
|
||||
let cert = parse_pem(key.data())?;
|
||||
let email = get_email_from_cert(&cert)?;
|
||||
let domain = extract_domain(&email)?;
|
||||
log_err!(
|
||||
sequoia_net::wkd::insert(ROOT_FOLDER, domain, SETTINGS.variant, &cert),
|
||||
warn
|
||||
)?;
|
||||
log_err!(insert_key(&cert), warn)?;
|
||||
email
|
||||
}
|
||||
Action::Delete => {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
use crate::log_err;
|
||||
use crate::settings::{ERROR_TEXT, ROOT_FOLDER};
|
||||
use crate::utils::{get_user_file_path, pending_path, read_file};
|
||||
use crate::settings::ERROR_TEXT;
|
||||
use crate::utils::{email_to_file_path, pending_path, read_file};
|
||||
|
||||
use anyhow::Result;
|
||||
use chrono::Utc;
|
||||
use log::{debug, warn};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{fmt::Display, fs, path::Path};
|
||||
use std::{fmt::Display, fs};
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy)]
|
||||
pub enum Action {
|
||||
|
@ -100,7 +100,7 @@ pub fn clean_stale(max_age: i64) {
|
|||
}
|
||||
|
||||
pub fn delete_key(email: &str) -> Result<()> {
|
||||
let path = Path::new(&ROOT_FOLDER).join(get_user_file_path(email)?);
|
||||
let path = email_to_file_path(email)?;
|
||||
log_err!(fs::remove_file(path), warn)?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
use lettre::{transport::smtp::authentication::Credentials, AsyncSmtpTransport, Tokio1Executor};
|
||||
use log::{debug, error};
|
||||
use once_cell::sync::Lazy;
|
||||
use sequoia_net::wkd::Variant;
|
||||
use sequoia_openpgp::policy::StandardPolicy;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::path::PathBuf;
|
||||
|
@ -11,7 +10,6 @@ use crate::{log_err, utils::read_file};
|
|||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct Settings {
|
||||
#[serde(with = "VariantDef")]
|
||||
pub variant: Variant,
|
||||
pub max_age: i64,
|
||||
pub cleanup_interval: u64,
|
||||
|
@ -34,8 +32,7 @@ pub struct MailSettings {
|
|||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
#[serde(remote = "Variant")]
|
||||
pub enum VariantDef {
|
||||
pub enum Variant {
|
||||
Advanced,
|
||||
Direct,
|
||||
}
|
||||
|
@ -55,14 +52,13 @@ fn get_settings() -> Settings {
|
|||
panic!("Unable to access settings file!")
|
||||
}
|
||||
};
|
||||
let settings = match log_err!(toml::from_str(&content), error) {
|
||||
match log_err!(toml::from_str(&content), error) {
|
||||
Ok(settings) => settings,
|
||||
Err(_) => {
|
||||
error!("Unable to parse settings from file!");
|
||||
panic!("Unable to parse settings from file!")
|
||||
}
|
||||
};
|
||||
settings
|
||||
}
|
||||
}
|
||||
|
||||
fn get_mailer() -> AsyncSmtpTransport<Tokio1Executor> {
|
||||
|
@ -79,7 +75,7 @@ fn get_mailer() -> AsyncSmtpTransport<Tokio1Executor> {
|
|||
AsyncSmtpTransport::<Tokio1Executor>::starttls_relay(&SETTINGS.mail_settings.smtp_host)
|
||||
}
|
||||
};
|
||||
let mailer = match builder {
|
||||
match builder {
|
||||
Ok(builder) => builder,
|
||||
Err(_) => {
|
||||
error!("Unable to set up smtp");
|
||||
|
@ -88,8 +84,7 @@ fn get_mailer() -> AsyncSmtpTransport<Tokio1Executor> {
|
|||
}
|
||||
.credentials(creds)
|
||||
.port(SETTINGS.mail_settings.smtp_port)
|
||||
.build();
|
||||
mailer
|
||||
.build()
|
||||
}
|
||||
|
||||
pub const ERROR_TEXT: &str = "An error occoured:";
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use crate::errors::CompatErr;
|
||||
use crate::errors::SpecialErrors;
|
||||
use crate::log_err;
|
||||
use crate::settings::Variant;
|
||||
use crate::settings::ROOT_FOLDER;
|
||||
use crate::settings::SETTINGS;
|
||||
|
||||
|
@ -14,7 +15,8 @@ use flexi_logger::{style, DeferredNow, FileSpec, FlexiLoggerError, Logger, Logge
|
|||
use log::debug;
|
||||
use log::error;
|
||||
use rand::{distributions::Alphanumeric, thread_rng, Rng};
|
||||
use sequoia_net::wkd::Url;
|
||||
use sequoia_openpgp::serialize::Marshal;
|
||||
use sequoia_openpgp::types::HashAlgorithm;
|
||||
use sequoia_openpgp::{parse::Parse, Cert};
|
||||
use std::{
|
||||
fs,
|
||||
|
@ -31,6 +33,48 @@ macro_rules! validate_cert {
|
|||
};
|
||||
}
|
||||
|
||||
pub fn encode_local(local: &str) -> String {
|
||||
let mut digest = vec![0; 20];
|
||||
let mut algo = HashAlgorithm::SHA1.context().unwrap();
|
||||
algo.update(local.as_bytes());
|
||||
let _ = algo.digest(&mut digest);
|
||||
|
||||
zbase32::encode_full_bytes(&digest[..])
|
||||
}
|
||||
|
||||
pub fn email_to_file_path(email: &str) -> Result<PathBuf> {
|
||||
let address_data: Vec<&str> = email.split('@').collect();
|
||||
if address_data.len() != 2 {
|
||||
Err(SpecialErrors::MalformedEmail)?;
|
||||
}
|
||||
|
||||
let domain = address_data[1];
|
||||
let local_encoded = encode_local(address_data[0]);
|
||||
|
||||
let directory = match SETTINGS.variant {
|
||||
Variant::Advanced => format!(".well-known/openpgpkey/{}/hu/{}", domain, local_encoded),
|
||||
Variant::Direct => format!(".well-known/openpgpkey/hu/{}", local_encoded),
|
||||
};
|
||||
|
||||
Ok(PathBuf::from(ROOT_FOLDER).join(directory))
|
||||
}
|
||||
|
||||
pub fn insert_key(cert: &Cert) -> Result<()> {
|
||||
let validcert = validate_cert!(cert)?;
|
||||
let path = email_to_file_path(&get_email_from_cert(cert)?)?;
|
||||
|
||||
fs::create_dir_all(path.parent().unwrap())?;
|
||||
let mut file = fs::File::create(&path)?;
|
||||
validcert.export(&mut file)?;
|
||||
|
||||
fs::OpenOptions::new()
|
||||
.write(true)
|
||||
.create(true)
|
||||
.open(path.parent().unwrap().parent().unwrap().join("policy"))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn pending_path() -> PathBuf {
|
||||
Path::new(&ROOT_FOLDER).join("pending")
|
||||
}
|
||||
|
@ -92,13 +136,8 @@ pub fn extract_domain(email: &str) -> Result<String> {
|
|||
Ok(domain)
|
||||
}
|
||||
|
||||
pub fn get_user_file_path(email: &str) -> Result<PathBuf> {
|
||||
let wkd_url = log_err!(Url::from(email), debug)?;
|
||||
wkd_url.to_file_path(SETTINGS.variant)
|
||||
}
|
||||
|
||||
pub fn key_exists(email: &str) -> Result<bool> {
|
||||
let path = get_user_file_path(email)?;
|
||||
let path = email_to_file_path(email)?;
|
||||
if !Path::new(&ROOT_FOLDER).join(path).is_file() {
|
||||
debug!("No key found for user {}", email);
|
||||
Err(SpecialErrors::InexistingUser)?
|
||||
|
|
Loading…
Reference in a new issue