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
better performance
Matheus Nogueira79e808765101
diff --git a/frontend/src/components/honey-tokens/HoneyTokenDetailsDrawer.tsx b/frontend/src/components/honey-tokens/HoneyTokenDetailsDrawer.tsxindex 9358e012f0..a81971f802 100644--- a/frontend/src/components/honey-tokens/HoneyTokenDetailsDrawer.tsx+++ b/frontend/src/components/honey-tokens/HoneyTokenDetailsDrawer.tsx@@ -1,4 +1,4 @@-import { useEffect, useReducer, useState } from "react";+import { forwardRef, useEffect, useImperativeHandle, useReducer, useState } from "react";import { format, formatDistanceToNow } from "date-fns";import {AlertTriangle,@@ -55,10 +55,11 @@ import {} from "@app/hooks/api/honeyTokens/queries";import { HoneyTokenEventsSection } from "@app/pages/secret-manager/HoneyTokenDetailsByIDPage/components";+export type HoneyTokenDetailsDrawerHandle = {+ open: (honeyTokenId: string) => void;+};+type Props = {- isOpen: boolean;- onOpenChange: (isOpen: boolean) => void;- honeyTokenId: string;projectId: string;};@@ -433,14 +434,22 @@ const DrawerContent = ({);};-export const HoneyTokenDetailsDrawer = ({- isOpen,- onOpenChange,- honeyTokenId,- projectId-}: Props) => {+export const HoneyTokenDetailsDrawer = forwardRef<HoneyTokenDetailsDrawerHandle, Props>(+ ({ projectId }, ref) => {+ const [honeyTokenId, setHoneyTokenId] = useState<string | null>(null);+ const isOpen = Boolean(honeyTokenId);++ useImperativeHandle(ref, () => ({+ open: (id: string) => setHoneyTokenId(id)+ }));+return (- <Sheet open={isOpen} onOpenChange={onOpenChange}>+ <Sheet+ open={isOpen}+ onOpenChange={(open) => {+ if (!open) setHoneyTokenId(null);+ }}+ ><SheetContent className="flex h-full flex-col gap-y-0 overflow-y-auto sm:max-w-3xl"><SheetHeader className="border-b"><SheetTitle>Honey Token Details</SheetTitle>@@ -451,4 +460,7 @@ export const HoneyTokenDetailsDrawer = ({</SheetContent></Sheet>);-};+ }+);++HoneyTokenDetailsDrawer.displayName = "HoneyTokenDetailsDrawer";diff --git a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsxindex 9e2bfb1e3f..9cb78aa85c 100644--- a/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx+++ b/frontend/src/pages/secret-manager/OverviewPage/OverviewPage.tsx@@ -28,6 +28,7 @@ import {CreateHoneyTokenModal,EditHoneyTokenModal,HoneyTokenDetailsDrawer,+ type HoneyTokenDetailsDrawerHandle,RevokeHoneyTokenModal,ViewHoneyTokenCredentialsModal} from "@app/components/honey-tokens";@@ -785,10 +786,11 @@ const OverviewPageContent = () => {"confirmDisableBatchMode","editHoneyToken","revokeHoneyToken",- "viewHoneyTokenCredentials",- "viewHoneyTokenDetails"+ "viewHoneyTokenCredentials"] as const);+ const honeyTokenDetailsRef = useRef<HoneyTokenDetailsDrawerHandle>(null);+// Auto-open dynamic secret leases modal when linked via notification/emailuseEffect(() => {if (routerSearch.dynamicSecretId && dynamicSecrets?.length) {@@ -3104,7 +3106,7 @@ const OverviewPageContent = () => {handlePopUpOpen("viewHoneyTokenCredentials", honeyToken)}onViewDetails={(honeyToken) =>- handlePopUpOpen("viewHoneyTokenDetails", honeyToken)+ honeyTokenDetailsRef.current?.open(honeyToken.id)}/>))}@@ -3461,12 +3463,7 @@ const OverviewPageContent = () => {projectId={projectId}onOpenChange={(isOpen) => handlePopUpToggle("viewHoneyTokenCredentials", isOpen)}/>- <HoneyTokenDetailsDrawer- isOpen={popUp.viewHoneyTokenDetails.isOpen}- honeyTokenId={(popUp.viewHoneyTokenDetails.data as TDashboardHoneyToken)?.id ?? ""}- projectId={projectId}- onOpenChange={(isOpen) => handlePopUpToggle("viewHoneyTokenDetails", isOpen)}- />+ <HoneyTokenDetailsDrawer ref={honeyTokenDetailsRef} projectId={projectId} /><ImportSecretsModalisOpen={popUp.importSecrets.isOpen}onOpenChange={(isOpen) => {diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/HoneyTokenTableRow/HoneyTokenTableRow.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/HoneyTokenTableRow/HoneyTokenTableRow.tsxindex 675b8ce564..cb14132d3c 100644--- a/frontend/src/pages/secret-manager/OverviewPage/components/HoneyTokenTableRow/HoneyTokenTableRow.tsx+++ b/frontend/src/pages/secret-manager/OverviewPage/components/HoneyTokenTableRow/HoneyTokenTableRow.tsx@@ -268,7 +268,10 @@ export const HoneyTokenTableRow = ({</TableCell>{environments.length > 1 &&environments.map(({ slug }, i) => {- if (isExpanded) return <TableCell className="border-b-0 bg-container-hover" />;+ if (isExpanded)+ return (+ <TableCell key={`ht-overview-${slug}-${i + 1}`} className="border-b-0 bg-container-hover" />+ );const isPresent = isHoneyTokenInEnv(honeyTokenName, slug);diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/HoneyTokenListView/HoneyTokenListView.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/HoneyTokenListView/HoneyTokenListView.tsxindex ecd8f02f94..27c55ca654 100644--- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/HoneyTokenListView/HoneyTokenListView.tsx+++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/HoneyTokenListView/HoneyTokenListView.tsx@@ -1,8 +1,9 @@-import { useState } from "react";+import { useRef, useState } from "react";import {EditHoneyTokenModal,HoneyTokenDetailsDrawer,+ type HoneyTokenDetailsDrawerHandle,RevokeHoneyTokenModal,ViewHoneyTokenCredentialsModal} from "@app/components/honey-tokens";@@ -21,7 +22,7 @@ export const HoneyTokenListView = ({ honeyTokens }: Props) => {const [revokeTarget, setRevokeTarget] = useState<TDashboardHoneyToken>();const [editTarget, setEditTarget] = useState<TDashboardHoneyToken>();const [credentialsTarget, setCredentialsTarget] = useState<TDashboardHoneyToken>();- const [detailsTarget, setDetailsTarget] = useState<TDashboardHoneyToken>();+ const honeyTokenDetailsRef = useRef<HoneyTokenDetailsDrawerHandle>(null);return (<>@@ -32,7 +33,7 @@ export const HoneyTokenListView = ({ honeyTokens }: Props) => {onEdit={() => setEditTarget(honeyToken)}onRevoke={() => setRevokeTarget(honeyToken)}onViewCredentials={() => setCredentialsTarget(honeyToken)}- onViewDetails={() => setDetailsTarget(honeyToken)}+ onViewDetails={() => honeyTokenDetailsRef.current?.open(honeyToken.id)}/>))}<EditHoneyTokenModal@@ -57,14 +58,7 @@ export const HoneyTokenListView = ({ honeyTokens }: Props) => {honeyToken={credentialsTarget}projectId={projectId}/>- <HoneyTokenDetailsDrawer- isOpen={Boolean(detailsTarget)}- onOpenChange={(isOpen) => {- if (!isOpen) setDetailsTarget(undefined);- }}- honeyTokenId={detailsTarget?.id ?? ""}- projectId={projectId}- />+ <HoneyTokenDetailsDrawer ref={honeyTokenDetailsRef} projectId={projectId} /></>);};