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

Support MSC3916 by adding unstable media endpoints to _matrix/client #17213

Merged
merged 8 commits into from
May 24, 2024

Conversation

H-Shay
Copy link
Contributor

@H-Shay H-Shay commented May 17, 2024

MSC3916 adds new media endpoints under _matrix/client. This PR adds the /preview_url, /config, and /thumbnail endpoints. /download will be added in a follow-up PR once the work for the federation /download endpoint is complete (see #17172).

Should be reviewable commit-by-commit.

@H-Shay H-Shay requested a review from a team as a code owner May 17, 2024 20:39
@@ -0,0 +1,1625 @@
#
# This file is licensed under the Affero General Public License (AGPL) version 3.
Copy link
Contributor Author

@H-Shay H-Shay May 17, 2024

Choose a reason for hiding this comment

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

Most of this is tests that are copies of the extant tests for media endpoints, with the url changed to the new unstable url (I did add one for the /config endpoint since there wasn't one), with the idea that the old tests testing the old urls would be removed when those endpoints are deprecated, and made sure these tests are under the correct hierarchy.

@@ -46,11 +46,11 @@
from synapse.media.filepath import MediaFilePaths
from synapse.media.media_storage import MediaStorage, ReadableFileWrapper
Copy link
Contributor Author

@H-Shay H-Shay May 17, 2024

Choose a reason for hiding this comment

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

Since these tests won't be moved when the old endpoints are deprecated I changed the urls in these tests to test the new URLs, I was thinking that we could drop these changes before merge as it is mostly just a proof that the new endpoints work the same as the old endpoints - or would it make sense to copy these tests and have a set for the new URLs and the old URLs (which I did below)?

Copy link
Member

Choose a reason for hiding this comment

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

I think we can use @parameterized_class to run the tests twice with different URLs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh that makes sense thanks! It's been fixed

@H-Shay H-Shay marked this pull request as draft May 17, 2024 22:11
@H-Shay H-Shay force-pushed the shay/msc3916 branch 2 times, most recently from e74b2a4 to 4307c4e Compare May 17, 2024 22:20
@H-Shay H-Shay marked this pull request as ready for review May 17, 2024 23:19
Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

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

I think this looks good, c.f. note about tests

@H-Shay H-Shay requested a review from erikjohnston May 22, 2024 22:56
@H-Shay
Copy link
Contributor Author

H-Shay commented May 23, 2024

Thanks for the approval! I think you might need to hit merge for me though, I no longer posses that power :)

@erikjohnston erikjohnston merged commit 9edb725 into element-hq:develop May 24, 2024
38 checks passed
H-Shay added a commit to H-Shay/hq_synapse that referenced this pull request May 31, 2024
element-hq#17213)

[MSC3916](https://github.com/matrix-org/matrix-spec-proposals/blob/rav/authentication-for-media/proposals/3916-authentication-for-media.md)
adds new media endpoints under `_matrix/client`. This PR adds the
`/preview_url`, `/config`, and `/thumbnail` endpoints. `/download` will
be added in a follow-up PR once the work for the federation `/download`
endpoint is complete (see
element-hq#17172).

Should be reviewable commit-by-commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants