mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 08:11:24 +01:00
upgrade all cargo dependencies
Unfortunately we need to pull tracing-opentelemetry from git because there hasn't been a release including the dependency bump on the other opentelemetry crates.
This commit is contained in:
parent
d5da913c79
commit
8f0fdfb2f2
26 changed files with 993 additions and 762 deletions
|
|
@ -17,11 +17,11 @@ use std::{
|
|||
use base64::{engine::general_purpose, Engine as _};
|
||||
pub(crate) use data::Data;
|
||||
use futures_util::FutureExt;
|
||||
use hyper::{
|
||||
client::connect::dns::{GaiResolver, Name},
|
||||
service::Service as HyperService,
|
||||
use hyper::service::Service as _;
|
||||
use hyper_util::{
|
||||
client::legacy::connect::dns::GaiResolver, service::TowerToHyperService,
|
||||
};
|
||||
use reqwest::dns::{Addrs, Resolve, Resolving};
|
||||
use reqwest::dns::{Addrs, Name, Resolve, Resolving};
|
||||
use ruma::{
|
||||
api::federation::discovery::{ServerSigningKeys, VerifyKey},
|
||||
serde::Base64,
|
||||
|
|
@ -147,9 +147,13 @@ impl Resolve for Resolver {
|
|||
})
|
||||
})
|
||||
.unwrap_or_else(|| {
|
||||
let this = &mut self.inner.clone();
|
||||
// This should never fail because reqwest's type is a wrapper
|
||||
// around hyper-utils' type
|
||||
let name = name.as_str().parse().expect("name should be valid");
|
||||
|
||||
Box::pin(
|
||||
HyperService::<Name>::call(this, name)
|
||||
TowerToHyperService::new(self.inner.clone())
|
||||
.call(name)
|
||||
.map(|result| {
|
||||
result
|
||||
.map(|addrs| -> Addrs { Box::new(addrs) })
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ impl Service {
|
|||
let mut thumbnail_bytes = Vec::new();
|
||||
thumbnail.write_to(
|
||||
&mut Cursor::new(&mut thumbnail_bytes),
|
||||
image::ImageOutputFormat::Png,
|
||||
image::ImageFormat::Png,
|
||||
)?;
|
||||
|
||||
// Save thumbnail in database so we don't have to generate it
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ impl Service {
|
|||
Ok(Some(pdu)) => {
|
||||
if pdu.room_id != room_id {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Forbidden,
|
||||
ErrorKind::forbidden(),
|
||||
"Evil event in db",
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ impl Service {
|
|||
|
||||
if services().rooms.metadata.is_disabled(room_id)? {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Forbidden,
|
||||
ErrorKind::forbidden(),
|
||||
"Federation of this room is currently disabled on this server.",
|
||||
));
|
||||
}
|
||||
|
|
@ -170,7 +170,7 @@ impl Service {
|
|||
// Check for disabled again because it might have changed
|
||||
if services().rooms.metadata.is_disabled(room_id)? {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Forbidden,
|
||||
ErrorKind::forbidden(),
|
||||
"Federation of this room is currently disabled on this \
|
||||
server.",
|
||||
));
|
||||
|
|
@ -1836,7 +1836,7 @@ impl Service {
|
|||
server_name, room_id
|
||||
);
|
||||
Err(Error::BadRequest(
|
||||
ErrorKind::Forbidden,
|
||||
ErrorKind::forbidden(),
|
||||
"Server was denied by room ACL",
|
||||
))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,6 +121,8 @@ impl Service {
|
|||
chunk: events_after,
|
||||
next_batch: next_token.map(|t| t.stringify()),
|
||||
prev_batch: Some(from.stringify()),
|
||||
// TODO
|
||||
recursion_depth: None,
|
||||
})
|
||||
}
|
||||
ruma::api::Direction::Backward => {
|
||||
|
|
@ -174,6 +176,8 @@ impl Service {
|
|||
chunk: events_before,
|
||||
next_batch: next_token.map(|t| t.stringify()),
|
||||
prev_batch: Some(from.stringify()),
|
||||
// TODO
|
||||
recursion_depth: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -463,7 +463,7 @@ impl Service {
|
|||
debug!("User is not allowed to see room {room_id}");
|
||||
// This error will be caught later
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Forbidden,
|
||||
ErrorKind::forbidden(),
|
||||
"User is not allowed to see the room",
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -794,7 +794,7 @@ impl Service {
|
|||
|
||||
if !auth_check {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Forbidden,
|
||||
ErrorKind::forbidden(),
|
||||
"Event is not authorized.",
|
||||
));
|
||||
}
|
||||
|
|
@ -878,7 +878,7 @@ impl Service {
|
|||
TimelineEventType::RoomEncryption => {
|
||||
warn!("Encryption is not allowed in the admins room");
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Forbidden,
|
||||
ErrorKind::forbidden(),
|
||||
"Encryption is not allowed in the admins room.",
|
||||
));
|
||||
}
|
||||
|
|
@ -916,7 +916,7 @@ impl Service {
|
|||
room"
|
||||
);
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Forbidden,
|
||||
ErrorKind::forbidden(),
|
||||
"Grapevine user cannot leave from admins \
|
||||
room.",
|
||||
));
|
||||
|
|
@ -935,7 +935,7 @@ impl Service {
|
|||
"Last admin cannot leave from admins room"
|
||||
);
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Forbidden,
|
||||
ErrorKind::forbidden(),
|
||||
"Last admin cannot leave from admins room.",
|
||||
));
|
||||
}
|
||||
|
|
@ -950,7 +950,7 @@ impl Service {
|
|||
admins room"
|
||||
);
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Forbidden,
|
||||
ErrorKind::forbidden(),
|
||||
"Grapevine user cannot be banned in \
|
||||
admins room.",
|
||||
));
|
||||
|
|
@ -970,7 +970,7 @@ impl Service {
|
|||
room"
|
||||
);
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Forbidden,
|
||||
ErrorKind::forbidden(),
|
||||
"Last admin cannot be banned in admins \
|
||||
room.",
|
||||
));
|
||||
|
|
@ -1004,7 +1004,7 @@ impl Service {
|
|||
false,
|
||||
)? {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Forbidden,
|
||||
ErrorKind::forbidden(),
|
||||
"User cannot redact this event.",
|
||||
));
|
||||
}
|
||||
|
|
@ -1026,7 +1026,7 @@ impl Service {
|
|||
false,
|
||||
)? {
|
||||
return Err(Error::BadRequest(
|
||||
ErrorKind::Forbidden,
|
||||
ErrorKind::forbidden(),
|
||||
"User cannot redact this event.",
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ impl Service {
|
|||
if !hash_matches {
|
||||
uiaainfo.auth_error =
|
||||
Some(ruma::api::client::error::StandardErrorBody {
|
||||
kind: ErrorKind::Forbidden,
|
||||
kind: ErrorKind::forbidden(),
|
||||
message: "Invalid username or password."
|
||||
.to_owned(),
|
||||
});
|
||||
|
|
@ -113,7 +113,7 @@ impl Service {
|
|||
} else {
|
||||
uiaainfo.auth_error =
|
||||
Some(ruma::api::client::error::StandardErrorBody {
|
||||
kind: ErrorKind::Forbidden,
|
||||
kind: ErrorKind::forbidden(),
|
||||
message: "Invalid registration token.".to_owned(),
|
||||
});
|
||||
return Ok((false, uiaainfo));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue