feat(kafka): improve topic management and Kerberos auth
This commit is contained in:
18 files changed
+1096
-81
No files matched your search
@@ -0,0 +1,22 @@
|
||||
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"]);
|
||||
|
||||
export function isMqAuthKindAllowedForSystem(systemKind: MqSystemKind, authKind: MqUiAuthKind): boolean {
|
||||
if (systemKind === "kafka") return KAFKA_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";
|
||||
}
|
||||
|
||||
return authKind || "none";
|
||||
}
|
||||
Reference in new issue
Block a user