This commit is contained in:
rustmailer
2025-11-26 09:21:42 +08:00
parent 22e12b68a8
commit 1bfecc2ff1
4 changed files with 33 additions and 164 deletions
+2 -2
View File
@@ -64,12 +64,12 @@ jobs:
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
cargo install cross --force
cross build --release --features vendored-openssl --target=${{ matrix.target }}
cross build --release --target=${{ matrix.target }}
- name: Build Rust backend
if: matrix.target != 'aarch64-unknown-linux-gnu'
run: |
cargo build --release --features vendored-openssl --target=${{ matrix.target }}
cargo build --release --target=${{ matrix.target }}
- name: Strip binary (Linux and macOS)
if: matrix.os != 'windows-latest' && matrix.target != 'aarch64-unknown-linux-gnu'
Generated
+20 -151
View File
@@ -436,12 +436,13 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "bb8"
version = "0.9.0"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "212d8b8e1a22743d9241575c6ba822cf9c8fef34771c86ab7e477a4fbfd254e5"
checksum = "457d7ed3f888dfd2c7af56d4975cade43c622f74bdcddfed6d4352f57acc6310"
dependencies = [
"futures-util",
"parking_lot",
"portable-atomic",
"tokio",
]
@@ -466,7 +467,7 @@ dependencies = [
"governor",
"hex",
"html2text",
"http 1.3.1",
"http 1.4.0",
"imap-proto",
"itertools 0.14.0",
"itoa",
@@ -480,7 +481,6 @@ dependencies = [
"native_model",
"num_cpus",
"oauth2",
"openssl-sys",
"poem",
"poem-derive",
"poem-openapi",
@@ -919,16 +919,6 @@ dependencies = [
"version_check",
]
[[package]]
name = "core-foundation"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]]
name = "core-foundation-sys"
version = "0.8.7"
@@ -1433,21 +1423,6 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
[[package]]
name = "foreign-types"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
dependencies = [
"foreign-types-shared",
]
[[package]]
name = "foreign-types-shared"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
[[package]]
name = "form_urlencoded"
version = "1.2.2"
@@ -1749,7 +1724,7 @@ dependencies = [
"fnv",
"futures-core",
"futures-sink",
"http 1.3.1",
"http 1.4.0",
"indexmap",
"slab",
"tokio",
@@ -1805,7 +1780,7 @@ dependencies = [
"base64 0.21.7",
"bytes 1.11.0",
"headers-core",
"http 1.3.1",
"http 1.4.0",
"httpdate",
"mime",
"sha1 0.10.6",
@@ -1817,7 +1792,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4"
dependencies = [
"http 1.3.1",
"http 1.4.0",
]
[[package]]
@@ -1991,12 +1966,11 @@ dependencies = [
[[package]]
name = "http"
version = "1.3.1"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565"
checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a"
dependencies = [
"bytes 1.11.0",
"fnv",
"itoa",
]
@@ -2007,7 +1981,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
dependencies = [
"bytes 1.11.0",
"http 1.3.1",
"http 1.4.0",
]
[[package]]
@@ -2018,7 +1992,7 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f"
dependencies = [
"bytes 1.11.0",
"futures-util",
"http 1.3.1",
"http 1.4.0",
"http-body",
"pin-project-lite",
]
@@ -2081,7 +2055,7 @@ dependencies = [
"futures-channel",
"futures-util",
"h2",
"http 1.3.1",
"http 1.4.0",
"http-body",
"httparse",
"httpdate",
@@ -2099,7 +2073,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333"
dependencies = [
"futures-util",
"http 1.3.1",
"http 1.4.0",
"hyper",
"hyper-util",
"rustls",
@@ -2110,22 +2084,6 @@ dependencies = [
"webpki-roots 0.26.10",
]
[[package]]
name = "hyper-tls"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
dependencies = [
"bytes 1.11.0",
"http-body-util",
"hyper",
"hyper-util",
"native-tls",
"tokio",
"tokio-native-tls",
"tower-service",
]
[[package]]
name = "hyper-util"
version = "0.1.16"
@@ -2137,7 +2095,7 @@ dependencies = [
"futures-channel",
"futures-core",
"futures-util",
"http 1.3.1",
"http 1.4.0",
"http-body",
"hyper",
"ipnet",
@@ -2910,7 +2868,7 @@ dependencies = [
"bytes 1.11.0",
"encoding_rs",
"futures-util",
"http 1.3.1",
"http 1.4.0",
"httparse",
"memchr",
"mime",
@@ -2931,23 +2889,6 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2195bf6aa996a481483b29d62a7663eed3fe39600c460e323f8ff41e90bdd89b"
[[package]]
name = "native-tls"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e"
dependencies = [
"libc",
"log",
"openssl",
"openssl-probe",
"openssl-sys",
"schannel",
"security-framework",
"security-framework-sys",
"tempfile",
]
[[package]]
name = "native_db"
version = "0.8.2"
@@ -3097,7 +3038,7 @@ dependencies = [
"base64 0.22.1",
"chrono",
"getrandom 0.2.15",
"http 1.3.1",
"http 1.4.0",
"rand 0.8.5",
"reqwest",
"serde",
@@ -3149,47 +3090,12 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
[[package]]
name = "openssl"
version = "0.10.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8"
dependencies = [
"bitflags",
"cfg-if",
"foreign-types",
"libc",
"once_cell",
"openssl-macros",
"openssl-sys",
]
[[package]]
name = "openssl-macros"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.100",
]
[[package]]
name = "openssl-probe"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-src"
version = "300.5.1+3.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "735230c832b28c000e3bc117119e6466a663ec73506bc0a9907ea4187508e42a"
dependencies = [
"cc",
]
[[package]]
name = "openssl-sys"
version = "0.9.111"
@@ -3198,7 +3104,6 @@ checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321"
dependencies = [
"cc",
"libc",
"openssl-src",
"pkg-config",
"vcpkg",
]
@@ -3374,7 +3279,7 @@ dependencies = [
"futures-util",
"headers",
"hex",
"http 1.3.1",
"http 1.4.0",
"http-body-util",
"hyper",
"hyper-util",
@@ -3453,7 +3358,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df3ddc21868273fd9159ea7e8b4e224c7b368577be53f23536b9dc9f37d285e8"
dependencies = [
"darling 0.20.10",
"http 1.3.1",
"http 1.4.0",
"indexmap",
"mime",
"proc-macro-crate",
@@ -3889,16 +3794,14 @@ dependencies = [
"futures-channel",
"futures-core",
"futures-util",
"http 1.3.1",
"http 1.4.0",
"http-body",
"http-body-util",
"hyper",
"hyper-rustls",
"hyper-tls",
"hyper-util",
"js-sys",
"log",
"native-tls",
"percent-encoding",
"pin-project-lite",
"quinn",
@@ -3909,7 +3812,6 @@ dependencies = [
"serde_urlencoded",
"sync_wrapper",
"tokio",
"tokio-native-tls",
"tokio-rustls",
"tokio-util",
"tower",
@@ -4139,29 +4041,6 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "security-framework"
version = "2.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02"
dependencies = [
"bitflags",
"core-foundation",
"core-foundation-sys",
"libc",
"security-framework-sys",
]
[[package]]
name = "security-framework-sys"
version = "2.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]]
name = "self_cell"
version = "1.0.4"
@@ -5101,16 +4980,6 @@ dependencies = [
"syn 2.0.100",
]
[[package]]
name = "tokio-native-tls"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
dependencies = [
"native-tls",
"tokio",
]
[[package]]
name = "tokio-rustls"
version = "0.26.4"
@@ -5198,7 +5067,7 @@ dependencies = [
"bitflags",
"bytes 1.11.0",
"futures-util",
"http 1.3.1",
"http 1.4.0",
"http-body",
"iri-string",
"pin-project-lite",
+6 -6
View File
@@ -10,7 +10,7 @@ path = "src/main.rs"
[features]
default = []
vendored-openssl = ["openssl-sys"]
#vendored-openssl = ["openssl-sys"]
[profile.release]
strip = true
@@ -47,13 +47,13 @@ snafu = "0.8.9"
reqwest = { version = "0.12.24", default-features = false, features = [
"json",
"stream",
"native-tls",
# "rustls-tls",
#"native-tls",
"rustls-tls",
"blocking",
"socks",
] }
tokio-socks = "0.5.2"
http = "1.3.1"
http = "1.4.0"
regex = "1.12.2"
email_address = "0.2.9"
futures = "0.3.31"
@@ -85,7 +85,7 @@ webpki-roots = "1.0.4"
rustls = { version = "0.23.35", default-features = false, features = ["ring"] }
rustls-pki-types = "1.13.0"
tokio-io-timeout = "1.2.1"
bb8 = "0.9.0"
bb8 = "0.9.1"
semver = "1.0.27"
governor = "0.10.2"
lru = "0.16.2"
@@ -102,7 +102,7 @@ autoconfig = "0.4.0"
urlencoding = "2.1.3"
dashmap = "6.1.0"
# Statically links OpenSSL by compiling from source, avoiding system library dependencies
openssl-sys = { version = "0.9.111", optional = true, features = ["vendored"] }
#openssl-sys = { version = "0.9.111", optional = true, features = ["vendored"] }
gethostname = "1.1.0"
tantivy = { version = "0.25.0", features = ["quickwit", "zstd-compression"] }
itoa = "1.0.15"
+5 -5
View File
@@ -195,19 +195,19 @@ impl OAuth2Api {
/// Configures an external OAuth2 token for a specified account.
///
/// This endpoint allows two usage modes:
/// 1. If only an `access_token` is provided, RustMailer will store it directly.
/// - In this mode, RustMailer **cannot refresh** the token, since it has no
/// 1. If only an `access_token` is provided, Bichon will store it directly.
/// - In this mode, Bichon **cannot refresh** the token, since it has no
/// associated OAuth2 configuration or refresh token.
/// - The caller is responsible for periodically updating the access token
/// by calling this endpoint again.
/// 2. If both `oauth2_id` and `refresh_token` are provided, it means the external
/// OAuth2 authorization flow has been completed outside RustMailer.
/// OAuth2 authorization flow has been completed outside Bichon.
/// - Since the OAuth2 configuration (including client_id and client_secret)
/// is already stored in RustMailer, the service can use the refresh token
/// is already stored in Bichon, the service can use the refresh token
/// to obtain new access tokens automatically.
///
/// Note: The `oauth2_id` must reference a valid OAuth2 configuration
/// already created in RustMailer.
/// already created in Bichon.
#[oai(
path = "/store-external-oauth2-token/:account_id",
method = "post",