Skip to content

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

UI improvements

Carlos Monastyrski449763feeee8
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/PreApproveSigningSheet.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/PreApproveSigningSheet.tsx
index 65bd44bafc..34bc98c6b3 100644
--- a/frontend/src/pages/cert-manager/SignerDetailPage/components/PreApproveSigningSheet.tsx
+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/PreApproveSigningSheet.tsx
@@ -36,7 +36,11 @@ import {
} from "@app/pages/cert-manager/components/ScopeFieldsFormSection";
import { PkiDocsUrls } from "@app/pages/cert-manager/pki-docs-urls";
-import { getDefaultSigningWindow, SigningWindowField } from "../../components/SigningWindowField";
+import {
+ getDefaultSigningWindow,
+ resolveSigningWindow,
+ SigningWindowField
+} from "../../components/SigningWindowField";
type Props = {
isOpen: boolean;
@@ -63,7 +67,7 @@ const schema = z
justification: z.string().trim().min(1, "Reason is required").max(2048),
scope: SigningScopeSchema
})
- .refine((d) => d.requestedSignings || d.requestedWindowDuration, {
+ .refine((d) => d.requestedSignings || resolveSigningWindow(d.requestedWindowDuration), {
message: "Provide a signature count or an approval duration",
path: ["requestedSignings"]
});
@@ -135,7 +139,7 @@ export const PreApproveSigningSheet = ({ isOpen, onOpenChange, signerId }: Props
granteeIdentityId: kind === "identity" ? id : undefined,
justification: data.justification,
requestedSignings: data.requestedSignings ?? undefined,
- requestedWindowDuration: data.requestedWindowDuration,
+ requestedWindowDuration: resolveSigningWindow(data.requestedWindowDuration),
scope: pickDeclaredScope(data.scope)
});
handleClose(false);
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/RequestToSignSheet.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/RequestToSignSheet.tsx
index eccc6c6da4..a1400403ec 100644
--- a/frontend/src/pages/cert-manager/SignerDetailPage/components/RequestToSignSheet.tsx
+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/RequestToSignSheet.tsx
@@ -29,7 +29,11 @@ import {
} from "@app/pages/cert-manager/components/ScopeFieldsFormSection";
import { PkiDocsUrls } from "@app/pages/cert-manager/pki-docs-urls";
-import { getDefaultSigningWindow, SigningWindowField } from "../../components/SigningWindowField";
+import {
+ getDefaultSigningWindow,
+ resolveSigningWindow,
+ SigningWindowField
+} from "../../components/SigningWindowField";
type Props = {
isOpen: boolean;
@@ -53,7 +57,7 @@ const schema = z
justification: z.string().trim().min(1, "Reason is required").max(2048),
scope: SigningScopeSchema
})
- .refine((d) => d.requestedSignings || d.requestedWindowDuration, {
+ .refine((d) => d.requestedSignings || resolveSigningWindow(d.requestedWindowDuration), {
message: "Provide a signature count or an approval duration",
path: ["requestedSignings"]
});
@@ -97,7 +101,7 @@ export const RequestToSignSheet = ({ isOpen, onOpenChange, signerId }: Props) =>
signerId,
justification: data.justification,
requestedSignings: data.requestedSignings ?? undefined,
- requestedWindowDuration: data.requestedWindowDuration,
+ requestedWindowDuration: resolveSigningWindow(data.requestedWindowDuration),
scope: pickDeclaredScope(data.scope)
});
handleClose(false);
diff --git a/frontend/src/pages/cert-manager/components/ScopeFieldsFormSection.tsx b/frontend/src/pages/cert-manager/components/ScopeFieldsFormSection.tsx
index 3aacbd5095..52ee02f187 100644
--- a/frontend/src/pages/cert-manager/components/ScopeFieldsFormSection.tsx
+++ b/frontend/src/pages/cert-manager/components/ScopeFieldsFormSection.tsx
@@ -20,7 +20,7 @@ import {
FieldContent,
FieldDescription,
FieldError,
- FieldTitle,
+ FieldLabel,
Input,
Select,
SelectContent,
@@ -164,16 +164,18 @@ export const ScopeFieldsFormSection = <
return (
<div>
- <FieldTitle>Scope this request (Optional)</FieldTitle>
+ <FieldLabel>
+ Scope this request <span className="text-muted">(optional)</span>
+ </FieldLabel>
<FieldDescription>
- Left empty, the access covers any signing situation. Anything you add has to match on every
- sign call, so a mismatch is denied even when signatures remain.
+ Leave empty to cover any signing. Anything you add must match at signing time, or the call
+ is denied.
</FieldDescription>
<div className="mt-3">
<div className="flex flex-col gap-2">
{fields.length === 0 && (
- <Empty className="border py-8">
+ <Empty className="gap-3 border p-5 md:p-6">
<EmptyMedia variant="icon">
<ListFilter />
</EmptyMedia>
diff --git a/frontend/src/pages/cert-manager/components/SigningWindowField.tsx b/frontend/src/pages/cert-manager/components/SigningWindowField.tsx
index 09096c9dc6..a41de0442c 100644
--- a/frontend/src/pages/cert-manager/components/SigningWindowField.tsx
+++ b/frontend/src/pages/cert-manager/components/SigningWindowField.tsx
@@ -23,11 +23,16 @@ const DURATION_PRESETS = [
{ value: "7d", label: "1 week" }
];
-const DEFAULT_UNCAPPED_WINDOW = "1d";
+export const NO_SIGNING_WINDOW = "none";
+
+const NO_LIMIT_OPTION = { value: NO_SIGNING_WINDOW, label: "No limit" };
+
+export const resolveSigningWindow = (value?: string) =>
+ !value || value === NO_SIGNING_WINDOW ? undefined : value;
const getSigningWindowOptions = (maxWindowDuration?: string | null) => {
const maxMs = parseDurationMs(maxWindowDuration);
- if (maxMs === null || !maxWindowDuration) return DURATION_PRESETS;
+ if (maxMs === null || !maxWindowDuration) return [NO_LIMIT_OPTION, ...DURATION_PRESETS];
const withinPolicy = DURATION_PRESETS.filter((option) => {
const optionMs = parseDurationMs(option.value);
@@ -41,7 +46,7 @@ const getSigningWindowOptions = (maxWindowDuration?: string | null) => {
export const getDefaultSigningWindow = (maxWindowDuration?: string | null) =>
maxWindowDuration && parseDurationMs(maxWindowDuration) !== null
? maxWindowDuration
- : DEFAULT_UNCAPPED_WINDOW;
+ : NO_SIGNING_WINDOW;
type Props<T extends FieldValues> = {
control: Control<T>;
@@ -79,7 +84,7 @@ export const SigningWindowField = <T extends FieldValues>({
<FieldDescription>
{maxWindowDuration
? `Counts down from when the access is granted. Policy caps it at ${maxWindowDuration}.`
- : "Counts down from when the access is granted."}
+ : "Counts down from when the access is granted. This policy sets no maximum, so the approval can run until its signatures are used up."}
</FieldDescription>
</FieldContent>
</Field>