fix(argo): default ArgoDB connections to no-SASL auth

This commit is contained in:
zipg
2026-09-03 01:12:36 +08:00
committed by GitHub
parent a13a7302fa
commit 45688cafd6
5 changed files with 51 additions and 2 deletions
+4 -1
View File
@@ -170,7 +170,10 @@ func parseConnectionConfig(params connectParams) (connectionConfig, error) {
CanonicalHostname: true,
},
}
if strings.EqualFold(params.DatabaseType, "impala") {
if config.DatabaseType == "argo" {
config.Auth = "NOSASL"
}
if config.DatabaseType == "impala" {
config.Auth = "NOSASL"
config.Kerberos.Service = defaultImpalaService
}
+44
View File
@@ -296,6 +296,50 @@ func TestImpalaDefaultsToNoSASL(t *testing.T) {
}
}
func TestArgoDefaultsToNoSASL(t *testing.T) {
config, err := parseConnectionConfig(connectParams{
DatabaseType: "argo",
Host: "argo.example.com",
Port: 10000,
Database: "analytics",
})
if err != nil {
t.Fatal(err)
}
if config.Auth != "NOSASL" {
t.Fatalf("unexpected ArgoDB auth mode: %q", config.Auth)
}
}
func TestArgoExplicitAuthenticationOverridesDefault(t *testing.T) {
config, err := parseConnectionConfig(connectParams{
DatabaseType: "argo",
Host: "argo.example.com",
Port: 10000,
URLParams: "auth=NONE",
})
if err != nil {
t.Fatal(err)
}
if config.Auth != "NONE" || !config.AuthExplicit {
t.Fatalf("explicit ArgoDB authentication was not preserved: %#v", config)
}
}
func TestHiveDefaultAuthenticationRemainsSASL(t *testing.T) {
config, err := parseConnectionConfig(connectParams{
DatabaseType: "hive",
Host: "hive.example.com",
Port: 10000,
})
if err != nil {
t.Fatal(err)
}
if config.Auth != "NONE" {
t.Fatalf("unexpected Hive auth mode: %q", config.Auth)
}
}
func TestImpalaExplicitAuthenticationOverridesDefaults(t *testing.T) {
config, err := parseConnectionConfig(connectParams{
DatabaseType: "impala",
@@ -12,6 +12,7 @@ describe("generated connection profiles", () => {
expect(CONNECTION_PROFILES.mariadb).toMatchObject({ type: "mysql", port: 3306, user: "root" });
expect(CONNECTION_PROFILES.rabbitmq).toMatchObject({ type: "mq", port: 5672, host: "127.0.0.1" });
expect(CONNECTION_PROFILES.nacos).toMatchObject({ type: "nacos", port: 8848, user: "nacos" });
expect(CONNECTION_PROFILES.argo).toMatchObject({ type: "argo", urlParams: "auth=noSasl" });
});
it("keeps internal variants out of the main picker", () => {
@@ -86,7 +86,7 @@ export const CONNECTION_PROFILES = {
prestosql: { type: "prestosql", port: 8080, user: "", label: "PrestoSQL", icon: "presto" },
hive: { type: "hive", port: 10000, user: "", label: "Apache Hive", icon: "hive" },
kyuubi: { type: "kyuubi", port: 10009, user: "", label: "Apache Kyuubi", icon: "kyuubi", urlParams: "auth=NONE" },
argo: { type: "argo", port: 10000, user: "", label: "ArgoDB (Transwarp)", icon: "hive" },
argo: { type: "argo", port: 10000, user: "", label: "ArgoDB (Transwarp)", icon: "hive", urlParams: "auth=noSasl" },
impala: { type: "impala", port: 21050, user: "", label: "Apache Impala", icon: "impala", urlParams: "auth=noSasl" },
spark: { type: "spark", port: 10015, user: "", label: "Apache Spark", icon: "spark" },
db2: { type: "db2", port: 50000, user: "db2inst1", label: "IBM DB2", icon: "db2" },
@@ -476,6 +476,7 @@ profiles:
icon: hive
port: 10000
user: ""
urlParams: auth=noSasl
category: domestic
pickerLabel: ArgoDB
- id: impala