add config option to allow guests to access TURN server
`turn_allow_guests` Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
40e4019f7f
commit
1cc7cf54a7
3 changed files with 30 additions and 6 deletions
|
@ -91,8 +91,21 @@ pub(super) async fn auth(
|
|||
appservice_info: Some(*info),
|
||||
})
|
||||
},
|
||||
(AuthScheme::AccessToken, Token::None) => {
|
||||
Err(Error::BadRequest(ErrorKind::MissingToken, "Missing access token."))
|
||||
(AuthScheme::AccessToken, Token::None) => match request.parts.uri.path() {
|
||||
// TODO: can we check this better?
|
||||
"/_matrix/client/v3/voip/turnServer" | "/_matrix/client/r0/voip/turnServer" => {
|
||||
if services().globals.config.turn_allow_guests {
|
||||
Ok(Auth {
|
||||
origin: None,
|
||||
sender_user: None,
|
||||
sender_device: None,
|
||||
appservice_info: None,
|
||||
})
|
||||
} else {
|
||||
Err(Error::BadRequest(ErrorKind::MissingToken, "Missing access token."))
|
||||
}
|
||||
},
|
||||
_ => Err(Error::BadRequest(ErrorKind::MissingToken, "Missing access token.")),
|
||||
},
|
||||
(
|
||||
AuthScheme::AccessToken | AuthScheme::AccessTokenOptional | AuthScheme::None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue