Skip to content

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

fix: search hidden secrets

adilsonc31f41902780
diff --git a/frontend/src/components/v2/SecretInput/SecretInput.tsx b/frontend/src/components/v2/SecretInput/SecretInput.tsx
index ed2b24864c..28f1a231fd 100644
--- a/frontend/src/components/v2/SecretInput/SecretInput.tsx
+++ b/frontend/src/components/v2/SecretInput/SecretInput.tsx
@@ -171,6 +171,8 @@ export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
};
}, []);
+ const shouldRevealValue = isVisible || (isSecretFocused && !valueAlwaysHidden);
+
return (
<div
className={twMerge("no-scrollbar w-full overflow-auto rounded-md", containerClassName)}
@@ -182,7 +184,7 @@ export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
<span className={twMerge("whitespace-break-spaces", !value && "text-muted")}>
{syntaxHighlight(
value,
- isVisible || (isSecretFocused && !valueAlwaysHidden),
+ shouldRevealValue,
isImport,
isLoadingValue,
isErrorLoadingValue,
@@ -225,7 +227,7 @@ export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
onMouseLeave={() => {
setHoveredPart(undefined);
}}
- value={value || ""}
+ value={value && !shouldRevealValue ? HIDDEN_SECRET_VALUE : (value ?? "")}
{...props}
readOnly={isReadOnly || isLoadingValue || isErrorLoadingValue}
/>
diff --git a/frontend/src/components/v3/platform/SecretInput/SecretInput.tsx b/frontend/src/components/v3/platform/SecretInput/SecretInput.tsx
index d42df08d29..8e28cdbc43 100644
--- a/frontend/src/components/v3/platform/SecretInput/SecretInput.tsx
+++ b/frontend/src/components/v3/platform/SecretInput/SecretInput.tsx
@@ -175,6 +175,8 @@ export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
};
}, []);
+ const shouldRevealValue = isVisible || (isSecretFocused && !valueAlwaysHidden);
+
return (
<div
className={cn(
@@ -195,7 +197,7 @@ export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
>
{syntaxHighlight(
value,
- isVisible || (isSecretFocused && !valueAlwaysHidden),
+ shouldRevealValue,
isImport,
isLoadingValue,
isErrorLoadingValue,
@@ -239,7 +241,7 @@ export const SecretInput = forwardRef<HTMLTextAreaElement, Props>(
onMouseLeave={() => {
setHoveredPart(undefined);
}}
- value={value || ""}
+ value={value && !shouldRevealValue ? HIDDEN_SECRET_VALUE : (value ?? "")}
{...props}
readOnly={isReadOnly || isLoadingValue || isErrorLoadingValue}
/>