mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 16:28:11 +00:00
misc: addressed type comment
This commit is contained in:
@@ -37,6 +37,11 @@ export enum DynamicSecretProviders {
|
|||||||
Vertica = "vertica"
|
Vertica = "vertica"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum KubernetesDynamicSecretCredentialType {
|
||||||
|
Static = "static",
|
||||||
|
Dynamic = "dynamic"
|
||||||
|
}
|
||||||
|
|
||||||
export enum SqlProviders {
|
export enum SqlProviders {
|
||||||
Postgres = "postgres",
|
Postgres = "postgres",
|
||||||
MySql = "mysql2",
|
MySql = "mysql2",
|
||||||
@@ -273,7 +278,7 @@ export type TDynamicSecretProvider =
|
|||||||
clusterToken?: string;
|
clusterToken?: string;
|
||||||
ca?: string;
|
ca?: string;
|
||||||
serviceAccountName: string;
|
serviceAccountName: string;
|
||||||
credentialType: "static";
|
credentialType: KubernetesDynamicSecretCredentialType.Static;
|
||||||
namespace: string;
|
namespace: string;
|
||||||
gatewayId?: string;
|
gatewayId?: string;
|
||||||
sslEnabled: boolean;
|
sslEnabled: boolean;
|
||||||
@@ -284,7 +289,7 @@ export type TDynamicSecretProvider =
|
|||||||
url: string;
|
url: string;
|
||||||
clusterToken?: string;
|
clusterToken?: string;
|
||||||
ca?: string;
|
ca?: string;
|
||||||
credentialType: "dynamic";
|
credentialType: KubernetesDynamicSecretCredentialType.Dynamic;
|
||||||
namespace: string;
|
namespace: string;
|
||||||
gatewayId?: string;
|
gatewayId?: string;
|
||||||
sslEnabled: boolean;
|
sslEnabled: boolean;
|
||||||
|
|||||||
+12
-14
@@ -29,15 +29,13 @@ import {
|
|||||||
import { OrgPermissionSubjects } from "@app/context/OrgPermissionContext";
|
import { OrgPermissionSubjects } from "@app/context/OrgPermissionContext";
|
||||||
import { OrgGatewayPermissionActions } from "@app/context/OrgPermissionContext/types";
|
import { OrgGatewayPermissionActions } from "@app/context/OrgPermissionContext/types";
|
||||||
import { gatewaysQueryKeys, useCreateDynamicSecret } from "@app/hooks/api";
|
import { gatewaysQueryKeys, useCreateDynamicSecret } from "@app/hooks/api";
|
||||||
import { DynamicSecretProviders } from "@app/hooks/api/dynamicSecret/types";
|
import {
|
||||||
|
DynamicSecretProviders,
|
||||||
|
KubernetesDynamicSecretCredentialType
|
||||||
|
} from "@app/hooks/api/dynamicSecret/types";
|
||||||
import { WorkspaceEnv } from "@app/hooks/api/types";
|
import { WorkspaceEnv } from "@app/hooks/api/types";
|
||||||
import { slugSchema } from "@app/lib/schemas";
|
import { slugSchema } from "@app/lib/schemas";
|
||||||
|
|
||||||
enum CredentialType {
|
|
||||||
Dynamic = "dynamic",
|
|
||||||
Static = "static"
|
|
||||||
}
|
|
||||||
|
|
||||||
enum RoleType {
|
enum RoleType {
|
||||||
ClusterRole = "cluster-role",
|
ClusterRole = "cluster-role",
|
||||||
Role = "role"
|
Role = "role"
|
||||||
@@ -51,11 +49,11 @@ export enum AuthMethod {
|
|||||||
const credentialTypes = [
|
const credentialTypes = [
|
||||||
{
|
{
|
||||||
label: "Static",
|
label: "Static",
|
||||||
value: CredentialType.Static
|
value: KubernetesDynamicSecretCredentialType.Static
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Dynamic",
|
label: "Dynamic",
|
||||||
value: CredentialType.Dynamic
|
value: KubernetesDynamicSecretCredentialType.Dynamic
|
||||||
}
|
}
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
@@ -67,7 +65,7 @@ const formSchema = z
|
|||||||
clusterToken: z.string().trim().optional(),
|
clusterToken: z.string().trim().optional(),
|
||||||
ca: z.string().optional(),
|
ca: z.string().optional(),
|
||||||
sslEnabled: z.boolean().default(false),
|
sslEnabled: z.boolean().default(false),
|
||||||
credentialType: z.literal(CredentialType.Static),
|
credentialType: z.literal(KubernetesDynamicSecretCredentialType.Static),
|
||||||
serviceAccountName: z.string().trim().min(1),
|
serviceAccountName: z.string().trim().min(1),
|
||||||
namespace: z.string().trim().min(1),
|
namespace: z.string().trim().min(1),
|
||||||
gatewayId: z.string().optional(),
|
gatewayId: z.string().optional(),
|
||||||
@@ -79,7 +77,7 @@ const formSchema = z
|
|||||||
clusterToken: z.string().trim().optional(),
|
clusterToken: z.string().trim().optional(),
|
||||||
ca: z.string().optional(),
|
ca: z.string().optional(),
|
||||||
sslEnabled: z.boolean().default(false),
|
sslEnabled: z.boolean().default(false),
|
||||||
credentialType: z.literal(CredentialType.Dynamic),
|
credentialType: z.literal(KubernetesDynamicSecretCredentialType.Dynamic),
|
||||||
namespace: z.string().trim().min(1),
|
namespace: z.string().trim().min(1),
|
||||||
gatewayId: z.string().optional(),
|
gatewayId: z.string().optional(),
|
||||||
audiences: z.array(z.string().trim().min(1)),
|
audiences: z.array(z.string().trim().min(1)),
|
||||||
@@ -161,7 +159,7 @@ export const KubernetesInputForm = ({
|
|||||||
sslEnabled: false,
|
sslEnabled: false,
|
||||||
serviceAccountName: "",
|
serviceAccountName: "",
|
||||||
namespace: "",
|
namespace: "",
|
||||||
credentialType: CredentialType.Static,
|
credentialType: KubernetesDynamicSecretCredentialType.Static,
|
||||||
gatewayId: undefined,
|
gatewayId: undefined,
|
||||||
audiences: [],
|
audiences: [],
|
||||||
authMethod: AuthMethod.Api
|
authMethod: AuthMethod.Api
|
||||||
@@ -464,7 +462,7 @@ export const KubernetesInputForm = ({
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
{credentialType === CredentialType.Static && (
|
{credentialType === KubernetesDynamicSecretCredentialType.Static && (
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
@@ -481,7 +479,7 @@ export const KubernetesInputForm = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{credentialType === CredentialType.Dynamic && (
|
{credentialType === KubernetesDynamicSecretCredentialType.Dynamic && (
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
@@ -519,7 +517,7 @@ export const KubernetesInputForm = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{credentialType === CredentialType.Dynamic && (
|
{credentialType === KubernetesDynamicSecretCredentialType.Dynamic && (
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
<Controller
|
<Controller
|
||||||
|
|||||||
+11
-13
@@ -28,14 +28,12 @@ import {
|
|||||||
import { OrgPermissionSubjects } from "@app/context/OrgPermissionContext";
|
import { OrgPermissionSubjects } from "@app/context/OrgPermissionContext";
|
||||||
import { OrgGatewayPermissionActions } from "@app/context/OrgPermissionContext/types";
|
import { OrgGatewayPermissionActions } from "@app/context/OrgPermissionContext/types";
|
||||||
import { gatewaysQueryKeys, useUpdateDynamicSecret } from "@app/hooks/api";
|
import { gatewaysQueryKeys, useUpdateDynamicSecret } from "@app/hooks/api";
|
||||||
import { TDynamicSecret } from "@app/hooks/api/dynamicSecret/types";
|
import {
|
||||||
|
KubernetesDynamicSecretCredentialType,
|
||||||
|
TDynamicSecret
|
||||||
|
} from "@app/hooks/api/dynamicSecret/types";
|
||||||
import { slugSchema } from "@app/lib/schemas";
|
import { slugSchema } from "@app/lib/schemas";
|
||||||
|
|
||||||
enum CredentialType {
|
|
||||||
Dynamic = "dynamic",
|
|
||||||
Static = "static"
|
|
||||||
}
|
|
||||||
|
|
||||||
enum RoleType {
|
enum RoleType {
|
||||||
ClusterRole = "cluster-role",
|
ClusterRole = "cluster-role",
|
||||||
Role = "role"
|
Role = "role"
|
||||||
@@ -49,11 +47,11 @@ enum AuthMethod {
|
|||||||
const credentialTypes = [
|
const credentialTypes = [
|
||||||
{
|
{
|
||||||
label: "Static",
|
label: "Static",
|
||||||
value: CredentialType.Static
|
value: KubernetesDynamicSecretCredentialType.Static
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Dynamic",
|
label: "Dynamic",
|
||||||
value: CredentialType.Dynamic
|
value: KubernetesDynamicSecretCredentialType.Dynamic
|
||||||
}
|
}
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
@@ -65,7 +63,7 @@ const formSchema = z
|
|||||||
clusterToken: z.string().trim().optional(),
|
clusterToken: z.string().trim().optional(),
|
||||||
ca: z.string().optional(),
|
ca: z.string().optional(),
|
||||||
sslEnabled: z.boolean().default(false),
|
sslEnabled: z.boolean().default(false),
|
||||||
credentialType: z.literal(CredentialType.Static),
|
credentialType: z.literal(KubernetesDynamicSecretCredentialType.Static),
|
||||||
serviceAccountName: z.string().trim().min(1),
|
serviceAccountName: z.string().trim().min(1),
|
||||||
namespace: z.string().trim().min(1),
|
namespace: z.string().trim().min(1),
|
||||||
gatewayId: z.string().optional(),
|
gatewayId: z.string().optional(),
|
||||||
@@ -77,7 +75,7 @@ const formSchema = z
|
|||||||
clusterToken: z.string().trim().optional(),
|
clusterToken: z.string().trim().optional(),
|
||||||
ca: z.string().optional(),
|
ca: z.string().optional(),
|
||||||
sslEnabled: z.boolean().default(false),
|
sslEnabled: z.boolean().default(false),
|
||||||
credentialType: z.literal(CredentialType.Dynamic),
|
credentialType: z.literal(KubernetesDynamicSecretCredentialType.Dynamic),
|
||||||
namespace: z.string().trim().min(1),
|
namespace: z.string().trim().min(1),
|
||||||
gatewayId: z.string().optional(),
|
gatewayId: z.string().optional(),
|
||||||
audiences: z.array(z.string().trim().min(1)),
|
audiences: z.array(z.string().trim().min(1)),
|
||||||
@@ -460,7 +458,7 @@ export const EditDynamicSecretKubernetesForm = ({
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
{credentialType === CredentialType.Static && (
|
{credentialType === KubernetesDynamicSecretCredentialType.Static && (
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
@@ -477,7 +475,7 @@ export const EditDynamicSecretKubernetesForm = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{credentialType === CredentialType.Dynamic && (
|
{credentialType === KubernetesDynamicSecretCredentialType.Dynamic && (
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
@@ -514,7 +512,7 @@ export const EditDynamicSecretKubernetesForm = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{credentialType === CredentialType.Dynamic && (
|
{credentialType === KubernetesDynamicSecretCredentialType.Dynamic && (
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
<Controller
|
<Controller
|
||||||
|
|||||||
Reference in New Issue
Block a user