Skip to content

Media authentication & event linking (MSC3916, MSC3911)#465

Draft
turt2live wants to merge 4 commits intomainfrom
travis/msc3916_msc3911
Draft

Media authentication & event linking (MSC3916, MSC3911)#465
turt2live wants to merge 4 commits intomainfrom
travis/msc3916_msc3911

Conversation

@turt2live
Copy link
Copy Markdown
Member

@turt2live turt2live commented Sep 10, 2023

MSCs:

Fixes #421
Closes #103
Closes #266

TODO:

  • MSC3916 - Split endpoints into Client-Server and Federation APIs
  • MSC3916 - X-Matrix authentication on Federation APIs
  • MSC3916 - Access token authentication on Client-Server APIs
  • MSC3916 - multipart/mixed Content-Type on new /download and /thumbnail endpoints
  • MSC3916 - Use new endpoints to download media
  • MSC3911 - Flag uploaded/created media as restricted
  • MSC3911 - Refuse download if restricted media checks fail
  • MSC3911 - Link media to events on send (refuse duplicate binds)
  • MSC3911 - Link media to profiles on update (maybe using MSC4069; refuse duplicate binds)
  • MSC3911 - Delete/quarantine media when event is redacted
  • MSC3911 - Delete/quarantine media when profile is updated away from event
  • MSC3911 - Add media copy API
  • MSC3911 - Delete unused restricted media after some (configurable?) time

MSC3916 implementation (with code commented out to bypass X-Matrix auth for curl 😇):

travp@DESKTOP-S0KMB7S MINGW64 ~
$ curl -s -X POST -H "Authorization: Bearer ${token}" -H "Content-Type: text/plain" --data 'Hello, world. This text needs to be longer so here are more characters.' http://localhost:8001/_matrix/media/v3/upload?filename=test.txt
{"content_uri":"mxc://localhost/cc1ad9bf8cc37be5c5369b739fc00233eaa9d8fb1700741659764981760"}


travp@DESKTOP-S0KMB7S MINGW64 ~
$ curl -s -X GET http://localhost:8001/_matrix/federation/unstable/org.matrix.msc3916/media/download/localhost/cc1ad9bf8cc37be5c5369b739fc00233eaa9d8fb1700741659764981760
--b82a7ae9c7f41bc9e8019a6b751b46fa50e407a9e8d05bba3099fb4cb91e
Content-Type: application/json

{}
--b82a7ae9c7f41bc9e8019a6b751b46fa50e407a9e8d05bba3099fb4cb91e
Content-Disposition: attachment; filename=test.txt
Content-Type: text/plain

Hello, world. This text needs to be longer so here are more characters.
--b82a7ae9c7f41bc9e8019a6b751b46fa50e407a9e8d05bba3099fb4cb91e--

@turt2live turt2live force-pushed the travis/msc3916_msc3911 branch from 2e6ae64 to f600ea4 Compare November 25, 2023 21:25
@turt2live turt2live mentioned this pull request Nov 25, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement new media auth proposals (MSC3916 & MSC3911) Implement MSC1902 Start implementation for media repo auth (MSC701)

1 participant