Skip to content

MSC4133: Update profile endpoints to support extended fields #2071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fdc012a
Describe MSC4133 profile endpoint changes
tcpipuk Feb 13, 2025
212377e
Merge branch 'matrix-org:main' into MSC4133
tcpipuk Feb 14, 2025
1fc0118
2071 change log
tcpipuk Feb 14, 2025
b2e122f
Update changelog from `clarification` to `feature`
tcpipuk Feb 14, 2025
59d2c62
Link to MSC4133 in endpoint descriptions
tcpipuk Feb 14, 2025
ee9b5dd
Correct types and errors
tcpipuk Feb 14, 2025
8e9874a
Simplify change log
tcpipuk Feb 14, 2025
41c64c8
Linkify MSC4133 in change log
tcpipuk Feb 14, 2025
82adcec
Clarify `avatar_url` should be MXC
tcpipuk Feb 14, 2025
4f8999b
Tweak wording on full profile `GET`
tcpipuk Feb 14, 2025
992cf9d
Clarify `null` behaviour for `PUT` and `DELETE`
tcpipuk Feb 14, 2025
3311b08
Alphabetise `avatar_url` and `displayname` and remove redundant descr…
tcpipuk Feb 14, 2025
f3c269d
Added capability
tcpipuk Feb 14, 2025
9327793
Inline information from MSC4133, remove links
tcpipuk Feb 14, 2025
5d5b561
Deprecate `m.set_displayname` and `m.set_avatar_url` capabilities
tcpipuk Feb 14, 2025
76b48e2
Specify CNIG pattern for custom fields
tcpipuk Feb 14, 2025
79a1cde
Remove reference to spec version in `m.profile_field` capability
tcpipuk Feb 14, 2025
17af55d
Fix broken link
tcpipuk Feb 14, 2025
79af780
Camel case for endpoint variables
tcpipuk Feb 14, 2025
1cc93ec
Attempt to make descriptions look better in HTML rendered spec
tcpipuk Feb 14, 2025
0b0942d
Clarify capability lists should support wildcards
tcpipuk Feb 14, 2025
7a3b0c0
Clarify in change log that `m.set_avatar_url` and `m.set_displayname`…
tcpipuk Feb 14, 2025
9859e20
Don't use reference for capability.
tcpipuk Feb 20, 2025
013502b
Mention replacement for `m.set_displayname` and `m.set_avatar_url` ca…
tcpipuk Feb 20, 2025
9889fe3
Use more accessible terminology than "glob"
tcpipuk Feb 20, 2025
3a5e555
Correct `PUT`/`GET` payload definitions
tcpipuk Feb 20, 2025
7ef1d9d
Add `x-changedInMatrixVersion`
tcpipuk Feb 20, 2025
b5e2edf
Add `x-addedInMatrixVersion`
tcpipuk Feb 20, 2025
d8cc250
Tag `x-addedInMatrixVersion` on `additionalProperties` in entire prof…
tcpipuk Feb 20, 2025
37b1362
Attempt to describe variable payload content
tcpipuk Feb 20, 2025
50eab35
Standardise line-wrapping and update `avatar_url` format to `mx-mxc-uri`
tcpipuk Feb 21, 2025
dd4ea94
Clarify why `avatar_url` and `displayname` can't be returned as `null`
tcpipuk Feb 21, 2025
6183f24
Clarify value validation requirements
tcpipuk Feb 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelogs/client_server/newsfragments/2071.feature
Original file line number Diff line number Diff line change
@@ -0,0 +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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see this has gone through a bit of iteration, so apologies for the back-and-forth, but honestly this feels rather wordy for a changelog entry. Take a look at the examples in https://spec.matrix.org/v1.14/changelog/v1.14/ (and previous versions): there are very few that run to more than a single sentence; if people want more details about what's actually changing they can easily click through to the PR; and the body of the spec contains "Changed in v1.14" notes.

I think a good trick here would be to have two separate changelog entries; so here, we want something like:

Suggested change
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).

... and then in changelogs/client_server/newsfragments/2071.deprecation, we want:

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

2 changes: 1 addition & 1 deletion content/client-server-api/modules/guest_access.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ for sending events:
The following API endpoints are allowed to be accessed by guest accounts
for their own account maintenance:

* [PUT /profile/{userId}/displayname](#put_matrixclientv3profileuseriddisplayname)
* [PUT /profile/{userId}/{key_name}](#put_matrixclientv3profileuseridkeyname)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* [PUT /profile/{userId}/{key_name}](#put_matrixclientv3profileuseridkeyname)
* [PUT /profile/{userId}/{keyName}](#put_matrixclientv3profileuseridkeyname)

* [GET /devices](#get_matrixclientv3devices)
* [GET /devices/{deviceId}](#get_matrixclientv3devicesdeviceid)
* [PUT /devices/{deviceId}](#put_matrixclientv3devicesdeviceid)
Expand Down
41 changes: 39 additions & 2 deletions data/api/client-server/capabilities.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,17 @@ paths:
- default
- available
m.set_displayname:
deprecated: true
$ref: '#/components/schemas/booleanCapability'
description: Capability to indicate if the user can change their display name.
description: |
**Deprecated:** Capability to indicate if the user can change their display name.
Please refer to `m.profile_fields` for extended profile management.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Please refer to `m.profile_fields` for extended profile management.
Refer to `m.profile_fields` for extended profile management.

m.set_avatar_url:
deprecated: true
$ref: '#/components/schemas/booleanCapability'
description: Capability to indicate if the user can change their avatar.
description: |
**Deprecated:** Capability to indicate if the user can change their avatar.
Please refer to `m.profile_fields` for extended profile management.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Please refer to `m.profile_fields` for extended profile management.
Refer to `m.profile_fields` for extended profile management.

m.3pid_changes:
$ref: '#/components/schemas/booleanCapability'
description: Capability to indicate if the user can change 3PID associations
Expand All @@ -86,6 +92,37 @@ 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:
x-addedInMatrixVersion: "1.14"
type: object
title: ProfileFieldsCapability
description: Capability to indicate if the user can set or modify extended profile fields.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Capability to indicate if the user can set or modify extended profile fields.
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).

If absent, clients should assume custom profile fields are supported.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If absent, clients should assume custom profile fields are supported.
If absent, clients should assume custom profile fields are supported, provided the
response from [`/versions`](/client-server-api/#get_matrixclientversions) indicates
support for a sufficiently recent spec version.

properties:
allowed:
type: array
description: List of allowed additional custom profile field keys. A `*` can be used as a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additional to what?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, avatar_url and displayname? We should say that explicitly.

wildcard to match any sequence of characters. This list takes precedence over the
Comment on lines +104 to +105
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A * can be used as a wildcard to match any sequence of characters.

Wait, where did this come from? This wasn't in the MSC, was it? Wildcarding opens up a whole new set of questions that I don't think we want to deal with.

disallowed list if both are provided.
items:
type: string
example:
- "m.example_field"
- "org.example/job_title"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't look like a valid Common Namespaced Identifier Grammar identifier, and is therefore not a great example?

disallowed:
type: array
description: List of disallowed additional custom profile field keys. A `*` can be used as
a wildcard to match any sequence of characters. Ignored if an allowed list is provided.
items:
type: string
example:
- "org.example.secret_field"
enabled:
type: boolean
description: True if the user can set or modify any extended profile fields, false otherwise.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: True if the user can set or modify any extended profile fields, false otherwise.
description: `true` if the user can set or modify any extended profile fields, `false` otherwise.

example: true
required:
- enabled
examples:
response:
value: {
Expand Down
Loading