Skip to content

Commit

Permalink
refactor: allow gateway to use "select 1" to verify token in request …
Browse files Browse the repository at this point in the history
…header.
  • Loading branch information
youngsofun committed Sep 25, 2024
1 parent e665183 commit 98637be
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/query/service/src/servers/http/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ impl EndpointKind {
EndpointKind::Verify => Ok(None),
EndpointKind::Refresh => Ok(Some(TokenType::Refresh)),
EndpointKind::StartQuery | EndpointKind::PollQuery | EndpointKind::Logout => {
Ok(Some(TokenType::Session))
if GlobalConfig::instance().query.management_mode {
// allow gateway to use "select 1" to verify token in request header.
Ok(None)
} else {
Ok(Some(TokenType::Session))
}
}
_ => Err(ErrorCode::AuthenticateFailure(format!(
"should not use databend token for {self:?}",
Expand Down

0 comments on commit 98637be

Please sign in to comment.