Merge branch 'no-auth-ignore-token' into 'next'
fix: ignore access tokens where they are not needed See merge request famedly/conduit!617
This commit is contained in:
commit
24e9c99d47
1 changed files with 5 additions and 7 deletions
|
@ -110,7 +110,8 @@ where
|
||||||
(
|
(
|
||||||
AuthScheme::AccessToken
|
AuthScheme::AccessToken
|
||||||
| AuthScheme::AppserviceToken
|
| AuthScheme::AppserviceToken
|
||||||
| AuthScheme::AccessTokenOptional,
|
| AuthScheme::AccessTokenOptional
|
||||||
|
| AuthScheme::None,
|
||||||
Token::Appservice(info),
|
Token::Appservice(info),
|
||||||
) => {
|
) => {
|
||||||
let user_id = query_params
|
let user_id = query_params
|
||||||
|
@ -144,7 +145,7 @@ where
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
(
|
(
|
||||||
AuthScheme::AccessToken | AuthScheme::AccessTokenOptional,
|
AuthScheme::AccessToken | AuthScheme::AccessTokenOptional | AuthScheme::None,
|
||||||
Token::User((user_id, device_id)),
|
Token::User((user_id, device_id)),
|
||||||
) => (Some(user_id), Some(device_id), None, false),
|
) => (Some(user_id), Some(device_id), None, false),
|
||||||
(AuthScheme::ServerSignatures, Token::None) => {
|
(AuthScheme::ServerSignatures, Token::None) => {
|
||||||
|
@ -259,13 +260,10 @@ where
|
||||||
| AuthScheme::AccessTokenOptional,
|
| AuthScheme::AccessTokenOptional,
|
||||||
Token::None,
|
Token::None,
|
||||||
) => (None, None, None, false),
|
) => (None, None, None, false),
|
||||||
(
|
(AuthScheme::ServerSignatures, Token::Appservice(_) | Token::User(_)) => {
|
||||||
AuthScheme::ServerSignatures | AuthScheme::None,
|
|
||||||
Token::Appservice(_) | Token::User(_),
|
|
||||||
) => {
|
|
||||||
return Err(Error::BadRequest(
|
return Err(Error::BadRequest(
|
||||||
ErrorKind::Unauthorized,
|
ErrorKind::Unauthorized,
|
||||||
"Access tokens should not be used on this endpoint.",
|
"Only server signatures should be used on this endpoint.",
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
(AuthScheme::AppserviceToken, Token::User(_)) => {
|
(AuthScheme::AppserviceToken, Token::User(_)) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue