api: Remove AuthScheme::QueryOnlyAccessToken

It is no longer used by the Appservice API.
This commit is contained in:
Kévin Commaille 2022-10-02 13:12:10 +02:00 committed by Kévin Commaille
parent 19a388a923
commit d55573a555
4 changed files with 2 additions and 9 deletions

View File

@ -5,6 +5,7 @@ Breaking changes:
* Remove deprecated `EventType` enum * Remove deprecated `EventType` enum
* Remove deprecated constructors for `RoomMessageEventContent` * Remove deprecated constructors for `RoomMessageEventContent`
* Remove `serde::vec_as_map_of_empty` from the public API * Remove `serde::vec_as_map_of_empty` from the public API
* Remove the `api::AuthScheme::QueryOnlyAccessToken` variant, which is no longer used
Improvements: Improvements:

View File

@ -393,7 +393,4 @@ pub enum AuthScheme {
/// Authentication is performed by including X-Matrix signatures in the request headers, /// Authentication is performed by including X-Matrix signatures in the request headers,
/// as defined in the federation API. /// as defined in the federation API.
ServerSignatures, ServerSignatures,
/// Authentication is performed by setting the `access_token` query parameter.
QueryOnlyAccessToken,
} }

View File

@ -6,14 +6,12 @@ mod kw {
syn::custom_keyword!(None); syn::custom_keyword!(None);
syn::custom_keyword!(AccessToken); syn::custom_keyword!(AccessToken);
syn::custom_keyword!(ServerSignatures); syn::custom_keyword!(ServerSignatures);
syn::custom_keyword!(QueryOnlyAccessToken);
} }
pub enum AuthScheme { pub enum AuthScheme {
None(kw::None), None(kw::None),
AccessToken(kw::AccessToken), AccessToken(kw::AccessToken),
ServerSignatures(kw::ServerSignatures), ServerSignatures(kw::ServerSignatures),
QueryOnlyAccessToken(kw::QueryOnlyAccessToken),
} }
impl Parse for AuthScheme { impl Parse for AuthScheme {
@ -26,8 +24,6 @@ impl Parse for AuthScheme {
input.parse().map(Self::AccessToken) input.parse().map(Self::AccessToken)
} else if lookahead.peek(kw::ServerSignatures) { } else if lookahead.peek(kw::ServerSignatures) {
input.parse().map(Self::ServerSignatures) input.parse().map(Self::ServerSignatures)
} else if lookahead.peek(kw::QueryOnlyAccessToken) {
input.parse().map(Self::QueryOnlyAccessToken)
} else { } else {
Err(lookahead.error()) Err(lookahead.error())
} }
@ -40,7 +36,6 @@ impl ToTokens for AuthScheme {
AuthScheme::None(kw) => kw.to_tokens(tokens), AuthScheme::None(kw) => kw.to_tokens(tokens),
AuthScheme::AccessToken(kw) => kw.to_tokens(tokens), AuthScheme::AccessToken(kw) => kw.to_tokens(tokens),
AuthScheme::ServerSignatures(kw) => kw.to_tokens(tokens), AuthScheme::ServerSignatures(kw) => kw.to_tokens(tokens),
AuthScheme::QueryOnlyAccessToken(kw) => kw.to_tokens(tokens),
} }
} }
} }

View File

@ -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() { let request_body = if let Some(field) = self.raw_body_field() {