Refactor secret path handling in InfisicalSecretInput to use folderPath directly, enhancing clarity in permission validation logic.

This commit is contained in:
Victor Santos
2025-11-10 16:43:06 -03:00
parent f16bc7df7e
commit 7b91e7192c

View File

@@ -387,8 +387,6 @@ export const InfisicalSecretInput = forwardRef<HTMLTextAreaElement, Props>(
}
}
const secretPath = segment === environmentSlug ? "/" : folderPath;
// Only validate secret permission, users can always view environments and folders
if (segment === secretName) {
const canReadSecretValue = hasSecretReadValueOrDescribePermission(
@@ -396,8 +394,8 @@ export const InfisicalSecretInput = forwardRef<HTMLTextAreaElement, Props>(
ProjectPermissionSecretActions.ReadValue,
{
environment: environmentSlug,
secretPath,
secretName: secretName ?? "*",
secretPath: folderPath,
secretName,
secretTags: ["*"]
}
);