From 5a7dac446ed94ceb8ca148be9b3c0c6357907346 Mon Sep 17 00:00:00 2001 From: Nym Seddon Date: Mon, 8 Feb 2021 04:02:44 +0000 Subject: [PATCH] api: Add identity service status endpoint --- ruma-identity-service-api/src/lib.rs | 1 + ruma-identity-service-api/src/status.rs | 3 ++ ruma-identity-service-api/src/status/v2.rs | 34 ++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 ruma-identity-service-api/src/status.rs create mode 100644 ruma-identity-service-api/src/status/v2.rs diff --git a/ruma-identity-service-api/src/lib.rs b/ruma-identity-service-api/src/lib.rs index bf3f9427..1030cb55 100644 --- a/ruma-identity-service-api/src/lib.rs +++ b/ruma-identity-service-api/src/lib.rs @@ -1 +1,2 @@ pub mod authentication; +pub mod status; diff --git a/ruma-identity-service-api/src/status.rs b/ruma-identity-service-api/src/status.rs new file mode 100644 index 00000000..d5238e30 --- /dev/null +++ b/ruma-identity-service-api/src/status.rs @@ -0,0 +1,3 @@ +//! Endpoint to check the status of an identity server. + +pub mod v2; diff --git a/ruma-identity-service-api/src/status/v2.rs b/ruma-identity-service-api/src/status/v2.rs new file mode 100644 index 00000000..e93167a7 --- /dev/null +++ b/ruma-identity-service-api/src/status/v2.rs @@ -0,0 +1,34 @@ +//! [GET /_matrix/identity/v2](https://matrix.org/docs/spec/identity_service/r0.3.0#get-matrix-identity-v2) + +use ruma_api::ruma_api; + +ruma_api! { + metadata: { + description: "Checks that an identity server is available at this API endpoint.", + method: GET, + name: "status", + path: "/_matrix/identity/v2", + authentication: None, + rate_limited: false, + } + + #[derive(Default)] + request: {} + + #[derive(Default)] + response: {} +} + +impl Request { + /// Creates an empty `Request`. + pub fn new() -> Self { + Self {} + } +} + +impl Response { + /// Creates an empty `Response`. + pub fn new() -> Self { + Self {} + } +}