Skip to content
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

Make cross-server matrix puppetting possible #26

Merged
merged 1 commit into from
Sep 18, 2020

Conversation

ShadowJonathan
Copy link
Contributor

Downstream libraries/code would need to persist base_url and make allow_external_custom_puppets toggleable for this.

@tulir would you want me to move that _discover_homeserver_endpoint somewhere else? If so, where exactly?

Closes #25

Downstream libraries/code would need to persist `base_url` and make `allow_external_custom_puppets` toggleable for this
Comment on lines +174 to +177
if await validate_versions_api(base_url):
return base_url
elif await validate_versions_api(base_url + "/"):
return base_url + "/"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to #20, it's possible this can cause problems

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is testing with a slash ever necessary? validate_versions_api will already add it if it's missing. It might be necessary to remove the slash if it's there though

Copy link
Contributor Author

@ShadowJonathan ShadowJonathan Sep 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validate_versions_api does urllib.parse.urljoin(base_url, "_matrix/client/versions"), which, with an url like https://homeserver.com/subpath, can either result in https://homeserver.com/_matrix/client/versions being tested, or https://homeserver.com/subpath/_matrix/client/versions

Unfortunately, subpath ambiguity is not mentioned in the spec, so if a slash isn't placed, it can be either one of those two cases, technically speaking.

@tulir tulir self-requested a review September 12, 2020 17:50
@tulir tulir merged commit 351cce7 into mautrix:master Sep 18, 2020
@tulir tulir removed their request for review October 24, 2020 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Allow Matrix Puppeting from other homeservers (or clarify error status if not possible)
2 participants