diff --git a/frontend/src/components/v2/InfisicalSecretInput/InfisicalSecretInput.tsx b/frontend/src/components/v2/InfisicalSecretInput/InfisicalSecretInput.tsx index 3b6d68112..82a652624 100644 --- a/frontend/src/components/v2/InfisicalSecretInput/InfisicalSecretInput.tsx +++ b/frontend/src/components/v2/InfisicalSecretInput/InfisicalSecretInput.tsx @@ -337,10 +337,10 @@ export const InfisicalSecretInput = forwardRef( permission, ProjectPermissionSecretActions.ReadValue, { - environment: propEnvironment ?? "", + environment: propEnvironment ?? "*", secretPath: propSecretPath ?? "/", secretName: segment, - secretTags: [] + secretTags: ["*"] } ); @@ -395,14 +395,21 @@ export const InfisicalSecretInput = forwardRef( { environment: environmentSlug, secretPath, - secretName: secretName ?? "", - secretTags: [] + secretName: secretName ?? "*", + secretTags: ["*"] } ); + let resourceName = "secret"; + if (segment === environmentSlug) { + resourceName = "environment"; + } else if (segment !== secretName && folderPath.includes(segment)) { + resourceName = "folder"; + } + if (!canReadSecretValue) { createNotification({ - text: "You do not have permission to access this secret", + text: `You do not have permission to access this ${resourceName}`, type: "error" }); return; diff --git a/frontend/src/pages/secret-manager/OverviewPage/components/CreateSecretForm/CreateSecretForm.tsx b/frontend/src/pages/secret-manager/OverviewPage/components/CreateSecretForm/CreateSecretForm.tsx index 3a7639cda..2ed31e50c 100644 --- a/frontend/src/pages/secret-manager/OverviewPage/components/CreateSecretForm/CreateSecretForm.tsx +++ b/frontend/src/pages/secret-manager/OverviewPage/components/CreateSecretForm/CreateSecretForm.tsx @@ -255,10 +255,12 @@ export const CreateSecretForm = ({ secretPath = "/", onClose }: Props) => { ${"{"}secret_name{"}"} - .
-
You can go to the referenced secret by holding the Cmd (Mac) or{" "} - Ctrl (Windows/Linux) key and clicking on the secret name. +
+ You can go to the referenced secret by holding the{" "} + Cmd (Mac) or{" "} + Ctrl (Windows/Linux) key + and clicking on the secret name. } tooltipClassName="max-w-md" diff --git a/frontend/src/pages/secret-manager/SecretDashboardPage/components/CreateSecretForm/CreateSecretForm.tsx b/frontend/src/pages/secret-manager/SecretDashboardPage/components/CreateSecretForm/CreateSecretForm.tsx index 858fcde77..1a4884ddb 100644 --- a/frontend/src/pages/secret-manager/SecretDashboardPage/components/CreateSecretForm/CreateSecretForm.tsx +++ b/frontend/src/pages/secret-manager/SecretDashboardPage/components/CreateSecretForm/CreateSecretForm.tsx @@ -197,6 +197,21 @@ export const CreateSecretForm = ({ render={({ field }) => ( + You can add references to other secrets using the format{" "} + + ${"{"}secret_name{"}"} + +
+
+ You can go to the referenced secret by holding the{" "} + Cmd (Mac) or{" "} + Ctrl (Windows/Linux) key + and clicking on the secret name. + + } + tooltipClassName="max-w-md" isError={Boolean(errors?.value)} errorText={errors?.value?.message} >