Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
fea: add support for tags, metadata and multiline encoding to csv upload
Scott Wilson5ba7ceddb3b5
diff --git a/frontend/src/components/utilities/parseSecrets.ts b/frontend/src/components/utilities/parseSecrets.tsindex e33f25ace8..115fbae5e8 100644--- a/frontend/src/components/utilities/parseSecrets.ts+++ b/frontend/src/components/utilities/parseSecrets.ts@@ -180,7 +180,10 @@ function detectSeparator(csvContent: string): string {return detected.count > 0 ? detected.separator : ",";}-export function parseCsvToMatrix(src: ArrayBuffer | string): string[][] {+export function parseCsvToMatrix(src: ArrayBuffer | string): {+ matrix: string[][];+ delimiter: string;+} {let csvContent: string;if (typeof src === "string") {csvContent = src;@@ -189,37 +192,45 @@ export function parseCsvToMatrix(src: ArrayBuffer | string): string[][] {}const separator = detectSeparator(csvContent);- const lines = csvContent.replace(/\r\n?/g, "\n").split("\n");+ const normalized = csvContent.replace(/\r\n?/g, "\n");const matrix: string[][] = [];- lines.forEach((line) => {- if (line.trim() !== "") {- const cells: string[] = [];- let currentCell = "";- let inQuote = false;+ let cells: string[] = [];+ let currentCell = "";+ let inQuote = false;- for (let i = 0; i < line.length; i += 1) {- const char = line[i];- const nextChar = line[i + 1];+ for (let i = 0; i < normalized.length; i += 1) {+ const char = normalized[i];+ const nextChar = normalized[i + 1];- if (char === '"') {- if (inQuote && nextChar === '"') {- currentCell += '"';- i += 1;- } else {- inQuote = !inQuote;- }- } else if (char === separator && !inQuote) {- cells.push(currentCell.trim());- currentCell = "";- } else {- currentCell += char;- }+ if (char === '"') {+ if (inQuote && nextChar === '"') {+ currentCell += '"';+ i += 1;+ } else {+ inQuote = !inQuote;}+ } else if (char === separator && !inQuote) {+ cells.push(currentCell.trim());+ currentCell = "";+ } else if (char === "\n" && !inQuote) {cells.push(currentCell.trim());+ if (cells.some((c) => c !== "")) {+ matrix.push(cells);+ }+ cells = [];+ currentCell = "";+ } else {+ currentCell += char;+ }+ }++ if (currentCell.length > 0 || cells.length > 0) {+ cells.push(currentCell.trim());+ if (cells.some((c) => c !== "")) {matrix.push(cells);}- });+ }- return matrix;+ return { matrix, delimiter: separator };}diff --git a/frontend/src/hooks/api/secrets/types.ts b/frontend/src/hooks/api/secrets/types.tsindex 93f72c2d06..8a37c4c7e3 100644--- a/frontend/src/hooks/api/secrets/types.ts+++ b/frontend/src/hooks/api/secrets/types.ts@@ -217,6 +217,7 @@ export type TCreateSecretBatchDTO = {skipMultilineEncoding?: boolean | null;type: SecretType;tagIds?: string[];+ secretMetadata?: { key: string; value: string; isEncrypted?: boolean }[];metadata?: {source?: string;};@@ -234,6 +235,7 @@ export type TUpdateSecretBatchDTO = {secretComment?: string;skipMultilineEncoding?: boolean | null;tagIds?: string[];+ secretMetadata?: { key: string; value: string; isEncrypted?: boolean }[];metadata?: {source?: string;};diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretDropzone/CsvColumnMapDialog.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretDropzone/CsvColumnMapDialog.tsxindex 78f180d5fa..9dc3b046a4 100644--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretDropzone/CsvColumnMapDialog.tsx+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretDropzone/CsvColumnMapDialog.tsx@@ -1,5 +1,14 @@-import { Dispatch, SetStateAction, useState } from "react";-import { ArrowRightIcon, AsteriskIcon, KeyIcon, MessageSquareIcon } from "lucide-react";+import { Dispatch, ReactNode, SetStateAction, useState } from "react";+import {+ ArrowRightIcon,+ AsteriskIcon,+ CodeXmlIcon,+ InfoIcon,+ KeyIcon,+ MessageSquareIcon,+ TagsIcon,+ WrapTextIcon+} from "lucide-react";import { createNotification } from "@app/components/notifications";import { FormLabel } from "@app/components/v2";@@ -15,35 +24,140 @@ import {SelectContent,SelectItem,SelectTrigger,- SelectValue+ SelectValue,+ Tooltip,+ TooltipContent,+ TooltipTrigger} from "@app/components/v3";-type TParsedEnv = Record<string, { value: string; comments: string[] }>;+import { TParsedEnv } from "./types";type SecretMatrixMap = {key: number;value: number | null;comment: number | null;+ tags: number | null;+ metadata: number | null;+ skipMultilineEncoding: number | null;};+type MapKey = keyof SecretMatrixMap;+type Props = {isOpen: boolean;onOpenChange: (isOpen: boolean) => void;headers: string[];matrix: string[][];+ delimiter: string;onParsedSecrets: (env: TParsedEnv) => void;};+const TRUTHY_VALUES = new Set(["true", "1", "yes", "y", "t"]);++const pickInnerSeparator = (primaryDelimiter: string): string =>+ primaryDelimiter === ";" ? "|" : ";";++const parseTagCell = (cell: string, innerSeparator: string): string[] =>+ cell+ .split(innerSeparator)+ .map((s) => s.trim())+ .filter(Boolean);++const parseMetadataCell = (+ cell: string,+ innerSeparator: string+): { pairs: { key: string; value: string }[]; malformed: boolean } => {+ if (!cell.trim()) return { pairs: [], malformed: false };+ const pairs: { key: string; value: string }[] = [];+ let malformed = false;+ cell.split(innerSeparator).forEach((chunk) => {+ const trimmed = chunk.trim();+ if (!trimmed) return;+ const eqIdx = trimmed.indexOf("=");+ if (eqIdx === -1) {+ malformed = true;+ return;+ }+ const key = trimmed.slice(0, eqIdx).trim();+ const value = trimmed.slice(eqIdx + 1).trim();+ if (!key) {+ malformed = true;+ return;+ }+ pairs.push({ key, value });+ });+ return { pairs, malformed };+};++const parseBooleanCell = (cell: string): boolean => TRUTHY_VALUES.has(cell.trim().toLowerCase());++type MatrixRow = {+ mapKey: MapKey;+ label: string;+ icon: ReactNode;+ hint?: (innerSeparator: string) => ReactNode;+};++const MATRIX_ROWS: MatrixRow[] = [+ { mapKey: "key", label: "Secret Key", icon: <KeyIcon /> },+ { mapKey: "value", label: "Secret Value", icon: <AsteriskIcon /> },+ { mapKey: "comment", label: "Comment", icon: <MessageSquareIcon /> },+ {+ mapKey: "tags",+ label: "Tags",+ icon: <TagsIcon />,+ hint: (sep) => (+ <>+ Separate multiple tag slugs with{" "}+ <code className="rounded bg-bunker-400/30 px-1">{sep}</code> (e.g.{" "}+ <code className="rounded bg-bunker-400/30 px-1">prod{sep}api</code>). Missing tags are+ auto-created if you have permission.+ </>+ )+ },+ {+ mapKey: "metadata",+ label: "Metadata",+ icon: <CodeXmlIcon />,+ hint: (sep) => (+ <>+ Provide <code className="rounded bg-bunker-400/30 px-1">key=value</code> pairs separated by{" "}+ <code className="rounded bg-bunker-400/30 px-1">{sep}</code> (e.g.{" "}+ <code className="rounded bg-bunker-400/30 px-1">owner=team-a{sep}tier=p0</code>).+ </>+ )+ },+ {+ mapKey: "skipMultilineEncoding",+ label: "Multi-line Encoding",+ icon: <WrapTextIcon />,+ hint: () => (+ <>+ Truthy cells (<code className="rounded bg-bunker-400/30 px-1">true</code>,{" "}+ <code className="rounded bg-bunker-400/30 px-1">1</code>,{" "}+ <code className="rounded bg-bunker-400/30 px-1">yes</code>) enable multi-line encoding;+ anything else leaves it disabled.+ </>+ )+ }+];+const MatrixImportModalTableRow = ({importSecretMatrixMap,setImportSecretMatrixMap,headers,- mapKey+ mapKey,+ label,+ icon,+ hint}: {importSecretMatrixMap: SecretMatrixMap;setImportSecretMatrixMap: Dispatch<SetStateAction<SecretMatrixMap>>;headers: string[];- mapKey: keyof SecretMatrixMap;+ mapKey: MapKey;+ label: string;+ icon: ReactNode;+ hint?: ReactNode;}) => {return (<tr>@@ -76,27 +190,21 @@ const MatrixImportModalTableRow = ({</div></td><td className="whitespace-nowrap">- <div className="flex h-full items-start justify-center">- <Badge isFullWidth variant="neutral">- {mapKey === "key" && (- <>- <KeyIcon />- Secret Key- </>- )}- {mapKey === "value" && (- <>- <AsteriskIcon />- Secret Value- </>- )}- {mapKey === "comment" && (- <>- <MessageSquareIcon />- Comment- </>- )}+ <div className="flex h-full items-center justify-center gap-1.5">+ <Badge className="flex-1" variant="neutral">+ {icon}+ {label}</Badge>+ {hint && (+ <Tooltip delayDuration={300}>+ <TooltipTrigger asChild>+ <span className="flex size-4 shrink-0 items-center justify-center text-muted">+ <InfoIcon className="size-3.5" />+ </span>+ </TooltipTrigger>+ <TooltipContent className="max-w-xs">{hint}</TooltipContent>+ </Tooltip>+ )}</div></td></tr>@@ -106,17 +214,29 @@ const MatrixImportModalTableRow = ({type ContentProps = {headers: string[];matrix: string[][];+ delimiter: string;onParsedSecrets: (env: TParsedEnv) => void;onClose: () => void;};-const CsvColumnMapContent = ({ headers, matrix, onParsedSecrets, onClose }: ContentProps) => {+const CsvColumnMapContent = ({+ headers,+ matrix,+ delimiter,+ onParsedSecrets,+ onClose+}: ContentProps) => {const [importSecretMatrixMap, setImportSecretMatrixMap] = useState<SecretMatrixMap>({key: 0,value: null,- comment: null+ comment: null,+ tags: null,+ metadata: null,+ skipMultilineEncoding: null});+ const innerSeparator = pickInnerSeparator(delimiter);+const handleImport = () => {if (!matrix.length) {createNotification({@@ -127,18 +247,56 @@ const CsvColumnMapContent = ({ headers, matrix, onParsedSecrets, onClose }: Cont}const env: TParsedEnv = {};+ let malformedMetadataRows = 0;+matrix.forEach((row) => {const key = row[importSecretMatrixMap.key];- if (key) {- env[key] = {- value: importSecretMatrixMap.value !== null ? row[importSecretMatrixMap.value] || "" : "",- comments:- importSecretMatrixMap.comment !== null ? [row[importSecretMatrixMap.comment] || ""] : []- };+ if (!key) return;++ const entry: TParsedEnv[string] = {+ value: importSecretMatrixMap.value !== null ? row[importSecretMatrixMap.value] || "" : "",+ comments:+ importSecretMatrixMap.comment !== null ? [row[importSecretMatrixMap.comment] || ""] : []+ };++ if (importSecretMatrixMap.tags !== null) {+ const tagSlugs = parseTagCell(row[importSecretMatrixMap.tags] || "", innerSeparator);+ if (tagSlugs.length) entry.tagSlugs = tagSlugs;+ }++ if (importSecretMatrixMap.metadata !== null) {+ const { pairs, malformed } = parseMetadataCell(+ row[importSecretMatrixMap.metadata] || "",+ innerSeparator+ );+ if (malformed) malformedMetadataRows += 1;+ if (pairs.length) entry.secretMetadata = pairs;+ }++ if (importSecretMatrixMap.skipMultilineEncoding !== null) {+ entry.skipMultilineEncoding = parseBooleanCell(+ row[importSecretMatrixMap.skipMultilineEncoding] || ""+ );}++ env[key] = entry;});- setImportSecretMatrixMap({ key: 0, value: null, comment: null });+ if (malformedMetadataRows > 0) {+ createNotification({+ type: "warning",+ text: `Skipped malformed metadata in ${malformedMetadataRows} row${malformedMetadataRows > 1 ? "s" : ""}. Expected format: key=value${innerSeparator}key=value`+ });+ }++ setImportSecretMatrixMap({+ key: 0,+ value: null,+ comment: null,+ tags: null,+ metadata: null,+ skipMultilineEncoding: null+ });onClose();onParsedSecrets(env);};@@ -148,7 +306,7 @@ const CsvColumnMapContent = ({ headers, matrix, onParsedSecrets, onClose }: Cont<DialogHeader><DialogTitle>Import Column Mapping</DialogTitle><p className="text-sm text-accent">- Map your data columns to different parts of the secret+ Map your data columns to different parts of the secret.</p></DialogHeader><div className="w-full overflow-hidden">@@ -165,24 +323,18 @@ const CsvColumnMapContent = ({ headers, matrix, onParsedSecrets, onClose }: Cont</tr></thead><tbody>- <MatrixImportModalTableRow- importSecretMatrixMap={importSecretMatrixMap}- setImportSecretMatrixMap={setImportSecretMatrixMap}- headers={headers}- mapKey="key"- />- <MatrixImportModalTableRow- importSecretMatrixMap={importSecretMatrixMap}- setImportSecretMatrixMap={setImportSecretMatrixMap}- headers={headers}- mapKey="value"- />- <MatrixImportModalTableRow- importSecretMatrixMap={importSecretMatrixMap}- setImportSecretMatrixMap={setImportSecretMatrixMap}- headers={headers}- mapKey="comment"- />+ {MATRIX_ROWS.map((row) => (+ <MatrixImportModalTableRow+ key={row.mapKey}+ importSecretMatrixMap={importSecretMatrixMap}+ setImportSecretMatrixMap={setImportSecretMatrixMap}+ headers={headers}+ mapKey={row.mapKey}+ label={row.label}+ icon={row.icon}+ hint={row.hint?.(innerSeparator)}+ />+ ))}</tbody></table></div>@@ -203,6 +355,7 @@ export const CsvColumnMapDialog = ({onOpenChange,headers,matrix,+ delimiter,onParsedSecrets}: Props) => {return (@@ -211,6 +364,7 @@ export const CsvColumnMapDialog = ({<CsvColumnMapContentheaders={headers}matrix={matrix}+ delimiter={delimiter}onParsedSecrets={onParsedSecrets}onClose={() => onOpenChange(false)}/>diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretDropzone/ImportSecretsModal.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretDropzone/ImportSecretsModal.tsxindex ba981ec270..adddd44710 100644--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretDropzone/ImportSecretsModal.tsx+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretDropzone/ImportSecretsModal.tsx@@ -2,11 +2,14 @@ import { ChangeEvent, DragEvent, useCallback, useState } from "react";import { subject } from "@casl/ability";import {ClipboardPasteIcon,+ CodeXmlIcon,EyeIcon,EyeOffIcon,InfoIcon,MessageSquareIcon,- UploadIcon+ TagsIcon,+ UploadIcon,+ WrapTextIcon} from "lucide-react";import { twMerge } from "tailwind-merge";@@ -52,12 +55,12 @@ import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionCoimport { useToggle } from "@app/hooks";import { useCreateSecretBatch, useGetOrCreateFolder, useUpdateSecretBatch } from "@app/hooks/api";import { fetchProjectSecrets, mergePersonalSecrets } from "@app/hooks/api/secrets/queries";+import { useCreateWsTag, useGetWsTags } from "@app/hooks/api/tags/queries";import { SecretType } from "@app/hooks/api/types";import { CsvColumnMapDialog } from "./CsvColumnMapDialog";import { PasteSecretsDialog } from "./PasteSecretsDialog";--type TParsedEnv = Record<string, { value: string; comments: string[] }>;+import { TParsedEnv } from "./types";type Props = {isOpen: boolean;@@ -92,13 +95,22 @@ const ImportSecretsContent = ({const [isDragActive, setDragActive] = useToggle();const [isImporting, setIsImporting] = useToggle();const [isPasteOpen, setIsPasteOpen] = useState(false);- const [csvData, setCsvData] = useState<{ headers: string[]; matrix: string[][] } | null>(null);+ const [csvData, setCsvData] = useState<{+ headers: string[];+ matrix: string[][];+ delimiter: string;+ } | null>(null);const [visibleSecretKeys, setVisibleSecretKeys] = useState<Set<string>>(new Set());const [shouldOverwrite, setShouldOverwrite] = useState(false);const { mutateAsync: createSecretBatch } = useCreateSecretBatch();const { mutateAsync: updateSecretBatch } = useUpdateSecretBatch();const { mutateAsync: getOrCreateFolder } = useGetOrCreateFolder();+ const { mutateAsync: createWsTag } = useCreateWsTag();++ const canReadTags = permission.can(ProjectPermissionActions.Read, ProjectPermissionSub.Tags);+ const canCreateTags = permission.can(ProjectPermissionActions.Create, ProjectPermissionSub.Tags);+ const { data: projectTags } = useGetWsTags(canReadTags ? projectId : "");const allowedEnvironments = environments.filter((env) =>permission.can(@@ -158,7 +170,7 @@ const ImportSecretsContent = ({handleParsedSecrets(parseYaml(src));break;case "text/csv": {- const fullMatrix = parseCsvToMatrix(src);+ const { matrix: fullMatrix, delimiter } = parseCsvToMatrix(src);if (!fullMatrix.length) {createNotification({type: "error",@@ -166,7 +178,7 @@ const ImportSecretsContent = ({});return;}- setCsvData({ headers: fullMatrix[0], matrix: fullMatrix.slice(1) });+ setCsvData({ headers: fullMatrix[0], matrix: fullMatrix.slice(1), delimiter });return;}default:@@ -214,6 +226,51 @@ const ImportSecretsContent = ({setIsImporting.on();try {+ const requestedSlugs = new Set<string>();+ Object.values(activeSecrets).forEach((s) => {+ s.tagSlugs?.forEach((slug) => requestedSlugs.add(slug));+ });++ const slugToTagId = new Map<string, string>();+ (projectTags || []).forEach((t) => slugToTagId.set(t.slug, t.id));++ const missingSlugs = [...requestedSlugs].filter((slug) => !slugToTagId.has(slug));+ let skippedTagsCount = 0;++ if (missingSlugs.length) {+ if (canCreateTags) {+ const createdTags = await Promise.allSettled(+ missingSlugs.map((slug) => createWsTag({ projectId, tagSlug: slug, tagColor: "" }))+ );+ createdTags.forEach((result, idx) => {+ if (result.status === "fulfilled") {+ slugToTagId.set(result.value.slug, result.value.id);+ } else {+ skippedTagsCount += 1;+ // eslint-disable-next-line no-console+ console.error(`Failed to create tag ${missingSlugs[idx]}`, result.reason);+ }+ });+ } else {+ skippedTagsCount = missingSlugs.length;+ }+ }++ if (skippedTagsCount > 0) {+ createNotification({+ type: "warning",+ text: canCreateTags+ ? `Failed to create ${skippedTagsCount} tag${skippedTagsCount > 1 ? "s" : ""}; those tags were skipped.`+ : `${skippedTagsCount} tag${skippedTagsCount > 1 ? "s were" : " was"} skipped because ${skippedTagsCount > 1 ? "they don't" : "it doesn't"} exist and you don't have permission to create tags.`+ });+ }++ const resolveTagIds = (slugs?: string[]): string[] | undefined => {+ if (!slugs?.length) return undefined;+ const ids = slugs.map((s) => slugToTagId.get(s)).filter((id): id is string => Boolean(id));+ return ids.length ? ids : undefined;+ };+const envPromises = selectedEnvs.map(async (env) => {// Ensure folder exists if not rootif (secretPath !== "/") {@@ -259,7 +316,12 @@ const ImportSecretsContent = ({secretKey,secretValue: secretData.value,secretComment: secretData.comments.join("\n") || "",- type: SecretType.Shared+ type: SecretType.Shared,+ tagIds: resolveTagIds(secretData.tagSlugs),+ secretMetadata: secretData.secretMetadata?.length+ ? secretData.secretMetadata+ : undefined,+ skipMultilineEncoding: secretData.skipMultilineEncoding}));const secretsToUpdate = Object.entries(activeSecrets)@@ -268,7 +330,12 @@ const ImportSecretsContent = ({secretKey,secretValue: secretData.value,secretComment: secretData.comments.join("\n") || undefined,- type: SecretType.Shared+ type: SecretType.Shared,+ tagIds: resolveTagIds(secretData.tagSlugs),+ secretMetadata: secretData.secretMetadata?.length+ ? secretData.secretMetadata+ : undefined,+ skipMultilineEncoding: secretData.skipMultilineEncoding}));const results = await Promise.allSettled([@@ -444,7 +511,12 @@ const ImportSecretsContent = ({<div className="flex-1 border-t border-muted/50" /></div>- <Button variant="outline" className="w-full" onClick={() => setIsPasteOpen(true)}>+ <Button+ variant="outline"+ size="lg"+ className="w-full"+ onClick={() => setIsPasteOpen(true)}+ ><ClipboardPasteIcon className="mr-2 size-4" />Paste Secrets</Button>@@ -474,7 +546,10 @@ const ImportSecretsContent = ({<TableBody>{Object.entries(activeSecrets!).map(([key, secretData]) => {const isVisible = visibleSecretKeys.has(key);- const hasComments = secretData.comments.length > 0;+ const hasComments = secretData.comments.some((c) => c);+ const hasTags = Boolean(secretData.tagSlugs?.length);+ const hasMetadata = Boolean(secretData.secretMetadata?.length);+ const hasSkipMl = secretData.skipMultilineEncoding === true;return (<TableRow key={key}><TableCell isTruncatable className="w-1/2 overflow-hidden font-mono text-xs">@@ -483,7 +558,7 @@ const ImportSecretsContent = ({{hasComments && (<Tooltip><TooltipTrigger asChild>- <MessageSquareIcon className="size-3.5 text-muted" />+ <MessageSquareIcon className="size-3.5 shrink-0 text-muted" /></TooltipTrigger><TooltipContent><p className="max-w-xs whitespace-pre-wrap">@@ -492,6 +567,39 @@ const ImportSecretsContent = ({</TooltipContent></Tooltip>)}+ {hasTags && (+ <Tooltip delayDuration={300}>+ <TooltipTrigger asChild>+ <span className="flex size-5 shrink-0 items-center justify-center text-muted">+ <TagsIcon className="size-3.5" />+ </span>+ </TooltipTrigger>+ <TooltipContent>+ {secretData.tagSlugs!.length} tag+ {secretData.tagSlugs!.length > 1 ? "s" : ""}+ </TooltipContent>+ </Tooltip>+ )}+ {hasMetadata && (+ <Tooltip delayDuration={300}>+ <TooltipTrigger asChild>+ <span className="flex size-5 shrink-0 items-center justify-center text-muted">+ <CodeXmlIcon className="size-3.5" />+ </span>+ </TooltipTrigger>+ <TooltipContent>Has metadata</TooltipContent>+ </Tooltip>+ )}+ {hasSkipMl && (+ <Tooltip>+ <TooltipTrigger asChild>+ <span className="flex size-5 shrink-0 items-center justify-center text-muted">+ <WrapTextIcon className="size-3.5" />+ </span>+ </TooltipTrigger>+ <TooltipContent>Multi-line encoding enabled</TooltipContent>+ </Tooltip>+ )}</div></TableCell><TableCell isTruncatable className="w-1/2 font-mono text-xs">@@ -597,6 +705,7 @@ const ImportSecretsContent = ({}}headers={csvData.headers}matrix={csvData.matrix}+ delimiter={csvData.delimiter}onParsedSecrets={(env) => {setCsvData(null);handleParsedSecrets(env);@@ -624,7 +733,7 @@ export const ImportSecretsModal = ({else onOpenChange(open);}}>- <DialogContent className="max-w-2xl">+ <DialogContent className="max-w-4xl"><ImportSecretsContentenvironments={environments}projectId={projectId}diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/SecretDropzone/SecretDropzone.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/SecretDropzone/SecretDropzone.tsxindex 0cc160419b..971feebc28 100644--- a/frontend/src/pages/secret-manager/OverviewPage/components/SecretDropzone/SecretDropzone.tsx+++ b/frontend/src/pages/secret-manager/OverviewPage/components/SecretDropzone/SecretDropzone.tsx@@ -27,8 +27,7 @@ import { useToggle } from "@app/hooks";import { CsvColumnMapDialog } from "./CsvColumnMapDialog";import { PasteSecretsDialog } from "./PasteSecretsDialog";--type TParsedEnv = Record<string, { value: string; comments: string[] }>;+import { TParsedEnv } from "./types";type Props = {onParsedSecrets: (env: TParsedEnv) => void;@@ -38,7 +37,11 @@ type Props = {export const SecretDropzone = ({ onParsedSecrets, onAddSecret }: Props) => {const [isDragActive, setDragActive] = useToggle();const [isPasteOpen, setIsPasteOpen] = useState(false);- const [csvData, setCsvData] = useState<{ headers: string[]; matrix: string[][] } | null>(null);+ const [csvData, setCsvData] = useState<{+ headers: string[];+ matrix: string[][];+ delimiter: string;+ } | null>(null);const handleParsedSecrets = (env: TParsedEnv) => {if (!Object.keys(env).length) {@@ -78,7 +81,7 @@ export const SecretDropzone = ({ onParsedSecrets, onAddSecret }: Props) => {handleParsedSecrets(parseYaml(src));break;case "text/csv": {- const fullMatrix = parseCsvToMatrix(src);+ const { matrix: fullMatrix, delimiter } = parseCsvToMatrix(src);if (!fullMatrix.length) {createNotification({type: "error",@@ -86,7 +89,7 @@ export const SecretDropzone = ({ onParsedSecrets, onAddSecret }: Props) => {});return;}- setCsvData({ headers: fullMatrix[0], matrix: fullMatrix.slice(1) });+ setCsvData({ headers: fullMatrix[0], matrix: fullMatrix.slice(1), delimiter });return;}default:@@ -204,6 +207,7 @@ export const SecretDropzone = ({ onParsedSecrets, onAddSecret }: Props) => {}}headers={csvData.headers}matrix={csvData.matrix}+ delimiter={csvData.delimiter}onParsedSecrets={(env) => {setCsvData(null);handleParsedSecrets(env);diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretDropzone/SecretDropzone.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretDropzone/SecretDropzone.tsxindex cb4a1a73a2..87f95a1cbb 100644--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretDropzone/SecretDropzone.tsx+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/SecretDropzone/SecretDropzone.tsx@@ -337,7 +337,7 @@ export const SecretDropzone = ({env = parseYaml(src);break;case "text/csv": {- const fullMatrix = parseCsvToMatrix(src);+ const { matrix: fullMatrix } = parseCsvToMatrix(src);if (!fullMatrix.length) {createNotification({type: "error",