From 63fdd72f737f2ad61b70751ffb9832fef7c76616 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 31 Aug 2018 11:24:35 -0600 Subject: [PATCH 1/6] Fix error description on /account/3pid/email/requestToken --- api/client-server/administrative_contact.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/client-server/administrative_contact.yaml b/api/client-server/administrative_contact.yaml index e3f96fa3..d2594c95 100644 --- a/api/client-server/administrative_contact.yaml +++ b/api/client-server/administrative_contact.yaml @@ -229,14 +229,14 @@ paths: } 400: description: |- - The homeserver was unable to locate a user with the third party identifier - already bound, or the request was invalid. + The third party identifier is already in use on the homeserver, or + the request was invalid. schema: $ref: "definitions/errors/error.yaml" examples: application/json: { - "errcode": "M_THREEPID_NOT_FOUND", - "error": "Third party identifier not found" + "errcode": "M_THREEPID_IN_USE", + "error": "Third party identifier already in use" } "/account/3pid/msisdn/requestToken": post: From 60dd9231e0ff0114a04ad9f5666ba7527b025164 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 31 Aug 2018 11:26:28 -0600 Subject: [PATCH 2/6] Don't explain how the IS might accept a 3pid The IS is bound to it's own set of specifications, and if the client chose this API then they should be aware of the risks but not necessarily arbitrary alternatives. --- api/client-server/administrative_contact.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/api/client-server/administrative_contact.yaml b/api/client-server/administrative_contact.yaml index d2594c95..0fdbf742 100644 --- a/api/client-server/administrative_contact.yaml +++ b/api/client-server/administrative_contact.yaml @@ -218,8 +218,7 @@ paths: 403: description: |- The homeserver does not permit the user from having the third party - identifier as a contact option. This does not prevent the identity - service from binding the third party identifier, however. + identifier as a contact option. schema: $ref: "definitions/errors/error.yaml" examples: @@ -273,8 +272,7 @@ paths: 403: description: |- The homeserver does not permit the user from having the third party - identifier as a contact option. This does not prevent the identity - service from binding the third party identifier, however. + identifier as a contact option. schema: $ref: "definitions/errors/error.yaml" examples: From 5bb7eca8e8d70c91d179793284cf642779af57ff Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 31 Aug 2018 11:31:03 -0600 Subject: [PATCH 3/6] English --- api/client-server/administrative_contact.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/client-server/administrative_contact.yaml b/api/client-server/administrative_contact.yaml index 0fdbf742..2fba9540 100644 --- a/api/client-server/administrative_contact.yaml +++ b/api/client-server/administrative_contact.yaml @@ -191,7 +191,7 @@ paths: first checks that the given email address is **not** already associated with an account on this homeserver. This API should be used to request validation tokens when adding an email address to an account. This API's - parameters and response is identical to that of the |/register/email/requestToken|_ + parameters and response are identical to that of the |/register/email/requestToken|_ endpoint. operationId: requestTokenTo3PIDEmail parameters: @@ -245,7 +245,7 @@ paths: first checks that the given phone number is **not** already associated with an account on this Home Server. This API should be used to request validation tokens when adding a phone number to an account. This API's - parameters and response is identical to that of the |/register/msisdn/requestToken|_ + parameters and response are identical to that of the |/register/msisdn/requestToken|_ endpoint. operationId: requestTokenTo3PIDMSISDN parameters: @@ -282,8 +282,8 @@ paths: } 400: description: |- - The homeserver was unable to location a user with the third party identifier - alrady bound, or the request was invalid. + The homeserver was unable to locate a user with the third party identifier + already bound, or the request was invalid. schema: $ref: "definitions/errors/error.yaml" examples: From 824ce22caaae00a76f8d965f575197995c245903 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 31 Aug 2018 11:41:46 -0600 Subject: [PATCH 4/6] Add additional clarity to the requestToken errors --- api/client-server/administrative_contact.yaml | 8 ++-- api/client-server/registration.yaml | 48 ++++++++++++++++++- 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/api/client-server/administrative_contact.yaml b/api/client-server/administrative_contact.yaml index 2fba9540..ddfbe172 100644 --- a/api/client-server/administrative_contact.yaml +++ b/api/client-server/administrative_contact.yaml @@ -282,12 +282,12 @@ paths: } 400: description: |- - The homeserver was unable to locate a user with the third party identifier - already bound, or the request was invalid. + The third party identifier is already in use on the homeserver, or + the request was invalid. schema: $ref: "definitions/errors/error.yaml" examples: application/json: { - "errcode": "M_THREEPID_NOT_FOUND", - "error": "Third party identifier not found" + "errcode": "M_THREEPID_IN_USE", + "error": "Third party identifier already in use" } diff --git a/api/client-server/registration.yaml b/api/client-server/registration.yaml index 7b1230cb..b935b4f7 100644 --- a/api/client-server/registration.yaml +++ b/api/client-server/registration.yaml @@ -406,9 +406,31 @@ paths: required: ['id_server'] responses: 200: - description: An email was sent to the given address + description: An email was sent to the given address. schema: $ref: "../identity/definitions/sid.yaml" + 403: + description: |- + The homeserver does not permit the user from having the third party + identifier as a contact option. + schema: + $ref: "definitions/errors/error.yaml" + examples: + application/json: { + "errcode": "M_THREEPID_DENIED", + "error": "Third party identifier is not allowed" + } + 400: + description: |- + The third party identifier is already in use on the homeserver, or + the request was invalid. + schema: + $ref: "definitions/errors/error.yaml" + examples: + application/json: { + "errcode": "M_THREEPID_NOT_FOUND", + "error": "Email not found" + } "/account/password/msisdn/requestToken": post: summary: Requests a validation token be sent to the given phone number for the purpose of resetting a user's password. @@ -420,7 +442,7 @@ paths: `account/password` endpoint. This API's parameters and response are identical to that of the HS API |/register/msisdn/requestToken|_ 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 + given phone number could be found. The server may instead send an SMS message to the given address prompting the user to create an account. `M_THREEPID_IN_USE` may not be returned. @@ -449,6 +471,28 @@ paths: description: An SMS message was sent to the given phone number. schema: $ref: "../identity/definitions/sid.yaml" + 403: + description: |- + The homeserver does not permit the user from having the third party + identifier as a contact option. + schema: + $ref: "definitions/errors/error.yaml" + examples: + application/json: { + "errcode": "M_THREEPID_DENIED", + "error": "Third party identifier is not allowed" + } + 400: + description: |- + The third party identifier is already in use on the homeserver, or + the request was invalid. + schema: + $ref: "definitions/errors/error.yaml" + examples: + application/json: { + "errcode": "M_THREEPID_NOT_FOUND", + "error": "Phone number not found" + } "/account/deactivate": post: summary: "Deactivate a user's account." From 1261da209dc368de9f59826813dceab747ae391c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 31 Aug 2018 14:38:22 -0600 Subject: [PATCH 5/6] Fix wording for the homeserver not allowing a particular 3pid --- api/client-server/administrative_contact.yaml | 8 ++++---- api/client-server/registration.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/client-server/administrative_contact.yaml b/api/client-server/administrative_contact.yaml index ddfbe172..5699a884 100644 --- a/api/client-server/administrative_contact.yaml +++ b/api/client-server/administrative_contact.yaml @@ -217,8 +217,8 @@ paths: $ref: "../identity/definitions/sid.yaml" 403: description: |- - The homeserver does not permit the user from having the third party - identifier as a contact option. + The homeserver does not allow the third party identifier as a + contact option. schema: $ref: "definitions/errors/error.yaml" examples: @@ -271,8 +271,8 @@ paths: $ref: "../identity/definitions/sid.yaml" 403: description: |- - The homeserver does not permit the user from having the third party - identifier as a contact option. + The homeserver does not allow the third party identifier as a + contact option. schema: $ref: "definitions/errors/error.yaml" examples: diff --git a/api/client-server/registration.yaml b/api/client-server/registration.yaml index b935b4f7..9861d905 100644 --- a/api/client-server/registration.yaml +++ b/api/client-server/registration.yaml @@ -411,8 +411,8 @@ paths: $ref: "../identity/definitions/sid.yaml" 403: description: |- - The homeserver does not permit the user from having the third party - identifier as a contact option. + The homeserver does not allow the third party identifier as a + contact option. schema: $ref: "definitions/errors/error.yaml" examples: @@ -473,8 +473,8 @@ paths: $ref: "../identity/definitions/sid.yaml" 403: description: |- - The homeserver does not permit the user from having the third party - identifier as a contact option. + The homeserver does not allow the third party identifier as a + contact option. schema: $ref: "definitions/errors/error.yaml" examples: From a1f655e5be073416a5e0cc098ffc1eb0dc8c52e4 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 31 Aug 2018 14:53:59 -0600 Subject: [PATCH 6/6] Fix more error wording --- api/client-server/registration.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/client-server/registration.yaml b/api/client-server/registration.yaml index 9861d905..324abbff 100644 --- a/api/client-server/registration.yaml +++ b/api/client-server/registration.yaml @@ -422,8 +422,8 @@ paths: } 400: description: |- - The third party identifier is already in use on the homeserver, or - the request was invalid. + The referenced third party identifier is not recognised by the + homeserver, or the request was invalid schema: $ref: "definitions/errors/error.yaml" examples: @@ -484,8 +484,8 @@ paths: } 400: description: |- - The third party identifier is already in use on the homeserver, or - the request was invalid. + The referenced third party identifier is not recognised by the + homeserver, or the request was invalid schema: $ref: "definitions/errors/error.yaml" examples: