From 1ca88fb6a078b8a97f207b4f74d0b5106f9389e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Mon, 6 Jan 2025 04:06:58 +0100 Subject: [PATCH 1/5] Clarify formats of string types in account management section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- .../client-server/definitions/request_email_validation.yaml | 1 + .../client-server/definitions/request_msisdn_validation.yaml | 1 + data/api/client-server/registration.yaml | 4 ++++ data/api/identity/definitions/request_email_validation.yaml | 2 ++ data/api/identity/definitions/request_msisdn_validation.yaml | 1 + 5 files changed, 9 insertions(+) diff --git a/data/api/client-server/definitions/request_email_validation.yaml b/data/api/client-server/definitions/request_email_validation.yaml index d52ea18e9..aa47e6589 100644 --- a/data/api/client-server/definitions/request_email_validation.yaml +++ b/data/api/client-server/definitions/request_email_validation.yaml @@ -18,6 +18,7 @@ allOf: properties: id_server: type: string + format: mx-server-name description: |- The hostname of the identity server to communicate with. May optionally include a port. This parameter is ignored when the homeserver handles diff --git a/data/api/client-server/definitions/request_msisdn_validation.yaml b/data/api/client-server/definitions/request_msisdn_validation.yaml index fba3a615d..8d5d73851 100644 --- a/data/api/client-server/definitions/request_msisdn_validation.yaml +++ b/data/api/client-server/definitions/request_msisdn_validation.yaml @@ -18,6 +18,7 @@ allOf: properties: id_server: type: string + format: mx-server-name description: |- The hostname of the identity server to communicate with. May optionally include a port. This parameter is ignored when the homeserver handles diff --git a/data/api/client-server/registration.yaml b/data/api/client-server/registration.yaml index 1dd314b8b..a2d043059 100644 --- a/data/api/client-server/registration.yaml +++ b/data/api/client-server/registration.yaml @@ -135,6 +135,8 @@ paths: properties: user_id: type: string + format: mx-user-id + pattern: "^@" description: |- The fully-qualified Matrix user ID (MXID) that has been registered. @@ -169,6 +171,7 @@ paths: x-addedInMatrixVersion: "1.3" home_server: type: string + format: mx-server-name deprecated: true description: |- The server_name of the homeserver on which the account has @@ -611,6 +614,7 @@ paths: - $ref: definitions/auth_data.yaml id_server: type: string + format: mx-server-name description: |- The identity server to unbind all of the user's 3PIDs from. If not provided, the homeserver MUST use the `id_server` diff --git a/data/api/identity/definitions/request_email_validation.yaml b/data/api/identity/definitions/request_email_validation.yaml index a447c8710..f165c6ac2 100644 --- a/data/api/identity/definitions/request_email_validation.yaml +++ b/data/api/identity/definitions/request_email_validation.yaml @@ -23,6 +23,7 @@ properties: example: "monkeys_are_GREAT" email: type: string + format: email description: The email address to validate. example: "alice@example.org" send_attempt: @@ -39,6 +40,7 @@ properties: example: 1 next_link: type: string + format: uri description: |- Optional. When the validation is completed, the identity server will redirect the user to this URL. This option is ignored when submitting diff --git a/data/api/identity/definitions/request_msisdn_validation.yaml b/data/api/identity/definitions/request_msisdn_validation.yaml index 28544580d..5900e447f 100644 --- a/data/api/identity/definitions/request_msisdn_validation.yaml +++ b/data/api/identity/definitions/request_msisdn_validation.yaml @@ -44,6 +44,7 @@ properties: example: 1 next_link: type: string + format: uri description: |- Optional. When the validation is completed, the identity server will redirect the user to this URL. This option is ignored when submitting From 5192eff70f78027b481db91c97f0ceac2510a975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Mon, 6 Jan 2025 04:12:15 +0100 Subject: [PATCH 2/5] Clarify formats of string types in account administrative contact section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- data/api/client-server/administrative_contact.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/api/client-server/administrative_contact.yaml b/data/api/client-server/administrative_contact.yaml index eddb2b01a..2ce11e531 100644 --- a/data/api/client-server/administrative_contact.yaml +++ b/data/api/client-server/administrative_contact.yaml @@ -120,6 +120,7 @@ paths: description: The client secret used in the session with the identity server. id_server: type: string + format: mx-server-name description: The identity server to use. id_access_token: type: string @@ -279,6 +280,7 @@ paths: description: The client secret used in the session with the identity server. id_server: type: string + format: mx-server-name description: The identity server to use. id_access_token: type: string @@ -338,6 +340,7 @@ paths: properties: id_server: type: string + format: mx-server-name description: |- The identity server to unbind from. If not provided, the homeserver MUST use the `id_server` the identifier was added through. If the @@ -408,6 +411,7 @@ paths: properties: id_server: type: string + format: mx-server-name description: |- The identity server to unbind from. If not provided, the homeserver MUST use the `id_server` the identifier was added through. If the From 65343601fea2915b4ae1085e33cee5439ee1e716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Mon, 6 Jan 2025 04:18:47 +0100 Subject: [PATCH 3/5] Clarify formats of string types in current account information section MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- data/api/client-server/whoami.yaml | 2 ++ data/event-schemas/schema/m.identity_server.yaml | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/data/api/client-server/whoami.yaml b/data/api/client-server/whoami.yaml index 8f4027e73..55e5cb794 100644 --- a/data/api/client-server/whoami.yaml +++ b/data/api/client-server/whoami.yaml @@ -44,6 +44,8 @@ paths: properties: user_id: type: string + format: mx-user-id + pattern: "^@" description: The user ID that owns the access token. device_id: x-addedInMatrixVersion: "1.1" diff --git a/data/event-schemas/schema/m.identity_server.yaml b/data/event-schemas/schema/m.identity_server.yaml index acd0eb92a..1c08b047e 100644 --- a/data/event-schemas/schema/m.identity_server.yaml +++ b/data/event-schemas/schema/m.identity_server.yaml @@ -9,7 +9,10 @@ properties: type: object properties: base_url: - type: string + anyOf: + - type: string + format: uri + - type: "null" description: |- The URL of the identity server the user prefers to use, or `null` if the user does not want to use an identity server. This value is From ed080f41fb00513397d3e5bac725469926d2328a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Mon, 6 Jan 2025 10:09:11 +0100 Subject: [PATCH 4/5] Add changelog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- changelogs/client_server/newsfragments/2046.clarification | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/client_server/newsfragments/2046.clarification diff --git a/changelogs/client_server/newsfragments/2046.clarification b/changelogs/client_server/newsfragments/2046.clarification new file mode 100644 index 000000000..bdcce7771 --- /dev/null +++ b/changelogs/client_server/newsfragments/2046.clarification @@ -0,0 +1 @@ +Clarify formats of string types. From 182ff5c4bbe9f0dafecf376a53f865752386b0eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 15 Jan 2025 16:07:31 +0100 Subject: [PATCH 5/5] Revert `id_server` formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Commaille --- data/api/client-server/administrative_contact.yaml | 4 ---- .../client-server/definitions/request_email_validation.yaml | 1 - .../client-server/definitions/request_msisdn_validation.yaml | 1 - data/api/client-server/registration.yaml | 1 - 4 files changed, 7 deletions(-) diff --git a/data/api/client-server/administrative_contact.yaml b/data/api/client-server/administrative_contact.yaml index 2ce11e531..eddb2b01a 100644 --- a/data/api/client-server/administrative_contact.yaml +++ b/data/api/client-server/administrative_contact.yaml @@ -120,7 +120,6 @@ paths: description: The client secret used in the session with the identity server. id_server: type: string - format: mx-server-name description: The identity server to use. id_access_token: type: string @@ -280,7 +279,6 @@ paths: description: The client secret used in the session with the identity server. id_server: type: string - format: mx-server-name description: The identity server to use. id_access_token: type: string @@ -340,7 +338,6 @@ paths: properties: id_server: type: string - format: mx-server-name description: |- The identity server to unbind from. If not provided, the homeserver MUST use the `id_server` the identifier was added through. If the @@ -411,7 +408,6 @@ paths: properties: id_server: type: string - format: mx-server-name description: |- The identity server to unbind from. If not provided, the homeserver MUST use the `id_server` the identifier was added through. If the diff --git a/data/api/client-server/definitions/request_email_validation.yaml b/data/api/client-server/definitions/request_email_validation.yaml index aa47e6589..d52ea18e9 100644 --- a/data/api/client-server/definitions/request_email_validation.yaml +++ b/data/api/client-server/definitions/request_email_validation.yaml @@ -18,7 +18,6 @@ allOf: properties: id_server: type: string - format: mx-server-name description: |- The hostname of the identity server to communicate with. May optionally include a port. This parameter is ignored when the homeserver handles diff --git a/data/api/client-server/definitions/request_msisdn_validation.yaml b/data/api/client-server/definitions/request_msisdn_validation.yaml index 8d5d73851..fba3a615d 100644 --- a/data/api/client-server/definitions/request_msisdn_validation.yaml +++ b/data/api/client-server/definitions/request_msisdn_validation.yaml @@ -18,7 +18,6 @@ allOf: properties: id_server: type: string - format: mx-server-name description: |- The hostname of the identity server to communicate with. May optionally include a port. This parameter is ignored when the homeserver handles diff --git a/data/api/client-server/registration.yaml b/data/api/client-server/registration.yaml index a2d043059..a418d2d2f 100644 --- a/data/api/client-server/registration.yaml +++ b/data/api/client-server/registration.yaml @@ -614,7 +614,6 @@ paths: - $ref: definitions/auth_data.yaml id_server: type: string - format: mx-server-name description: |- The identity server to unbind all of the user's 3PIDs from. If not provided, the homeserver MUST use the `id_server`