Compare commits

..

24 commits

Author SHA1 Message Date
Tom Foster 0dde1c9c27
Merge 4293659dc5 into 7d2de48cb4 2025-07-31 13:21:30 +00:00
Tom Foster 4293659dc5
Update data/api/client-server/capabilities.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:21:28 +01:00
Tom Foster 0051295e94
Update data/api/client-server/capabilities.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:20:39 +01:00
Tom Foster ea0277649b
Update data/api/client-server/capabilities.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:19:41 +01:00
Tom Foster c9057ed1b0
Update data/api/client-server/profile.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:19:04 +01:00
Tom Foster df9d3e6991
Update data/api/client-server/profile.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:18:26 +01:00
Tom Foster f5b9209443
Update data/api/client-server/capabilities.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:15:52 +01:00
Tom Foster c197a23a7e
Update changelogs/client_server/newsfragments/2071.feature
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
2025-07-31 14:14:45 +01:00
Tom Foster 0c6132ef8e Deprecate m.set_avatar_url and m.set_displayname capabilities 2025-07-31 14:13:51 +01:00
Tom Foster 7c18c4d091
Update data/api/client-server/capabilities.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:10:45 +01:00
Tom Foster c67980a58d
Update data/api/client-server/profile.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:10:39 +01:00
Tom Foster e78b073bb8
Update data/api/client-server/profile.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:10:32 +01:00
Tom Foster 4408198e49
Update data/api/client-server/profile.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:10:20 +01:00
Tom Foster 0a87d1b0a1
Update data/api/client-server/profile.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:10:07 +01:00
Tom Foster 3da3b18779
Update data/api/client-server/profile.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:10:00 +01:00
Tom Foster 6a8b542d2c
Update data/api/client-server/profile.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:09:53 +01:00
Tom Foster 22a3405547
Update data/api/client-server/capabilities.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:09:45 +01:00
Tom Foster 3f5c14b679
Update data/api/client-server/capabilities.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:09:33 +01:00
Tom Foster 9357cea9ce
Update data/api/client-server/capabilities.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:09:18 +01:00
Tom Foster 48ee9cf59c
Update data/api/client-server/profile.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:09:03 +01:00
Tom Foster 648c05002a
Update data/api/client-server/profile.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:08:41 +01:00
Tom Foster b834933171
Update data/api/client-server/profile.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:08:24 +01:00
Tom Foster 5a082635f7
Update data/api/client-server/profile.yaml
Co-authored-by: Johannes Marbach <n0-0ne+github@mailbox.org>
2025-07-31 14:08:13 +01:00
Tom Foster 569c8aafa3 Merge upstream main into MSC4133 2025-07-31 11:25:13 +01:00
4 changed files with 56 additions and 40 deletions

View file

