forked from matrix-org/matrix-spec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clarifications to AS spec, including MSC3905 (matrix-org#1305)
Primarily this is the spec for MSC3905, but I've also taken the opportunity to clean up the section a bit and move the definition out to a .yaml file.
- Loading branch information
Showing
4 changed files
with
137 additions
and
57 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
changelogs/application_service/newsfragments/1305.clarification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Clarify that application services can only register an interest in local users, as per [MSC3905](https://github.com/matrix-org/matrix-spec-proposals/issues/3905). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
data/api/application-service/definitions/namespace_list.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2022 The Matrix.org Foundation C.I.C | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
type: array | ||
items: | ||
type: object | ||
title: Namespace | ||
properties: | ||
regex: | ||
type: string | ||
description: A POSIX regular expression defining which values this namespace includes. | ||
exclusive: | ||
type: boolean | ||
description: A true or false value stating whether this application service has exclusive access to events within this namespace. | ||
required: | ||
- regex | ||
- exclusive |
74 changes: 74 additions & 0 deletions
74
data/api/application-service/definitions/registration.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Copyright 2022 The Matrix.org Foundation C.I.C | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
type: object | ||
title: Registration | ||
properties: | ||
id: | ||
type: string | ||
description: A unique, user-defined ID of the application service which will never change. | ||
url: | ||
type: string | ||
description: The URL for the application service. May include a path after the domain name. Optionally set to null if no traffic is required. | ||
as_token: | ||
type: string | ||
description: A secret token that the application service will use to authenticate requests to the homeserver. | ||
hs_token: | ||
type: string | ||
description: A secret token that the homeserver will use authenticate requests to the application service. | ||
sender_localpart: | ||
type: string | ||
description: The localpart of the user associated with the application service. | ||
namespaces: | ||
type: object | ||
title: Namespaces | ||
description: The namespaces that the application service is interested in. | ||
properties: | ||
users: | ||
allOf: | ||
- $ref: namespace_list.yaml | ||
- description: |- | ||
A list of namespaces defining the user IDs that the application | ||
service is interested in. Events will be sent to the AS if a | ||
local user matching one of the namespaces is the target of the event, | ||
or is a joined member of the room where the event occurred. | ||
rooms: | ||
allOf: | ||
- $ref: namespace_list.yaml | ||
- description: |- | ||
A list of namespaces defining the room IDs that the application | ||
service is interested in. All events sent in a room with an ID | ||
which matches one of the namespaces will be sent to the AS. | ||
aliases: | ||
allOf: | ||
- $ref: namespace_list.yaml | ||
- description: |- | ||
A list of namespaces defining the room aliases that the application | ||
service is interested in. All events sent in a room with an alias | ||
which matches one of the namespaces will be sent to the AS. | ||
rate_limited: | ||
type: boolean | ||
description: Whether requests from masqueraded users are rate-limited. The sender is excluded. | ||
protocols: | ||
type: array | ||
description: The external protocols which the application service provides (e.g. IRC). | ||
items: | ||
type: string | ||
required: | ||
- id | ||
- url | ||
- as_token | ||
- hs_token | ||
- sender_localpart | ||
- namespaces |