From f3c269d95107d5e70c676274a766cf3b420098b3 Mon Sep 17 00:00:00 2001 From: Tom Foster Date: Fri, 14 Feb 2025 12:20:25 +0000 Subject: [PATCH] Added capability --- .../client_server/newsfragments/2071.feature | 2 +- data/api/client-server/capabilities.yaml | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/changelogs/client_server/newsfragments/2071.feature b/changelogs/client_server/newsfragments/2071.feature index 00695c46..25c338f2 100644 --- a/changelogs/client_server/newsfragments/2071.feature +++ b/changelogs/client_server/newsfragments/2071.feature @@ -1 +1 @@ -Feature: Update profile endpoints to become generic to support [MSC4133](https://github.com/matrix-org/matrix-spec-proposals/pull/4133) extended fields. Stabilised keys are explicitly enumerated, and custom keys must conform to the Common Namespaced Identifier Grammar. +Feature: Update profile endpoints to become generic to support [MSC4133](https://github.com/matrix-org/matrix-spec-proposals/pull/4133) extended fields. Extended profile fields are now supported via the new `m.profile_fields` capability. Stabilised keys are explicitly enumerated, and custom keys must conform to the Common Namespaced Identifier Grammar. diff --git a/data/api/client-server/capabilities.yaml b/data/api/client-server/capabilities.yaml index 523c6091..c2853586 100644 --- a/data/api/client-server/capabilities.yaml +++ b/data/api/client-server/capabilities.yaml @@ -86,6 +86,10 @@ paths: $ref: '#/components/schemas/booleanCapability' description: Capability to indicate if the user can generate tokens to log further clients into their account. + m.profile_fields: + $ref: "#/components/schemas/profileFieldsCapability" + description: Capability to indicate if the user can set or modify extended profile fields. + If absent, clients SHOULD assume extended profiles are supported in the correct spec version. examples: response: value: { @@ -144,3 +148,28 @@ components: example: false required: - enabled + profileFieldsCapability: + type: object + title: ProfileFieldsCapability + properties: + enabled: + type: boolean + description: True if the user can set or modify any extended profile fields, false otherwise. + example: true + allowed: + type: array + description: List of allowed custom profile field keys. This takes precedence over disallowed if both are provided. + items: + type: string + example: + - "m.example_field" + - "org.example.job_title" + disallowed: + type: array + description: List of disallowed custom profile field keys. Ignored if allowed is provided. + items: + type: string + example: + - "org.example.secret_field" + required: + - enabled