From d55573a555064703872f9972be1e8e45ade7111d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Sun, 2 Oct 2022 13:12:10 +0200 Subject: [PATCH] api: Remove AuthScheme::QueryOnlyAccessToken It is no longer used by the Appservice API. --- crates/ruma-common/CHANGELOG.md | 1 + crates/ruma-common/src/api.rs | 3 --- crates/ruma-macros/src/api/auth_scheme.rs | 5 ----- crates/ruma-macros/src/api/request/outgoing.rs | 2 +- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/crates/ruma-common/CHANGELOG.md b/crates/ruma-common/CHANGELOG.md index 0f6a57be..44f96d9c 100644 --- a/crates/ruma-common/CHANGELOG.md +++ b/crates/ruma-common/CHANGELOG.md @@ -5,6 +5,7 @@ Breaking changes: * Remove deprecated `EventType` enum * Remove deprecated constructors for `RoomMessageEventContent` * Remove `serde::vec_as_map_of_empty` from the public API +* Remove the `api::AuthScheme::QueryOnlyAccessToken` variant, which is no longer used Improvements: diff --git a/crates/ruma-common/src/api.rs b/crates/ruma-common/src/api.rs index 806c7521..bc7f9084 100644 --- a/crates/ruma-common/src/api.rs +++ b/crates/ruma-common/src/api.rs @@ -393,7 +393,4 @@ pub enum AuthScheme { /// Authentication is performed by including X-Matrix signatures in the request headers, /// as defined in the federation API. ServerSignatures, - - /// Authentication is performed by setting the `access_token` query parameter. - QueryOnlyAccessToken, } diff --git a/crates/ruma-macros/src/api/auth_scheme.rs b/crates/ruma-macros/src/api/auth_scheme.rs index 90338aee..b5c95fea 100644 --- a/crates/ruma-macros/src/api/auth_scheme.rs +++ b/crates/ruma-macros/src/api/auth_scheme.rs @@ -6,14 +6,12 @@ mod kw { syn::custom_keyword!(None); syn::custom_keyword!(AccessToken); syn::custom_keyword!(ServerSignatures); - syn::custom_keyword!(QueryOnlyAccessToken); } pub enum AuthScheme { None(kw::None), AccessToken(kw::AccessToken), ServerSignatures(kw::ServerSignatures), - QueryOnlyAccessToken(kw::QueryOnlyAccessToken), } impl Parse for AuthScheme { @@ -26,8 +24,6 @@ impl Parse for AuthScheme { input.parse().map(Self::AccessToken) } else if lookahead.peek(kw::ServerSignatures) { input.parse().map(Self::ServerSignatures) - } else if lookahead.peek(kw::QueryOnlyAccessToken) { - input.parse().map(Self::QueryOnlyAccessToken) } else { Err(lookahead.error()) } @@ -40,7 +36,6 @@ impl ToTokens for AuthScheme { AuthScheme::None(kw) => kw.to_tokens(tokens), AuthScheme::AccessToken(kw) => kw.to_tokens(tokens), AuthScheme::ServerSignatures(kw) => kw.to_tokens(tokens), - AuthScheme::QueryOnlyAccessToken(kw) => kw.to_tokens(tokens), } } } diff --git a/crates/ruma-macros/src/api/request/outgoing.rs b/crates/ruma-macros/src/api/request/outgoing.rs index 71250bb6..138017c2 100644 --- a/crates/ruma-macros/src/api/request/outgoing.rs +++ b/crates/ruma-macros/src/api/request/outgoing.rs @@ -125,7 +125,7 @@ impl Request { ); } }, - AuthScheme::QueryOnlyAccessToken(_) | AuthScheme::ServerSignatures(_) => quote! {}, + AuthScheme::ServerSignatures(_) => quote! {}, }); let request_body = if let Some(field) = self.raw_body_field() {