This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Implement MSC1708 (.well-known lookups for server routing)#4489
Merged
Conversation
Turns out that the library does a better job of parsing URIs than our reinvented wheel. Who knew. There are two things going on here. The first is that, unlike parse_server_name, URI.fromBytes will strip off square brackets from IPv6 literals, which means that it is valid input to ClientTLSOptionsFactory and HostnameEndpoint. The second is that we stay in `bytes` throughout (except for the argument to ClientTLSOptionsFactory), which avoids the weirdness of (sometimes) ending up with idna-encoded values being held in `unicode` variables. TBH it probably would have been ok but it made the tests fragile.
This is going to get too big and unmanageable.
We don't want to be doing .well-known lookups on these guys.
Codecov Report
@@ Coverage Diff @@
## develop #4489 +/- ##
===========================================
- Coverage 74.76% 74.75% -0.01%
===========================================
Files 336 336
Lines 34180 34224 +44
Branches 5559 5567 +8
===========================================
+ Hits 25553 25583 +30
- Misses 7051 7061 +10
- Partials 1576 1580 +4 |
erikjohnston
suggested changes
Jan 28, 2019
Member
erikjohnston
left a comment
There was a problem hiding this comment.
Looks sane, would be nice to have some more comments/docstrings about what's going on thought 👍
|
|
||
| body = yield make_deferred_yieldable(readBody(response)) | ||
|
|
||
| logger.info("Response from .well-known: %s", body) |
Member
There was a problem hiding this comment.
This should probably be debug
Member
Author
There was a problem hiding this comment.
I'm minded to leave it as info for now as otherwise it's quite hard to see what's going on. I've moved it down a bit to print out the parsed response though.
82b31b9 to
f3b50e0
Compare
erikjohnston
approved these changes
Jan 28, 2019
two reasons for this. One, it saves a bunch of boilerplate. Two, it squashes unicode to IDNA-in-a-`str` (even on python 3) in a way that it turns out we rely on to give consistent behaviour between python 2 and 3.
Member
Author
|
(have merged in #4497 in an attempt to get the tests to work) |
turt2live
added a commit
to matrix-org/matrix-spec-proposals
that referenced
this pull request
Jan 31, 2019
Original proposals: * #1708 (note: the JSON requirements were softened by #1824) * #1711 Implementation proofs: * matrix-org/synapse#4489 * No explicit PRs for MSC1711 could be found, however Synapse is known to implement it. There are no intentional changes which differ from the proposals in this commit, however the author has relied upon various historical conversations outside of the proposals to gain the required context. Inaccuracies introduced by the author are purely accidental.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Based on #4488.