-
Notifications
You must be signed in to change notification settings - Fork 416
MSC2346: Bridge information state event #2346
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
Open
Half-Shot
wants to merge
23
commits into
old_master
Choose a base branch
from
hs/msc-bridge-inf
base: old_master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
fa30188
Initial WIP of proposal
Half-Shot e5daeb9
2346
Half-Shot e13cbec
Various updates to take this out of WIP
Half-Shot e887a08
Backticks around location header
Half-Shot dfba42d
Clarify fields
Half-Shot 38e635a
Add some example event bodys
Half-Shot 0103c30
Small fixes
Half-Shot ffc98ce
C&P fail
Half-Shot ef21d6b
Fix content in mastodon example.
Half-Shot 542dfa7
@uhoreg nit picks
Half-Shot 4f05bb3
Remove `status` key
Half-Shot 8deecda
Update 2346-bridge-info-state-event.md
Half-Shot 899f4b1
Update key info for dispn/avatar
Half-Shot d21d25b
Update MSC to include escaping information
Half-Shot e133838
Add Implementation notes
Half-Shot 6e72d10
Apply suggestions from code review
Half-Shot 9104740
Update proposals/2346-bridge-info-state-event.md
Half-Shot a0b98d7
Some feedback changes
Half-Shot d5dd039
Merge branch 'hs/msc-bridge-inf' of github.com:matrix-org/matrix-doc …
Half-Shot 5251039
Add bridgebot
Half-Shot 74bc2d9
Remove thirdparty/location statement
Half-Shot 380b54d
"avatar_url" is now the standard for avatars
Half-Shot 62afef8
Update proposals/2346-bridge-info-state-event.md
Half-Shot 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
This file contains hidden or 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,91 @@ | ||
| ### MSC XXXX: Bridge information state event | ||
|
|
||
| Many rooms across the matrix network are currently bridged into other networks, using our bridging API. | ||
| However the specification does not contain a method to determine which networks are bridged into a given | ||
| room. Many users have taken to peeking at the list of aliases for a giveaway alias like `#freenode_` or | ||
| looking for bridge bots or users with a `@_discord_` prefix. | ||
|
|
||
| This is an unacceptable situation. Users must know beforehand the names of IRC networks or protocols in order | ||
| to determine if a given ID is part of a bridge. The bridge cannot give away any infomation about itself | ||
| via Matrix. And blah blah blah. It alos allows bridges to be re-usable between different servers should we | ||
| want to go for the decentralised route one day. | ||
|
|
||
| This proposal stands to fix, or partially fix the following issues: | ||
| - a bunch of riot projects that depend upon this | ||
| - a bunch of spec items too | ||
|
|
||
| This proposal is heavily based upon my previous attempt [#1410](https://github.com/matrix-org/matrix-doc/issues/1410) | ||
| albeit with a notably reduced set of features. The aim of this proposal is to offer information about the | ||
| bridged network and nothing more. | ||
|
|
||
| ## Proposal | ||
|
|
||
| This proposal uses | ||
|
|
||
| It should be noted that this MSC is intended to provide the baseline needed to display information about | ||
| a bridge. Future MSCs should be written to expand this event as the need arises. | ||
|
|
||
| ### `org.matrix.bridge` | ||
|
|
||
| *The name of the event type should eventually be `m.bridge` but has been prefixed until the spec is ready.* | ||
|
|
||
| ```js | ||
| { | ||
| "state_key": "org.matrix.appservice-irc://network_id/channel_id", | ||
| "type": "org.matrix.bridge" | ||
| "content": { | ||
| "creator": "@alice:matrix.org", // Optional | ||
| "status": "active" // Optional, will default to active. One of "active", "disabled". | ||
| "network": { | ||
| "id": "freenode", | ||
| "displayname": "Freenode", // Optional | ||
| "avatar": "mxc://foo/bar" // Optinal | ||
Half-Shot marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }, | ||
| "channel": { | ||
| "id": "#friends", | ||
| "displayname": "Friends" // Optional | ||
| }, | ||
| // Custom vendor-specific keys | ||
| "org.matrix.appservice-irc.room_mode": "+sn", | ||
| }, | ||
| "sender": "@appservice-irc:matrix.org" | ||
| } | ||
| ``` | ||
|
|
||
| The `state_key` must be comprised of the bridge's prefix, followed by the `network.id`, followed by the `channel.id`. | ||
|
|
||
| The `sender` should be the MXID of the bridge bot. | ||
|
|
||
| The `creator` field is the name of the *user* which provisioned the bridge. In the case of alias based bridges, where the | ||
| creator is not known -- it may be omitted. | ||
|
|
||
| The `status` field informs the client if the bridge is still active, or has been disabled. The meaning may be different | ||
| depending on the context of the network. | ||
|
|
||
| The `network` field should be information about the specific network the bridge is connected to. This may be "Freenode" for IRC, | ||
| or "Discord" if the network is global. (What does this mean?). | ||
|
|
||
| The event may contain information specific to the bridge in question, such as the mode for the room in IRC. These keys | ||
| should be prefixed by the bridge's name. Clients may be capable of displaying this extra information and are free to do so. | ||
|
|
||
| ## Potential issues | ||
|
|
||
| This proposal knowingly discards some information present in #1410. These were removed to allow the MSC to pass quicker | ||
| through the process, as well as some of the information having limited value to clients. | ||
|
|
||
| The proposal intentionally sidesteps the 'bridge type' problem: Codifing what a portal, plumbed and gatewayed bridge look | ||
| like in Matrix. For the time being, the event will not contain information about the type of bridge in a room but merely | ||
| information about what is is connected to. | ||
|
|
||
| ## Alternatives | ||
|
|
||
| Some thoughts have been thought on using the third party bridge routes in the AS api to get bridge info, | ||
| by calling a specalised endpoint. There are many issues with this, such as the routes not working presently | ||
| over federation, as well as requring the bridge to be online. Using a state event ensures the data is scoped | ||
| per room, and can be synchronised and updated over federation. | ||
|
|
||
| ## Security considerations | ||
|
|
||
| Anybody with the correct PLs to post state events will be able to manipulate a room by sending a bridge | ||
| event into a room , even if the bridge is not present or does not exist. It goes without saying that if | ||
| you let people modify your room state, you need to trust them not to mess around. | ||
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.
Uh oh!
There was an error while loading. Please reload this page.