client-api: Stabilize authenticated media endpoints

According to Matrix 1.11
This commit is contained in:
Kévin Commaille 2024-06-21 15:21:32 +02:00 committed by Kévin Commaille
parent 644883eaf5
commit 44b474a6f1
10 changed files with 26 additions and 24 deletions

View File

@ -14,7 +14,8 @@ Improvements:
- Heroes in `sync::sync_events::v4`: `SyncRequestList` and `RoomSubscription`
both have a new `include_heroes` field. `SlidingSyncRoom` has a new `heroes`
field, with a new type `SlidingSyncRoomHero`.
- Add unstable support for authenticated media endpoints, according to MSC3916.
- Add support for authenticated media endpoints, according to MSC3916 / Matrix
1.11.
Bug fixes:

View File

@ -48,7 +48,6 @@ unstable-msc3488 = []
unstable-msc3575 = []
unstable-msc3814 = []
unstable-msc3843 = []
unstable-msc3916 = []
unstable-msc3983 = []
unstable-msc4108 = []
unstable-msc4121 = []

View File

@ -1,6 +1,6 @@
//! Authenticated endpoints for the media repository, according to [MSC3916].
//! Authenticated endpoints for the [content repository].
//!
//! [MSC3916]: https://github.com/matrix-org/matrix-spec-proposals/pull/3916
//! [content repository]: https://spec.matrix.org/latest/client-server-api/#content-repository
pub mod get_content;
pub mod get_content_as_filename;

View File

@ -2,10 +2,10 @@
//!
//! Retrieve content from the media store.
pub mod unstable {
//! `/unstable/org.matrix.msc3916/` ([MSC])
pub mod v1 {
//! `/v1/` ([spec])
//!
//! [MSC]: https://github.com/matrix-org/matrix-spec-proposals/pull/3916
//! [spec]: https://spec.matrix.org/latest/client-server-api/#get_matrixclientv1mediadownloadservernamemediaid
use std::time::Duration;
@ -17,10 +17,11 @@ pub mod unstable {
const METADATA: Metadata = metadata! {
method: GET,
rate_limited: false,
rate_limited: true,
authentication: AccessToken,
history: {
unstable => "/_matrix/client/unstable/org.matrix.msc3916/media/download/:server_name/:media_id",
1.11 => "/_matrix/client/v1/media/download/:server_name/:media_id",
}
};

View File

@ -2,10 +2,10 @@
//!
//! Retrieve content from the media store, specifying a filename to return.
pub mod unstable {
//! `/unstable/org.matrix.msc3916/` ([MSC])
pub mod v1 {
//! `/v1/` ([spec])
//!
//! [MSC]: https://github.com/matrix-org/matrix-spec-proposals/pull/3916
//! [spec]: https://spec.matrix.org/latest/client-server-api/#get_matrixclientv1mediadownloadservernamemediaidfilename
use std::time::Duration;
@ -17,10 +17,11 @@ pub mod unstable {
const METADATA: Metadata = metadata! {
method: GET,
rate_limited: false,
rate_limited: true,
authentication: AccessToken,
history: {
unstable => "/_matrix/client/unstable/org.matrix.msc3916/media/download/:server_name/:media_id/:filename",
1.11 => "/_matrix/client/v1/media/download/:server_name/:media_id/:filename",
}
};

View File

@ -2,10 +2,10 @@
//!
//! Get a thumbnail of content from the media store.
pub mod unstable {
//! `/unstable/org.matrix.msc3916/` ([MSC])
pub mod v1 {
//! `/v1/` ([spec])
//!
//! [MSC]: https://github.com/matrix-org/matrix-spec-proposals/pull/3916
//! [spec]: https://spec.matrix.org/latest/client-server-api/#get_matrixclientv1mediathumbnailservernamemediaid
use std::time::Duration;
@ -24,6 +24,7 @@ pub mod unstable {
authentication: AccessToken,
history: {
unstable => "/_matrix/client/unstable/org.matrix.msc3916/media/thumbnail/:server_name/:media_id",
1.11 => "/_matrix/client/v1/media/thumbnail/:server_name/:media_id",
}
};

View File

@ -2,10 +2,10 @@
//!
//! Gets the config for the media repository.
pub mod unstable {
//! `/unstable/org.matrix.msc3916/` ([MSC])
pub mod v1 {
//! `/v1/` ([spec])
//!
//! [MSC]: https://github.com/matrix-org/matrix-spec-proposals/pull/3916
//! [spec]: https://spec.matrix.org/latest/client-server-api/#get_matrixclientv1mediaconfig
use js_int::UInt;
use ruma_common::{
@ -19,6 +19,7 @@ pub mod unstable {
authentication: AccessToken,
history: {
unstable => "/_matrix/client/unstable/org.matrix.msc3916/media/config",
1.11 => "/_matrix/client/v1/media/config",
}
};

View File

@ -2,10 +2,10 @@
//!
//! Get a preview for a URL.
pub mod unstable {
//! `/unstable/org.matrix.msc3916/` ([MSC])
pub mod v1 {
//! `/v1/` ([spec])
//!
//! [MSC]: https://github.com/matrix-org/matrix-spec-proposals/pull/3916
//! [spec]: https://spec.matrix.org/latest/client-server-api/#get_matrixclientv1mediapreview_url
use ruma_common::{
api::{request, response, Metadata},
@ -20,6 +20,7 @@ pub mod unstable {
authentication: AccessToken,
history: {
unstable => "/_matrix/client/unstable/org.matrix.msc3916/media/preview_url",
1.11 => "/_matrix/client/v1/media/preview_url",
}
};

View File

@ -12,7 +12,6 @@
pub mod account;
pub mod alias;
pub mod appservice;
#[cfg(feature = "unstable-msc3916")]
pub mod authenticated_media;
pub mod backup;
pub mod config;

View File

@ -217,7 +217,6 @@ unstable-msc3618 = ["ruma-federation-api?/unstable-msc3618"]
unstable-msc3723 = ["ruma-federation-api?/unstable-msc3723"]
unstable-msc3814 = ["ruma-client-api?/unstable-msc3814"]
unstable-msc3843 = ["ruma-client-api?/unstable-msc3843", "ruma-federation-api?/unstable-msc3843"]
unstable-msc3916 = ["ruma-client-api?/unstable-msc3916"]
unstable-msc3927 = ["ruma-events?/unstable-msc3927"]
unstable-msc3930 = ["ruma-common/unstable-msc3930"]
unstable-msc3931 = ["ruma-common/unstable-msc3931"]
@ -273,7 +272,6 @@ __ci = [
"unstable-msc3723",
"unstable-msc3814",
"unstable-msc3843",
"unstable-msc3916",
"unstable-msc3927",
"unstable-msc3930",
"unstable-msc3931",