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
upgrade components to v3
Matheus Nogueira0edbf076ba92
diff --git a/frontend/src/components/honey-tokens/CreateHoneyTokenModal.tsx b/frontend/src/components/honey-tokens/CreateHoneyTokenModal.tsxindex 1b70533530..5ab51710f2 100644--- a/frontend/src/components/honey-tokens/CreateHoneyTokenModal.tsx+++ b/frontend/src/components/honey-tokens/CreateHoneyTokenModal.tsx@@ -3,8 +3,14 @@ import { useState } from "react";import { HoneyTokenForm } from "@app/components/honey-tokens/forms";import { HoneyTokenModalHeader } from "@app/components/honey-tokens/HoneyTokenModalHeader";import { HoneyTokenSelect } from "@app/components/honey-tokens/HoneyTokenSelect";-import { Modal, ModalContent } from "@app/components/v2";-import { DocumentationLinkBadge } from "@app/components/v3";+import {+ Dialog,+ DialogContent,+ DialogDescription,+ DialogHeader,+ DialogTitle,+ DocumentationLinkBadge+} from "@app/components/v3";import { HoneyTokenType } from "@app/hooks/api/honeyTokens/enums";import { ProjectEnv } from "@app/hooks/api/projects/types";@@ -42,8 +48,8 @@ export const CreateHoneyTokenModal = ({ onOpenChange, isOpen, ...props }: Props)};return (- <Modal- isOpen={isOpen}+ <Dialog+ open={isOpen}onOpenChange={(open) => {if (!open) {handleReset();@@ -51,21 +57,24 @@ export const CreateHoneyTokenModal = ({ onOpenChange, isOpen, ...props }: Props)onOpenChange(open);}}>- <ModalContent- title={- selectedType ? (- <HoneyTokenModalHeader type={selectedType} />- ) : (- <div className="flex items-center gap-x-2 text-mineshaft-300">- Add Honey Token- <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/honey-tokens/overview" />- </div>- )- }- className={selectedType ? "max-w-2xl" : "max-w-3xl"}- subTitle={selectedType ? undefined : "Select a provider to create a honey token for."}- bodyClassName="overflow-visible"+ <DialogContent+ className={selectedType ? "max-w-2xl overflow-visible" : "max-w-3xl overflow-visible"}>+ <DialogHeader>+ <DialogTitle>+ {selectedType ? (+ <HoneyTokenModalHeader type={selectedType} />+ ) : (+ <div className="flex items-center gap-x-2">+ Add Honey Token+ <DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/honey-tokens/overview" />+ </div>+ )}+ </DialogTitle>+ {!selectedType && (+ <DialogDescription>Select a provider to create a honey token for.</DialogDescription>+ )}+ </DialogHeader><ContentonComplete={() => {handleReset();@@ -76,7 +85,7 @@ export const CreateHoneyTokenModal = ({ onOpenChange, isOpen, ...props }: Props)setSelectedType={setSelectedType}{...props}/>- </ModalContent>- </Modal>+ </DialogContent>+ </Dialog>);};diff --git a/frontend/src/components/honey-tokens/DeleteHoneyTokenModal.tsx b/frontend/src/components/honey-tokens/DeleteHoneyTokenModal.tsxindex 3816bc6ba8..ad891a66ae 100644--- a/frontend/src/components/honey-tokens/DeleteHoneyTokenModal.tsx+++ b/frontend/src/components/honey-tokens/DeleteHoneyTokenModal.tsx@@ -1,5 +1,22 @@+import { useEffect, useState } from "react";+import { Trash2Icon } from "lucide-react";+import { createNotification } from "@app/components/notifications";-import { DeleteActionModal } from "@app/components/v2";+import {+ AlertDialog,+ AlertDialogAction,+ AlertDialogCancel,+ AlertDialogContent,+ AlertDialogDescription,+ AlertDialogFooter,+ AlertDialogHeader,+ AlertDialogMedia,+ AlertDialogTitle,+ Field,+ FieldContent,+ FieldLabel,+ Input+} from "@app/components/v3";import { useDeleteHoneyToken } from "@app/hooks/api/honeyTokens";import { TDashboardHoneyToken } from "@app/hooks/api/honeyTokens/types";@@ -11,6 +28,11 @@ type Props = {export const DeleteHoneyTokenModal = ({ isOpen, onOpenChange, honeyToken }: Props) => {const deleteHoneyToken = useDeleteHoneyToken();+ const [inputData, setInputData] = useState("");++ useEffect(() => {+ setInputData("");+ }, [isOpen]);if (!honeyToken) return null;@@ -29,13 +51,48 @@ export const DeleteHoneyTokenModal = ({ isOpen, onOpenChange, honeyToken }: Prop};return (- <DeleteActionModal- isOpen={isOpen}- onChange={onOpenChange}- title={`Are you sure you want to delete ${honeyToken.name}?`}- subTitle="This will revoke the AWS IAM credentials and remove the associated decoy secrets from this environment."- deleteKey={honeyToken.name}- onDeleteApproved={handleDelete}- />+ <AlertDialog open={isOpen} onOpenChange={onOpenChange}>+ <AlertDialogContent className="sm:max-w-xl!">+ <AlertDialogHeader>+ <AlertDialogMedia>+ <Trash2Icon />+ </AlertDialogMedia>+ <AlertDialogTitle>Are you sure you want to delete {honeyToken.name}?</AlertDialogTitle>+ <AlertDialogDescription>+ This will revoke the AWS IAM credentials and remove the associated decoy secrets from+ this environment.+ </AlertDialogDescription>+ </AlertDialogHeader>+ <form+ onSubmit={(e) => {+ e.preventDefault();+ if (inputData === honeyToken.name) handleDelete();+ }}+ >+ <Field>+ <FieldLabel>+ Type <span className="font-bold">{honeyToken.name}</span> to confirm+ </FieldLabel>+ <FieldContent>+ <Input+ value={inputData}+ onChange={(e) => setInputData(e.target.value)}+ placeholder={`Type ${honeyToken.name} here`}+ />+ </FieldContent>+ </Field>+ </form>+ <AlertDialogFooter>+ <AlertDialogCancel>Cancel</AlertDialogCancel>+ <AlertDialogAction+ variant="danger"+ onClick={handleDelete}+ disabled={inputData !== honeyToken.name}+ >+ Delete+ </AlertDialogAction>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialog>);};diff --git a/frontend/src/components/honey-tokens/EditHoneyTokenModal.tsx b/frontend/src/components/honey-tokens/EditHoneyTokenModal.tsxindex a536f8dc0a..583d7a229f 100644--- a/frontend/src/components/honey-tokens/EditHoneyTokenModal.tsx+++ b/frontend/src/components/honey-tokens/EditHoneyTokenModal.tsx@@ -1,6 +1,6 @@import { HoneyTokenForm } from "@app/components/honey-tokens/forms";import { HoneyTokenModalHeader } from "@app/components/honey-tokens/HoneyTokenModalHeader";-import { Modal, ModalContent } from "@app/components/v2";+import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@app/components/v3";import { HoneyTokenType } from "@app/hooks/api/honeyTokens/enums";import { TDashboardHoneyToken } from "@app/hooks/api/honeyTokens/types";@@ -14,12 +14,13 @@ export const EditHoneyTokenModal = ({ isOpen, onOpenChange, honeyToken }: Props)if (!honeyToken) return null;return (- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent- title={<HoneyTokenModalHeader type={honeyToken.type as HoneyTokenType} isEdit />}- className="max-w-2xl"- bodyClassName="overflow-visible"- >+ <Dialog open={isOpen} onOpenChange={onOpenChange}>+ <DialogContent className="max-w-2xl overflow-visible">+ <DialogHeader>+ <DialogTitle>+ <HoneyTokenModalHeader type={honeyToken.type as HoneyTokenType} isEdit />+ </DialogTitle>+ </DialogHeader><HoneyTokenFormonComplete={() => onOpenChange(false)}onCancel={() => onOpenChange(false)}@@ -28,7 +29,7 @@ export const EditHoneyTokenModal = ({ isOpen, onOpenChange, honeyToken }: Props)secretPath={honeyToken.folder.path}environment={honeyToken.environment.slug}/>- </ModalContent>- </Modal>+ </DialogContent>+ </Dialog>);};diff --git a/frontend/src/components/honey-tokens/ViewHoneyTokenCredentialsModal.tsx b/frontend/src/components/honey-tokens/ViewHoneyTokenCredentialsModal.tsxindex b2fe1bccb1..4fafbe6c39 100644--- a/frontend/src/components/honey-tokens/ViewHoneyTokenCredentialsModal.tsx+++ b/frontend/src/components/honey-tokens/ViewHoneyTokenCredentialsModal.tsx@@ -1,6 +1,13 @@import { ReactNode } from "react";-import { Modal, ModalContent, Spinner } from "@app/components/v2";+import {+ Dialog,+ DialogContent,+ DialogDescription,+ DialogHeader,+ DialogTitle,+ PageLoader+} from "@app/components/v3";import { useGetHoneyTokenCredentials } from "@app/hooks/api/honeyTokens";import { HoneyTokenType } from "@app/hooks/api/honeyTokens/enums";import { TDashboardHoneyToken } from "@app/hooks/api/honeyTokens/types";@@ -47,12 +54,7 @@ const ModalBody = ({});if (isPending) {- return (- <div className="flex flex-col items-center justify-center py-4">- <Spinner size="lg" className="text-mineshaft-500" />- <p className="mt-4 text-sm text-mineshaft-400">Loading credentials...</p>- </div>- );+ return <PageLoader />;}if (credentials && honeyToken) {@@ -69,14 +71,16 @@ export const ViewHoneyTokenCredentialsModal = ({onOpenChange}: Props) => {return (- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>- <ModalContent- onOpenAutoFocus={(e) => e.preventDefault()}- title="Honey Token Credentials"- subTitle={honeyToken ? `Credentials for "${honeyToken.name}".` : ""}- >+ <Dialog open={isOpen} onOpenChange={onOpenChange}>+ <DialogContent className="max-w-2xl" onOpenAutoFocus={(e) => e.preventDefault()}>+ <DialogHeader>+ <DialogTitle>Honey Token Credentials</DialogTitle>+ {honeyToken && (+ <DialogDescription>Credentials for "{honeyToken.name}".</DialogDescription>+ )}+ </DialogHeader><ModalBody honeyToken={honeyToken} projectId={projectId} isOpen={isOpen} />- </ModalContent>- </Modal>+ </DialogContent>+ </Dialog>);};diff --git a/frontend/src/components/honey-tokens/forms/HoneyTokenConfigurationFields.tsx b/frontend/src/components/honey-tokens/forms/HoneyTokenConfigurationFields.tsxindex 59f3def507..ee3512dd0f 100644--- a/frontend/src/components/honey-tokens/forms/HoneyTokenConfigurationFields.tsx+++ b/frontend/src/components/honey-tokens/forms/HoneyTokenConfigurationFields.tsx@@ -1,6 +1,6 @@import { Controller, useFormContext } from "react-hook-form";-import { FilterableSelect, FormControl } from "@app/components/v2";+import { Field, FieldContent, FieldError, FieldLabel, FilterableSelect } from "@app/components/v3";import { ProjectEnv } from "@app/hooks/api/projects/types";import { THoneyTokenForm } from "./schemas";@@ -20,16 +20,21 @@ export const HoneyTokenConfigurationFields = ({ environments }: Props) => {control={control}name="environment"render={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl label="Environment" isError={Boolean(error)} errorText={error?.message}>- <FilterableSelect- value={value}- onChange={onChange}- options={environments}- placeholder="Select an environment..."- getOptionLabel={(option) => option?.name}- getOptionValue={(option) => option?.id}- />- </FormControl>+ <Field>+ <FieldLabel>Environment</FieldLabel>+ <FieldContent>+ <FilterableSelect+ value={value}+ onChange={onChange}+ options={environments}+ placeholder="Select an environment..."+ getOptionLabel={(option) => option?.name}+ getOptionValue={(option) => option?.id}+ isError={Boolean(error)}+ />+ </FieldContent>+ {error && <FieldError>{error.message}</FieldError>}+ </Field>)}/>)}diff --git a/frontend/src/components/honey-tokens/forms/HoneyTokenDetailsFields.tsx b/frontend/src/components/honey-tokens/forms/HoneyTokenDetailsFields.tsxindex 3eeb1a9e71..57fbe55bf3 100644--- a/frontend/src/components/honey-tokens/forms/HoneyTokenDetailsFields.tsx+++ b/frontend/src/components/honey-tokens/forms/HoneyTokenDetailsFields.tsx@@ -1,6 +1,14 @@import { Controller, useFormContext } from "react-hook-form";-import { FormControl, Input, TextArea } from "@app/components/v2";+import {+ Field,+ FieldContent,+ FieldDescription,+ FieldError,+ FieldLabel,+ Input,+ TextArea+} from "@app/components/v3";import { THoneyTokenForm } from "./schemas";@@ -8,44 +16,54 @@ export const HoneyTokenDetailsFields = () => {const { control } = useFormContext<THoneyTokenForm>();return (- <>- <p className="mb-4 text-sm text-bunker-300">+ <div className="flex flex-col gap-4">+ <p className="text-sm text-bunker-300">Provide a name and description for this honey token.</p><Controllerrender={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl- helperText="Must be slug-friendly"- isError={Boolean(error)}- errorText={error?.message}- label="Name"- >- <Input autoFocus value={value} onChange={onChange} placeholder="aws-canary-prod-key" />- </FormControl>+ <Field>+ <FieldLabel>Name</FieldLabel>+ <FieldContent>+ <Input+ autoFocus+ value={value}+ onChange={onChange}+ placeholder="aws-canary-prod-key"+ isError={Boolean(error)}+ />+ {error ? (+ <FieldError>{error.message}</FieldError>+ ) : (+ <FieldDescription>Must be slug-friendly</FieldDescription>+ )}+ </FieldContent>+ </Field>)}control={control}name="name"/><Controllerrender={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl- isError={Boolean(error)}- isOptional- errorText={error?.message}- label="Description"- >- <TextArea- value={value ?? ""}- onChange={onChange}- placeholder="Describe where this decoy is planted and who should respond..."- className="resize-none!"- rows={4}- />- </FormControl>+ <Field>+ <FieldLabel>+ Description <span className="text-muted-foreground text-xs">(optional)</span>+ </FieldLabel>+ <FieldContent>+ <TextArea+ value={value ?? ""}+ onChange={onChange}+ placeholder="Describe where this decoy is planted and who should respond..."+ className="resize-none!"+ rows={4}+ />+ {error && <FieldError>{error.message}</FieldError>}+ </FieldContent>+ </Field>)}control={control}name="description"/>- </>+ </div>);};diff --git a/frontend/src/components/honey-tokens/forms/HoneyTokenForm.tsx b/frontend/src/components/honey-tokens/forms/HoneyTokenForm.tsxindex 12764950ac..db52aa66e9 100644--- a/frontend/src/components/honey-tokens/forms/HoneyTokenForm.tsx+++ b/frontend/src/components/honey-tokens/forms/HoneyTokenForm.tsx@@ -4,7 +4,7 @@ import { Tab } from "@headlessui/react";import { zodResolver } from "@hookform/resolvers/zod";import { createNotification } from "@app/components/notifications";-import { Button } from "@app/components/v2";+import { Button } from "@app/components/v3";import { useProject } from "@app/context";import { HONEY_TOKEN_DEFAULT_SECRET_NAMES, HONEY_TOKEN_MAP } from "@app/helpers/honeyTokens";import { useCreateHoneyToken, useUpdateHoneyToken } from "@app/hooks/api/honeyTokens";@@ -55,9 +55,7 @@ export const HoneyTokenForm = ({const { name: tokenTypeName } = HONEY_TOKEN_MAP[type];const isUpdate = Boolean(honeyToken);- const formTabs = isUpdate- ? FORM_TABS.filter((tab) => tab.key !== "configuration")- : FORM_TABS;+ const formTabs = isUpdate ? FORM_TABS.filter((tab) => tab.key !== "configuration") : FORM_TABS;const [selectedTabIndex, setSelectedTabIndex] = useState(0);@@ -248,13 +246,13 @@ export const HoneyTokenForm = ({<div className="flex w-full flex-shrink-0 flex-row-reverse justify-between gap-4 pt-4"><ButtononClick={handleNext}- isLoading={isSubmitting || isValidating}+ isPending={isSubmitting || isValidating}isDisabled={isSubmitting || isValidating}- colorSchema="secondary"+ variant="outline">{isFinalStep ? `${honeyToken ? "Update" : "Create"} Honey Token` : "Next"}</Button>- <Button onClick={handlePrev} colorSchema="secondary">+ <Button onClick={handlePrev} variant="outline">Back</Button></div>diff --git a/frontend/src/components/honey-tokens/forms/HoneyTokenMappingFields/AwsHoneyTokenMappingFields.tsx b/frontend/src/components/honey-tokens/forms/HoneyTokenMappingFields/AwsHoneyTokenMappingFields.tsxindex 5d02237102..a6bfc6d121 100644--- a/frontend/src/components/honey-tokens/forms/HoneyTokenMappingFields/AwsHoneyTokenMappingFields.tsx+++ b/frontend/src/components/honey-tokens/forms/HoneyTokenMappingFields/AwsHoneyTokenMappingFields.tsx@@ -1,9 +1,17 @@import { Controller, useFormContext } from "react-hook-form";import { faArrowRight, faKey, faLock } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";+import { InfoIcon } from "lucide-react";-import { FormControl, FormLabel, Input } from "@app/components/v2";-import { Badge } from "@app/components/v3";+import {+ Badge,+ FieldError,+ Input,+ Label,+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";import { HONEY_TOKEN_DEFAULT_SECRET_NAMES } from "@app/helpers/honeyTokens";import { HoneyTokenType } from "@app/hooks/api/honeyTokens/enums";@@ -39,16 +47,23 @@ export const AwsHoneyTokenMappingFields = () => {<table className="w-full table-auto"><thead><tr className="text-left">- <th className="whitespace-nowrap">- <FormLabel label="Decoy Credential" />+ <th className="whitespace-nowrap pb-3">+ <Label className="text-xs">Decoy Credential</Label></th>- <th />- <th>- <FormLabel- tooltipClassName="max-w-sm"- tooltipText="The name of the secret that the decoy credential will be mapped to in your project."- label="Secret Name"- />+ <th className="pb-3" />+ <th className="pb-3">+ <div className="flex items-center gap-1">+ <Label className="text-xs">Secret Name</Label>+ <Tooltip>+ <TooltipTrigger asChild>+ <InfoIcon className="text-muted-foreground size-3.5" />+ </TooltipTrigger>+ <TooltipContent className="max-w-sm">+ The name of the secret that the decoy credential will be mapped to in your+ project.+ </TooltipContent>+ </Tooltip>+ </div></th></tr></thead>@@ -71,16 +86,22 @@ export const AwsHoneyTokenMappingFields = () => {<td className="w-full"><Controllerrender={({ field: { value, onChange }, fieldState: { error } }) => (- <FormControl isError={Boolean(error)} errorText={error?.message}>+ <div className="mb-4"><div className="relative">- <Input value={value} onChange={onChange} placeholder={placeholder} />+ <Input+ value={value}+ onChange={onChange}+ placeholder={placeholder}+ isError={Boolean(error)}+ /><span className="pointer-events-none absolute top-1/2 right-2 -translate-y-1/2"><Badge variant="warning" className="text-[10px]">Decoy</Badge></span></div>- </FormControl>+ {error && <FieldError>{error.message}</FieldError>}+ </div>)}control={control}name={fieldName}diff --git a/frontend/src/components/honey-tokens/forms/HoneyTokenReviewFields/AwsHoneyTokenReviewFields.tsx b/frontend/src/components/honey-tokens/forms/HoneyTokenReviewFields/AwsHoneyTokenReviewFields.tsxindex 7a9a25425a..96238ec15a 100644--- a/frontend/src/components/honey-tokens/forms/HoneyTokenReviewFields/AwsHoneyTokenReviewFields.tsx+++ b/frontend/src/components/honey-tokens/forms/HoneyTokenReviewFields/AwsHoneyTokenReviewFields.tsx@@ -1,6 +1,6 @@import { useFormContext } from "react-hook-form";-import { GenericFieldLabel } from "@app/components/v2";+import { Detail, DetailLabel, DetailValue } from "@app/components/v3";import { HoneyTokenType } from "@app/hooks/api/honeyTokens/enums";import { THoneyTokenForm } from "../schemas";@@ -13,8 +13,14 @@ export const AwsHoneyTokenReviewFields = () => {return (<HoneyTokenReviewSection label="Secret Mapping">- <GenericFieldLabel label="Access Key ID">{accessKeyId}</GenericFieldLabel>- <GenericFieldLabel label="Secret Access Key">{secretAccessKey}</GenericFieldLabel>+ <Detail>+ <DetailLabel>Access Key ID</DetailLabel>+ <DetailValue>{accessKeyId}</DetailValue>+ </Detail>+ <Detail>+ <DetailLabel>Secret Access Key</DetailLabel>+ <DetailValue>{secretAccessKey}</DetailValue>+ </Detail></HoneyTokenReviewSection>);};diff --git a/frontend/src/components/honey-tokens/forms/HoneyTokenReviewFields/HoneyTokenReviewFields.tsx b/frontend/src/components/honey-tokens/forms/HoneyTokenReviewFields/HoneyTokenReviewFields.tsxindex 25e1b7f215..02e9e127a3 100644--- a/frontend/src/components/honey-tokens/forms/HoneyTokenReviewFields/HoneyTokenReviewFields.tsx+++ b/frontend/src/components/honey-tokens/forms/HoneyTokenReviewFields/HoneyTokenReviewFields.tsx@@ -1,6 +1,6 @@import { useFormContext } from "react-hook-form";-import { GenericFieldLabel } from "@app/components/v2";+import { Detail, DetailLabel, DetailValue } from "@app/components/v3";import { HONEY_TOKEN_MAP } from "@app/helpers/honeyTokens";import { HoneyTokenType } from "@app/hooks/api/honeyTokens/enums";@@ -23,12 +23,21 @@ export const HoneyTokenReviewFields = () => {return (<div className="mb-4 flex flex-col gap-6"><HoneyTokenReviewSection label="Configuration">- <GenericFieldLabel label="Type">{tokenDetails.name}</GenericFieldLabel>+ <Detail>+ <DetailLabel>Type</DetailLabel>+ <DetailValue>{tokenDetails.name}</DetailValue>+ </Detail></HoneyTokenReviewSection><MappingComponent /><HoneyTokenReviewSection label="Details">- <GenericFieldLabel label="Name">{name}</GenericFieldLabel>- <GenericFieldLabel label="Description">{description}</GenericFieldLabel>+ <Detail>+ <DetailLabel>Name</DetailLabel>+ <DetailValue>{name}</DetailValue>+ </Detail>+ <Detail>+ <DetailLabel>Description</DetailLabel>+ <DetailValue>{description}</DetailValue>+ </Detail></HoneyTokenReviewSection></div>);diff --git a/frontend/src/pages/secret-manager/HoneyTokenDetailsByIDPage/HoneyTokenDetailsByIDPage.tsx b/frontend/src/pages/secret-manager/HoneyTokenDetailsByIDPage/HoneyTokenDetailsByIDPage.tsxindex 38e6031a56..3f1a381acb 100644--- a/frontend/src/pages/secret-manager/HoneyTokenDetailsByIDPage/HoneyTokenDetailsByIDPage.tsx+++ b/frontend/src/pages/secret-manager/HoneyTokenDetailsByIDPage/HoneyTokenDetailsByIDPage.tsx@@ -1,12 +1,11 @@-import { useState } from "react";+import { useEffect, useState } from "react";import { Helmet } from "react-helmet";-import { faChevronLeft } from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { useNavigate, useParams } from "@tanstack/react-router";import { format, formatDistanceToNow } from "date-fns";import {AlertTriangle,CalendarIcon,+ ChevronLeftIcon,ClockIcon,KeyIcon,MapPinIcon,@@ -19,21 +18,40 @@ import { createNotification } from "@app/components/notifications";import { ProjectPermissionCan } from "@app/components/permissions";import { CredentialDisplay } from "@app/components/secret-rotations-v2/ViewSecretRotationV2GeneratedCredentials/shared/CredentialDisplay";import {+ AlertDialog,+ AlertDialogAction,+ AlertDialogCancel,+ AlertDialogContent,+ AlertDialogDescription,+ AlertDialogFooter,+ AlertDialogHeader,+ AlertDialogMedia,+ AlertDialogTitle,+ Badge,Button,- ContentLoader,- DeleteActionModal,- EmptyState,- Spinner,- Tag,- Tooltip-} from "@app/components/v2";+ Empty,+ EmptyHeader,+ EmptyTitle,+ Field,+ FieldContent,+ FieldLabel,+ Input,+ PageLoader,+ Skeleton,+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";import { ROUTE_PATHS } from "@app/const/routes";import { ProjectPermissionSub } from "@app/context";import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionContext/types";import { HONEY_TOKEN_CREDENTIAL_FIELDS, HONEY_TOKEN_MAP } from "@app/helpers/honeyTokens";import { HoneyTokenStatus, HoneyTokenType } from "@app/hooks/api/honeyTokens/enums";import { useDeleteHoneyToken, useResetHoneyToken } from "@app/hooks/api/honeyTokens/mutations";-import { useGetHoneyTokenById, useGetHoneyTokenCredentials } from "@app/hooks/api/honeyTokens/queries";+import {+ useGetHoneyTokenById,+ useGetHoneyTokenCredentials+} from "@app/hooks/api/honeyTokens/queries";import { HoneyTokenEventsSection } from "./components";@@ -52,16 +70,21 @@ const PageContent = () => {const { mutateAsync: resetHoneyToken } = useResetHoneyToken();const { mutateAsync: deleteHoneyToken } = useDeleteHoneyToken();const [isDeleteOpen, setIsDeleteOpen] = useState(false);+ const [deleteInput, setDeleteInput] = useState("");const { data: credentials, isPending: isCredentialsPending } = useGetHoneyTokenCredentials({honeyTokenId,projectId,enabled: Boolean(honeyTokenId && projectId)});+ useEffect(() => {+ setDeleteInput("");+ }, [isDeleteOpen]);+if (isPending) {return (<div className="flex h-full w-full items-center justify-center">- <ContentLoader />+ <PageLoader /></div>);}@@ -69,10 +92,11 @@ const PageContent = () => {if (!honeyToken) {return (<div className="flex h-full w-full items-center justify-center px-20">- <EmptyState- className="max-w-2xl rounded-md text-center"- title={`Could not find honey token with ID ${honeyTokenId}`}- />+ <Empty>+ <EmptyHeader>+ <EmptyTitle>Could not find honey token with ID {honeyTokenId}</EmptyTitle>+ </EmptyHeader>+ </Empty></div>);}@@ -114,9 +138,7 @@ const PageContent = () => {<div className="container mx-auto flex flex-col justify-between bg-bunker-800 font-inter text-white"><div className="mx-auto mb-6 w-full max-w-8xl"><Button- variant="link"- type="submit"- leftIcon={<FontAwesomeIcon icon={faChevronLeft} />}+ variant="ghost"onClick={() => {navigate({to: ROUTE_PATHS.SecretManager.OverviewPage.path,@@ -124,10 +146,11 @@ const PageContent = () => {});}}>+ <ChevronLeftIcon size={14} />Overview</Button>- <div className="mb-4 mt-2 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-5">+ <div className="mt-2 mb-4 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-5"><div className="flex items-start justify-between"><div className="flex items-center gap-3"><div className="flex h-11 w-11 items-center justify-center rounded-lg border border-mineshaft-600 bg-mineshaft-800">@@ -139,19 +162,19 @@ const PageContent = () => {<div className="min-w-0"><div className="flex items-center gap-2.5"><p className="truncate text-lg font-medium text-white">{honeyToken.name}</p>- <Tag colorSchema={isTriggered ? "red" : "green"}>+ <Badge variant={isTriggered ? "danger" : "success"}>{isTriggered && <AlertTriangle size={12} className="mr-1" />}{isTriggered ? "Triggered" : "Active"}- </Tag>+ </Badge>{tokenInfo && (- <Tag className="flex items-center gap-1 px-1.5 py-0 text-xs normal-case">+ <Badge variant="neutral" className="flex items-center gap-1"><imgsrc={`/images/integrations/${tokenInfo.image}`}style={{ width: "11px" }}alt={`${tokenInfo.name} logo`}/>{tokenInfo.name}- </Tag>+ </Badge>)}</div><p className="text-xs text-bunker-300">@@ -160,37 +183,31 @@ const PageContent = () => {</div></div><div className="flex shrink-0 items-center gap-2">- <Button- variant="outline_bg"- size="xs"- leftIcon={<RotateCcw size={14} />}- onClick={handleReset}- >+ <Button variant="outline" size="xs" onClick={handleReset}>+ <RotateCcw size={14} />Reset</Button>- <Button- variant="outline_bg"- size="xs"- colorSchema="danger"- leftIcon={<Trash2Icon size={14} />}- onClick={() => setIsDeleteOpen(true)}- >+ <Button variant="danger" size="xs" onClick={() => setIsDeleteOpen(true)}>+ <Trash2Icon size={14} />Delete</Button></div></div><div className="mt-4 flex flex-wrap items-center gap-x-6 gap-y-2 border-t border-mineshaft-600 pt-4 text-xs text-bunker-300">- <Tooltip- content={format(new Date(honeyToken.createdAt), "MMMM do, yyyy 'at' h:mm a")}- >- <div className="flex items-center gap-1.5">- <CalendarIcon size={13} />- <span>- Created{" "}- {formatDistanceToNow(new Date(honeyToken.createdAt), { addSuffix: true })}- </span>- </div>+ <Tooltip>+ <TooltipTrigger asChild>+ <div className="flex items-center gap-1.5">+ <CalendarIcon size={13} />+ <span>+ Created{" "}+ {formatDistanceToNow(new Date(honeyToken.createdAt), { addSuffix: true })}+ </span>+ </div>+ </TooltipTrigger>+ <TooltipContent>+ {format(new Date(honeyToken.createdAt), "MMMM do, yyyy 'at' h:mm a")}+ </TooltipContent></Tooltip>{honeyToken.environment && (<div className="flex items-center gap-1.5">@@ -226,12 +243,13 @@ const PageContent = () => {<KeyIcon size={13} /><span>Credentials</span></div>- {isCredentialsPending ? (- <div className="flex items-center gap-2 py-2">- <Spinner size="xs" className="text-mineshaft-500" />- <span className="text-xs text-mineshaft-400">Loading credentials...</span>+ {isCredentialsPending && (+ <div className="flex flex-col gap-2 py-2">+ <Skeleton className="h-8 w-full rounded-md" />+ <Skeleton className="h-8 w-full rounded-md" /></div>- ) : credentials ? (+ )}+ {!isCredentialsPending && credentials && (<div className="flex flex-col gap-x-8 gap-y-2 rounded-sm border border-mineshaft-600 bg-mineshaft-700 p-2">{(HONEY_TOKEN_CREDENTIAL_FIELDS[honeyToken.type as HoneyTokenType] ?? []@@ -246,7 +264,8 @@ const PageContent = () => {);})}</div>- ) : (+ )}+ {!isCredentialsPending && !credentials && (<p className="text-xs text-bunker-400">No credentials available.</p>)}</div>@@ -297,14 +316,49 @@ const PageContent = () => {<HoneyTokenEventsSection honeyTokenId={honeyTokenId} projectId={projectId} /></div></div>- <DeleteActionModal- isOpen={isDeleteOpen}- onChange={setIsDeleteOpen}- title={`Are you sure you want to delete ${honeyToken.name}?`}- subTitle="This will revoke the AWS IAM credentials and remove the associated decoy secrets from this environment."- deleteKey={honeyToken.name}- onDeleteApproved={handleDelete}- />+ <AlertDialog open={isDeleteOpen} onOpenChange={setIsDeleteOpen}>+ <AlertDialogContent className="sm:max-w-xl!">+ <AlertDialogHeader>+ <AlertDialogMedia>+ <Trash2Icon />+ </AlertDialogMedia>+ <AlertDialogTitle>Are you sure you want to delete {honeyToken.name}?</AlertDialogTitle>+ <AlertDialogDescription>+ This will revoke the AWS IAM credentials and remove the associated decoy secrets from+ this environment.+ </AlertDialogDescription>+ </AlertDialogHeader>+ <form+ onSubmit={(e) => {+ e.preventDefault();+ if (deleteInput === honeyToken.name) handleDelete();+ }}+ >+ <Field>+ <FieldLabel>+ Type <span className="font-bold">{honeyToken.name}</span> to confirm+ </FieldLabel>+ <FieldContent>+ <Input+ value={deleteInput}+ onChange={(e) => setDeleteInput(e.target.value)}+ placeholder={`Type ${honeyToken.name} here`}+ />+ </FieldContent>+ </Field>+ </form>+ <AlertDialogFooter>+ <AlertDialogCancel>Cancel</AlertDialogCancel>+ <AlertDialogAction+ variant="danger"+ onClick={handleDelete}+ disabled={deleteInput !== honeyToken.name}+ >+ Delete+ </AlertDialogAction>+ </AlertDialogFooter>+ </AlertDialogContent>+ </AlertDialog></>);};diff --git a/frontend/src/pages/secret-manager/HoneyTokenDetailsByIDPage/components/HoneyTokenEventsSection.tsx b/frontend/src/pages/secret-manager/HoneyTokenDetailsByIDPage/components/HoneyTokenEventsSection.tsxindex ad14ec8f45..451c33d2f2 100644--- a/frontend/src/pages/secret-manager/HoneyTokenDetailsByIDPage/components/HoneyTokenEventsSection.tsx+++ b/frontend/src/pages/secret-manager/HoneyTokenDetailsByIDPage/components/HoneyTokenEventsSection.tsx@@ -2,8 +2,17 @@ import { useState } from "react";import { format, formatDistanceToNow } from "date-fns";import { ActivityIcon } from "lucide-react";-import { ContentLoader, EmptyState, Tag, Tooltip } from "@app/components/v2";-import { Pagination } from "@app/components/v3";+import {+ Badge,+ Empty,+ EmptyHeader,+ EmptyTitle,+ PageLoader,+ Pagination,+ Tooltip,+ TooltipContent,+ TooltipTrigger+} from "@app/components/v3";import { useGetHoneyTokenEvents } from "@app/hooks/api/honeyTokens/queries";type Props = {@@ -39,10 +48,14 @@ export const HoneyTokenEventsSection = ({ honeyTokenId, projectId }: Props) => {)}</div>- {isPending && <ContentLoader />}+ {isPending && <PageLoader />}{!isPending && (!events || events.length === 0) && (- <EmptyState title="No events recorded yet" className="rounded-md" />+ <Empty>+ <EmptyHeader>+ <EmptyTitle>No events recorded yet</EmptyTitle>+ </EmptyHeader>+ </Empty>)}{events && events.length > 0 && (@@ -50,7 +63,7 @@ export const HoneyTokenEventsSection = ({ honeyTokenId, projectId }: Props) => {<div className="overflow-x-auto"><table className="w-full text-left text-sm"><thead>- <tr className="border-b border-mineshaft-600 text-xs uppercase text-bunker-300">+ <tr className="border-b border-mineshaft-600 text-xs text-bunker-300 uppercase"><th className="px-3 py-2">Timestamp</th><th className="px-3 py-2">Action</th><th className="px-3 py-2">Region</th>@@ -70,25 +83,29 @@ export const HoneyTokenEventsSection = ({ honeyTokenId, projectId }: Props) => {key={event.id}className="border-b border-mineshaft-700 text-sm text-white last:border-0">- <td className="whitespace-nowrap px-3 py-3 text-bunker-300">- <Tooltip- content={format(eventDate, "MMMM do, yyyy 'at' h:mm:ss a")}- >- <span>{formatDistanceToNow(eventDate, { addSuffix: true })}</span>+ <td className="px-3 py-3 whitespace-nowrap text-bunker-300">+ <Tooltip>+ <TooltipTrigger asChild>+ <span>{formatDistanceToNow(eventDate, { addSuffix: true })}</span>+ </TooltipTrigger>+ <TooltipContent>+ {format(eventDate, "MMMM do, yyyy 'at' h:mm:ss a")}+ </TooltipContent></Tooltip></td><td className="px-3 py-3">- {meta?.eventName ? <Tag>{meta.eventName}</Tag> : "—"}+ {meta?.eventName ? <Badge variant="neutral">{meta.eventName}</Badge> : "—"}</td>- <td className="whitespace-nowrap px-3 py-3 text-bunker-300">+ <td className="px-3 py-3 whitespace-nowrap text-bunker-300">{meta?.awsRegion ?? "—"}</td>- <td className="px-3 py-3 text-bunker-300">- {meta?.sourceIp ?? "—"}- </td>+ <td className="px-3 py-3 text-bunker-300">{meta?.sourceIp ?? "—"}</td><td className="max-w-[300px] px-3 py-3 text-bunker-300">- <Tooltip content={meta?.userAgent}>- <span className="block truncate">{meta?.userAgent ?? "—"}</span>+ <Tooltip>+ <TooltipTrigger asChild>+ <span className="block truncate">{meta?.userAgent ?? "—"}</span>+ </TooltipTrigger>+ <TooltipContent>{meta?.userAgent}</TooltipContent></Tooltip></td></tr>diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/HoneyTokenListView/HoneyTokenItem.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/HoneyTokenListView/HoneyTokenItem.tsxindex 8c667cae2a..a55ac6a84c 100644--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/HoneyTokenListView/HoneyTokenItem.tsx+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/HoneyTokenListView/HoneyTokenItem.tsx@@ -1,19 +1,18 @@import { useState } from "react";-import {- faAsterisk,- faEdit,- faExternalLinkAlt,- faInfoCircle,- faTrash-} from "@fortawesome/free-solid-svg-icons";-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { useNavigate, useParams } from "@tanstack/react-router";import { AnimatePresence, motion } from "framer-motion";-import { SirenIcon } from "lucide-react";+import {+ AsteriskIcon,+ ExternalLinkIcon,+ InfoIcon,+ PencilIcon,+ SirenIcon,+ Trash2Icon+} from "lucide-react";import { twMerge } from "tailwind-merge";import { ProjectPermissionCan } from "@app/components/permissions";-import { IconButton, Tag, Tooltip } from "@app/components/v2";+import { Badge, IconButton, Tooltip, TooltipContent, TooltipTrigger } from "@app/components/v3";import { ROUTE_PATHS } from "@app/const/routes";import { ProjectPermissionSub } from "@app/context";import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionContext/types";@@ -69,30 +68,28 @@ export const HoneyTokenItem = ({ honeyToken, onEdit, onDelete, onViewCredentials<div className="flex w-full flex-wrap items-center"><span>{name}</span>{honeyTokenInfo && (- <Tag className="mx-2.5 flex items-center gap-1 px-1.5 py-0 text-xs normal-case">+ <Badge variant="neutral" className="mx-2.5"><imgsrc={`/images/integrations/${honeyTokenInfo.image}`}style={{ width: "11px" }}alt={`${honeyTokenInfo.name} logo`}/>{honeyTokenInfo.name} Honey Token- </Tag>+ </Badge>)}- <Tag- className={twMerge(- "px-1.5 py-0 text-xs normal-case",- status === HoneyTokenStatus.Active ? "bg-green/20 text-green" : "bg-red/20 text-red"- )}- >+ <Badge variant={status === HoneyTokenStatus.Active ? "success" : "danger"}>{status === HoneyTokenStatus.Active ? "Active" : "Triggered"}- </Tag>+ </Badge></div><divkey="actions"className="ml-2 flex h-full shrink-0 self-start transition-all group-hover:gap-x-2">- <Tooltip content={`${mappedSecretKeys.length} mapped secret(s)`}>- <FontAwesomeIcon icon={faInfoCircle} className="text-mineshaft-400" />+ <Tooltip>+ <TooltipTrigger asChild>+ <InfoIcon className="size-4 text-mineshaft-400" />+ </TooltipTrigger>+ <TooltipContent>{mappedSecretKeys.length} mapped secret(s)</TooltipContent></Tooltip></div></div>@@ -104,21 +101,25 @@ export const HoneyTokenItem = ({ honeyToken, onEdit, onDelete, onViewCredentialsanimate={{ x: 0, opacity: 1 }}exit={{ x: 10, opacity: 0 }}>- <Tooltip content="View details">- <IconButton- ariaLabel="View details"- variant="plain"- className="opacity-0 group-hover:opacity-100"- onClick={(e) => {- e.stopPropagation();- navigate({- to: ROUTE_PATHS.SecretManager.HoneyTokenDetailsByIDPage.path,- params: { orgId, projectId, honeyTokenId: honeyToken.id }- });- }}- >- <FontAwesomeIcon icon={faExternalLinkAlt} />- </IconButton>+ <Tooltip>+ <TooltipTrigger asChild>+ <IconButton+ aria-label="View details"+ variant="ghost"+ size="xs"+ className="opacity-0 group-hover:opacity-100"+ onClick={(e) => {+ e.stopPropagation();+ navigate({+ to: ROUTE_PATHS.SecretManager.HoneyTokenDetailsByIDPage.path,+ params: { orgId, projectId, honeyTokenId: honeyToken.id }+ });+ }}+ >+ <ExternalLinkIcon className="size-4" />+ </IconButton>+ </TooltipTrigger>+ <TooltipContent>View details</TooltipContent></Tooltip><ProjectPermissionCanI={ProjectPermissionSecretActions.DescribeAndReadValue}@@ -128,8 +129,9 @@ export const HoneyTokenItem = ({ honeyToken, onEdit, onDelete, onViewCredentials>{(isAllowed) => (<IconButton- ariaLabel="View credentials"- variant="plain"+ aria-label="View credentials"+ variant="ghost"+ size="xs"isDisabled={!isAllowed}className="opacity-0 group-hover:opacity-100"onClick={(e) => {@@ -137,7 +139,7 @@ export const HoneyTokenItem = ({ honeyToken, onEdit, onDelete, onViewCredentialsonViewCredentials();}}>- <FontAwesomeIcon icon={faAsterisk} />+ <AsteriskIcon className="size-4" /></IconButton>)}</ProjectPermissionCan>@@ -149,8 +151,9 @@ export const HoneyTokenItem = ({ honeyToken, onEdit, onDelete, onViewCredentials>{(isAllowed) => (<IconButton- ariaLabel="Edit honey token"- variant="plain"+ aria-label="Edit honey token"+ variant="ghost"+ size="xs"isDisabled={!isAllowed}className="opacity-0 group-hover:opacity-100"onClick={(e) => {@@ -158,7 +161,7 @@ export const HoneyTokenItem = ({ honeyToken, onEdit, onDelete, onViewCredentialsonEdit();}}>- <FontAwesomeIcon icon={faEdit} />+ <PencilIcon className="size-4" /></IconButton>)}</ProjectPermissionCan>@@ -170,9 +173,9 @@ export const HoneyTokenItem = ({ honeyToken, onEdit, onDelete, onViewCredentials>{(isAllowed) => (<IconButton- ariaLabel="Delete honey token"- variant="plain"- colorSchema="danger"+ aria-label="Delete honey token"+ variant="danger"+ size="xs"className="opacity-0 group-hover:opacity-100"onClick={(e) => {e.stopPropagation();@@ -180,7 +183,7 @@ export const HoneyTokenItem = ({ honeyToken, onEdit, onDelete, onViewCredentials}}isDisabled={!isAllowed}>- <FontAwesomeIcon icon={faTrash} />+ <Trash2Icon className="size-4" /></IconButton>)}</ProjectPermissionCan>@@ -195,7 +198,9 @@ export const HoneyTokenItem = ({ honeyToken, onEdit, onDelete, onViewCredentialsclassName="flex items-center border-b border-mineshaft-700 px-5 py-2 pl-16 last:border-b-0"><span className="font-mono text-sm text-bunker-200">{secretKey}</span>- <Tag className="ml-2 px-1.5 py-0 text-xs text-yellow normal-case">Decoy</Tag>+ <Badge variant="warning" className="ml-2">+ Decoy+ </Badge></div>))}</div>