Skip to content

Conversation

@aaronraimist
Copy link
Contributor

@aaronraimist aaronraimist commented Apr 13, 2020

Rendered

Intended to address:
https://github.com/matrix-org/matrix-doc/issues/1919
https://github.com/matrix-org/matrix-doc/issues/1896
https://github.com/matrix-org/matrix-doc/issues/2335

If there are any other issues with the client well-known that I've missed let me know so there doesn't need to be a followup MSC.

@aaronraimist aaronraimist changed the title MSCXXXX: Fixes for Client Well-known URI MSC2499: Fixes for Client Well-known URI Apr 13, 2020
@aaronraimist aaronraimist force-pushed the fix-client-well-known branch from 78d3a47 to 9270c4c Compare April 13, 2020 23:55
Signed-off-by: Aaron Raimist <aaron@raim.ist>
@aaronraimist aaronraimist force-pushed the fix-client-well-known branch from 9270c4c to 2f19796 Compare April 13, 2020 23:56
@uhoreg uhoreg added the proposal A matrix spec change proposal label Apr 14, 2020
@turt2live turt2live added proposal-in-review kind:maintenance MSC which clarifies/updates existing spec labels Apr 14, 2020
@turt2live turt2live self-requested a review April 27, 2020 23:38
Copy link
Member

@KitsuneRal KitsuneRal left a comment

Choose a reason for hiding this comment

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

Generally ok except one small addition, please.

@aaronraimist aaronraimist changed the title MSC2499: Fixes for Client Well-known URI MSC2499: Fixes for Well-known URIs Apr 10, 2021
Signed-off-by: Aaron Raimist <aaron@raim.ist>
@turt2live turt2live self-requested a review May 4, 2021 15:59
Comment on lines 37 to 38
1. The maximum size of size of the well-known file is 51200 bytes. A client or server
requesting a well-known file MUST abort and FAIL_PROMPT if the response exceeds 51200 bytes. No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

This isn't a super realistic thing that can be applied by clients: if the server admin has configured the server so badly that a 10gb JSON file is being served then so be it. It's just not in the server admin's interest to attack bandwidth in this way given the costs they would be incurring from their ISP/service provider.

Copy link
Member

Choose a reason for hiding this comment

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

At least for native clients (and servers) it's fairly easy to abort on 51201st byte but FAIL_PROMPT looks a bit dubious here: should the client re-request .well-known or rather just continue (rather than abort) receiving the payload after confirming with the user? And yes, generally there's no incentive to attack in that way of course; but a recommendation to protect receiving sides from such misconfigurations wouldn't hurt, would it? Maybe not as MUST but as SHOULD.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not convinced that this endpoint specifically needs this recommendation though: surely we should be applying this to all endpoints like profiles, sync, etc...

It feels like another MSC's problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's fine, I can leave it to another MSC. The main reason for including it here is because Synapse has already implemented this limit for the server well-known so a well-known bigger than that already isn't going to work with most servers. If it was specced then at least people could expect there is some reasonable limit on the size.

Copy link
Member

Choose a reason for hiding this comment

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

I would be a bit surprised if people expected 1mb json files to work for this use case, honestly. I think it's reasonable for clients/servers to impose their own limits, and iirc Synapse only really limited the JSON file size on server-server because federation has tiny timeouts (typically), so read delays are not ideal.

aaronraimist and others added 3 commits May 6, 2021 13:49
Signed-off-by: Aaron Raimist <aaron@raim.ist>
Co-authored-by: Travis Ralston <travpc@gmail.com>
Signed-off-by: Aaron Raimist <aaron@raim.ist>
@turt2live turt2live added the needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. label Jun 8, 2021
Signed-off-by: Aaron Raimist <aaron@raim.ist>
@aaronraimist aaronraimist changed the base branch from old_master to main December 28, 2021 18:15
Co-authored-by: Vladimir Panteleev <CyberShadow@users.noreply.github.com>
SHOULD be `application/json` however it should be assumed to be JSON regardless of Content-Type.
This is consistent with the Server-Server API.

1. Step 3f in the Client-Server well-known flow should be changed to use the modern
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
1. Step 3f in the Client-Server well-known flow should be changed to use the modern
1. Step 3.6 in the Client-Server well-known flow should be changed to use the modern

The latest rendering of the spec uses numbers for the sub-steps instead of letters

is the suggested replacement.

1. The maximum size of the well-known file is 51200 bytes. A client or server
requesting a well-known file MUST abort and FAIL_PROMPT if the response exceeds 51200 bytes.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
requesting a well-known file MUST abort and FAIL_PROMPT if the response exceeds 51200 bytes.
requesting a well-known file MUST abort and FAIL_PROMPT if the response exceeds 51200 bytes.
This check becomes part of step 3.2.

Copy link
Member

Choose a reason for hiding this comment

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

(Though #2499 (comment) says that this check is supposed to be removed entirely.)


1. The spec does not mention that redirects should be followed for `/.well-known/matrix/client`
and does not clearly specify what type of redirects should be followed for `/.well-known/matrix/server`.
To fix this, the spec should be changed to state that when a well-known URI is requested,
Copy link

Choose a reason for hiding this comment

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

The server-server spec simply states
30x redirects should be followed, however redirection loops should be avoided.
which is short, reasonable but not overcomplicated. Adopting the same for the Client-Server spec sounds reasonable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind:maintenance MSC which clarifies/updates existing spec needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants