mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-04-30 06:04:10 +02:00
Compare commits
4 commits
f4496d27c3
...
9d85039b48
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d85039b48 | ||
|
|
70c7d59caa | ||
|
|
a6fb075d92 | ||
|
|
064e8f1411 |
|
|
@ -0,0 +1,3 @@
|
||||||
|
The optional `submit_url` response parameter of the `/requestToken` endpoints uses the same request
|
||||||
|
and response parameters and error codes as the Identity Service API's `POST /_matrix/identity/v2/validate/email/submitToken`,
|
||||||
|
as per [MSC4183](https://github.com/matrix-org/matrix-spec-proposals/pull/4183).
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
Clarify the error codes that can be returned with a 400 HTTP status code by the `POST /_matrix/identity/v2/validate/email/submitToken`
|
||||||
|
and `POST /_matrix/identity/v2/validate/msisdn/submitToken` endpoints, introducing the `M_TOKEN_INCORRECT`
|
||||||
|
error code, as per [MSC4183](https://github.com/matrix-org/matrix-spec-proposals/pull/4183).
|
||||||
1
changelogs/internal/newsfragments/2222.clarification
Normal file
1
changelogs/internal/newsfragments/2222.clarification
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Clarify vendor prefixing requirements.
|
||||||
|
|
@ -408,41 +408,9 @@ development or testing data.
|
||||||
that a particular MSC works) do not have to follow this process.
|
that a particular MSC works) do not have to follow this process.
|
||||||
|
|
||||||
1. Have an idea for a feature.
|
1. Have an idea for a feature.
|
||||||
1. Implement the feature using unstable endpoints, vendor prefixes, and
|
1. Implement the feature using [unstable endpoints, vendor prefixes, and
|
||||||
unstable feature flags as appropriate.
|
unstable feature flags](#unstable-endpoints-features-and-vendor-prefixes)
|
||||||
- When using unstable endpoints, they MUST include a vendor
|
as appropriate.
|
||||||
prefix. For example:
|
|
||||||
`/_matrix/client/unstable/com.example/login`. Vendor prefixes
|
|
||||||
throughout Matrix always use the Java package naming convention.
|
|
||||||
The MSC for the feature should identify which preferred vendor
|
|
||||||
prefix is to be used by early adopters.
|
|
||||||
- Note that unstable namespaces do not automatically inherit
|
|
||||||
endpoints from stable namespaces: for example, the fact that
|
|
||||||
`/_matrix/client/r0/sync` exists does not imply that
|
|
||||||
`/_matrix/client/unstable/com.example/sync` exists.
|
|
||||||
- If the client needs to be sure the server supports the feature,
|
|
||||||
an unstable feature flag that MUST be vendor prefixed is to be
|
|
||||||
used. This kind of flag shows up in the `unstable_features`
|
|
||||||
section of `/versions` as, for example, `com.example.new_login`.
|
|
||||||
The MSC for the feature should identify which preferred feature
|
|
||||||
flag is to be used by early adopters.
|
|
||||||
- When using this approach correctly, the implementation can
|
|
||||||
ship/release the feature at any time, so long as the
|
|
||||||
implementation is able to accept the technical debt that results
|
|
||||||
from needing to provide adequate backwards and forwards
|
|
||||||
compatibility. The implementation MUST support the flag (and
|
|
||||||
server-side implementation) disappearing and be generally safe
|
|
||||||
for users. Note that implementations early in the MSC review
|
|
||||||
process may also be required to provide backwards compatibility
|
|
||||||
with earlier editions of the proposal.
|
|
||||||
- If the implementation cannot support the technical debt (or if
|
|
||||||
it's impossible to provide forwards/backwards compatibility -
|
|
||||||
e.g. a user authentication change which can't be safely rolled
|
|
||||||
back), the implementation should not attempt to implement the
|
|
||||||
feature and should instead wait for a spec release.
|
|
||||||
- If at any point after early release, the idea changes in a
|
|
||||||
backwards-incompatible way, the feature flag should also change
|
|
||||||
so that implementations can adapt as needed.
|
|
||||||
1. In parallel, or ahead of implementation, open an MSC and solicit
|
1. In parallel, or ahead of implementation, open an MSC and solicit
|
||||||
review per above.
|
review per above.
|
||||||
1. Before FCP can be called, the Spec Core Team will require evidence
|
1. Before FCP can be called, the Spec Core Team will require evidence
|
||||||
|
|
@ -452,10 +420,7 @@ that a particular MSC works) do not have to follow this process.
|
||||||
forwards/backwards compatibility concerns mentioned here.
|
forwards/backwards compatibility concerns mentioned here.
|
||||||
1. The FCP process is completed, and assuming nothing is flagged the
|
1. The FCP process is completed, and assuming nothing is flagged the
|
||||||
MSC lands.
|
MSC lands.
|
||||||
1. Implementations can now switch to using stable prefixes
|
1. Implementations can now switch to using stable prefixes, assuming that the change
|
||||||
(for example, for an endpoint, moving from
|
|
||||||
`/unstable/org.matrix.mscxxxx/frobnicate`
|
|
||||||
to `/v1/frobnicate`), assuming that the change
|
|
||||||
is backwards compatible with older implementations. In the rare occasion
|
is backwards compatible with older implementations. In the rare occasion
|
||||||
where backwards compatibility is not possible without a new spec release,
|
where backwards compatibility is not possible without a new spec release,
|
||||||
implementations should continue to use unstable prefixes.
|
implementations should continue to use unstable prefixes.
|
||||||
|
|
@ -471,13 +436,6 @@ that a particular MSC works) do not have to follow this process.
|
||||||
started supporting the new spec release, some noise should be raised
|
started supporting the new spec release, some noise should be raised
|
||||||
in the general direction of the implementation.
|
in the general direction of the implementation.
|
||||||
|
|
||||||
{{% boxes/note %}}
|
|
||||||
MSCs MUST still describe what the stable endpoints/feature looks like
|
|
||||||
with a note towards the bottom for what the unstable feature
|
|
||||||
flag/prefixes are. For example, an MSC would propose `/_matrix/client/r0/new/endpoint`, not `/_matrix/client/unstable/
|
|
||||||
com.example/new/endpoint`.
|
|
||||||
{{% /boxes/note %}}
|
|
||||||
|
|
||||||
In summary:
|
In summary:
|
||||||
|
|
||||||
- Implementations MUST NOT use stable endpoints before the MSC has
|
- Implementations MUST NOT use stable endpoints before the MSC has
|
||||||
|
|
@ -489,14 +447,90 @@ In summary:
|
||||||
- Implementations SHOULD be wary of the technical debt they are
|
- Implementations SHOULD be wary of the technical debt they are
|
||||||
incurring by moving faster than the spec.
|
incurring by moving faster than the spec.
|
||||||
- The vendor prefix is chosen by the developer of the feature, using
|
- The vendor prefix is chosen by the developer of the feature, using
|
||||||
the Java package naming convention. The foundation's preferred
|
the Java package naming convention.
|
||||||
vendor prefix is `org.matrix`.
|
|
||||||
- The vendor prefixes, unstable feature flags, and unstable endpoints
|
- The vendor prefixes, unstable feature flags, and unstable endpoints
|
||||||
should be included in the MSC, though the MSC MUST be written in a
|
should be included in the MSC, though the MSC MUST be written in a
|
||||||
way that proposes new stable endpoints. Typically this is solved by
|
way that proposes new stable endpoints. Typically this is solved by
|
||||||
a small table at the bottom mapping the various values from stable
|
a small table at the bottom mapping the various values from stable
|
||||||
to unstable.
|
to unstable.
|
||||||
|
|
||||||
|
#### Unstable endpoints, features and vendor prefixes
|
||||||
|
|
||||||
|
Unstable endpoints MUST use `/unstable` as the endpoint version and a
|
||||||
|
vendor prefix in Java package naming format. For example:
|
||||||
|
`/_matrix/client/unstable/com.example.mscxxxx/login`.
|
||||||
|
|
||||||
|
{{% boxes/note %}}
|
||||||
|
Proposal authors operating with a Matrix.org Foundation mandate SHOULD use
|
||||||
|
a vendor prefix within the `org.matrix` namespace. This namespace is otherwise
|
||||||
|
restricted. Authors who don't own a domain MAY use the `io.github` namespace
|
||||||
|
instead.
|
||||||
|
{{% /boxes/note %}}
|
||||||
|
|
||||||
|
Note that unstable namespaces do not automatically inherit endpoints from
|
||||||
|
stable namespaces: for example, the fact that `/_matrix/client/v3/sync`
|
||||||
|
exists does not imply that `/_matrix/client/unstable/com.example.mscxxxx/sync`
|
||||||
|
exists.
|
||||||
|
|
||||||
|
Vendor prefixes MUST also be used for:
|
||||||
|
|
||||||
|
- New parameters on existing endpoints. For example:
|
||||||
|
`/_matrix/client/v3/publicRooms?com.example.mscxxxx.ordered_by=member_count`.
|
||||||
|
- New properties in existing JSON objects. For example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"avatar_url": "mxc://matrix.org/SDGdghriugerRg",
|
||||||
|
"displayname": "Alice Margatroid",
|
||||||
|
"com.example.mscxxxx.phone": [{
|
||||||
|
"type": "landline",
|
||||||
|
"number": "+1-206-555-7000"
|
||||||
|
}],
|
||||||
|
...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
- New values for existing parameters or properties. For example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"errcode": "COM.EXAMPLE.MSCXXXX.M_INVALID_EMAIL",
|
||||||
|
"error": "The email address you provided is invalid."
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
If the client needs to be sure the server supports the feature, an
|
||||||
|
unstable feature flag that MUST also be vendor prefixed is to be used.
|
||||||
|
This flag shows up in the `unstable_features` section of
|
||||||
|
[`/_matrix/client/versions`](/client-server-api/#get_matrixclientversions)
|
||||||
|
as, for example, `com.example.mscxxxx.new_login`.
|
||||||
|
|
||||||
|
{{% boxes/note %}}
|
||||||
|
MSCs MUST still describe what the stable endpoints/feature looks like
|
||||||
|
with a note towards the bottom for what the unstable feature
|
||||||
|
flag/prefixes are. For example, an MSC would propose `/_matrix/client/v1/new/endpoint`,
|
||||||
|
not `/_matrix/client/unstable/com.example.mscxxxx/new/endpoint`.
|
||||||
|
{{% /boxes/note %}}
|
||||||
|
|
||||||
|
When using this approach correctly, the implementation can release
|
||||||
|
the feature at any time, so long as the implementation is able to
|
||||||
|
accept the technical debt that results from needing to provide
|
||||||
|
adequate backwards and forwards compatibility. The implementation
|
||||||
|
MUST support the flag (and server-side implementation) disappearing
|
||||||
|
and be generally safe for users. Note that implementations early in
|
||||||
|
the MSC review process may also be required to provide backwards
|
||||||
|
compatibility with earlier editions of the proposal.
|
||||||
|
|
||||||
|
If the implementation cannot support the technical debt (or if it's
|
||||||
|
impossible to provide forwards/backwards compatibility - e.g. a user
|
||||||
|
authentication change which can't be safely rolled back), the
|
||||||
|
implementation should not attempt to implement the feature and should
|
||||||
|
instead wait for a spec release.
|
||||||
|
|
||||||
|
If at any point after early release, the idea changes in a
|
||||||
|
backwards-incompatible way, the feature flag should also change so
|
||||||
|
that implementations can adapt as needed.
|
||||||
|
|
||||||
### Placeholder MSCs
|
### Placeholder MSCs
|
||||||
|
|
||||||
Some proposals may contain security-sensitive or private context which can't be
|
Some proposals may contain security-sensitive or private context which can't be
|
||||||
|
|
|
||||||
|
|
@ -24,16 +24,22 @@ properties:
|
||||||
submit_url:
|
submit_url:
|
||||||
type: string
|
type: string
|
||||||
format: uri
|
format: uri
|
||||||
|
x-changedInMatrixVersion:
|
||||||
|
"1.18": |-
|
||||||
|
The URL has the same request and response parameters and error codes as
|
||||||
|
the Identity Service API's endpoint.
|
||||||
description: |-
|
description: |-
|
||||||
An optional field containing a URL where the client must submit the
|
An optional field containing a URL where the client must submit the
|
||||||
validation token to, with identical parameters to the Identity Service
|
validation token, with identical request and response parameters and error
|
||||||
API's `POST /validate/email/submitToken` endpoint (without the requirement
|
codes to the Identity Service API's
|
||||||
for an access token). The homeserver must send this token to the user (if
|
[`POST /_matrix/identity/v2/validate/email/submitToken`](/identity-service-api/#post_matrixidentityv2validateemailsubmittoken)
|
||||||
applicable), who should then be prompted to provide it to the client.
|
endpoint (without the requirement for an access token). The homeserver
|
||||||
|
must send this token to the user (if applicable), who should then be
|
||||||
|
prompted to provide it to the client.
|
||||||
|
|
||||||
If this field is not present, the client can assume that verification
|
If this field is not present, the client can assume that verification
|
||||||
will happen without the client's involvement provided the homeserver
|
will happen without the client's involvement provided the homeserver
|
||||||
advertises this specification version in the `/versions` response
|
advertises this specification version in the [`GET /versions`](/client-server-api/#get_matrixclientversions)
|
||||||
(ie: r0.5.0).
|
response (ie: r0.5.0).
|
||||||
example: "https://example.org/path/to/submitToken"
|
example: "https://example.org/path/to/submitToken"
|
||||||
required: ['sid']
|
required: ['sid']
|
||||||
|
|
|
||||||
|
|
@ -153,6 +153,25 @@ paths:
|
||||||
value: {
|
value: {
|
||||||
"success": true
|
"success": true
|
||||||
}
|
}
|
||||||
|
"400":
|
||||||
|
x-addedInMatrixVersion: "1.18"
|
||||||
|
description: |
|
||||||
|
An error occurred. Some possible errors are:
|
||||||
|
|
||||||
|
- `M_TOKEN_INCORRECT`: The token that the user entered to validate the session is
|
||||||
|
incorrect.
|
||||||
|
- `M_INVALID_PARAM`: One of the supplied parameters is not valid.
|
||||||
|
- `M_SESSION_EXPIRED`: The validation session in question has expired.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: ../client-server/definitions/errors/error.yaml
|
||||||
|
examples:
|
||||||
|
response:
|
||||||
|
value: {
|
||||||
|
"errcode": "M_TOKEN_INCORRECT",
|
||||||
|
"error": "The token is incorrect"
|
||||||
|
}
|
||||||
"403":
|
"403":
|
||||||
description: |
|
description: |
|
||||||
The user must do something in order to use this endpoint. One example
|
The user must do something in order to use this endpoint. One example
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,25 @@ paths:
|
||||||
value: {
|
value: {
|
||||||
"success": true
|
"success": true
|
||||||
}
|
}
|
||||||
|
"400":
|
||||||
|
x-addedInMatrixVersion: "1.18"
|
||||||
|
description: |
|
||||||
|
An error occurred. Some possible errors are:
|
||||||
|
|
||||||
|
- `M_TOKEN_INCORRECT`: The token that the user entered to validate the session is
|
||||||
|
incorrect.
|
||||||
|
- `M_INVALID_PARAM`: One of the supplied parameters is not valid.
|
||||||
|
- `M_SESSION_EXPIRED`: The validation session in question has expired.
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: ../client-server/definitions/errors/error.yaml
|
||||||
|
examples:
|
||||||
|
response:
|
||||||
|
value: {
|
||||||
|
"errcode": "M_TOKEN_INCORRECT",
|
||||||
|
"error": "The token is incorrect"
|
||||||
|
}
|
||||||
"403":
|
"403":
|
||||||
description: |
|
description: |
|
||||||
The user must do something in order to use this endpoint. One example
|
The user must do something in order to use this endpoint. One example
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue