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

[WIP] MSC4097: Interactions between media redirection and authentication #4097

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

turt2live
Copy link
Member

Rendered

In line with matrix-org/matrix-spec#1700, the following disclosure applies:

I am Director of Standards Development at The Matrix.org Foundation C.I.C., Matrix Spec Core Team (SCT) member, employed by Element, and operate the t2bot.io service. This proposal is written and published under a generic Matrix.org Foundation role following discussions around FOSDEM 2024 regarding CDN usage in Matrix.


Implementation requirements:

  • Write more of the MSC
  • TBD once written

@turt2live turt2live changed the title WIP: Interactions between media redirection and authentication [WIP] MSC4097: Interactions between media redirection and authentication Feb 6, 2024
@turt2live turt2live added proposal A matrix spec change proposal client-server Client-Server API kind:core MSC which is critical to the protocol's success needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. labels Feb 6, 2024

**TODO**: This section.

## Alternatives
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't having the auth/expiration data in a header instead of the URL fulfill the same purpose (preventing copying links) without the added complexity of an additional layer of encryption?

Copy link
Member Author

Choose a reason for hiding this comment

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

CDNs find it difficult to use headers, unfortunately.

Copy link
Member

Choose a reason for hiding this comment

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

CDNs find it easier to receive a temporary encryption key via a side channel and encrypt media on the fly than just read a header in the request and do some simple hmac check? 🤔 Fastly seems to have a header reading method at least: https://developer.fastly.com/reference/vcl/functions/headers/header-get/

A static per-media key would be easier for the CDN as it wouldn't need to know about encryption at all, and would also have the extra benefit of at-rest encryption, although that wouldn't be opt-in for clients.

Copy link
Member Author

Choose a reason for hiding this comment

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

The concern was that headers are slow and might not be compatible with all providers. Will take a look though.

Copy link
Member Author

Choose a reason for hiding this comment

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

ftr, Cloudflare and headers don't get along unless you have an Enterprise plan, which affects caching pretty badly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-server Client-Server API kind:core MSC which is critical to the protocol's success 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.

2 participants