Skip to content

Commit add262c

Browse files
committed
Upgrade Ruma
Use brand new release
1 parent 0fc1543 commit add262c

File tree

24 files changed

+103
-136
lines changed

24 files changed

+103
-136
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ jobs:
4949
- name: Install MSRV toolchain
5050
uses: dtolnay/rust-toolchain@master
5151
with:
52-
toolchain: "1.82"
52+
toolchain: "1.88"
5353

5454
- uses: Swatinem/rust-cache@v2
5555
with:
5656
# A stable compiler update should automatically not reuse old caches.
5757
# Add the MSRV as a stable cache key too so bumping it also gets us a
5858
# fresh cache.
59-
shared-key: msrv1.82
59+
shared-key: msrv1.88
6060

6161
- name: Run checks
6262
run: cargo check --all-features

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# [unreleased]
22

3+
Breaking changes:
4+
5+
- Upgrade Ruma to 0.14.0
6+
- All endpoints use `SinglePath` rather than `VersionHistory` as `PathBuilder`.
7+
- Bump MSRV to 1.88.
8+
39
# 0.8.0
410

511
Breaking changes:

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ keywords = ["matrix", "chat", "messaging", "ruma"]
88
license = "MIT"
99
repository = "https://github.com/ruma/synapse-admin-api"
1010
edition = "2021"
11-
rust-version = "1.82"
11+
rust-version = "1.88"
1212

1313
[features]
1414
client = []
@@ -19,7 +19,7 @@ shared-secret-registration-mac = ["dep:hex", "dep:hmac", "dep:sha1"]
1919
[dependencies]
2020
hex = { version = "0.4.3", optional = true }
2121
hmac = { version = "0.12.1", optional = true }
22-
ruma = { version = "0.13.0", features = ["api", "events"] }
22+
ruma = { version = "0.14.0", features = ["api", "events"] }
2323
serde = { version = "1.0.118", features = ["derive"] }
2424
sha1 = { version = "0.10.1", optional = true }
2525

src/account_validity/renew_account/v1.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
//! [GET /_synapse/admin/v1/account_validity/validity](https://github.com/element-hq/synapse/blob/master/docs/admin_api/account_validity.md)
22
33
use ruma::{
4-
api::{metadata, request, response, Metadata},
4+
api::{auth_scheme::AccessToken, metadata, request, response},
55
MilliSecondsSinceUnixEpoch, OwnedUserId,
66
};
77

8-
const METADATA: Metadata = metadata! {
8+
metadata! {
99
method: POST,
1010
rate_limited: false,
1111
authentication: AccessToken,
12-
history: {
13-
unstable => "/_synapse/admin/v1/account_validity/validity",
14-
}
15-
};
12+
path: "/_synapse/admin/v1/account_validity/validity",
13+
}
1614

1715
#[request]
1816
pub struct Request {

src/background_updates/enabled/v1.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
//! [POST /_synapse/admin/v1/background_updates/enabled](https://github.com/element-hq/synapse/blob/develop/docs/usage/administration/admin_api/background_updates.md#enabled)
22
33
use ruma::{
4-
api::{request, response, Metadata},
4+
api::{auth_scheme::AccessToken, request, response},
55
metadata,
66
};
77
use serde::{Deserialize, Serialize};
88

9-
const METADATA: Metadata = metadata! {
9+
metadata! {
1010
method: POST,
1111
rate_limited: false,
1212
authentication: AccessToken,
13-
history: {
14-
unstable => "/_synapse/admin/v1/background_updates/enabled",
15-
}
16-
};
13+
path: "/_synapse/admin/v1/background_updates/enabled",
14+
}
1715

1816
#[request]
1917
pub struct Request {

src/background_updates/run/v1.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
//! [POST /_synapse/admin/v1/background_updates/start_job](https://github.com/element-hq/synapse/blob/master/docs/usage/administration/admin_api/background_updates.md#run)
22
33
use ruma::{
4-
api::{request, response, Metadata},
4+
api::{auth_scheme::AccessToken, request, response},
55
metadata,
6-
serde::{PartialEqAsRefStr, StringEnum},
6+
serde::StringEnum,
77
};
88

9-
const METADATA: Metadata = metadata! {
9+
metadata! {
1010
method: POST,
1111
rate_limited: false,
1212
authentication: AccessToken,
13-
history: {
14-
unstable => "/_synapse/admin/v1/background_updates/start_job",
15-
}
16-
};
13+
path: "/_synapse/admin/v1/background_updates/start_job",
14+
}
1715

1816
#[request]
1917
pub struct Request {
@@ -39,7 +37,7 @@ impl Response {
3937
}
4038
}
4139

42-
#[derive(Clone, PartialEqAsRefStr, Eq, StringEnum)]
40+
#[derive(Clone, StringEnum)]
4341
#[ruma_enum(rename_all = "snake_case")]
4442
#[non_exhaustive]
4543
pub enum JobName {

src/background_updates/status/v1.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22
33
use std::collections::HashMap;
44

5-
use ruma::api::{metadata, request, response, Metadata};
5+
use ruma::api::{auth_scheme::AccessToken, metadata, request, response};
66
use serde::{Deserialize, Serialize};
77

8-
const METADATA: Metadata = metadata! {
8+
metadata! {
99
method: GET,
1010
rate_limited: false,
1111
authentication: AccessToken,
12-
history: {
13-
unstable => "/_synapse/admin/v1/background_updates/status",
14-
}
15-
};
12+
path: "/_synapse/admin/v1/background_updates/status",
13+
}
1614

1715
#[request]
1816
#[derive(Default)]

src/experimental_features/enable_features/v1.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
//! [PUT /_synapse/admin/v1/experimental_features/:user_id](https://github.com/element-hq/synapse/blob/master/docs/admin_api/experimental_features.md#enablingdisabling-features)
22
33
use ruma::{
4-
api::{request, response, Metadata},
4+
api::{auth_scheme::AccessToken, request, response},
55
metadata, OwnedUserId,
66
};
77
use serde::{Deserialize, Serialize};
88

9-
const METADATA: Metadata = metadata! {
9+
metadata! {
1010
method: PUT,
1111
rate_limited: false,
1212
authentication: AccessToken,
13-
history: {
14-
unstable => "/_synapse/admin/v1/experimental_features/{user_id}",
15-
}
16-
};
13+
path: "/_synapse/admin/v1/experimental_features/{user_id}",
14+
}
1715

1816
#[request]
1917
#[derive(Serialize, Deserialize, PartialEq)]

src/experimental_features/list_features/v1.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
//! [GET /_synapse/admin/v1/experimental_features/:user_id](https://github.com/element-hq/synapse/blob/develop/docs/admin_api/experimental_features.md#listing-enabled-features)
22
33
use ruma::{
4-
api::{request, response, Metadata},
4+
api::{auth_scheme::AccessToken, request, response},
55
metadata, OwnedUserId,
66
};
77
use serde::{Deserialize, Serialize};
88

99
use crate::experimental_features::enable_features::v1::ExperimentalFeatures;
1010

11-
const METADATA: Metadata = metadata! {
11+
metadata! {
1212
method: GET,
1313
rate_limited: false,
1414
authentication: AccessToken,
15-
history: {
16-
unstable => "/_synapse/admin/v1/experimental_features/{user_id}",
17-
}
18-
};
15+
path: "/_synapse/admin/v1/experimental_features/{user_id}",
16+
}
1917

2018
#[request]
2119
#[derive(Serialize, Deserialize, PartialEq)]

src/register_users/shared_secret_register/v1.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#[cfg(feature = "shared-secret-registration-mac")]
44
use hmac::{digest::InvalidLength, Hmac, Mac};
55
use ruma::{
6-
api::{metadata, request, response, Metadata},
6+
api::{auth_scheme::NoAuthentication, metadata, request, response},
77
OwnedDeviceId, OwnedServerName, OwnedUserId,
88
};
99
#[cfg(feature = "shared-secret-registration-mac")]
@@ -12,14 +12,12 @@ use sha1::Sha1;
1212
#[cfg(feature = "shared-secret-registration-mac")]
1313
type HmacSha1 = Hmac<Sha1>;
1414

15-
const METADATA: Metadata = metadata! {
15+
metadata! {
1616
method: POST,
1717
rate_limited: false,
18-
authentication: None,
19-
history: {
20-
unstable => "/_synapse/admin/v1/register",
21-
}
22-
};
18+
authentication: NoAuthentication,
19+
path: "/_synapse/admin/v1/register",
20+
}
2321

2422
#[request]
2523
#[derive(Default)]

0 commit comments

Comments
 (0)