Skip to content

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

Merge remote-tracking branch 'origin/main' into feat-secret-input-autocomplete

Sheen Capadnganfb69236f47d2
diff --cc backend/src/server/routes/v1/project-env-router.ts
index db35e16f65,ef51f865c6..341b8a184e
--- a/backend/src/server/routes/v1/project-env-router.ts
+++ b/backend/src/server/routes/v1/project-env-router.ts
@@@ -19,16 -22,11 +23,17 @@@ export const registerProjectEnvRouter
}
],
params: z.object({
- workspaceId: z.string().trim()
+ workspaceId: z.string().trim().describe(ENVIRONMENTS.CREATE.workspaceId)
}),
body: z.object({
- name: z.string().trim(),
+ name: z.string().trim().describe(ENVIRONMENTS.CREATE.name),
- slug: z.string().trim().describe(ENVIRONMENTS.CREATE.slug)
+ slug: z
+ .string()
+ .trim()
+ .refine((v) => slugify(v) === v, {
+ message: "Slug must be a valid slug"
+ })
++ .describe(ENVIRONMENTS.CREATE.slug)
}),
response: {
200: z.object({
@@@ -79,17 -80,13 +87,20 @@@
}
],
params: z.object({
- workspaceId: z.string().trim(),
- id: z.string().trim()
+ workspaceId: z.string().trim().describe(ENVIRONMENTS.UPDATE.workspaceId),
+ id: z.string().trim().describe(ENVIRONMENTS.UPDATE.id)
}),
body: z.object({
- slug: z.string().trim().optional().describe(ENVIRONMENTS.UPDATE.slug),
+ slug: z
+ .string()
- .regex(/^[^./]*$/g)
+ .trim()
- .optional(),
- name: z.string().trim().optional(),
- position: z.number().optional()
++ .optional()
++ .refine((v) => !v || slugify(v) === v, {
++ message: "Slug must be a valid slug"
++ })
++ .describe(ENVIRONMENTS.UPDATE.slug),
+ name: z.string().trim().optional().describe(ENVIRONMENTS.UPDATE.name),
+ position: z.number().optional().describe(ENVIRONMENTS.UPDATE.position)
}),
response: {
200: z.object({
diff --cc frontend/src/views/SecretMainPage/components/CreateSecretForm/CreateSecretForm.tsx
index edd5d8df99,23f8089d1d..7ac057eef7
--- a/frontend/src/views/SecretMainPage/components/CreateSecretForm/CreateSecretForm.tsx
+++ b/frontend/src/views/SecretMainPage/components/CreateSecretForm/CreateSecretForm.tsx
@@@ -2,9 -2,8 +2,9 @@@ import { Controller, useForm } from "re
import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod";
- import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
+ import { createNotification } from "@app/components/notifications";
-import { Button, FormControl, Input, Modal, ModalContent, SecretInput } from "@app/components/v2";
+import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";
+import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput/InfisicalSecretInput";
import { useCreateSecretV3 } from "@app/hooks/api";
import { UserWsKeyPair } from "@app/hooks/api/types";
@@@ -45,8 -44,8 +45,6 @@@ export const CreateSecretForm = (
const { isOpen } = usePopUpState(PopUpNames.CreateSecretForm);
const { closePopUp, togglePopUp } = usePopUpAction();
- const { createNotification } = useNotificationContext();
-
--
const { mutateAsync: createSecretV3 } = useCreateSecretV3();
const handleFormSubmit = async ({ key, value }: TFormSchema) => {
diff --cc frontend/src/views/SecretOverviewPage/components/SecretOverviewTableRow/SecretEditRow.tsx
index 6f70bb59bb,e06a6d5002..5dd8db4d61
--- a/frontend/src/views/SecretOverviewPage/components/SecretOverviewTableRow/SecretEditRow.tsx
+++ b/frontend/src/views/SecretOverviewPage/components/SecretOverviewTableRow/SecretEditRow.tsx
@@@ -2,11 -2,11 +2,12 @@@ import { Controller, useForm } from "re
import { subject } from "@casl/ability";
import { faCheck, faCopy, faTrash, faXmark } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
+ import { twMerge } from "tailwind-merge";
- import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
+ import { createNotification } from "@app/components/notifications";
import { ProjectPermissionCan } from "@app/components/permissions";
-import { IconButton, SecretInput, Tooltip } from "@app/components/v2";
+import { IconButton, Tooltip } from "@app/components/v2";
+import { InfisicalSecretInput } from "@app/components/v2/InfisicalSecretInput/InfisicalSecretInput";
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
import { useToggle } from "@app/hooks";
@@@ -47,7 -49,7 +50,6 @@@ export const SecretEditRow = (
}
});
const [isDeleting, setIsDeleting] = useToggle();
- const { createNotification } = useNotificationContext();
-
const handleFormReset = () => {
reset();
@@@ -98,8 -101,7 +101,9 @@@
{...field}
value={field.value as string}
isVisible={isVisible}
+ secretPath={secretPath}
+ environment={environment}
+ isImport={isImportedSecret}
/>
)}
/>
diff --cc frontend/src/views/Settings/ProjectSettingsPage/components/EnvironmentSection/AddEnvironmentModal.tsx
index f12dcfa4d1,658faea0e3..68bbeb8406
--- a/frontend/src/views/Settings/ProjectSettingsPage/components/EnvironmentSection/AddEnvironmentModal.tsx
+++ b/frontend/src/views/Settings/ProjectSettingsPage/components/EnvironmentSection/AddEnvironmentModal.tsx
@@@ -1,9 -1,8 +1,9 @@@
import { Controller, useForm } from "react-hook-form";
import { yupResolver } from "@hookform/resolvers/yup";
+import slugify from "@sindresorhus/slugify";
import * as yup from "yup";
- import { useNotificationContext } from "@app/components/context/Notifications/NotificationProvider";
+ import { createNotification } from "@app/components/notifications";
import { Button, FormControl, Input, Modal, ModalContent } from "@app/components/v2";
import { useWorkspace } from "@app/context";
import { useCreateWsEnvironment } from "@app/hooks/api";