Skip to content

Commit

Permalink
feat: discovery_nodes not need auth.
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun committed Sep 4, 2024
1 parent 11a6daf commit 102e230
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/query/service/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pub enum Credential {
password: Option<Vec<u8>>,
client_ip: Option<String>,
},
NoNeed,
}

impl AuthMgr {
Expand Down Expand Up @@ -79,6 +80,7 @@ impl AuthMgr {
) -> Result<Option<String>> {
let user_api = UserApiProvider::instance();
match credential {
Credential::NoNeed => Ok(None),
Credential::DatabendToken {
token,
set_user,
Expand Down
2 changes: 1 addition & 1 deletion src/query/service/src/servers/http/http_services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl HttpHandler {
"/discovery_nodes",
get(discovery_nodes).with(HTTPSessionMiddleware::create(
self.kind,
EndpointKind::StartQuery,
EndpointKind::NoAuth,
)),
);

Expand Down
1 change: 1 addition & 0 deletions src/query/service/src/servers/http/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ pub enum EndpointKind {
StartQuery,
PollQuery,
Clickhouse,
NoAuth,
}

const USER_AGENT: &str = "User-Agent";
Expand Down

0 comments on commit 102e230

Please sign in to comment.