mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-04-30 06:04:10 +02:00
Compare commits
4 commits
70d65b2e6d
...
c5ca5f9efa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c5ca5f9efa | ||
|
|
252de984cc | ||
|
|
a6112535bf | ||
|
|
ca801d1751 |
1
changelogs/client_server/newsfragments/2328.feature
Normal file
1
changelogs/client_server/newsfragments/2328.feature
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Add the `is_animated` flag to the `info` object of the `m.image` msgtype and the `m.sticker` event, as per [MSC4230](https://github.com/matrix-org/matrix-spec-proposals/pull/423O).
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Add link to JSON signing algorithm in server-server auth section for clarity. Contributed by @thetayloredman.
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Clarify the s2s profile query behaviour and responses.
|
||||||
|
|
@ -277,12 +277,12 @@ queried from multiple servers to mitigate against DNS spoofing.
|
||||||
|
|
||||||
Every HTTP request made by a homeserver is authenticated using public
|
Every HTTP request made by a homeserver is authenticated using public
|
||||||
key digital signatures. The request method, target and body are signed
|
key digital signatures. The request method, target and body are signed
|
||||||
by wrapping them in a JSON object and signing it using the JSON signing
|
by wrapping them in a JSON object and signing it using the [JSON signing
|
||||||
algorithm. The resulting signatures are added as an Authorization header
|
algorithm](/appendices#signing-json). The resulting signatures are added
|
||||||
with an auth scheme of `X-Matrix`. Note that the target field should
|
as an Authorization header with an auth scheme of `X-Matrix`. Note that
|
||||||
include the full path starting with `/_matrix/...`, including the `?`
|
the target field should include the full path starting with `/_matrix/...`,
|
||||||
and any query parameters if present, but should not include the leading
|
including the `?` and any query parameters if present, but should not
|
||||||
`https:`, nor the destination server's hostname.
|
include the leading `https:`, nor the destination server's hostname.
|
||||||
|
|
||||||
Step 1 sign JSON:
|
Step 1 sign JSON:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,22 +111,26 @@ paths:
|
||||||
summary: Query for profile information about a given user
|
summary: Query for profile information about a given user
|
||||||
description: |-
|
description: |-
|
||||||
Performs a query to get profile information, such as a display name or avatar,
|
Performs a query to get profile information, such as a display name or avatar,
|
||||||
for a given user. Homeservers should only query profiles for users that belong
|
for a given user. Homeservers MUST only query profiles for users that belong
|
||||||
to the target server (identified by the [server name](/appendices/#server-name)
|
to the target server (identified by the [server name](/appendices/#server-name)
|
||||||
in the user ID).
|
in the user ID).
|
||||||
|
|
||||||
Servers may wish to cache the response to this query to avoid requesting the
|
Responding servers MAY
|
||||||
information too often.
|
- allow users to set arbitrary key/value pairs in their profile in addition to the
|
||||||
|
specified pairs
|
||||||
|
- deny profile look-up over federation by responding with 403 and an error code of
|
||||||
|
`M_FORBIDDEN`
|
||||||
|
- omit certain key/value pairs in the response
|
||||||
|
|
||||||
Servers MAY deny profile look-up over federation by responding with 403 and an
|
Requesting servers MAY wish to cache the response to this query to avoid requesting the
|
||||||
error code of `M_FORBIDDEN`.
|
information too often.
|
||||||
operationId: queryProfile
|
operationId: queryProfile
|
||||||
security:
|
security:
|
||||||
- signedRequest: []
|
- signedRequest: []
|
||||||
parameters:
|
parameters:
|
||||||
- in: query
|
- in: query
|
||||||
name: user_id
|
name: user_id
|
||||||
description: The user ID to query. Must be a user local to the receiving homeserver.
|
description: The user ID to query. MUST be a user local to the receiving homeserver.
|
||||||
required: true
|
required: true
|
||||||
example: "@someone:example.org"
|
example: "@someone:example.org"
|
||||||
schema:
|
schema:
|
||||||
|
|
@ -134,24 +138,24 @@ paths:
|
||||||
- in: query
|
- in: query
|
||||||
name: field
|
name: field
|
||||||
description: |-
|
description: |-
|
||||||
The field to query. If specified, the server will only return the given field
|
The field of the profile to query. If specified, the server MUST only return the
|
||||||
in the response. If not specified, the server will return the full profile for
|
given field in the response. If not specified, the server MUST return the full,
|
||||||
the user.
|
public, profile for the user.
|
||||||
|
|
||||||
|
Defined values are `displayname`, `avatar_url` and `m.tz`. In addition to these
|
||||||
|
servers MAY allow users to set additional key/value pairs.
|
||||||
schema:
|
schema:
|
||||||
type: string
|
type: string
|
||||||
enum:
|
|
||||||
- displayname
|
|
||||||
- avatar_url
|
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
description: |-
|
description: |-
|
||||||
The profile for the user. If a `field` is specified in the request, only the
|
The profile for the user. If a `field` is specified in the request, only the
|
||||||
matching field should be included in the response. If no `field` was specified,
|
matching field MUST included in the response. If no `field` was specified,
|
||||||
the response should include the fields of the user's profile that can be made
|
the response MUST include the fields of the user's profile that can be made
|
||||||
public, such as the display name and avatar.
|
public, such as the display name and avatar.
|
||||||
|
|
||||||
If the user does not have a particular field set on their profile, the server
|
If the user does not have a particular field set on their profile, the server
|
||||||
should exclude it from the response body or give it the value `null`.
|
MUST either exclude it from the response body or give it the value `null`.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
|
|
@ -160,20 +164,20 @@ paths:
|
||||||
displayname:
|
displayname:
|
||||||
type: string
|
type: string
|
||||||
description: |-
|
description: |-
|
||||||
The display name of the user. May be omitted if the user does not have a
|
The display name of the user. MUST either be omitted or set to `null` if
|
||||||
display name set.
|
the user does not have a display name set.
|
||||||
example: John Doe
|
example: John Doe
|
||||||
avatar_url:
|
avatar_url:
|
||||||
type: string
|
type: string
|
||||||
description: |-
|
description: |-
|
||||||
The avatar URL for the user's avatar. May be omitted if the user does not
|
The avatar URL for the user's avatar. MUST either be omitted or set to
|
||||||
have an avatar set.
|
`null` if the user does not have an avatar set.
|
||||||
example: mxc://matrix.org/MyC00lAvatar
|
example: mxc://example.org/MyC00lAvatar
|
||||||
examples:
|
examples:
|
||||||
response:
|
response:
|
||||||
value: {
|
value: {
|
||||||
"displayname": "John Doe",
|
"displayname": "John Doe",
|
||||||
"avatar_url": "mxc://matrix.org/MyC00lAvatar"
|
"avatar_url": "mxc://example.org/MyC00lAvatar"
|
||||||
}
|
}
|
||||||
"403":
|
"403":
|
||||||
x-addedInMatrixVersion: "1.12"
|
x-addedInMatrixVersion: "1.12"
|
||||||
|
|
@ -190,7 +194,7 @@ paths:
|
||||||
"error": "Profile lookup over federation is disabled on this homeserver"
|
"error": "Profile lookup over federation is disabled on this homeserver"
|
||||||
}
|
}
|
||||||
"404":
|
"404":
|
||||||
description: The user does not exist or does not have a profile.
|
description: The user does not exist, does not have a profile or the queried field does not exist.
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,8 @@
|
||||||
"h": 398,
|
"h": 398,
|
||||||
"w": 394,
|
"w": 394,
|
||||||
"mimetype": "image/jpeg",
|
"mimetype": "image/jpeg",
|
||||||
"size": 31037
|
"size": 31037,
|
||||||
|
"is_animated": false
|
||||||
},
|
},
|
||||||
"url": "mxc://example.org/JWEIFJgwEIhweiWJE",
|
"url": "mxc://example.org/JWEIFJgwEIhweiWJE",
|
||||||
"msgtype": "m.image"
|
"msgtype": "m.image"
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@
|
||||||
"mimetype": "image/png",
|
"mimetype": "image/png",
|
||||||
"h": 200,
|
"h": 200,
|
||||||
"w": 140,
|
"w": 140,
|
||||||
"size": 73602
|
"size": 73602,
|
||||||
|
"is_animated": true
|
||||||
},
|
},
|
||||||
"h": 200,
|
"h": 200,
|
||||||
"thumbnail_url": "mxc://matrix.org/sHhqkFCvSkFwtmvtETOtKnLP",
|
"thumbnail_url": "mxc://matrix.org/sHhqkFCvSkFwtmvtETOtKnLP",
|
||||||
|
|
|
||||||
|
|
@ -34,5 +34,19 @@ properties:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: thumbnail_info.yaml
|
- $ref: thumbnail_info.yaml
|
||||||
description: Metadata about the image referred to in `thumbnail_url`.
|
description: Metadata about the image referred to in `thumbnail_url`.
|
||||||
|
is_animated:
|
||||||
|
x-addedInMatrixVersion: "1.18"
|
||||||
|
description: |-
|
||||||
|
If this flag is `true`, the original image SHOULD be assumed to be
|
||||||
|
animated. If this flag is `false`, the original image SHOULD be assumed to
|
||||||
|
NOT be animated.
|
||||||
|
|
||||||
|
If a sending client is unable to determine whether an image is animated,
|
||||||
|
it SHOULD leave the flag unset.
|
||||||
|
|
||||||
|
Receiving clients MAY use this flag to optimize whether to download the
|
||||||
|
original image rather than a thumbnail if it is animated, but they SHOULD
|
||||||
|
NOT trust this flag.
|
||||||
|
type: boolean
|
||||||
title: ImageInfo
|
title: ImageInfo
|
||||||
type: object
|
type: object
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue