mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-03-25 04:24:48 +03:00
Merge branch '3pid_403_next' into 'next'
Return 403 to 3pid token routes to signal not implemented See merge request famedly/conduit!375
This commit is contained in:
commit
876fdf480d
2 changed files with 33 additions and 2 deletions
|
@ -3,7 +3,8 @@ use crate::{api::client_server, services, utils, Error, Result, Ruma};
|
||||||
use ruma::{
|
use ruma::{
|
||||||
api::client::{
|
api::client::{
|
||||||
account::{
|
account::{
|
||||||
change_password, deactivate, get_3pids, get_username_availability, register, whoami,
|
change_password, deactivate, get_3pids, get_username_availability, register,
|
||||||
|
request_3pid_management_token_via_email, request_3pid_management_token_via_msisdn, whoami,
|
||||||
ThirdPartyIdRemovalStatus,
|
ThirdPartyIdRemovalStatus,
|
||||||
},
|
},
|
||||||
error::ErrorKind,
|
error::ErrorKind,
|
||||||
|
@ -406,7 +407,7 @@ pub async fn deactivate_route(
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/// # `GET _matrix/client/r0/account/3pid`
|
/// # `GET _matrix/client/v3/account/3pid`
|
||||||
///
|
///
|
||||||
/// Get a list of third party identifiers associated with this account.
|
/// Get a list of third party identifiers associated with this account.
|
||||||
///
|
///
|
||||||
|
@ -418,3 +419,31 @@ pub async fn third_party_route(
|
||||||
|
|
||||||
Ok(get_3pids::v3::Response::new(Vec::new()))
|
Ok(get_3pids::v3::Response::new(Vec::new()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// # `POST /_matrix/client/v3/account/3pid/email/requestToken`
|
||||||
|
///
|
||||||
|
/// "This API should be used to request validation tokens when adding an email address to an account"
|
||||||
|
///
|
||||||
|
/// - 403 signals that The homeserver does not allow the third party identifier as a contact option.
|
||||||
|
pub async fn request_3pid_management_token_via_email_route(
|
||||||
|
_body: Ruma<request_3pid_management_token_via_email::v3::IncomingRequest>,
|
||||||
|
) -> Result<request_3pid_management_token_via_email::v3::Response> {
|
||||||
|
Err(Error::BadRequest(
|
||||||
|
ErrorKind::ThreepidDenied,
|
||||||
|
"Third party identifier is not allowed",
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// # `POST /_matrix/client/v3/account/3pid/msisdn/requestToken`
|
||||||
|
///
|
||||||
|
/// "This API should be used to request validation tokens when adding an phone number to an account"
|
||||||
|
///
|
||||||
|
/// - 403 signals that The homeserver does not allow the third party identifier as a contact option.
|
||||||
|
pub async fn request_3pid_management_token_via_msisdn_route(
|
||||||
|
_body: Ruma<request_3pid_management_token_via_msisdn::v3::IncomingRequest>,
|
||||||
|
) -> Result<request_3pid_management_token_via_msisdn::v3::Response> {
|
||||||
|
Err(Error::BadRequest(
|
||||||
|
ErrorKind::ThreepidDenied,
|
||||||
|
"Third party identifier is not allowed",
|
||||||
|
))
|
||||||
|
}
|
||||||
|
|
|
@ -223,6 +223,8 @@ fn routes() -> Router {
|
||||||
.ruma_route(client_server::change_password_route)
|
.ruma_route(client_server::change_password_route)
|
||||||
.ruma_route(client_server::deactivate_route)
|
.ruma_route(client_server::deactivate_route)
|
||||||
.ruma_route(client_server::third_party_route)
|
.ruma_route(client_server::third_party_route)
|
||||||
|
.ruma_route(client_server::request_3pid_management_token_via_email_route)
|
||||||
|
.ruma_route(client_server::request_3pid_management_token_via_msisdn_route)
|
||||||
.ruma_route(client_server::get_capabilities_route)
|
.ruma_route(client_server::get_capabilities_route)
|
||||||
.ruma_route(client_server::get_pushrules_all_route)
|
.ruma_route(client_server::get_pushrules_all_route)
|
||||||
.ruma_route(client_server::set_pushrule_route)
|
.ruma_route(client_server::set_pushrule_route)
|
||||||
|
|
Loading…
Reference in a new issue