diff options
Diffstat (limited to 'lib/identity')
-rw-r--r-- | lib/identity/definitions/request_email_validation.cpp | 5 | ||||
-rw-r--r-- | lib/identity/definitions/request_email_validation.h | 60 | ||||
-rw-r--r-- | lib/identity/definitions/request_msisdn_validation.cpp | 5 | ||||
-rw-r--r-- | lib/identity/definitions/request_msisdn_validation.h | 67 | ||||
-rw-r--r-- | lib/identity/definitions/sid.cpp | 9 | ||||
-rw-r--r-- | lib/identity/definitions/sid.h | 34 |
6 files changed, 89 insertions, 91 deletions
diff --git a/lib/identity/definitions/request_email_validation.cpp b/lib/identity/definitions/request_email_validation.cpp index 47463a8b..22cb0072 100644 --- a/lib/identity/definitions/request_email_validation.cpp +++ b/lib/identity/definitions/request_email_validation.cpp @@ -4,10 +4,10 @@ #include "request_email_validation.h" -using namespace QMatrixClient; +using namespace Quotient; void JsonObjectConverter<RequestEmailValidation>::dumpTo( - QJsonObject& jo, const RequestEmailValidation& pod) + QJsonObject& jo, const RequestEmailValidation& pod) { addParam<>(jo, QStringLiteral("client_secret"), pod.clientSecret); addParam<>(jo, QStringLiteral("email"), pod.email); @@ -23,4 +23,3 @@ void JsonObjectConverter<RequestEmailValidation>::fillFrom( fromJson(jo.value("send_attempt"_ls), result.sendAttempt); fromJson(jo.value("next_link"_ls), result.nextLink); } - diff --git a/lib/identity/definitions/request_email_validation.h b/lib/identity/definitions/request_email_validation.h index eb7d8ed6..99487073 100644 --- a/lib/identity/definitions/request_email_validation.h +++ b/lib/identity/definitions/request_email_validation.h @@ -6,37 +6,37 @@ #include "converters.h" -#include "converters.h" +namespace Quotient +{ -namespace QMatrixClient +// Data structures + +struct RequestEmailValidation { - // Data structures + /// A unique string generated by the client, and used to identify + /// thevalidation attempt. It must be a string consisting of the + /// characters``[0-9a-zA-Z.=_-]``. Its length must not exceed 255 characters + /// and itmust not be empty. + QString clientSecret; + /// The email address to validate. + QString email; + /// The server will only send an email if the ``send_attempt``is a number + /// greater than the most recent one which it has seen,scoped to that + /// ``email`` + ``client_secret`` pair. This is toavoid repeatedly sending + /// the same email in the case of requestretries between the POSTing user + /// and the identity server.The client should increment this value if they + /// desire a newemail (e.g. a reminder) to be sent. + int sendAttempt; + /// Optional. When the validation is completed, the identityserver will + /// redirect the user to this URL. + QString nextLink; +}; - struct RequestEmailValidation - { - /// A unique string generated by the client, and used to identify the - /// validation attempt. It must be a string consisting of the characters - /// ``[0-9a-zA-Z.=_-]``. Its length must not exceed 255 characters and it - /// must not be empty. - QString clientSecret; - /// The email address to validate. - QString email; - /// The server will only send an email if the ``send_attempt`` - /// is a number greater than the most recent one which it has seen, - /// scoped to that ``email`` + ``client_secret`` pair. This is to - /// avoid repeatedly sending the same email in the case of request - /// retries between the POSTing user and the identity server. - /// The client should increment this value if they desire a new - /// email (e.g. a reminder) to be sent. - int sendAttempt; - /// Optional. When the validation is completed, the identity - /// server will redirect the user to this URL. - QString nextLink; - }; - template <> struct JsonObjectConverter<RequestEmailValidation> - { - static void dumpTo(QJsonObject& jo, const RequestEmailValidation& pod); - static void fillFrom(const QJsonObject& jo, RequestEmailValidation& pod); - }; +template <> +struct JsonObjectConverter<RequestEmailValidation> +{ + static void dumpTo(QJsonObject& jo, const RequestEmailValidation& pod); + static void fillFrom(const QJsonObject& jo, RequestEmailValidation& pod); +}; -} // namespace QMatrixClient +} // namespace Quotient diff --git a/lib/identity/definitions/request_msisdn_validation.cpp b/lib/identity/definitions/request_msisdn_validation.cpp index a123d326..6024bf61 100644 --- a/lib/identity/definitions/request_msisdn_validation.cpp +++ b/lib/identity/definitions/request_msisdn_validation.cpp @@ -4,10 +4,10 @@ #include "request_msisdn_validation.h" -using namespace QMatrixClient; +using namespace Quotient; void JsonObjectConverter<RequestMsisdnValidation>::dumpTo( - QJsonObject& jo, const RequestMsisdnValidation& pod) + QJsonObject& jo, const RequestMsisdnValidation& pod) { addParam<>(jo, QStringLiteral("client_secret"), pod.clientSecret); addParam<>(jo, QStringLiteral("country"), pod.country); @@ -25,4 +25,3 @@ void JsonObjectConverter<RequestMsisdnValidation>::fillFrom( fromJson(jo.value("send_attempt"_ls), result.sendAttempt); fromJson(jo.value("next_link"_ls), result.nextLink); } - diff --git a/lib/identity/definitions/request_msisdn_validation.h b/lib/identity/definitions/request_msisdn_validation.h index b48ed6d5..ecccf567 100644 --- a/lib/identity/definitions/request_msisdn_validation.h +++ b/lib/identity/definitions/request_msisdn_validation.h @@ -6,40 +6,41 @@ #include "converters.h" -#include "converters.h" +namespace Quotient +{ -namespace QMatrixClient +// Data structures + +struct RequestMsisdnValidation { - // Data structures + /// A unique string generated by the client, and used to identify + /// thevalidation attempt. It must be a string consisting of the + /// characters``[0-9a-zA-Z.=_-]``. Its length must not exceed 255 characters + /// and itmust not be empty. + QString clientSecret; + /// The two-letter uppercase ISO country code that the number + /// in``phone_number`` should be parsed as if it were dialled from. + QString country; + /// The phone number to validate. + QString phoneNumber; + /// The server will only send an SMS if the ``send_attempt`` is anumber + /// greater than the most recent one which it has seen,scoped to that + /// ``country`` + ``phone_number`` + ``client_secret``triple. This is to + /// avoid repeatedly sending the same SMS inthe case of request retries + /// between the POSTing user and theidentity server. The client should + /// increment this value ifthey desire a new SMS (e.g. a reminder) to be + /// sent. + int sendAttempt; + /// Optional. When the validation is completed, the identityserver will + /// redirect the user to this URL. + QString nextLink; +}; - struct RequestMsisdnValidation - { - /// A unique string generated by the client, and used to identify the - /// validation attempt. It must be a string consisting of the characters - /// ``[0-9a-zA-Z.=_-]``. Its length must not exceed 255 characters and it - /// must not be empty. - QString clientSecret; - /// The two-letter uppercase ISO country code that the number in - /// ``phone_number`` should be parsed as if it were dialled from. - QString country; - /// The phone number to validate. - QString phoneNumber; - /// The server will only send an SMS if the ``send_attempt`` is a - /// number greater than the most recent one which it has seen, - /// scoped to that ``country`` + ``phone_number`` + ``client_secret`` - /// triple. This is to avoid repeatedly sending the same SMS in - /// the case of request retries between the POSTing user and the - /// identity server. The client should increment this value if - /// they desire a new SMS (e.g. a reminder) to be sent. - int sendAttempt; - /// Optional. When the validation is completed, the identity - /// server will redirect the user to this URL. - QString nextLink; - }; - template <> struct JsonObjectConverter<RequestMsisdnValidation> - { - static void dumpTo(QJsonObject& jo, const RequestMsisdnValidation& pod); - static void fillFrom(const QJsonObject& jo, RequestMsisdnValidation& pod); - }; +template <> +struct JsonObjectConverter<RequestMsisdnValidation> +{ + static void dumpTo(QJsonObject& jo, const RequestMsisdnValidation& pod); + static void fillFrom(const QJsonObject& jo, RequestMsisdnValidation& pod); +}; -} // namespace QMatrixClient +} // namespace Quotient diff --git a/lib/identity/definitions/sid.cpp b/lib/identity/definitions/sid.cpp index 1ba4b3b5..99fe9b59 100644 --- a/lib/identity/definitions/sid.cpp +++ b/lib/identity/definitions/sid.cpp @@ -4,17 +4,14 @@ #include "sid.h" -using namespace QMatrixClient; +using namespace Quotient; -void JsonObjectConverter<Sid>::dumpTo( - QJsonObject& jo, const Sid& pod) +void JsonObjectConverter<Sid>::dumpTo(QJsonObject& jo, const Sid& pod) { addParam<>(jo, QStringLiteral("sid"), pod.sid); } -void JsonObjectConverter<Sid>::fillFrom( - const QJsonObject& jo, Sid& result) +void JsonObjectConverter<Sid>::fillFrom(const QJsonObject& jo, Sid& result) { fromJson(jo.value("sid"_ls), result.sid); } - diff --git a/lib/identity/definitions/sid.h b/lib/identity/definitions/sid.h index ac8c4130..0f7ce58a 100644 --- a/lib/identity/definitions/sid.h +++ b/lib/identity/definitions/sid.h @@ -6,23 +6,25 @@ #include "converters.h" +namespace Quotient +{ + +// Data structures -namespace QMatrixClient +struct Sid { - // Data structures + /// The session ID. Session IDs are opaque strings generated by the + /// identityserver. They must consist entirely of the + /// characters``[0-9a-zA-Z.=_-]``. Their length must not exceed 255 + /// characters and theymust not be empty. + QString sid; +}; - struct Sid - { - /// The session ID. Session IDs are opaque strings generated by the identity - /// server. They must consist entirely of the characters - /// ``[0-9a-zA-Z.=_-]``. Their length must not exceed 255 characters and they - /// must not be empty. - QString sid; - }; - template <> struct JsonObjectConverter<Sid> - { - static void dumpTo(QJsonObject& jo, const Sid& pod); - static void fillFrom(const QJsonObject& jo, Sid& pod); - }; +template <> +struct JsonObjectConverter<Sid> +{ + static void dumpTo(QJsonObject& jo, const Sid& pod); + static void fillFrom(const QJsonObject& jo, Sid& pod); +}; -} // namespace QMatrixClient +} // namespace Quotient |