Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e7a3d25
Add redis resources
fangpenlin Dec 22, 2025
95e56a4
Add redis pam
fangpenlin Dec 22, 2025
4e5288b
Add more missing redis stuff
fangpenlin Dec 22, 2025
2714f2e
Make redis modal works, fix missing key issue
fangpenlin Dec 22, 2025
99c5186
Add missing redis pam account
fangpenlin Dec 23, 2025
ef7b25c
Add missing redis stuff
fangpenlin Dec 24, 2025
bbe2db3
Remove username pwd in redis resource
fangpenlin Dec 24, 2025
5f7cb18
Add a dedicated auth func
fangpenlin Dec 24, 2025
70dcc0b
Fix connection error not raised issue
fangpenlin Dec 24, 2025
542127d
Fix TLS hostname check
fangpenlin Dec 24, 2025
9ab22ce
Hide spin buttons
fangpenlin Dec 24, 2025
7cd4c4e
Remove listener
fangpenlin Dec 25, 2025
2a2794c
Do not send out info cmd after connect
fangpenlin Dec 25, 2025
a6ff590
Fix linter issues
fangpenlin Dec 25, 2025
99d5e41
Use a different field for redis instead of using the one for sql
fangpenlin Jan 6, 2026
4964e60
Address feedbacks
fangpenlin Jan 6, 2026
56d545a
Make credential optional
fangpenlin Jan 6, 2026
e499baf
Improve connect and validate logic for redis credentials
fangpenlin Jan 6, 2026
4a851b1
Remove unused stuff
fangpenlin Jan 6, 2026
c330ae4
Inline component
fangpenlin Jan 6, 2026
17cc53a
Inline component
fangpenlin Jan 6, 2026
d8db03d
Fix linter issue
fangpenlin Jan 6, 2026
3856f03
Fix typo in error msg
fangpenlin Jan 6, 2026
238d9c0
Add new toggle field for redis credentials
fangpenlin Jan 6, 2026
c8fa0ac
frontend linter fix
fangpenlin Jan 6, 2026
3a28a47
small tweak
x032205 Jan 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions backend/src/ee/routes/v1/pam-account-routers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ import {
SanitizedPostgresAccountWithResourceSchema,
UpdatePostgresAccountSchema
} from "@app/ee/services/pam-resource/postgres/postgres-resource-schemas";
import {
CreateRedisAccountSchema,
SanitizedRedisAccountWithResourceSchema,
UpdateRedisAccountSchema
} from "@app/ee/services/pam-resource/redis/redis-resource-schemas";
import {
CreateSSHAccountSchema,
SanitizedSSHAccountWithResourceSchema,
Expand Down Expand Up @@ -46,6 +51,15 @@ export const PAM_ACCOUNT_REGISTER_ROUTER_MAP: Record<PamResource, (server: Fasti
updateAccountSchema: UpdateMySQLAccountSchema
});
},
[PamResource.Redis]: async (server: FastifyZodProvider) => {
registerPamAccountEndpoints({
server,
resourceType: PamResource.Redis,
accountResponseSchema: SanitizedRedisAccountWithResourceSchema,
createAccountSchema: CreateRedisAccountSchema,
updateAccountSchema: UpdateRedisAccountSchema
});
},
[PamResource.SSH]: async (server: FastifyZodProvider) => {
registerPamAccountEndpoints({
server,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { SanitizedMySQLAccountWithResourceSchema } from "@app/ee/services/pam-re
import { PamResource } from "@app/ee/services/pam-resource/pam-resource-enums";
import { GatewayAccessResponseSchema } from "@app/ee/services/pam-resource/pam-resource-schemas";
import { SanitizedPostgresAccountWithResourceSchema } from "@app/ee/services/pam-resource/postgres/postgres-resource-schemas";
import { SanitizedRedisAccountWithResourceSchema } from "@app/ee/services/pam-resource/redis/redis-resource-schemas";
import { SanitizedSSHAccountWithResourceSchema } from "@app/ee/services/pam-resource/ssh/ssh-resource-schemas";
import { BadRequestError } from "@app/lib/errors";
import { removeTrailingSlash } from "@app/lib/fn";
Expand All @@ -22,6 +23,7 @@ const SanitizedAccountSchema = z.union([
SanitizedSSHAccountWithResourceSchema, // ORDER MATTERS
SanitizedPostgresAccountWithResourceSchema,
SanitizedMySQLAccountWithResourceSchema,
SanitizedRedisAccountWithResourceSchema,
SanitizedKubernetesAccountWithResourceSchema,
SanitizedAwsIamAccountWithResourceSchema
]);
Expand Down Expand Up @@ -134,9 +136,10 @@ export const registerPamAccountRouter = async (server: FastifyZodProvider) => {
}),
response: {
200: z.discriminatedUnion("resourceType", [
// Gateway-based resources (Postgres, MySQL, SSH)
// Gateway-based resources (Postgres, MySQL, Redis, SSH)
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.Postgres) }),
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.MySQL) }),
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.Redis) }),
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.SSH) }),
GatewayAccessResponseSchema.extend({ resourceType: z.literal(PamResource.Kubernetes) }),
// AWS IAM (no gateway, returns console URL)
Expand Down
14 changes: 14 additions & 0 deletions backend/src/ee/routes/v1/pam-resource-routers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ import {
SanitizedPostgresResourceSchema,
UpdatePostgresResourceSchema
} from "@app/ee/services/pam-resource/postgres/postgres-resource-schemas";
import {
CreateRedisResourceSchema,
SanitizedRedisResourceSchema,
UpdateRedisResourceSchema
} from "@app/ee/services/pam-resource/redis/redis-resource-schemas";
import {
CreateSSHResourceSchema,
SanitizedSSHResourceSchema,
Expand Down Expand Up @@ -78,5 +83,14 @@ export const PAM_RESOURCE_REGISTER_ROUTER_MAP: Record<PamResource, (server: Fast
createResourceSchema: CreateAwsIamResourceSchema,
updateResourceSchema: UpdateAwsIamResourceSchema
});
},
[PamResource.Redis]: async (server: FastifyZodProvider) => {
registerPamResourceEndpoints({
server,
resourceType: PamResource.Redis,
resourceResponseSchema: SanitizedRedisResourceSchema,
createResourceSchema: CreateRedisResourceSchema,
updateResourceSchema: UpdateRedisResourceSchema
});
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,15 +36,17 @@ const SanitizedResourceSchema = z.union([
SanitizedMySQLResourceSchema,
SanitizedSSHResourceSchema,
SanitizedKubernetesResourceSchema,
SanitizedAwsIamResourceSchema
SanitizedAwsIamResourceSchema,
SanitizedRedisResourceSchema
]);

const ResourceOptionsSchema = z.discriminatedUnion("resource", [
PostgresResourceListItemSchema,
MySQLResourceListItemSchema,
SSHResourceListItemSchema,
KubernetesResourceListItemSchema,
AwsIamResourceListItemSchema
AwsIamResourceListItemSchema,
RedisResourceListItemSchema
]);

export const registerPamResourceRouter = async (server: FastifyZodProvider) => {
Expand Down
4 changes: 3 additions & 1 deletion backend/src/ee/routes/v1/pam-session-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -20,7 +21,8 @@ const SessionCredentialsSchema = z.union([
SSHSessionCredentialsSchema,
PostgresSessionCredentialsSchema,
MySQLSessionCredentialsSchema,
KubernetesSessionCredentialsSchema
KubernetesSessionCredentialsSchema,
RedisSessionCredentialsSchema
]);

export const registerPamSessionRouter = async (server: FastifyZodProvider) => {
Expand Down
16 changes: 16 additions & 0 deletions backend/src/ee/services/pam-account/pam-account-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import { getFullPamFolderPath } from "../pam-folder/pam-folder-fns";
import { TPamResourceDALFactory } from "../pam-resource/pam-resource-dal";
import { PamResource } from "../pam-resource/pam-resource-enums";
import { TPamAccountCredentials } from "../pam-resource/pam-resource-types";
import { TRedisAccountCredentials } from "../pam-resource/redis/redis-resource-types";
import { TSqlAccountCredentials, TSqlResourceConnectionDetails } from "../pam-resource/shared/sql/sql-resource-types";
import { TSSHAccountCredentials, TSSHResourceMetadata } from "../pam-resource/ssh/ssh-resource-types";
import { TPamSessionDALFactory } from "../pam-session/pam-session-dal";
Expand Down Expand Up @@ -883,6 +884,21 @@ export const pamAccountServiceFactory = ({
};
}
break;
case PamResource.Redis:
{
const credentials = (await decryptAccountCredentials({
encryptedCredentials: account.encryptedCredentials,
kmsService,
projectId
})) as TRedisAccountCredentials;

metadata = {
username: credentials.username,
accountName: account.name,
accountPath: folderPath
};
}
break;
case PamResource.SSH:
{
const credentials = (await decryptAccountCredentials({
Expand Down
3 changes: 2 additions & 1 deletion backend/src/ee/services/pam-resource/pam-resource-enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ export enum PamResource {
MySQL = "mysql",
SSH = "ssh",
Kubernetes = "kubernetes",
AwsIam = "aws-iam"
AwsIam = "aws-iam",
Redis = "redis"
}

export enum PamResourceOrderBy {
Expand Down
4 changes: 3 additions & 1 deletion backend/src/ee/services/pam-resource/pam-resource-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { awsIamResourceFactory } from "./aws-iam/aws-iam-resource-factory";
import { kubernetesResourceFactory } from "./kubernetes/kubernetes-resource-factory";
import { PamResource } from "./pam-resource-enums";
import { TPamAccountCredentials, TPamResourceConnectionDetails, TPamResourceFactory } from "./pam-resource-types";
import { redisResourceFactory } from "./redis/redis-resource-factory";
import { sqlResourceFactory } from "./shared/sql/sql-resource-factory";
import { sshResourceFactory } from "./ssh/ssh-resource-factory";

Expand All @@ -12,5 +13,6 @@ export const PAM_RESOURCE_FACTORY_MAP: Record<PamResource, TPamResourceFactoryIm
[PamResource.MySQL]: sqlResourceFactory as TPamResourceFactoryImplementation,
[PamResource.SSH]: sshResourceFactory as TPamResourceFactoryImplementation,
[PamResource.Kubernetes]: kubernetesResourceFactory as TPamResourceFactoryImplementation,
[PamResource.AwsIam]: awsIamResourceFactory as TPamResourceFactoryImplementation
[PamResource.AwsIam]: awsIamResourceFactory as TPamResourceFactoryImplementation,
[PamResource.Redis]: redisResourceFactory as TPamResourceFactoryImplementation
};
4 changes: 3 additions & 1 deletion backend/src/ee/services/pam-resource/pam-resource-fns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
};

Expand Down
28 changes: 24 additions & 4 deletions backend/src/ee/services/pam-resource/pam-resource-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ import {
TPostgresResource,
TPostgresResourceConnectionDetails
} from "./postgres/postgres-resource-types";
import {
TRedisAccount,
TRedisAccountCredentials,
TRedisResource,
TRedisResourceConnectionDetails
} from "./redis/redis-resource-types";
import {
TSSHAccount,
TSSHAccountCredentials,
Expand All @@ -35,25 +41,39 @@ import {
} from "./ssh/ssh-resource-types";

// Resource types
export type TPamResource = TPostgresResource | TMySQLResource | TSSHResource | TAwsIamResource | TKubernetesResource;
export type TPamResource =
| TPostgresResource
| TMySQLResource
| TSSHResource
| TAwsIamResource
| TKubernetesResource
| TRedisResource;
export type TPamResourceConnectionDetails =
| TPostgresResourceConnectionDetails
| TMySQLResourceConnectionDetails
| TSSHResourceConnectionDetails
| TKubernetesResourceConnectionDetails
| TAwsIamResourceConnectionDetails;
| TAwsIamResourceConnectionDetails
| TRedisResourceConnectionDetails;
export type TPamResourceMetadata = TSSHResourceMetadata;

// Account types
export type TPamAccount = TPostgresAccount | TMySQLAccount | TSSHAccount | TAwsIamAccount | TKubernetesAccount;
export type TPamAccount =
| TPostgresAccount
| TMySQLAccount
| TSSHAccount
| TAwsIamAccount
| TKubernetesAccount
| TRedisAccount;

export type TPamAccountCredentials =
| TPostgresAccountCredentials
// eslint-disable-next-line @typescript-eslint/no-duplicate-type-constituents
| TMySQLAccountCredentials
| TSSHAccountCredentials
| TKubernetesAccountCredentials
| TAwsIamAccountCredentials;
| TAwsIamAccountCredentials
| TRedisAccountCredentials;

// Resource DTOs
export type TCreateResourceDTO = Pick<TPamResource, "name" | "connectionDetails" | "resourceType" | "projectId"> & {
Expand Down
Loading
Loading