feat(zookeeper): support TLS-secured connections

This commit is contained in:
yimiaoxiehou authored and GitHub committed 2026-09-14 00:48:51 +08:00
1 parent 8cd5372e22
commit 56c0f8567d
14 files changed
+320 -33

No files matched your search

@@ -2546,10 +2546,6 @@ function applyProfile(val: string, preserveConnectionFields = false) {
if (profile.type === "zookeeper") {
form.value.database = undefined;
form.value.connection_string = "";
form.value.ssl = false;
form.value.ca_cert_path = "";
form.value.client_cert_path = "";
form.value.client_key_path = "";
}
if (profile.type === "nacos") {
resetNacosFields();
@@ -3173,6 +3169,7 @@ const tlsCapableDatabaseTypes = new Set<DatabaseType>([
"influxdb",
"victoriametrics",
"cassandra",
"zookeeper",
]);
const supportsTlsToggle = computed(() => tlsCapableDatabaseTypes.has(form.value.db_type));
const supportsCaCertificatePath = computed(() => form.value.db_type === "clickhouse" || form.value.db_type === "victoriametrics");
@@ -4385,7 +4382,12 @@ function connectionConfigForSubmit(id: string, generatedName = "", validatePlugi
config.port = firstEndpoint.port;
}
config.database = undefined;
config.ssl = false;
config.ca_cert_path = config.ca_cert_path?.trim() || "";
config.client_cert_path = config.client_cert_path?.trim() || "";
config.client_key_path = config.client_key_path?.trim() || "";
if ((config.client_cert_path && !config.client_key_path) || (!config.client_cert_path && config.client_key_path)) {
throw new Error(t("connection.etcdClientCertPairRequired"));
}
}
if (config.db_type === "etcd") {
config.etcd_endpoints = normalizeEndpointLines(config.etcd_endpoints || "");
@@ -4400,12 +4402,12 @@ function connectionConfigForSubmit(id: string, generatedName = "", validatePlugi
if ((config.client_cert_path && !config.client_key_path) || (!config.client_cert_path && config.client_key_path)) {
throw new Error(t("connection.etcdClientCertPairRequired"));
}
} else if (form.value.db_type !== "consul") {
} else if (form.value.db_type !== "consul" && config.db_type !== "zookeeper") {
config.etcd_endpoints = undefined;
config.client_cert_path = undefined;
config.client_key_path = undefined;
}
if (config.db_type !== "mysql" && config.db_type !== "clickhouse" && config.db_type !== "etcd" && config.db_type !== "consul" && config.db_type !== "starrocks" && config.db_type !== "mongodb" && config.db_type !== "victoriametrics") {
if (config.db_type !== "mysql" && config.db_type !== "clickhouse" && config.db_type !== "etcd" && config.db_type !== "consul" && config.db_type !== "starrocks" && config.db_type !== "mongodb" && config.db_type !== "victoriametrics" && config.db_type !== "zookeeper") {
config.ca_cert_path = undefined;
} else {
config.ca_cert_path = config.ca_cert_path?.trim() || "";
@@ -8342,7 +8344,7 @@ function openExternalUrl(url: string) {
</label>
</div>
<template v-if="form.db_type === 'etcd' || form.db_type === 'consul'">
<template v-if="form.db_type === 'etcd' || form.db_type === 'consul' || form.db_type === 'zookeeper'">
<div class="grid grid-cols-4 items-start gap-4">
<Label :class="connectionLabelSmallPaddedClass">
<span class="inline-flex items-center justify-end gap-1">
@@ -8396,7 +8398,7 @@ function openExternalUrl(url: string) {
</Tooltip>
</div>
<p class="text-[11px] leading-4 text-muted-foreground">
{{ t("connection.etcdClientCertHint") }}
{{ t("connection.clientCertHint") }}
</p>
</div>
</div>
+1
View File
@@ -837,6 +837,7 @@ export default {
etcdClientCertPlaceholder: "/path/to/client.crt",
etcdClientKeyPlaceholder: "/path/to/client.key",
etcdClientCertHint: "Client certificate and private key must be provided together when etcd requires mTLS.",
clientCertHint: "Client certificate and private key must be provided together when mutual TLS (mTLS) is required.",
etcdClientCertBrowse: "Choose client certificate",
etcdClientKeyBrowse: "Choose client private key",
etcdClientCertPairRequired: "Client certificate and private key must be provided together.",
+1
View File
@@ -1389,6 +1389,7 @@ export default withEnglishFallback({
mqttNoLocal: "Prohibir reenvío local",
doltShowSystemTables: "Mostrar tablas integradas de Dolt",
doltShowSystemTablesHint: "Muestra las tablas integradas de control de versiones de Dolt en la lista de tablas de la conexión actual.",
clientCertHint: "Cuando se requiere mTLS, el certificado de cliente y la clave privada deben completarse juntos.",
},
editor: {
duckdbDraining: "La consulta anterior de DuckDB aún se está deteniendo. Vuelva a intentarlo en breve.",
+1
View File
@@ -1387,6 +1387,7 @@ export default withEnglishFallback({
mqttNoLocal: "Disabilita inoltro locale",
doltShowSystemTables: "Mostra le tabelle integrate di Dolt",
doltShowSystemTablesHint: "Mostra le tabelle di controllo versione integrate di Dolt nell'elenco delle tabelle della connessione corrente.",
clientCertHint: "Quando è richiesto mTLS, il certificato client e la chiave privata devono essere inseriti insieme.",
},
editor: {
duckdbDraining: "La query DuckDB precedente è ancora in fase di arresto. Riprova a breve.",
+1
View File
@@ -1408,6 +1408,7 @@ export default withEnglishFallback({
mqttNoLocal: "ローカル転送禁止",
doltShowSystemTables: "Dolt 組み込みテーブルを表示",
doltShowSystemTablesHint: "現在の接続のテーブルリストに Dolt 組み込みのバージョン管理テーブルを表示します。",
clientCertHint: "mTLS が要求される場合、クライアント証明書と秘密鍵は一緒に入力する必要があります。",
},
editor: {
duckdbDraining: "前回の DuckDB クエリはまだ停止処理中です。しばらくしてから再試行してください。",
+1
View File
@@ -831,6 +831,7 @@ export default withEnglishFallback({
etcdClientCertPlaceholder: "/path/to/client.crt",
etcdClientKeyPlaceholder: "/path/to/client.key",
etcdClientCertHint: "etcd가 mTLS를 요구할 때 클라이언트 인증서와 개인 키를 함께 제공해야 합니다.",
clientCertHint: "mTLS가 요구되는 경우 클라이언트 인증서와 개인 키를 함께 입력해야 합니다.",
etcdClientCertBrowse: "클라이언트 인증서 선택",
etcdClientKeyBrowse: "클라이언트 개인 키 선택",
etcdClientCertPairRequired: "클라이언트 인증서와 개인 키를 함께 제공해야 합니다.",
+1
View File
@@ -1388,6 +1388,7 @@ export default withEnglishFallback({
mqttNoLocal: "Proibir encaminhamento local",
doltShowSystemTables: "Exibir tabelas internas do Dolt",
doltShowSystemTablesHint: "Exibir as tabelas de controle de versão internas do Dolt na lista de tabelas da conexão atual.",
clientCertHint: "Quando o mTLS for exigido, o certificado do cliente e a chave privada devem ser preenchidos juntos.",
},
editor: {
duckdbDraining: "A consulta anterior do DuckDB ainda está sendo interrompida. Tente novamente em breve.",
+1
View File
@@ -753,6 +753,7 @@ export default withEnglishFallback({
etcdClientCertPlaceholder: "/path/to/client.crt",
etcdClientKeyPlaceholder: "/path/to/client.key",
etcdClientCertHint: "etcd 要求 mTLS 时,客户端证书和私钥必须一起填写。",
clientCertHint: "要求 mTLS 时,客户端证书和私钥必须一起填写。",
etcdClientCertBrowse: "选择客户端证书",
etcdClientKeyBrowse: "选择客户端私钥",
etcdClientCertPairRequired: "客户端证书和私钥必须一起填写。",
+1
View File
@@ -1387,6 +1387,7 @@ export default withEnglishFallback({
mqttClientCertPath: "用戶端憑證路徑",
mqttClientKeyPath: "用戶端私鑰路徑",
mqttNoLocal: "禁止本機轉送",
clientCertHint: "要求 mTLS 時,用戶端憑證和私密金鑰必須一起填寫。",
},
editor: {
duckdbDraining: "上一筆 DuckDB 查詢仍在停止,請稍後重試。",