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 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:

View File

@ -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,
}

View File

@ -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),
}
}
}

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() {