Skip to content

Commit 8c5301f

Browse files
committed
fix(client): allow token to coexist with egress basic-auth password in one cluster config
A single QuestDB.connect() string drives both the ingest and the query pools: the egress side authenticates with username=/password= while the ingest side may use token=. The ingest parser's auth conflict is only its own key pair (token + user); a password that belongs to the egress pair is no longer rejected.
1 parent cce3001 commit 8c5301f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

core/src/main/java/io/questdb/client/Sender.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import io.questdb.client.cutlass.qwp.client.sf.cursor.CursorSendEngine;
4040
import io.questdb.client.cutlass.qwp.client.sf.cursor.CursorWebSocketSendLoop;
4141
import io.questdb.client.impl.ConfStringParser;
42+
import io.questdb.client.impl.ConfigSchema;
4243
import io.questdb.client.impl.ConfigString;
4344
import io.questdb.client.impl.ConfigView;
4445
import io.questdb.client.network.NetworkFacade;
@@ -3741,7 +3742,7 @@ static void validateWsConfig(ConfigView view, boolean tls) {
37413742
if ((user == null) != (password == null)) {
37423743
throw new IllegalArgumentException("username and password must be provided together");
37433744
}
3744-
if (token != null && (user != null || password != null)) {
3745+
if (token != null && user != null) {
37453746
throw new IllegalArgumentException("cannot use both token and username/password authentication");
37463747
}
37473748
String tlsVerify = view.getStr("tls_verify");

0 commit comments

Comments
 (0)