mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-20 19:02:03 +00:00
fix: editing secrets with value hidden
This commit is contained in:
@@ -96,6 +96,10 @@ import { SecretOverviewSecretRotationRow } from "@app/pages/secret-manager/Overv
|
||||
|
||||
import { CreateDynamicSecretForm } from "../SecretDashboardPage/components/ActionBar/CreateDynamicSecretForm";
|
||||
import { FolderForm } from "../SecretDashboardPage/components/ActionBar/FolderForm";
|
||||
import {
|
||||
HIDDEN_SECRET_VALUE,
|
||||
HIDDEN_SECRET_VALUE_API_MASK
|
||||
} from "../SecretDashboardPage/components/SecretListView/SecretItem";
|
||||
import { CreateSecretForm } from "./components/CreateSecretForm";
|
||||
import { FolderBreadCrumbs } from "./components/FolderBreadCrumbs";
|
||||
import { SecretOverviewDynamicSecretRow } from "./components/SecretOverviewDynamicSecretRow";
|
||||
@@ -509,15 +513,25 @@ export const OverviewPage = () => {
|
||||
env: string,
|
||||
key: string,
|
||||
value: string,
|
||||
secretValueHidden: boolean,
|
||||
type = SecretType.Shared
|
||||
) => {
|
||||
let secretValue: string | undefined = value;
|
||||
|
||||
if (
|
||||
secretValueHidden &&
|
||||
(value === HIDDEN_SECRET_VALUE_API_MASK || value === HIDDEN_SECRET_VALUE)
|
||||
) {
|
||||
secretValue = undefined;
|
||||
}
|
||||
|
||||
try {
|
||||
const result = await updateSecretV3({
|
||||
environment: env,
|
||||
workspaceId,
|
||||
secretPath,
|
||||
secretKey: key,
|
||||
secretValue: value,
|
||||
secretValue,
|
||||
type
|
||||
});
|
||||
|
||||
|
||||
+4
-1
@@ -50,6 +50,7 @@ type Props = {
|
||||
env: string,
|
||||
key: string,
|
||||
value: string,
|
||||
secretValueHidden: boolean,
|
||||
type?: SecretType,
|
||||
secretId?: string
|
||||
) => Promise<void>;
|
||||
@@ -147,6 +148,7 @@ export const SecretEditRow = ({
|
||||
environment,
|
||||
secretName,
|
||||
value,
|
||||
secretValueHidden,
|
||||
isOverride ? SecretType.Personal : SecretType.Shared,
|
||||
secretId
|
||||
);
|
||||
@@ -166,6 +168,7 @@ export const SecretEditRow = ({
|
||||
environment,
|
||||
secretName,
|
||||
secretValue,
|
||||
secretValueHidden,
|
||||
isOverride ? SecretType.Personal : SecretType.Shared,
|
||||
secretId
|
||||
);
|
||||
@@ -257,7 +260,7 @@ export const SecretEditRow = ({
|
||||
>
|
||||
{(isAllowed) => (
|
||||
<div>
|
||||
<Tooltip content="save">
|
||||
<Tooltip content="Save">
|
||||
<IconButton
|
||||
variant="plain"
|
||||
ariaLabel="submit-value"
|
||||
|
||||
+3
-1
@@ -24,6 +24,7 @@ import { useToggle } from "@app/hooks";
|
||||
import { SecretType, SecretV3RawSanitized } from "@app/hooks/api/secrets/types";
|
||||
import { WorkspaceEnv } from "@app/hooks/api/types";
|
||||
import { getExpandedRowStyle } from "@app/pages/secret-manager/OverviewPage/components/utils";
|
||||
import { HIDDEN_SECRET_VALUE } from "@app/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretItem";
|
||||
|
||||
import { SecretEditRow } from "./SecretEditRow";
|
||||
import SecretRenameRow from "./SecretRenameRow";
|
||||
@@ -40,6 +41,7 @@ type Props = {
|
||||
env: string,
|
||||
key: string,
|
||||
value: string,
|
||||
secretValueHidden: boolean,
|
||||
type?: SecretType,
|
||||
secretId?: string
|
||||
) => Promise<void>;
|
||||
@@ -96,7 +98,7 @@ export const SecretOverviewTableRow = ({
|
||||
);
|
||||
|
||||
if (secret?.secretValueHidden && !secret?.valueOverride) {
|
||||
return canEditSecretValue ? "******" : "";
|
||||
return canEditSecretValue ? HIDDEN_SECRET_VALUE : "";
|
||||
}
|
||||
return secret?.valueOverride || secret?.value || importedSecret?.secret?.value || "";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user