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:
Charles Hall 2024-05-22 17:42:05 -07:00
parent d5da913c79
commit 8f0fdfb2f2
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
26 changed files with 993 additions and 762 deletions

View file

@ -93,7 +93,7 @@ pub(crate) async fn register_route(
&& body.appservice_info.is_none()
{
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"Registration has been disabled.",
));
}

View file

@ -53,7 +53,7 @@ pub(crate) async fn get_context_route(
&body.event_id,
)? {
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"You don't have permission to view this event.",
));
}

View file

@ -450,7 +450,7 @@ pub(crate) async fn get_member_events_route(
.user_can_see_state_events(sender_user, &body.room_id)?
{
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"You don't have permission to view this room.",
));
}
@ -485,7 +485,7 @@ pub(crate) async fn joined_members_route(
.user_can_see_state_events(sender_user, &body.room_id)?
{
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"You don't have permission to view this room.",
));
}
@ -1399,7 +1399,7 @@ pub(crate) async fn invite_helper(
if !services().rooms.state_cache.is_joined(sender_user, room_id)? {
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"You don't have permission to view this room.",
));
}

View file

@ -48,7 +48,7 @@ pub(crate) async fn send_message_event_route(
&& !services().globals.allow_encryption()
{
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"Encryption has been disabled",
));
}

View file

@ -49,6 +49,8 @@ pub(crate) async fn get_relating_events_with_rel_type_and_event_type_route(
chunk: res.chunk,
next_batch: res.next_batch,
prev_batch: res.prev_batch,
// TODO
recursion_depth: None,
}))
}
@ -92,6 +94,8 @@ pub(crate) async fn get_relating_events_with_rel_type_route(
chunk: res.chunk,
next_batch: res.next_batch,
prev_batch: res.prev_batch,
// TODO
recursion_depth: None,
}))
}

View file

@ -78,7 +78,7 @@ pub(crate) async fn create_room_route(
&& !services().users.is_admin(sender_user)?
{
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"Room creation has been disabled.",
));
}
@ -565,7 +565,7 @@ pub(crate) async fn get_room_event_route(
&body.event_id,
)? {
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"You don't have permission to view this event.",
));
}
@ -591,7 +591,7 @@ pub(crate) async fn get_room_aliases_route(
if !services().rooms.state_cache.is_joined(sender_user, &body.room_id)? {
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"You don't have permission to view this room.",
));
}

View file

@ -53,7 +53,7 @@ pub(crate) async fn search_events_route(
for room_id in room_ids {
if !services().rooms.state_cache.is_joined(sender_user, &room_id)? {
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"You don't have permission to view this room.",
));
}

View file

@ -81,7 +81,7 @@ pub(crate) async fn login_route(
} else {
warn!("Bad login type: {:?}", &body.login_info);
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"Bad login type.",
));
}
@ -101,7 +101,7 @@ pub(crate) async fn login_route(
let hash = services().users.password_hash(&user_id)?.ok_or(
Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"Wrong username or password.",
),
)?;
@ -119,7 +119,7 @@ pub(crate) async fn login_route(
if !hash_matches {
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"Wrong username or password.",
));
}
@ -190,7 +190,7 @@ pub(crate) async fn login_route(
} else {
warn!("Bad login type: {:?}", &body.login_info);
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"Bad login type.",
));
}

View file

@ -63,7 +63,7 @@ pub(crate) async fn send_state_event_for_empty_key_route(
&& !services().globals.allow_encryption()
{
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"Encryption has been disabled",
));
}
@ -101,7 +101,7 @@ pub(crate) async fn get_state_events_route(
.user_can_see_state_events(sender_user, &body.room_id)?
{
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"You don't have permission to view the room state.",
));
}
@ -135,7 +135,7 @@ pub(crate) async fn get_state_events_for_key_route(
.user_can_see_state_events(sender_user, &body.room_id)?
{
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"You don't have permission to view the room state.",
));
}
@ -176,7 +176,7 @@ pub(crate) async fn get_state_events_for_empty_key_route(
.user_can_see_state_events(sender_user, &body.room_id)?
{
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"You don't have permission to view the room state.",
));
}
@ -232,7 +232,7 @@ async fn send_state_event_for_key_helper(
.is_none()
{
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"You are only allowed to send canonical_alias events when \
it's aliases already exists",
));

View file

@ -605,7 +605,9 @@ async fn load_joined_room(
.state_cache
.is_invited(&user_id, room_id)?)
{
Ok::<_, Error>(Some(state_key.clone()))
Ok::<_, Error>(Some(state_key.parse().expect(
"`state_key` should be a valid user ID",
)))
} else {
Ok(None)
}
@ -1686,6 +1688,8 @@ pub(crate) async fn sync_events_v4_route(
// Count events in timeline greater than global sync counter
num_live: None,
timestamp: None,
// TODO
heroes: None,
},
);
}

View file

@ -14,7 +14,7 @@ pub(crate) async fn create_typing_event_route(
if !services().rooms.state_cache.is_joined(sender_user, &body.room_id)? {
return Err(Error::BadRequest(
ErrorKind::Forbidden,
ErrorKind::forbidden(),
"You are not in this room.",
));
}