-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Clarifications to AS spec, including MSC3905 #1305
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b711536
Clean up AS registration definitions
richvdh d0442ec
Clarify that appservices can only watch local users
richvdh 4ba23ed
changelog
richvdh a344dfa
Update changelogs/application_service/newsfragments/1305.clarification
richvdh a959df7
Apply suggestions from code review
richvdh 321d55c
wrap text
richvdh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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. Events will be sent to the AS if they | ||
take place in a room with an ID matching one of the namespaces. | ||
richvdh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
aliases: | ||
allOf: | ||
- $ref: namespace_list.yaml | ||
- description: |- | ||
A list of namespaces defining the room aliases that the application | ||
service is interested in. Events will be sent to the AS if they | ||
take place in a room with an alias matching one of the namespaces. | ||
richvdh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.
Not entirely convinced this is an improvement in clarity, personally. The fact that namespaces are defined via regular expressions is a detail which I think is better left for the formal definition below rather in this overview.
(In any case, we'd want to say "namespace regular expressions" rather than "namespace regex patterns").
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.
"namespace regular expressions" sounds good to me 👍
I think it makes sense to mention when we're talking about matching. It's immediately apparent and understandable for anyone slightly familiar with regex how it matches then.