@ -0,0 +1 @@
Deprecate `m.set_avatar_url` and `m.set_displayname` capabilities, as per [MSC4133](https://github.com/matrix-org/matrix-spec-proposals/pull/4133).

View file

@ -1 +1 @@
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, which deprecates the previous `m.set_avatar_url` and `m.set_displayname` capabilities. Stabilised keys are explicitly enumerated, and custom keys must conform to the Common Namespaced Identifier Grammar. Update user profile endpoints to handle custom fields, and add a new `m.profile_fields` capability,as per [MSC4133](https://github.com/matrix-org/matrix-spec-proposals/pull/4133).

View file

@ -78,12 +78,20 @@ paths:
description: | description: |
**Deprecated:** Capability to indicate if the user can change their display name. **Deprecated:** Capability to indicate if the user can change their display name.
Refer to `m.profile_fields` for extended profile management. Refer to `m.profile_fields` for extended profile management.
For backwards compatibility, servers that directly or indirectly include the
`displayname` profile field in the `m.profile_fields` capability MUST also
set this capability accordingly.
m.set_avatar_url: m.set_avatar_url:
deprecated: true deprecated: true
$ref: '#/components/schemas/booleanCapability' $ref: '#/components/schemas/booleanCapability'
description: | description: |
**Deprecated:** Capability to indicate if the user can change their avatar. **Deprecated:** Capability to indicate if the user can change their avatar.
Refer to `m.profile_fields` for extended profile management. Refer to `m.profile_fields` for extended profile management.
For backwards compatibility, servers that directly or indirectly include the
`avatar_url` profile field in the `m.profile_fields` capability MUST also
set this capability accordingly.
m.3pid_changes: m.3pid_changes:
$ref: '#/components/schemas/booleanCapability' $ref: '#/components/schemas/booleanCapability'
description: Capability to indicate if the user can change 3PID associations description: Capability to indicate if the user can change 3PID associations
@ -93,14 +101,14 @@ paths:
description: Capability to indicate if the user can generate tokens to log further description: Capability to indicate if the user can generate tokens to log further
clients into their account. clients into their account.
m.profile_fields: m.profile_fields:
x-addedInMatrixVersion: "1.14" x-addedInMatrixVersion: "1.16"
type: object type: object
title: ProfileFieldsCapability title: ProfileFieldsCapability
description: Capability to indicate if the user can set or modify extended profile fields via description: Capability to indicate if the user can set or modify extended profile fields via
[`PUT /_matrix/client/v3/profile/{userId}/{keyName}`](/client-server-api/#put_matrixclientv3profileuseridkeyname). [`PUT /_matrix/client/v3/profile/{userId}/{keyName}`](/client-server-api/#put_matrixclientv3profileuseridkeyname).
If absent, clients should assume custom profile fields are supported, provided the If absent, clients SHOULD assume custom profile fields are supported, provided the
response from [`/versions`](/client-server-api/#get_matrixclientversions) indicates homeserver advertises a specification version that includes `m.profile_fields` in the
support for a sufficiently recent spec version. [`/versions`](/client-server-api/#get_matrixclientversions) response.
properties: properties:
allowed: allowed:
type: array type: array
@ -111,18 +119,21 @@ paths:
type: string type: string
example: example:
- "m.example_field" - "m.example_field"
- "org.example/job_title" - "org.example.job_title"
disallowed: disallowed:
type: array type: array
description: List of disallowed additional custom profile field keys. A `*` can be used as description: If `enabled` is `true`, a list of profile fields that clients are _not_ allowed to
a wildcard to match any sequence of characters. Ignored if an allowed list is provided. create, modify or delete. Clients SHOULD assume all fields not in this list to be unmanaged
and available for their use.
Only one of `allowed` and `disallowed` is permitted at the same time.
items: items:
type: string type: string
example: example:
- "org.example.secret_field" - "org.example.managed_field"
enabled: enabled:
type: boolean type: boolean
description: `true` if the user can set or modify any extended profile fields, `false` otherwise. description: "`true` if the user can create, update or delete any profile fields, `false` otherwise."
example: true example: true
required: required:
- enabled - enabled

View file

@ -19,16 +19,16 @@ paths:
"/profile/{userId}/{keyName}": "/profile/{userId}/{keyName}":
put: put:
x-changedInMatrixVersion: x-changedInMatrixVersion:
"1.14": Endpoint now accepts variable `keyName` parameter. "1.16": This endpoint now accepts a variable `keyName` parameter.
summary: Set a profile field for a user. summary: Set a profile field for a user.
description: |- description: |-
Set or update a profile field for a user. Must be authenticated with an Set or update a profile field for a user. Must be authenticated with an
access token authorised to make changes. Servers MAY impose size limits access token authorised to make changes. Servers MAY impose size limits
on individual fields, and the total profile MUST be under 64 KiB. on individual fields, and the total profile MUST be under 64 KiB.
**Note**: Setting a field to `null` keeps the key but with a `null` value, Servers MAY reject `null` values. Servers that accept `null` values SHOULD store
which some servers may reject. To remove a field completely, use the them rather than treating `null` as a deletion request. Clients that want to delete a
`DELETE` endpoint instead. field, including its key and value, SHOULD use the `DELETE` endpoint instead.
operationId: setProfileField operationId: setProfileField
security: security:
- accessTokenQuery: [] - accessTokenQuery: []
@ -43,7 +43,7 @@ paths:
type: string type: string
- in: path - in: path
name: keyName name: keyName
description: The profile field key name to set. It must be either description: The profile field key name to set. This MUST be either
`avatar_url`, `displayname`, or a custom field following the `avatar_url`, `displayname`, or a custom field following the
[Common Namespaced Identifier Grammar](/appendices/#common-namespaced-identifier-grammar). [Common Namespaced Identifier Grammar](/appendices/#common-namespaced-identifier-grammar).
required: true required: true
@ -61,13 +61,13 @@ paths:
schema: schema:
type: object type: object
minProperties: 1 minProperties: 1
additionalProperties:
description: The JSON object must include a property whose key description: The JSON object must include a property whose key
matches the `keyName` specified in the URL. For `avatar_url`, matches the `keyName` specified in the URL. For `avatar_url`,
the value must be an MXC URI string. For `displayname`, the value the value must be an MXC URI string. For `displayname`, the value
must be a string. For custom keys, any JSON type is allowed - must be a string. For custom keys, any JSON type is allowed -
servers may not validate these values, but clients should follow servers may not validate these values, but clients should follow
the format defined for that key. the format defined for that key.
additionalProperties: true
example: { "displayname": "Alice Wonderland" } example: { "displayname": "Alice Wonderland" }
responses: responses:
"200": "200":
@ -80,9 +80,16 @@ paths:
response: response:
value: {} value: {}
"400": "400":
description: The request is malformed, contains invalid JSON, missing description: The input was invalid in some way. This can include one
a required parameter, specifies an invalid key, or exceeds allowed of the following error codes:
size limits.
- `M_BAD_JSON`: The provided value is not valid JSON.
- `M_MISSING_PARAM`: The required `{keyName}` property is
missing from the request body.
- `M_PROFILE_TOO_LARGE`: Storing the supplied value would
make the profile exceed its maximum allowed size of 64 KiB.
- `M_KEY_TOO_LARGE`: The supplied profile key exceeds the
maximum allowed key length of 255 bytes.
content: content:
application/json: application/json:
schema: schema:
@ -125,10 +132,9 @@ paths:
- User data - User data
get: get:
x-changedInMatrixVersion: x-changedInMatrixVersion:
"1.14": Endpoint now accepts variable `keyName` parameter. "1.16": This endpoint now accepts a variable `keyName` parameter.
summary: Get a profile field for a user. summary: Get a profile field for a user.
description: Get the value of a profile field for a user. Any individual description: Get the value of a profile field for a user.
field must be within the total profile limit of 64 KiB.
operationId: getProfileField operationId: getProfileField
parameters: parameters:
- in: path - in: path
@ -155,13 +161,13 @@ paths:
application/json: application/json:
schema: schema:
type: object type: object
minProperties: 1 description: If a value is stored for `keyName`, the JSON response
additionalProperties: includes a property whose key matches the `keyName` specified
description: The JSON response includes a property whose key in the URL. For `avatar_url`, the value will be an MXC URI string.
matches the `keyName` specified in the URL. For `avatar_url`, For `displayname`, the value will be a string. For custom keys, any
the value will be an MXC URI string. For `displayname`, the JSON type is possible - clients should expect the format defined
value will be a string. For custom keys, any JSON type is for that key.
possible - clients should expect the format defined for that key. additionalProperties: true
examples: examples:
response: response:
value: { "displayname": "Alice" } value: { "displayname": "Alice" }
@ -186,7 +192,7 @@ paths:
tags: tags:
- User data - User data
delete: delete:
x-addedInMatrixVersion: "1.14" x-addedInMatrixVersion: "1.16"
summary: Remove a profile field from a user. summary: Remove a profile field from a user.
description: Remove a specific field from a user's profile. description: Remove a specific field from a user's profile.
operationId: deleteProfileField operationId: deleteProfileField
@ -266,8 +272,6 @@ paths:
Get the complete profile for a user. The response includes `avatar_url` Get the complete profile for a user. The response includes `avatar_url`
and `displayname` (unless set to `null`, as they can only be strings) and `displayname` (unless set to `null`, as they can only be strings)
plus any custom profile fields. plus any custom profile fields.
**Note**: The complete profile must be under 64 KiB.
operationId: getUserProfile operationId: getUserProfile
parameters: parameters:
- in: path - in: path
@ -292,7 +296,7 @@ paths:
displayname: displayname:
type: string type: string
additionalProperties: additionalProperties:
x-addedInMatrixVersion: "1.14" x-addedInMatrixVersion: "1.16"
description: Any additional profile field value; may be any description: Any additional profile field value; may be any
valid JSON type, with keys following the valid JSON type, with keys following the
[Common Namespaced Identifier Grammar](/appendices/#common-namespaced-identifier-grammar). [Common Namespaced Identifier Grammar](/appendices/#common-namespaced-identifier-grammar).