Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
import { PamAccountType } from "@app/ee/services/pam/pam-enums";
import { handleClickhouseSession } from "./clickhouse/pam-clickhouse-session-handler";
import { handleMysqlSession } from "./mysql/pam-mysql-session-handler";
import { TSessionContext, TSessionHandlerResult } from "./pam-web-access-types";
import { handlePostgresSession } from "./postgres/pam-postgres-session-handler";
import { handleRdpSession } from "./rdp/pam-rdp-session-handler";
import { handleRedisSession } from "./redis/pam-redis-session-handler";
import { handleSnowflakeSession } from "./snowflake/pam-snowflake-session-handler";
import { handleSSHSession } from "./ssh/pam-ssh-session-handler";
export type TWebAccessHandler = (
ctx: TSessionContext,
params: { connectionDetails: Record<string, unknown>; credentials: Record<string, unknown> }
) => Promise<TSessionHandlerResult>;
type TSessionHandlerEntry = {
gatewayAccountType: PamAccountType;
handler: TWebAccessHandler;
};
export const SESSION_HANDLERS: Partial<Record<PamAccountType, TSessionHandlerEntry>> = {
[PamAccountType.Postgres]: {
gatewayAccountType: PamAccountType.Postgres,
handler: handlePostgresSession
},
[PamAccountType.MySQL]: {
gatewayAccountType: PamAccountType.MySQL,
handler: handleMysqlSession
},
[PamAccountType.Redis]: {
gatewayAccountType: PamAccountType.Redis,
handler: handleRedisSession
},
[PamAccountType.Snowflake]: {
gatewayAccountType: PamAccountType.Snowflake,
handler: handleSnowflakeSession
},
[PamAccountType.ClickHouse]: {
gatewayAccountType: PamAccountType.ClickHouse,
handler: handleClickhouseSession
},
[PamAccountType.SSH]: {
gatewayAccountType: PamAccountType.SSH,
handler: handleSSHSession
},
[PamAccountType.Windows]: {
gatewayAccountType: PamAccountType.Windows,
handler: handleRdpSession
},
// Windows AD accounts use RDP through the Windows gateway protocol
[PamAccountType.WindowsAd]: {
gatewayAccountType: PamAccountType.Windows,
handler: handleRdpSession
}
};