mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-07 05:27:48 +00:00
Enhance InfisicalSecretInput to use wildcard for environment and secret tags; update error message to reflect resource type. Improve tooltip in CreateSecretForm for secret references in both Overview and SecretDashboard pages.
This commit is contained in:
@@ -337,10 +337,10 @@ export const InfisicalSecretInput = forwardRef<HTMLTextAreaElement, Props>(
|
|||||||
permission,
|
permission,
|
||||||
ProjectPermissionSecretActions.ReadValue,
|
ProjectPermissionSecretActions.ReadValue,
|
||||||
{
|
{
|
||||||
environment: propEnvironment ?? "",
|
environment: propEnvironment ?? "*",
|
||||||
secretPath: propSecretPath ?? "/",
|
secretPath: propSecretPath ?? "/",
|
||||||
secretName: segment,
|
secretName: segment,
|
||||||
secretTags: []
|
secretTags: ["*"]
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -395,14 +395,21 @@ export const InfisicalSecretInput = forwardRef<HTMLTextAreaElement, Props>(
|
|||||||
{
|
{
|
||||||
environment: environmentSlug,
|
environment: environmentSlug,
|
||||||
secretPath,
|
secretPath,
|
||||||
secretName: secretName ?? "",
|
secretName: secretName ?? "*",
|
||||||
secretTags: []
|
secretTags: ["*"]
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let resourceName = "secret";
|
||||||
|
if (segment === environmentSlug) {
|
||||||
|
resourceName = "environment";
|
||||||
|
} else if (segment !== secretName && folderPath.includes(segment)) {
|
||||||
|
resourceName = "folder";
|
||||||
|
}
|
||||||
|
|
||||||
if (!canReadSecretValue) {
|
if (!canReadSecretValue) {
|
||||||
createNotification({
|
createNotification({
|
||||||
text: "You do not have permission to access this secret",
|
text: `You do not have permission to access this ${resourceName}`,
|
||||||
type: "error"
|
type: "error"
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
|
|||||||
+5
-3
@@ -255,10 +255,12 @@ export const CreateSecretForm = ({ secretPath = "/", onClose }: Props) => {
|
|||||||
<code>
|
<code>
|
||||||
${"{"}secret_name{"}"}
|
${"{"}secret_name{"}"}
|
||||||
</code>
|
</code>
|
||||||
.
|
|
||||||
<br />
|
<br />
|
||||||
<br /> You can go to the referenced secret by holding the <code>Cmd</code> (Mac) or{" "}
|
<br />
|
||||||
<code>Ctrl</code> (Windows/Linux) key and clicking on the secret name.
|
You can go to the referenced secret by holding the{" "}
|
||||||
|
<code className="rounded-sm bg-mineshaft-600 p-0.5">Cmd</code> (Mac) or{" "}
|
||||||
|
<code className="rounded-sm bg-mineshaft-600 p-0.5">Ctrl</code> (Windows/Linux) key
|
||||||
|
and clicking on the secret name.
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
tooltipClassName="max-w-md"
|
tooltipClassName="max-w-md"
|
||||||
|
|||||||
+15
@@ -197,6 +197,21 @@ export const CreateSecretForm = ({
|
|||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormControl
|
<FormControl
|
||||||
label="Value"
|
label="Value"
|
||||||
|
tooltipText={
|
||||||
|
<div>
|
||||||
|
You can add references to other secrets using the format{" "}
|
||||||
|
<code>
|
||||||
|
${"{"}secret_name{"}"}
|
||||||
|
</code>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
You can go to the referenced secret by holding the{" "}
|
||||||
|
<code className="rounded-sm bg-mineshaft-600 p-0.5">Cmd</code> (Mac) or{" "}
|
||||||
|
<code className="rounded-sm bg-mineshaft-600 p-0.5">Ctrl</code> (Windows/Linux) key
|
||||||
|
and clicking on the secret name.
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
tooltipClassName="max-w-md"
|
||||||
isError={Boolean(errors?.value)}
|
isError={Boolean(errors?.value)}
|
||||||
errorText={errors?.value?.message}
|
errorText={errors?.value?.message}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user