Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Add more missing redis stuff

Fang-Pen Lin4e5288b8af0b
diff --git a/backend/src/ee/routes/v1/pam-resource-routers/pam-resource-router.ts b/backend/src/ee/routes/v1/pam-resource-routers/pam-resource-router.ts
index 8e4326f3f1..7b4ac763c7 100644
--- a/backend/src/ee/routes/v1/pam-resource-routers/pam-resource-router.ts
+++ b/backend/src/ee/routes/v1/pam-resource-routers/pam-resource-router.ts
@@ -18,6 +18,10 @@ import {
PostgresResourceListItemSchema,
SanitizedPostgresResourceSchema
} from "@app/ee/services/pam-resource/postgres/postgres-resource-schemas";
+import {
+ RedisResourceListItemSchema,
+ SanitizedRedisResourceSchema
+} from "@app/ee/services/pam-resource/redis/redis-resource-schemas";
import {
SanitizedSSHResourceSchema,
SSHResourceListItemSchema
@@ -32,7 +36,8 @@ const SanitizedResourceSchema = z.union([
SanitizedMySQLResourceSchema,
SanitizedSSHResourceSchema,
SanitizedKubernetesResourceSchema,
- SanitizedAwsIamResourceSchema
+ SanitizedAwsIamResourceSchema,
+ SanitizedRedisResourceSchema
]);
const ResourceOptionsSchema = z.discriminatedUnion("resource", [
@@ -40,7 +45,8 @@ const ResourceOptionsSchema = z.discriminatedUnion("resource", [
MySQLResourceListItemSchema,
SSHResourceListItemSchema,
KubernetesResourceListItemSchema,
- AwsIamResourceListItemSchema
+ AwsIamResourceListItemSchema,
+ RedisResourceListItemSchema
]);
export const registerPamResourceRouter = async (server: FastifyZodProvider) => {
diff --git a/backend/src/ee/services/pam-resource/pam-resource-fns.ts b/backend/src/ee/services/pam-resource/pam-resource-fns.ts
index d193d14e50..f75a7b0da4 100644
--- a/backend/src/ee/services/pam-resource/pam-resource-fns.ts
+++ b/backend/src/ee/services/pam-resource/pam-resource-fns.ts
@@ -8,13 +8,15 @@ import { getKubernetesResourceListItem } from "./kubernetes/kubernetes-resource-
import { getMySQLResourceListItem } from "./mysql/mysql-resource-fns";
import { TPamResource, TPamResourceConnectionDetails, TPamResourceMetadata } from "./pam-resource-types";
import { getPostgresResourceListItem } from "./postgres/postgres-resource-fns";
+import { getRedisResourceListItem } from "./redis/redis-resource-fns";
export const listResourceOptions = () => {
return [
getPostgresResourceListItem(),
getMySQLResourceListItem(),
getAwsIamResourceListItem(),
- getKubernetesResourceListItem()
+ getKubernetesResourceListItem(),
+ getRedisResourceListItem()
].sort((a, b) => a.name.localeCompare(b.name));
};
diff --git a/backend/src/ee/services/pam-resource/redis/redis-resource-fns.ts b/backend/src/ee/services/pam-resource/redis/redis-resource-fns.ts
new file mode 100644
index 0000000000..cb7239b190
--- /dev/null
+++ b/backend/src/ee/services/pam-resource/redis/redis-resource-fns.ts
@@ -0,0 +1,8 @@
+import { RedisResourceListItemSchema } from "./redis-resource-schemas";
+
+export const getRedisResourceListItem = () => {
+ return {
+ name: RedisResourceListItemSchema.shape.name.value,
+ resource: RedisResourceListItemSchema.shape.resource.value
+ };
+};
diff --git a/frontend/src/hooks/api/pam/types/index.ts b/frontend/src/hooks/api/pam/types/index.ts
index 79bd93941d..f8b14e7962 100644
--- a/frontend/src/hooks/api/pam/types/index.ts
+++ b/frontend/src/hooks/api/pam/types/index.ts
@@ -10,17 +10,20 @@ import { TAwsIamAccount, TAwsIamResource } from "./aws-iam-resource";
import { TKubernetesAccount, TKubernetesResource } from "./kubernetes-resource";
import { TMySQLAccount, TMySQLResource } from "./mysql-resource";
import { TPostgresAccount, TPostgresResource } from "./postgres-resource";
+import { TRedisAccount, TRedisResource } from "./redis-resource";
import { TSSHAccount, TSSHResource } from "./ssh-resource";
export * from "./aws-iam-resource";
export * from "./kubernetes-resource";
export * from "./mysql-resource";
export * from "./postgres-resource";
+export * from "./redis-resource";
export * from "./ssh-resource";
export type TPamResource =
| TPostgresResource
| TMySQLResource
+ | TRedisResource
| TSSHResource
| TAwsIamResource
| TKubernetesResource;
@@ -28,6 +31,7 @@ export type TPamResource =
export type TPamAccount =
| TPostgresAccount
| TMySQLAccount
+ | TRedisAccount
| TSSHAccount
| TAwsIamAccount
| TKubernetesAccount;
diff --git a/frontend/src/hooks/api/pam/types/redis-resource.ts b/frontend/src/hooks/api/pam/types/redis-resource.ts
new file mode 100644
index 0000000000..589eacaeb0
--- /dev/null
+++ b/frontend/src/hooks/api/pam/types/redis-resource.ts
@@ -0,0 +1,28 @@
+import { PamResourceType } from "../enums";
+import { TBasePamAccount } from "./base-account";
+import { TBasePamResource } from "./base-resource";
+
+export type TRedisConnectionDetails = {
+ host: string;
+ port: number;
+ username?: string;
+ password?: string;
+ sslEnabled: boolean;
+ sslRejectUnauthorized: boolean;
+ sslCertificate?: string;
+};
+
+export type TRedisCredentials = {
+ username: string;
+ password: string;
+};
+
+// Resources
+export type TRedisResource = TBasePamResource & { resourceType: PamResourceType.Redis } & {
+ connectionDetails: TRedisConnectionDetails;
+};
+
+// Accounts
+export type TRedisAccount = TBasePamAccount & {
+ credentials: TRedisCredentials;
+};
diff --git a/frontend/src/pages/pam/PamResourcesPage/components/ResourceTypeSelect.tsx b/frontend/src/pages/pam/PamResourcesPage/components/ResourceTypeSelect.tsx
index ffba498be9..e9a9d06e79 100644
--- a/frontend/src/pages/pam/PamResourcesPage/components/ResourceTypeSelect.tsx
+++ b/frontend/src/pages/pam/PamResourcesPage/components/ResourceTypeSelect.tsx
@@ -35,7 +35,6 @@ export const ResourceTypeSelect = ({ onSelect }: Props) => {
{ name: "DynamoDB", resource: PamResourceType.DynamoDB },
{ name: "Snowflake", resource: PamResourceType.Snowflake },
{ name: "Elasticsearch", resource: PamResourceType.Elasticsearch },
- { name: "Redis", resource: PamResourceType.Redis },
{ name: "RDP", resource: PamResourceType.RDP },
{ name: "SSH", resource: PamResourceType.SSH },
{ name: "MCP", resource: PamResourceType.MCP },