diff --git a/crates/matrix-sdk/CHANGELOG.md b/crates/matrix-sdk/CHANGELOG.md index 1e2519ced..eaf73d2a3 100644 --- a/crates/matrix-sdk/CHANGELOG.md +++ b/crates/matrix-sdk/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file. ### Features +- The scopes sent when logging in with the `OAuth` API now use the stable prefix defined in the + specification. - [**breaking**]: The unread count computation has now moved from the sliding sync processing, to the event cache. As a result, it is necessary to enable the event cache if you want to keep a precise unread counts, using `Client::event_cache().subscribe()`. The unread counts will now also diff --git a/crates/matrix-sdk/src/authentication/oauth/mod.rs b/crates/matrix-sdk/src/authentication/oauth/mod.rs index cecac8914..dce161262 100644 --- a/crates/matrix-sdk/src/authentication/oauth/mod.rs +++ b/crates/matrix-sdk/src/authentication/oauth/mod.rs @@ -759,10 +759,9 @@ impl OAuth { additional_scopes: Option>, ) -> (Vec, OwnedDeviceId) { /// Scope to grand full access to the client-server API. - const SCOPE_MATRIX_CLIENT_SERVER_API_FULL_ACCESS: &str = - "urn:matrix:org.matrix.msc2967.client:api:*"; + const SCOPE_MATRIX_CLIENT_SERVER_API_FULL_ACCESS: &str = "urn:matrix:client:api:*"; /// Prefix of the scope to bind a device ID to an access token. - const SCOPE_MATRIX_DEVICE_ID_PREFIX: &str = "urn:matrix:org.matrix.msc2967.client:device:"; + const SCOPE_MATRIX_DEVICE_ID_PREFIX: &str = "urn:matrix:client:device:"; // Generate the device ID if it is not provided. let device_id = device_id.unwrap_or_else(DeviceId::new); diff --git a/crates/matrix-sdk/src/authentication/oauth/tests.rs b/crates/matrix-sdk/src/authentication/oauth/tests.rs index 574117b72..9f700908f 100644 --- a/crates/matrix-sdk/src/authentication/oauth/tests.rs +++ b/crates/matrix-sdk/src/authentication/oauth/tests.rs @@ -92,25 +92,21 @@ async fn check_authorization_url( assert!(actual_scopes.len() >= 2, "Expected at least two scopes"); assert!( - actual_scopes - .contains(&"urn:matrix:org.matrix.msc2967.client:api:*".to_owned()), + actual_scopes.contains(&"urn:matrix:client:api:*".to_owned()), "Expected Matrix API scope not found in scopes" ); // Only check the device ID if we know it. If it's generated randomly we don't // know it. if let Some(device_id) = device_id { - let device_id_scope = - format!("urn:matrix:org.matrix.msc2967.client:device:{device_id}"); + let device_id_scope = format!("urn:matrix:client:device:{device_id}"); assert!( actual_scopes.contains(&device_id_scope), "Expected device ID scope not found in scopes" ) } else { assert!( - actual_scopes - .iter() - .any(|s| s.starts_with("urn:matrix:org.matrix.msc2967.client:device:")), + actual_scopes.iter().any(|s| s.starts_with("urn:matrix:client:device:")), "Expected device ID scope not found in scopes" ); }