mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-10 07:58:15 -05:00
Add missing redis stuff
This commit is contained in:
@@ -5,6 +5,7 @@ import { EventType } from "@app/ee/services/audit-log/audit-log-types";
|
||||
import { KubernetesSessionCredentialsSchema } from "@app/ee/services/pam-resource/kubernetes/kubernetes-resource-schemas";
|
||||
import { MySQLSessionCredentialsSchema } from "@app/ee/services/pam-resource/mysql/mysql-resource-schemas";
|
||||
import { PostgresSessionCredentialsSchema } from "@app/ee/services/pam-resource/postgres/postgres-resource-schemas";
|
||||
import { RedisSessionCredentialsSchema } from "@app/ee/services/pam-resource/redis/redis-resource-schemas";
|
||||
import { SSHSessionCredentialsSchema } from "@app/ee/services/pam-resource/ssh/ssh-resource-schemas";
|
||||
import {
|
||||
HttpEventSchema,
|
||||
@@ -20,7 +21,8 @@ const SessionCredentialsSchema = z.union([
|
||||
SSHSessionCredentialsSchema,
|
||||
PostgresSessionCredentialsSchema,
|
||||
MySQLSessionCredentialsSchema,
|
||||
KubernetesSessionCredentialsSchema
|
||||
KubernetesSessionCredentialsSchema,
|
||||
RedisSessionCredentialsSchema
|
||||
]);
|
||||
|
||||
export const registerPamSessionRouter = async (server: FastifyZodProvider) => {
|
||||
|
||||
@@ -886,12 +886,6 @@ export const pamAccountServiceFactory = ({
|
||||
break;
|
||||
case PamResource.Redis:
|
||||
{
|
||||
const connectionCredentials = (await decryptResourceConnectionDetails({
|
||||
encryptedConnectionDetails: resource.encryptedConnectionDetails,
|
||||
kmsService,
|
||||
projectId
|
||||
})) as TRedisResourceConnectionDetails;
|
||||
|
||||
const credentials = (await decryptAccountCredentials({
|
||||
encryptedCredentials: account.encryptedCredentials,
|
||||
kmsService,
|
||||
@@ -900,8 +894,6 @@ export const pamAccountServiceFactory = ({
|
||||
|
||||
metadata = {
|
||||
username: credentials.username,
|
||||
host: connectionCredentials.host,
|
||||
port: connectionCredentials.port,
|
||||
accountName: account.name,
|
||||
accountPath: folderPath
|
||||
};
|
||||
|
||||
@@ -64,7 +64,10 @@ const makeRedisConnection = (
|
||||
rejectUnauthorized: sslRejectUnauthorized,
|
||||
ca: sslCertificate
|
||||
}
|
||||
})
|
||||
}),
|
||||
retryStrategy: () => {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -74,15 +77,9 @@ const makeRedisConnection = (
|
||||
client = createClient();
|
||||
|
||||
// Test authentication
|
||||
let result: string;
|
||||
if (actualPassword) {
|
||||
result = await client.auth(actualUsername, actualPassword, () => {});
|
||||
} else {
|
||||
result = await client.auth(actualUsername, () => {});
|
||||
}
|
||||
|
||||
const result = await client.auth(actualUsername, actualPassword);
|
||||
if (result !== "OK") {
|
||||
throw new BadRequestError({ message: `Redis authentication failed: ${result}` });
|
||||
throw new BadRequestError({ message: `Redis authentication failed: ${result as string}` });
|
||||
}
|
||||
|
||||
// Test connection with a simple command
|
||||
|
||||
@@ -83,6 +83,8 @@ export const PamAccessAccountModal = ({
|
||||
case PamResourceType.Postgres:
|
||||
case PamResourceType.MySQL:
|
||||
return `infisical pam db access-account ${fullAccountPath} --project-id ${projectId} --duration ${cliDuration} --domain ${siteURL}`;
|
||||
case PamResourceType.Redis:
|
||||
return `infisical pam redis access-account ${fullAccountPath} --project-id ${projectId} --duration ${cliDuration} --domain ${siteURL}`;
|
||||
case PamResourceType.SSH:
|
||||
return `infisical pam ssh access-account ${fullAccountPath} --project-id ${projectId} --duration ${cliDuration} --domain ${siteURL}`;
|
||||
case PamResourceType.Kubernetes:
|
||||
|
||||
@@ -22,7 +22,8 @@ export const PamSessionLogsSection = ({ session }: Props) => {
|
||||
const isSSHSession = session.resourceType === PamResourceType.SSH;
|
||||
const isDatabaseSession =
|
||||
session.resourceType === PamResourceType.Postgres ||
|
||||
session.resourceType === PamResourceType.MySQL;
|
||||
session.resourceType === PamResourceType.MySQL ||
|
||||
session.resourceType === PamResourceType.Redis;
|
||||
const isHttpSession = session.resourceType === PamResourceType.Kubernetes;
|
||||
const isAwsIamSession = session.resourceType === PamResourceType.AwsIam;
|
||||
const hasLogs = session.logs.length > 0;
|
||||
|
||||
Reference in New Issue
Block a user