mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +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
|
|
@ -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.",
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
));
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.",
|
||||
));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue