25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
import type { MqAuth, MqSystemKind } from "@/types/mq";
export type MqAuthKind = MqAuth["kind"];
export type MqUiAuthKind = MqAuthKind | "kerberos";
const KAFKA_AUTH_KINDS = new Set<MqUiAuthKind>(["none", "basic", "kerberos"]);
const ROCKETMQ_AUTH_KINDS = new Set<MqUiAuthKind>(["none", "basic"]);
const RABBITMQ_AUTH_KINDS = new Set<MqUiAuthKind>(["none", "basic"]);
export function isMqAuthKindAllowedForSystem(systemKind: MqSystemKind, authKind: MqUiAuthKind): boolean {
if (systemKind === "kafka") return KAFKA_AUTH_KINDS.has(authKind);
if (systemKind === "rocketmq") return ROCKETMQ_AUTH_KINDS.has(authKind);
if (systemKind === "rabbitmq") return RABBITMQ_AUTH_KINDS.has(authKind);
return authKind !== "kerberos";
}
export function detectMqUiAuthKind({ systemKind, authKind, saslMechanism, jaasConfig }: { systemKind: MqSystemKind; authKind?: MqAuthKind; saslMechanism: string; jaasConfig: string }): MqUiAuthKind {
if (systemKind === "kafka") {
if (saslMechanism.toUpperCase() === "GSSAPI" && jaasConfig.includes("Krb5LoginModule")) {
return "kerberos";
}
return authKind === "basic" ? "basic" : "none";
}
if (systemKind === "rocketmq") {
return authKind === "basic" ? "basic" : "none";
}
if (systemKind === "rabbitmq") {
return authKind === "basic" ? "basic" : "none";
}
return authKind || "none";
}