-
-
Notifications
You must be signed in to change notification settings - Fork 118
Spec for 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
base: main
Are you sure you want to change the base?
Changes from all commits
fdc012a
212377e
1fc0118
b2e122f
59d2c62
ee9b5dd
8e9874a
41c64c8
82adcec
4f8999b
992cf9d
3311b08
f3c269d
9327793
5d5b561
76b48e2
79a1cde
17af55d
79af780
1cc93ec
0b0942d
7a3b0c0
9859e20
013502b
9889fe3
3a5e555
7ef1d9d
b5e2edf
d8cc250
37b1362
50eab35
dd4ea94
6183f24
6646146
569c8aa
5a08263
b834933
648c050
48ee9cf
9357cea
3f5c14b
22a3405
6a8b542
3da3b18
0a87d1b
4408198
e78b073
c67980a
7c18c4d
0c6132e
c197a23
f5b9209
df9d3e6
c9057ed
ea02776
0051295
4293659
578e1fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
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). |
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -73,11 +73,25 @@ paths: | |||||||||||||||||
- default | ||||||||||||||||||
tcpipuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
- 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. | ||||||||||||||||||
Refer to `m.profile_fields` for extended profile management. | ||||||||||||||||||
tcpipuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
|
||||||||||||||||||
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: | ||||||||||||||||||
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. | ||||||||||||||||||
Refer to `m.profile_fields` for extended profile management. | ||||||||||||||||||
tcpipuk marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||
|
||||||||||||||||||
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: | ||||||||||||||||||
$ref: '#/components/schemas/booleanCapability' | ||||||||||||||||||
description: Capability to indicate if the user can change 3PID associations | ||||||||||||||||||
|
@@ -86,6 +100,43 @@ 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.16" | ||||||||||||||||||
type: object | ||||||||||||||||||
title: ProfileFieldsCapability | ||||||||||||||||||
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, provided the | ||||||||||||||||||
homeserver advertises a specification version that includes `m.profile_fields` in the | ||||||||||||||||||
[`/versions`](/client-server-api/#get_matrixclientversions) response. | ||||||||||||||||||
properties: | ||||||||||||||||||
allowed: | ||||||||||||||||||
type: array | ||||||||||||||||||
description: List of allowed additional custom profile field keys. A `*` can be used as a | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. additional to what? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm actually not sure if
That only makes sense if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||
wildcard to match any sequence of characters. This list takes precedence over the | ||||||||||||||||||
Comment on lines
+115
to
+116
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not seeing this in the MSC either. I can imagine this might be useful if home servers want to block- or allow-list a certain namespace within profiles. This feels more like a new feature and less like a clarification that could be tacked onto the MSC post merging though. So it's probably better deferred to a separate proposal. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know it was discussed in the MSC, but looks like it didn't make it through... there was a lot of back-and-forth on a few features, so I've had to fix a few changes that I forgot weren't still in the MSC when it merged 🥲 |
||||||||||||||||||
disallowed list if both are provided. | ||||||||||||||||||
Comment on lines
+115
to
+117
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
The MSC says:
However, it's not clear to me why a server would specify both to begin with. I think we can rather say that only one is allowed at a time. I'm mindful that this might be a debatable interpretation of the proposal though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This pattern is usually for something like disallowed: my.*, allowed: my.field There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but the MSC says:
I'm saying rather than ignore the second list on the client, we could instead prevent the server from setting both at the same time. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I think your email reply got misrouted)
Oh! So this is about the same key showing up in Though I guess in this case could we not make this kind of duplication illegal in the spec? The server must simply not include a key in both lists at the same time (wildcards are not currently supported by the MSC). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that probably makes sense to do anyway. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The intention was to have either an "allowlist" model where a server can prescribe specific keys they allow users to set, or a "denylist" model where a server only forbids specific keys to be set. It seems the MSC doesn't technically allow wildcards, so we wouldn't need both of these to exist, though I'm slightly afraid of forbidding in the spec both keys from existing at the same time just in case the behaviour needs to change in the future to accommodate an extension like wildcards. The current MSC recommendation is that we simply prefer |
||||||||||||||||||
items: | ||||||||||||||||||
type: string | ||||||||||||||||||
example: | ||||||||||||||||||
- "m.example_field" | ||||||||||||||||||
- "org.example.job_title" | ||||||||||||||||||
disallowed: | ||||||||||||||||||
type: array | ||||||||||||||||||
description: If `enabled` is `true`, a list of profile fields that clients are _not_ allowed to | ||||||||||||||||||
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: | ||||||||||||||||||
type: string | ||||||||||||||||||
example: | ||||||||||||||||||
- "org.example.managed_field" | ||||||||||||||||||
enabled: | ||||||||||||||||||
type: boolean | ||||||||||||||||||
description: "`true` if the user can create, update or delete any profile fields, `false` otherwise." | ||||||||||||||||||
example: true | ||||||||||||||||||
required: | ||||||||||||||||||
- enabled | ||||||||||||||||||
examples: | ||||||||||||||||||
response: | ||||||||||||||||||
value: { | ||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could do with corresponding updates to the text sections that describe the capabilites: https://pr2071--matrix-spec-previews.netlify.app/client-server-api/#mset_displayname-capability, https://pr2071--matrix-spec-previews.netlify.app/client-server-api/#mset_avatar_url-capability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: tcpipuk#2