mirror of
https://github.com/Infisical/infisical.git
synced 2026-01-10 07:58:15 -05:00
Add more missing redis stuff
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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));
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { RedisResourceListItemSchema } from "./redis-resource-schemas";
|
||||
|
||||
export const getRedisResourceListItem = () => {
|
||||
return {
|
||||
name: RedisResourceListItemSchema.shape.name.value,
|
||||
resource: RedisResourceListItemSchema.shape.resource.value
|
||||
};
|
||||
};
|
||||
@@ -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;
|
||||
|
||||
28
frontend/src/hooks/api/pam/types/redis-resource.ts
Normal file
28
frontend/src/hooks/api/pam/types/redis-resource.ts
Normal file
@@ -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;
|
||||
};
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user