Proof of concept: support multiple domains on a single server.#486
Open
nicktobey wants to merge 1 commit into
Open
Proof of concept: support multiple domains on a single server.#486nicktobey wants to merge 1 commit into
nicktobey wants to merge 1 commit into
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change allows the server to declare multiple domains that it is authoritative for, in addition to the base server name. Every listed domain must have its own
well-knownentry, pointing to the same REST API.Clients will be able to use any of the supported domains as the homeserver name, and they all resolve to the same server. It's still a single server: for instance, it has a single room directory. But the server has the ability to authorize users from any of its supported domains.
Rationaille:
There are two use cases that immediately come to mind:
The use of
well-knownalready allows a Matrix server to be authoritative for a single domain that doesn't match the API domain: this change merely allows the server to be authoritative for multiple such domains.Tests:
I added a basic test that the registration workflow works for alternate domains, but additional test coverage than this is probably required. Ideally we'd want to test that the server does not attempt to federate with itself or use the Server-Server API to resolve references to an alternate domain. But I couldn't find those kinds of integration tests in the codebase and wasn't sure how they should be added.
Risks:
I'm trying to think if alternate domains could violate any existing invariants. The big change is that it's now possible for IDs from two different domains to both be seen as "local", but I'm not sure if that can break anything.
It's possible that users on one domain might be able to create room aliases on the alternate domain. I'm not sure how room alias permissions work, and whether this is a problem.