Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies #86

Merged
merged 1 commit into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,50 @@ license = "AGPL-3.0"
repository = "https://github.com/LemmyNet/activitypub-federation-rust"
documentation = "https://docs.rs/activitypub_federation/"

[features]
default = ["actix-web", "axum"]
actix-web = ["dep:actix-web"]
axum = ["dep:axum", "dep:tower", "dep:hyper", "dep:http-body-util"]

[dependencies]
chrono = { version = "0.4.31", features = ["clock"], default-features = false }
serde = { version = "1.0.189", features = ["derive"] }
serde = { version = "1.0.193", features = ["derive"] }
async-trait = "0.1.74"
url = { version = "2.4.1", features = ["serde"] }
serde_json = { version = "1.0.107", features = ["preserve_order"] }
url = { version = "2.5.0", features = ["serde"] }
serde_json = { version = "1.0.108", features = ["preserve_order"] }
reqwest = { version = "0.11.22", features = ["json", "stream"] }
reqwest-middleware = "0.2.3"
reqwest-middleware = "0.2.4"
tracing = "0.1.40"
base64 = "0.21.5"
openssl = "0.10.57"
openssl = "0.10.60"
once_cell = "1.18.0"
http = "0.2.9"
http = "0.2.11"
sha2 = "0.10.8"
thiserror = "1.0.50"
derive_builder = "0.12.0"
itertools = "0.10.5"
dyn-clone = "1.0.14"
itertools = "0.12.0"
dyn-clone = "1.0.16"
enum_delegate = "0.2.0"
httpdate = "1.0.3"
http-signature-normalization-reqwest = { version = "0.8.0", default-features = false, features = [
http-signature-normalization-reqwest = { version = "0.10.0", default-features = false, features = [
"sha-2",
"middleware",
"default-spawner",
] }
http-signature-normalization = "0.7.0"
bytes = "1.5.0"
futures-core = { version = "0.3.28", default-features = false }
futures-core = { version = "0.3.29", default-features = false }
pin-project-lite = "0.2.13"
activitystreams-kinds = "0.3.0"
regex = { version = "1.10.2", default-features = false, features = ["std", "unicode-case"] }
tokio = { version = "1.33.0", features = [
tokio = { version = "1.34.0", features = [
"sync",
"rt",
"rt-multi-thread",
"time",
] }
futures = "0.3.29"
moka = { version = "0.12.1", features = ["future"] }

# Actix-web
actix-web = { version = "4.4.0", default-features = false, optional = true }
Expand All @@ -55,26 +63,20 @@ axum = { version = "0.6.20", features = [
], default-features = false, optional = true }
tower = { version = "0.4.13", optional = true }
hyper = { version = "0.14", optional = true }
futures = "0.3.28"
moka = { version = "0.11.3", features = ["future"] }

[features]
default = ["actix-web", "axum"]
actix-web = ["dep:actix-web"]
axum = ["dep:axum", "dep:tower", "dep:hyper"]
http-body-util = {version = "0.1.0", optional = true }

[dev-dependencies]
anyhow = "1.0.75"
rand = "0.8.5"
env_logger = "0.10.0"
tower-http = { version = "0.4.4", features = ["map-request-body", "util"] }
env_logger = "0.10.1"
tower-http = { version = "0.5.0", features = ["map-request-body", "util"] }
axum = { version = "0.6.20", features = [
"http1",
"tokio",
"query",
], default-features = false }
axum-macros = "0.3.8"
tokio = { version = "1.33.0", features = ["full"] }
tokio = { version = "1.34.0", features = ["full"] }

[profile.dev]
strip = "symbols"
Expand Down
6 changes: 4 additions & 2 deletions src/activity_sending.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ use crate::{

use bytes::Bytes;
use futures::StreamExt;
use http::{header::HeaderName, HeaderMap, HeaderValue};
use httpdate::fmt_http_date;
use itertools::Itertools;
use openssl::pkey::{PKey, Private};
use reqwest::Request;
use reqwest::{
header::{HeaderMap, HeaderName, HeaderValue},
Request,
};
use reqwest_middleware::ClientWithMiddleware;
use serde::Serialize;
use std::{
Expand Down
8 changes: 6 additions & 2 deletions src/http_signatures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ use crate::{
use base64::{engine::general_purpose::STANDARD as Base64, Engine};
use bytes::Bytes;
use http::{header::HeaderName, uri::PathAndQuery, HeaderValue, Method, Uri};
use http_signature_normalization_reqwest::prelude::{Config, SignExt};
use http_signature_normalization_reqwest::{
prelude::{Config, SignExt},
DefaultSpawner,
};
use once_cell::sync::Lazy;
use openssl::{
hash::MessageDigest,
Expand Down Expand Up @@ -83,7 +86,8 @@ pub(crate) async fn sign_request(
private_key: PKey<Private>,
http_signature_compat: bool,
) -> Result<Request, Error> {
static CONFIG: Lazy<Config> = Lazy::new(|| Config::new().set_expiration(EXPIRES_AFTER));
static CONFIG: Lazy<Config<DefaultSpawner>> =
Lazy::new(|| Config::new().set_expiration(EXPIRES_AFTER));
static CONFIG_COMPAT: Lazy<Config> = Lazy::new(|| {
Config::new()
.mastodon_compat()
Expand Down