Update r0::account::change_password to r0.6.0

This commit is contained in:
Jonas Platte 2019-11-29 00:27:25 +01:00
parent e7db530782
commit c455020802
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
4 changed files with 22 additions and 12 deletions

View File

@ -5,6 +5,7 @@ Breaking changes:
* Move `r0::directory::get_public_rooms::PublicRoomsChunk` to `r0::directory::PublicRoomsChunk`
* Move `r0::room::create_room::Visibility` to `r0::room::Visibility`
* Our Minimum Supported Rust Version is now 1.36.0
* Move `r0::account::register::AuthenticationData` to `r0::account::AuthenticationData`
Improvements:
@ -13,3 +14,5 @@ Improvements:
* Add `filter` optional parameter to `r0::sync::get_message_events` (introduced upstream in r0.3.0)
* Add `r0::appservice::set_room_visibility` (part of application service extensions for the client-server API)
* Add `contains_url` to `r0::filter::RoomEventFilter` (introduced upstream in r0.3.0)
* Update `r0::account::change_password` from r0.3.0 to r0.6.0
* Add optional `auth` field

View File

@ -6,3 +6,15 @@ pub mod register;
pub mod request_password_change_token;
pub mod request_register_token;
pub mod whoami;
use serde::{Deserialize, Serialize};
/// Additional authentication information for the user-interactive authentication API.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct AuthenticationData {
/// The login type that the client is attempting to complete.
#[serde(rename = "type")]
kind: String,
/// The value of the session key given by the homeserver.
session: Option<String>,
}

View File

@ -1,7 +1,9 @@
//! [POST /_matrix/client/r0/account/password](https://matrix.org/docs/spec/client_server/r0.4.0.html#post-matrix-client-r0-account-password)
//! [POST /_matrix/client/r0/account/password](https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-client-r0-account-password)
use ruma_api::ruma_api;
use super::AuthenticationData;
ruma_api! {
metadata {
description: "Change the password of the current user's account.",
@ -15,7 +17,8 @@ ruma_api! {
request {
/// The new password for the account.
pub new_password: String,
// TODO: missing `auth` field
/// Additional authentication information for the user-interactive authentication API.
pub auth: Option<AuthenticationData>,
}
response {}

View File

@ -4,6 +4,8 @@ use ruma_api::ruma_api;
use ruma_identifiers::UserId;
use serde::{Deserialize, Serialize};
use super::AuthenticationData;
ruma_api! {
metadata {
description: "Register an account on this homeserver.",
@ -73,16 +75,6 @@ ruma_api! {
}
}
/// Additional authentication information for the user-interactive authentication API.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct AuthenticationData {
/// The login type that the client is attempting to complete.
#[serde(rename = "type")]
kind: String,
/// The value of the session key given by the homeserver.
session: Option<String>,
}
/// The kind of account being registered.
#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
#[serde(rename_all = "snake_case")]