From 42811660094c88a4a1bfa8bd8ace5f4b148c246a Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Tue, 31 May 2022 18:24:53 +0200 Subject: Regenerate API files (FTBFS; see the next commit) --- lib/csapi/registration.h | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'lib/csapi/registration.h') diff --git a/lib/csapi/registration.h b/lib/csapi/registration.h index 10375971..39840008 100644 --- a/lib/csapi/registration.h +++ b/lib/csapi/registration.h @@ -227,7 +227,8 @@ public: * should be revoked if the request succeeds. * * When `false`, the server can still take advantage of the [soft logout - * method](/client-server-api/#soft-logout) for the user's remaining devices. + * method](/client-server-api/#soft-logout) for the user's remaining + * devices. * * \param auth * Additional authentication information for the user-interactive @@ -247,7 +248,7 @@ public: * `/account/password` endpoint. * * This API's parameters and response are identical to that of the - * [`/register/email/requestToken`](/client-server-api/#post_matrixclientr0registeremailrequesttoken) + * [`/register/email/requestToken`](/client-server-api/#post_matrixclientv3registeremailrequesttoken) * endpoint, except that * `M_THREEPID_NOT_FOUND` may be returned if no account matching the * given email address could be found. The server may instead send an @@ -269,7 +270,7 @@ public: * `/account/password` endpoint. * * This API's parameters and response are identical to that of the - * [`/register/email/requestToken`](/client-server-api/#post_matrixclientr0registeremailrequesttoken) + * [`/register/email/requestToken`](/client-server-api/#post_matrixclientv3registeremailrequesttoken) * endpoint, except that * `M_THREEPID_NOT_FOUND` may be returned if no account matching the * given email address could be found. The server may instead send an @@ -299,7 +300,7 @@ public: * `/account/password` endpoint. * * This API's parameters and response are identical to that of the - * [`/register/msisdn/requestToken`](/client-server-api/#post_matrixclientr0registermsisdnrequesttoken) + * [`/register/msisdn/requestToken`](/client-server-api/#post_matrixclientv3registermsisdnrequesttoken) * endpoint, except that * `M_THREEPID_NOT_FOUND` may be returned if no account matching the * given phone number could be found. The server may instead send the SMS @@ -321,15 +322,16 @@ public: * `/account/password` endpoint. * * This API's parameters and response are identical to that of the - * [`/register/msisdn/requestToken`](/client-server-api/#post_matrixclientr0registermsisdnrequesttoken) + * [`/register/msisdn/requestToken`](/client-server-api/#post_matrixclientv3registermsisdnrequesttoken) * endpoint, except that * `M_THREEPID_NOT_FOUND` may be returned if no account matching the * given phone number could be found. The server may instead send the SMS * to the given phone number prompting the user to create an account. * `M_THREEPID_IN_USE` may not be returned. * - * The homeserver should validate the phone number itself, either by sending - * a validation message itself or by using a service it has control over. + * The homeserver should validate the phone number itself, either by + * sending a validation message itself or by using a service it has control + * over. */ explicit RequestTokenToResetPasswordMSISDNJob( const MsisdnValidationData& body); @@ -377,8 +379,9 @@ public: * it must return an `id_server_unbind_result` of * `no-support`. */ - explicit DeactivateAccountJob(const Omittable& auth = none, - const QString& idServer = {}); + explicit DeactivateAccountJob( + const Omittable& auth = none, + const QString& idServer = {}); // Result properties -- cgit v1.2.3 From ed05d9d589fe3d36bd3714e648016352179afbef Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Sat, 11 Jun 2022 19:42:08 +0200 Subject: Regenerate API files using latest matrix-spec New: - refresh tokens support (changes in login.* and registration.*; RefreshJob); - GetRelatingEvents[WithRelType[AndEventType]]Job Changed space_hierarchy.*: - childrenState is of type StateEvents now; limit and maxDepth are (omittable) integers, not doubles. - no more unused `stripped_state.h` file inclusion. --- lib/csapi/registration.h | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'lib/csapi/registration.h') diff --git a/lib/csapi/registration.h b/lib/csapi/registration.h index 39840008..7a20cab8 100644 --- a/lib/csapi/registration.h +++ b/lib/csapi/registration.h @@ -93,6 +93,9 @@ public: * If true, an `access_token` and `device_id` should not be * returned from this call, therefore preventing an automatic * login. Defaults to false. + * + * \param refreshToken + * If true, the client supports refresh tokens. */ explicit RegisterJob(const QString& kind = QStringLiteral("user"), const Omittable& auth = none, @@ -100,7 +103,8 @@ public: const QString& password = {}, const QString& deviceId = {}, const QString& initialDeviceDisplayName = {}, - Omittable inhibitLogin = none); + Omittable inhibitLogin = none, + Omittable refreshToken = none); // Result properties @@ -118,15 +122,27 @@ public: return loadFromJson("access_token"_ls); } - /// The server_name of the homeserver on which the account has - /// been registered. + /// A refresh token for the account. This token can be used to + /// obtain a new access token when it expires by calling the + /// `/refresh` endpoint. + /// + /// Omitted if the `inhibit_login` option is false. + QString refreshToken() const + { + return loadFromJson("refresh_token"_ls); + } + + /// The lifetime of the access token, in milliseconds. Once + /// the access token has expired a new access token can be + /// obtained by using the provided refresh token. If no + /// refresh token is provided, the client will need to re-log in + /// to obtain a new access token. If not given, the client can + /// assume that the access token will not expire. /// - /// **Deprecated**. Clients should extract the server_name from - /// `user_id` (by splitting at the first colon) if they require - /// it. Note also that `homeserver` is not spelt this way. - QString homeServer() const + /// Omitted if the `inhibit_login` option is false. + Omittable expiresInMs() const { - return loadFromJson("home_server"_ls); + return loadFromJson>("expires_in_ms"_ls); } /// ID of the registered device. Will be the same as the -- cgit v1.2.3 From 2dd85770cbfd6d9c7506757f25765c05ef74987d Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Thu, 16 Jun 2022 13:29:02 +0200 Subject: Regenerate API files upon the previous commit --- lib/csapi/registration.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/csapi/registration.h') diff --git a/lib/csapi/registration.h b/lib/csapi/registration.h index 7a20cab8..21d7f9d7 100644 --- a/lib/csapi/registration.h +++ b/lib/csapi/registration.h @@ -126,7 +126,7 @@ public: /// obtain a new access token when it expires by calling the /// `/refresh` endpoint. /// - /// Omitted if the `inhibit_login` option is false. + /// Omitted if the `inhibit_login` option is true. QString refreshToken() const { return loadFromJson("refresh_token"_ls); @@ -139,7 +139,7 @@ public: /// to obtain a new access token. If not given, the client can /// assume that the access token will not expire. /// - /// Omitted if the `inhibit_login` option is false. + /// Omitted if the `inhibit_login` option is true. Omittable expiresInMs() const { return loadFromJson>("expires_in_ms"_ls); -- cgit v1.2.3