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

Add doc section for auth media #70

Merged
merged 6 commits into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,26 @@ Example (generated using the body and public key from the previous examples):
}
}
```

## Authenticated Media

When accessing media from a Synapse homeserver with authenticated media enabled, an
`Authorization` HTTP header must be passed along with any request to the Matrix Content Scanner.
If the `Authorization` header is not present, the content scanner assumes the request is not an
authenticated media request and will use the old Matrix endpoints.

This header follows the `Authentication Bearer scheme` as [outlined in the Matrix specification](https://spec.matrix.org/v1.12/client-server-api/#using-access-tokens).
The `access_token` must be the Matrix access token of the client's user.
The `Authorization` header method must be used, sending the access token as a query string
devonh marked this conversation as resolved.
Show resolved Hide resolved
parameter is not supported.

Example authorization header:

```
Authorization: Bearer <access_token>
```
devonh marked this conversation as resolved.
Show resolved Hide resolved

If a request is made for authenticated media and the access token is invalid, the content scanner
will respond with HTTP status 502, errcode `MCS_MEDIA_REQUEST_FAILED`.
If a request is made for authenticated media and the `Authorization` header is missing, the content
scanner will respond with HTTP status 404, errcode `M_NOT_FOUND`.
Loading