Bump ruma to e8b0876dda083433a7f9181d47d0aff5a5e05497 (auth check return type change)

This commit is contained in:
Olivia Lee 2025-07-19 15:08:11 -07:00 committed by Charles Hall
parent 644639ad10
commit d8ec961589
5 changed files with 25 additions and 53 deletions

22
Cargo.lock generated
View file

@ -2442,7 +2442,7 @@ dependencies = [
[[package]]
name = "ruma"
version = "0.12.1"
source = "git+https://github.com/ruma/ruma.git?rev=d84760a925d8e5830d668b031fec53ddf9101814#d84760a925d8e5830d668b031fec53ddf9101814"
source = "git+https://github.com/ruma/ruma.git?rev=e8b0876dda083433a7f9181d47d0aff5a5e05497#e8b0876dda083433a7f9181d47d0aff5a5e05497"
dependencies = [
"assign",
"js_int",
@ -2461,7 +2461,7 @@ dependencies = [
[[package]]
name = "ruma-appservice-api"
version = "0.12.1"
source = "git+https://github.com/ruma/ruma.git?rev=d84760a925d8e5830d668b031fec53ddf9101814#d84760a925d8e5830d668b031fec53ddf9101814"
source = "git+https://github.com/ruma/ruma.git?rev=e8b0876dda083433a7f9181d47d0aff5a5e05497#e8b0876dda083433a7f9181d47d0aff5a5e05497"
dependencies = [
"js_int",
"ruma-common",
@ -2473,7 +2473,7 @@ dependencies = [
[[package]]
name = "ruma-client-api"
version = "0.20.1"
source = "git+https://github.com/ruma/ruma.git?rev=d84760a925d8e5830d668b031fec53ddf9101814#d84760a925d8e5830d668b031fec53ddf9101814"
source = "git+https://github.com/ruma/ruma.git?rev=e8b0876dda083433a7f9181d47d0aff5a5e05497#e8b0876dda083433a7f9181d47d0aff5a5e05497"
dependencies = [
"as_variant",
"assign",
@ -2496,7 +2496,7 @@ dependencies = [
[[package]]
name = "ruma-common"
version = "0.15.1"
source = "git+https://github.com/ruma/ruma.git?rev=d84760a925d8e5830d668b031fec53ddf9101814#d84760a925d8e5830d668b031fec53ddf9101814"
source = "git+https://github.com/ruma/ruma.git?rev=e8b0876dda083433a7f9181d47d0aff5a5e05497#e8b0876dda083433a7f9181d47d0aff5a5e05497"
dependencies = [
"as_variant",
"base64",
@ -2527,7 +2527,7 @@ dependencies = [
[[package]]
name = "ruma-events"
version = "0.30.1"
source = "git+https://github.com/ruma/ruma.git?rev=d84760a925d8e5830d668b031fec53ddf9101814#d84760a925d8e5830d668b031fec53ddf9101814"
source = "git+https://github.com/ruma/ruma.git?rev=e8b0876dda083433a7f9181d47d0aff5a5e05497#e8b0876dda083433a7f9181d47d0aff5a5e05497"
dependencies = [
"as_variant",
"indexmap 2.10.0",
@ -2550,7 +2550,7 @@ dependencies = [
[[package]]
name = "ruma-federation-api"
version = "0.11.0"
source = "git+https://github.com/ruma/ruma.git?rev=d84760a925d8e5830d668b031fec53ddf9101814#d84760a925d8e5830d668b031fec53ddf9101814"
source = "git+https://github.com/ruma/ruma.git?rev=e8b0876dda083433a7f9181d47d0aff5a5e05497#e8b0876dda083433a7f9181d47d0aff5a5e05497"
dependencies = [
"bytes",
"headers",
@ -2572,7 +2572,7 @@ dependencies = [
[[package]]
name = "ruma-identifiers-validation"
version = "0.10.1"
source = "git+https://github.com/ruma/ruma.git?rev=d84760a925d8e5830d668b031fec53ddf9101814#d84760a925d8e5830d668b031fec53ddf9101814"
source = "git+https://github.com/ruma/ruma.git?rev=e8b0876dda083433a7f9181d47d0aff5a5e05497#e8b0876dda083433a7f9181d47d0aff5a5e05497"
dependencies = [
"js_int",
"thiserror 2.0.12",
@ -2581,7 +2581,7 @@ dependencies = [
[[package]]
name = "ruma-macros"
version = "0.15.1"
source = "git+https://github.com/ruma/ruma.git?rev=d84760a925d8e5830d668b031fec53ddf9101814#d84760a925d8e5830d668b031fec53ddf9101814"
source = "git+https://github.com/ruma/ruma.git?rev=e8b0876dda083433a7f9181d47d0aff5a5e05497#e8b0876dda083433a7f9181d47d0aff5a5e05497"
dependencies = [
"cfg-if",
"proc-macro-crate",
@ -2596,7 +2596,7 @@ dependencies = [
[[package]]
name = "ruma-push-gateway-api"
version = "0.11.0"
source = "git+https://github.com/ruma/ruma.git?rev=d84760a925d8e5830d668b031fec53ddf9101814#d84760a925d8e5830d668b031fec53ddf9101814"
source = "git+https://github.com/ruma/ruma.git?rev=e8b0876dda083433a7f9181d47d0aff5a5e05497#e8b0876dda083433a7f9181d47d0aff5a5e05497"
dependencies = [
"js_int",
"ruma-common",
@ -2608,7 +2608,7 @@ dependencies = [
[[package]]
name = "ruma-signatures"
version = "0.17.0"
source = "git+https://github.com/ruma/ruma.git?rev=d84760a925d8e5830d668b031fec53ddf9101814#d84760a925d8e5830d668b031fec53ddf9101814"
source = "git+https://github.com/ruma/ruma.git?rev=e8b0876dda083433a7f9181d47d0aff5a5e05497#e8b0876dda083433a7f9181d47d0aff5a5e05497"
dependencies = [
"base64",
"ed25519-dalek",
@ -2624,7 +2624,7 @@ dependencies = [
[[package]]
name = "ruma-state-res"
version = "0.13.0"
source = "git+https://github.com/ruma/ruma.git?rev=d84760a925d8e5830d668b031fec53ddf9101814#d84760a925d8e5830d668b031fec53ddf9101814"
source = "git+https://github.com/ruma/ruma.git?rev=e8b0876dda083433a7f9181d47d0aff5a5e05497#e8b0876dda083433a7f9181d47d0aff5a5e05497"
dependencies = [
"js_int",
"ruma-common",

View file

@ -145,7 +145,7 @@ xdg = "2.5.2"
[dependencies.ruma]
git = "https://github.com/ruma/ruma.git"
rev = "d84760a925d8e5830d668b031fec53ddf9101814"
rev = "e8b0876dda083433a7f9181d47d0aff5a5e05497"
features = [
"compat-server-signing-key-version",
"compat-empty-string-null",

View file

@ -1036,7 +1036,7 @@ async fn join_room_by_id_helper(
}
info!("Running send_join auth check");
let authenticated = state_res::event_auth::auth_check(
state_res::event_auth::auth_check(
&state_res::RoomVersion::new(&room_version_id).map_err(|_| {
Error::UnsupportedRoomVersion(room_version_id.clone())
})?,
@ -1065,13 +1065,6 @@ async fn join_room_by_id_helper(
Error::BadRequest(ErrorKind::InvalidParam, "Auth check failed")
})?;
if !authenticated {
return Err(Error::BadRequest(
ErrorKind::InvalidParam,
"Auth check failed",
));
}
info!("Saving state from send_join");
let (statehash_before_join, new, removed) =
services().rooms.state_compressor.save_state(

View file

@ -501,19 +501,14 @@ impl Service {
));
}
if !state_res::event_auth::auth_check(
state_res::event_auth::auth_check(
&ruma_room_version,
&incoming_pdu,
|k, s| auth_events.get(&(k.to_string().into(), s.to_owned())),
)
.map_err(|_e| {
Error::BadRequest(ErrorKind::InvalidParam, "Auth check failed")
})? {
return Err(Error::BadRequest(
ErrorKind::InvalidParam,
"Auth check failed",
));
}
})?;
debug!("Validation successful");
@ -869,7 +864,7 @@ impl Service {
debug!("Starting auth check");
// 11. Check the auth of the event passes based on the state of the
// event
let check_result = state_res::event_auth::auth_check(
state_res::event_auth::auth_check(
&ruma_room_version,
&incoming_pdu,
|k, s| {
@ -895,12 +890,6 @@ impl Service {
.map_err(|_e| {
Error::BadRequest(ErrorKind::InvalidParam, "Auth check failed.")
})?;
if !check_result {
return Err(Error::bad_database(
"Event has failed auth check with state at the event.",
));
}
debug!("Auth check succeeded");
// Soft fail check before doing state res
@ -912,14 +901,12 @@ impl Service {
&incoming_pdu.content,
)?;
let auth_fail_against_current = !state_res::event_auth::auth_check(
let auth_fail_against_current = state_res::event_auth::auth_check(
&ruma_room_version,
&incoming_pdu,
|k, s| auth_events.get(&(k.clone(), s.to_owned())),
)
.map_err(|_e| {
Error::BadRequest(ErrorKind::InvalidParam, "Auth check failed.")
})?;
.is_err();
let cannot_redact = incoming_pdu.kind
== TimelineEventType::RoomRedaction

View file

@ -844,21 +844,13 @@ impl Service {
signatures: None,
};
let auth_check =
state_res::auth_check(&ruma_room_version, &pdu, |k, s| {
auth_events.get(&(k.clone(), s.to_owned()))
})
.map_err(|error| {
error!(%error, "Auth check failed");
Error::BadDatabase("Auth check failed.")
})?;
if !auth_check {
return Err(Error::BadRequest(
ErrorKind::forbidden(),
"Event is not authorized.",
));
}
state_res::auth_check(&ruma_room_version, &pdu, |k, s| {
auth_events.get(&(k.clone(), s.to_owned()))
})
.map_err(|error| {
error!(%error, "Auth check failed");
Error::BadRequest(ErrorKind::InvalidParam, "Auth check failed.")
})?;
// Hash and sign
let mut pdu_json = utils::to_canonical_object(&pdu)