Skip to content

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

feat(pki): scope code-signing approvals to a signing situation

Carlos Monastyrski36606182ae79
diff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.ts
index 5b5d31b571..0d3c25c33a 100644
--- a/backend/src/ee/services/audit-log/audit-log-types.ts
+++ b/backend/src/ee/services/audit-log/audit-log-types.ts
@@ -803,6 +803,7 @@ export enum EventType {
GET_PKI_SIGNERS = "get-pki-signers",
GET_PKI_SIGNER_PUBLIC_KEY = "get-pki-signer-public-key",
GET_PKI_SIGNING_OPERATIONS = "get-pki-signing-operations",
+ GET_PKI_SIGNING_OPERATION = "get-pki-signing-operation",
PKI_SIGNER_SIGN = "pki-signer-sign",
ENABLE_PKI_SIGNER = "enable-pki-signer",
DISABLE_PKI_SIGNER = "disable-pki-signer",
@@ -4718,6 +4719,14 @@ interface GetPkiSigningOperationsEvent {
};
}
+interface GetPkiSigningOperationEvent {
+ type: EventType.GET_PKI_SIGNING_OPERATION;
+ metadata: {
+ signerId: string;
+ operationId: string;
+ };
+}
+
interface PkiSignerSignEvent {
type: EventType.PKI_SIGNER_SIGN;
metadata: {
@@ -7378,6 +7387,7 @@ export type Event =
| GetPkiSignersEvent
| GetPkiSignerPublicKeyEvent
| GetPkiSigningOperationsEvent
+ | GetPkiSigningOperationEvent
| PkiSignerSignEvent
| EnablePkiSignerEvent
| DisablePkiSignerEvent
diff --git a/backend/src/server/routes/v1/signer-routers/operations-router.ts b/backend/src/server/routes/v1/signer-routers/operations-router.ts
index 69ceef557b..801450ba98 100644
--- a/backend/src/server/routes/v1/signer-routers/operations-router.ts
+++ b/backend/src/server/routes/v1/signer-routers/operations-router.ts
@@ -64,4 +64,51 @@ export const registerSignerOperationsRouter = async (server: FastifyZodProvider)
return result;
}
});
+
+ server.route({
+ method: "GET",
+ url: "/:signerId/operations/:operationId",
+ config: { rateLimit: readLimit },
+ schema: {
+ hide: false,
+ operationId: "getSigningOperation",
+ tags: [ApiDocsTags.PkiSigners],
+ description: "Get a signing operation with its full client context",
+ params: z.object({ signerId: z.string().uuid(), operationId: z.string().uuid() }),
+ response: {
+ 200: z.object({
+ operation: PkiSigningOperationsSchema.extend({
+ actorName: z.string().nullable(),
+ actorMembershipId: z.string().uuid().nullable()
+ }),
+ signerName: z.string()
+ })
+ }
+ },
+ onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
+ handler: async (req) => {
+ const result = await server.services.pkiSigner.getOperationById({
+ signerId: req.params.signerId,
+ operationId: req.params.operationId,
+ actor: req.permission.type,
+ actorId: req.permission.id,
+ actorAuthMethod: req.permission.authMethod,
+ actorOrgId: req.permission.orgId
+ });
+
+ await server.services.auditLog.createAuditLog({
+ ...req.auditLogInfo,
+ projectId: result.projectId,
+ event: {
+ type: EventType.GET_PKI_SIGNING_OPERATION,
+ metadata: {
+ signerId: req.params.signerId,
+ operationId: req.params.operationId
+ }
+ }
+ });
+
+ return result;
+ }
+ });
};
diff --git a/backend/src/server/routes/v1/signer-routers/requests-router.ts b/backend/src/server/routes/v1/signer-routers/requests-router.ts
index fb5223707e..f093086319 100644
--- a/backend/src/server/routes/v1/signer-routers/requests-router.ts
+++ b/backend/src/server/routes/v1/signer-routers/requests-router.ts
@@ -4,6 +4,10 @@ import { EventType } from "@app/ee/services/audit-log/audit-log-types";
import { ApiDocsTags } from "@app/lib/api-docs";
import { readLimit, writeLimit } from "@app/server/config/rateLimiter";
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
+import {
+ CODE_SIGNING_SCOPE_API_DESCRIPTION,
+ CodeSigningScopeSchema
+} from "@app/services/approval-policy/code-signing/code-signing-policy-schemas";
import { AuthMode } from "@app/services/auth/auth-type";
import { SignerIdParamsSchema } from "./schemas";
@@ -66,7 +70,10 @@ export const registerSignerRequestsRouter = async (server: FastifyZodProvider) =
justification: z.string().trim().min(1).max(2048),
requestedSignings: z.number().int().min(1).optional(),
requestedWindowStart: z.string().datetime().optional(),
- requestedWindowEnd: z.string().datetime().optional()
+ requestedWindowEnd: z.string().datetime().optional(),
+ // Strict: an unrecognized key here would otherwise be dropped, turning a scoped
+ // request into an unscoped one that authorizes every signing context.
+ scope: CodeSigningScopeSchema.strict().optional().describe(CODE_SIGNING_SCOPE_API_DESCRIPTION)
})
},
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
@@ -109,7 +116,8 @@ export const registerSignerRequestsRouter = async (server: FastifyZodProvider) =
justification: z.string().trim().min(1).max(2048),
requestedSignings: z.number().int().min(1).optional(),
requestedWindowStart: z.string().datetime().optional(),
- requestedWindowEnd: z.string().datetime().optional()
+ requestedWindowEnd: z.string().datetime().optional(),
+ scope: CodeSigningScopeSchema.strict().optional().describe(CODE_SIGNING_SCOPE_API_DESCRIPTION)
})
},
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
diff --git a/backend/src/server/routes/v1/signer-routers/signing-router.ts b/backend/src/server/routes/v1/signer-routers/signing-router.ts
index 68b5aa8efa..420d7eae11 100644
--- a/backend/src/server/routes/v1/signer-routers/signing-router.ts
+++ b/backend/src/server/routes/v1/signer-routers/signing-router.ts
@@ -28,11 +28,38 @@ export const registerSignerSigningRouter = async (server: FastifyZodProvider) =>
isDigest: z.boolean().default(false),
clientMetadata: z
.object({
- tool: z.string().max(128).optional(),
- hostname: z.string().max(256).optional(),
- reportedIp: z.string().max(64).optional()
+ tool: z
+ .string()
+ .max(128)
+ .optional()
+ .describe("The signing application. Compared against a 'signingApplication' scope on the approval."),
+ hostname: z.string().max(256).optional().describe("The machine the sign call is made from."),
+ reportedIp: z
+ .string()
+ .max(64)
+ .optional()
+ .describe("Recorded for audit only. Approvals are matched against the address the call arrives from."),
+ command: z.string().max(2048).optional().describe("The command line that issued the sign call."),
+ osUsername: z
+ .string()
+ .max(256)
+ .optional()
+ .describe("The operating system account running the signing tool."),
+ signingApplicationHash: z
+ .string()
+ .max(64)
+ .optional()
+ .describe("SHA-256 checksum of the signing application binary."),
+ moduleVersion: z
+ .string()
+ .max(64)
+ .optional()
+ .describe("Version of the Infisical client that made the sign call. Recorded for audit only.")
})
.optional()
+ .describe(
+ "Context describing the signing situation. Values here are compared against any scope declared on the approval, and are recorded on the signing operation for audit."
+ )
}),
response: {
200: z.object({
@@ -54,6 +81,7 @@ export const registerSignerSigningRouter = async (server: FastifyZodProvider) =>
const result = await server.services.pkiSigner.sign({
signerId: req.params.signerId,
...req.body,
+ ipAddress: req.realIp,
actorName,
actor: req.permission.type,
actorId: req.permission.id,
diff --git a/backend/src/services/approval-policy/code-signing/code-signing-policy-enums.ts b/backend/src/services/approval-policy/code-signing/code-signing-policy-enums.ts
new file mode 100644
index 0000000000..04e1d38d3d
--- /dev/null
+++ b/backend/src/services/approval-policy/code-signing/code-signing-policy-enums.ts
@@ -0,0 +1,19 @@
+export enum CodeSigningScopeField {
+ Command = "command",
+ SigningApplication = "signingApplication",
+ SigningApplicationHash = "signingApplicationHash",
+ Hostname = "hostname",
+ OsUsername = "osUsername",
+ IpAddress = "ipAddress",
+ DataHash = "dataHash"
+}
+
+export const CODE_SIGNING_SCOPE_FIELD_LABELS: Record<CodeSigningScopeField, string> = {
+ [CodeSigningScopeField.Command]: "command",
+ [CodeSigningScopeField.SigningApplication]: "signing application",
+ [CodeSigningScopeField.SigningApplicationHash]: "signing application checksum",
+ [CodeSigningScopeField.Hostname]: "hostname",
+ [CodeSigningScopeField.OsUsername]: "OS username",
+ [CodeSigningScopeField.IpAddress]: "IP address",
+ [CodeSigningScopeField.DataHash]: "data digest"
+};
diff --git a/backend/src/services/approval-policy/code-signing/code-signing-policy-factory.ts b/backend/src/services/approval-policy/code-signing/code-signing-policy-factory.ts
index 1b530e8d05..5d9602f818 100644
--- a/backend/src/services/approval-policy/code-signing/code-signing-policy-factory.ts
+++ b/backend/src/services/approval-policy/code-signing/code-signing-policy-factory.ts
@@ -9,6 +9,7 @@ import {
TApprovalRequestFactoryValidateConstraints,
TApprovalResourceFactory
} from "../approval-policy-types";
+import { normalizeCodeSigningScope } from "./code-signing-policy-fns";
import {
TCodeSigningGrantAttributes,
TCodeSigningPolicy,
@@ -143,6 +144,10 @@ export const codeSigningPolicyFactory: TApprovalResourceFactory<
if (requestData.requestedWindowEnd) {
expiresAt = new Date(requestData.requestedWindowEnd);
}
+ const scope = normalizeCodeSigningScope(requestData.scope);
+ if (scope) {
+ grantAttributes.scope = scope;
+ }
await approvalRequestGrantsDAL.create({
projectId: request.projectId,
diff --git a/backend/src/services/approval-policy/code-signing/code-signing-policy-fns.test.ts b/backend/src/services/approval-policy/code-signing/code-signing-policy-fns.test.ts
new file mode 100644
index 0000000000..a11f7bb5c9
--- /dev/null
+++ b/backend/src/services/approval-policy/code-signing/code-signing-policy-fns.test.ts
@@ -0,0 +1,268 @@
+import { CodeSigningScopeField } from "./code-signing-policy-enums";
+import {
+ commandsMatch,
+ getCodeSigningScopeMismatches,
+ isSameRequestedSigningWindow,
+ normalizeCodeSigningScope
+} from "./code-signing-policy-fns";
+
+const DIGEST = "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9";
+const CHECKSUM = "8f677ab944beafd2cc37af6c173beb116b91b2400c9dfd3b7ae218b15b3c11b3";
+
+// A scope covering every parameter, plus the signing situation that matches it exactly.
+const fullScope = {
+ [CodeSigningScopeField.Command]: "signtool sign /fd sha256 installer.msi",
+ [CodeSigningScopeField.SigningApplication]: "signtool",
+ [CodeSigningScopeField.SigningApplicationHash]: CHECKSUM,
+ [CodeSigningScopeField.Hostname]: "build-agent-01",
+ [CodeSigningScopeField.OsUsername]: "svc-release",
+ [CodeSigningScopeField.IpAddress]: "203.0.113.10",
+ [CodeSigningScopeField.DataHash]: DIGEST
+};
+
+const matchingContext = { ...fullScope };
+
+describe("normalizeCodeSigningScope", () => {
+ test("returns undefined when nothing was declared", () => {
+ expect(normalizeCodeSigningScope(undefined)).toBeUndefined();
+ expect(normalizeCodeSigningScope({})).toBeUndefined();
+ });
+
+ test("treats blank and whitespace-only values as not declared", () => {
+ expect(
+ normalizeCodeSigningScope({
+ [CodeSigningScopeField.Command]: " ",
+ [CodeSigningScopeField.Hostname]: ""
+ })
+ ).toBeUndefined();
+ });
+
+ test("keeps only the declared parameters and trims them", () => {
+ expect(
+ normalizeCodeSigningScope({
+ [CodeSigningScopeField.Command]: " signtool sign a.msi ",
+ [CodeSigningScopeField.Hostname]: "",
+ [CodeSigningScopeField.OsUsername]: "svc-release"
+ })
+ ).toEqual({
+ [CodeSigningScopeField.Command]: "signtool sign a.msi",
+ [CodeSigningScopeField.OsUsername]: "svc-release"
+ });
+ });
+});
+
+describe("getCodeSigningScopeMismatches", () => {
+ test("an unscoped grant constrains nothing", () => {
+ expect(getCodeSigningScopeMismatches(null, {})).toEqual([]);
+ expect(getCodeSigningScopeMismatches(undefined, matchingContext)).toEqual([]);
+ expect(getCodeSigningScopeMismatches({}, {})).toEqual([]);
+ });
+
+ test("an exact match on every parameter reports no mismatch", () => {
+ expect(getCodeSigningScopeMismatches(fullScope, matchingContext)).toEqual([]);
+ });
+
+ test("a parameter left unbound is not constrained, whatever the caller reports", () => {
+ const scope = { [CodeSigningScopeField.Command]: "signtool sign a.msi" };
+ expect(
+ getCodeSigningScopeMismatches(scope, {
+ [CodeSigningScopeField.Command]: "signtool sign a.msi",
+ [CodeSigningScopeField.Hostname]: "some-other-machine",
+ [CodeSigningScopeField.OsUsername]: "someone-else"
+ })
+ ).toEqual([]);
+ });
+
+ test.each([
+ [CodeSigningScopeField.Command, "signtool sign EVIL.msi"],
+ [CodeSigningScopeField.SigningApplication, "osslsigncode"],
+ [CodeSigningScopeField.SigningApplicationHash, CHECKSUM.replace("8f6", "aaa")],
+ [CodeSigningScopeField.Hostname, "laptop-42"],
+ [CodeSigningScopeField.OsUsername, "attacker"],
+ [CodeSigningScopeField.IpAddress, "198.51.100.7"],
+ [CodeSigningScopeField.DataHash, DIGEST.replace("b94", "ccc")]
+ ])("reports %s alone when only that parameter differs", (field, wrongValue) => {
+ expect(getCodeSigningScopeMismatches(fullScope, { ...matchingContext, [field]: wrongValue })).toEqual([field]);
+ });
+
+ test("reports every parameter that differs", () => {
+ const mismatches = getCodeSigningScopeMismatches(fullScope, {
+ ...matchingContext,
+ [CodeSigningScopeField.SigningApplication]: "osslsigncode",
+ [CodeSigningScopeField.Hostname]: "laptop-42"
+ });
+ expect(mismatches).toEqual([CodeSigningScopeField.SigningApplication, CodeSigningScopeField.Hostname]);
+ });
+
+ // A caller that simply omits the context must not slip past a scope that names it.
+ test("a missing observed value fails closed", () => {
+ expect(getCodeSigningScopeMismatches(fullScope, {})).toEqual(Object.values(CodeSigningScopeField));
+ expect(
+ getCodeSigningScopeMismatches(fullScope, {
+ ...matchingContext,
+ [CodeSigningScopeField.Hostname]: undefined
+ })
+ ).toEqual([CodeSigningScopeField.Hostname]);
+ });
+
+ test("a blank or whitespace-only observed value also fails closed", () => {
+ expect(
+ getCodeSigningScopeMismatches(fullScope, {
+ ...matchingContext,
+ [CodeSigningScopeField.OsUsername]: " "
+ })
+ ).toEqual([CodeSigningScopeField.OsUsername]);
+ });
+
+ test.each([
+ [CodeSigningScopeField.Hostname, "BUILD-AGENT-01"],
+ [CodeSigningScopeField.SigningApplicationHash, CHECKSUM.toUpperCase()],
+ [CodeSigningScopeField.DataHash, DIGEST.toUpperCase()]
+ ])("%s matches regardless of case", (field, differentCase) => {
+ expect(getCodeSigningScopeMismatches(fullScope, { ...matchingContext, [field]: differentCase })).toEqual([]);
+ });
+
+ test("an IPv6 address matches regardless of hex case", () => {
+ const scope = { [CodeSigningScopeField.IpAddress]: "2001:DB8::1" };
+ expect(getCodeSigningScopeMismatches(scope, { [CodeSigningScopeField.IpAddress]: "2001:db8::1" })).toEqual([]);
+ });
+
+ test.each([
+ [CodeSigningScopeField.Command, "SIGNTOOL SIGN /FD SHA256 INSTALLER.MSI"],
+ [CodeSigningScopeField.SigningApplication, "SIGNTOOL"],
+ [CodeSigningScopeField.OsUsername, "SVC-RELEASE"]
+ ])("%s stays case-sensitive", (field, differentCase) => {
+ expect(getCodeSigningScopeMismatches(fullScope, { ...matchingContext, [field]: differentCase })).toEqual([field]);
+ });
+
+ test("surrounding whitespace does not change the decision", () => {
+ expect(
+ getCodeSigningScopeMismatches(
+ { [CodeSigningScopeField.Command]: " signtool sign a.msi " },
+ { [CodeSigningScopeField.Command]: "signtool sign a.msi " }
+ )
+ ).toEqual([]);
+ });
+});
+
+describe("commandsMatch", () => {
+ const SIGNTOOL =
+ '"C:\\Program Files (x86)\\Windows Kits\\10\\bin\\signtool.exe" sign /fd SHA256 /f cert.cer /csp "Infisical KSP" /kc demo app.exe';
+
+ test("a command matches itself", () => {
+ expect(commandsMatch(SIGNTOOL, SIGNTOOL)).toBe(true);
+ expect(commandsMatch("pkcs11-tool --sign --slot 0", "pkcs11-tool --sign --slot 0")).toBe(true);
+ });
+
+ // The one tolerance: a client that renders its argv with a different amount of whitespace than
+ // the operator typed still describes the same command.
+ test("whitespace is collapsed on both sides", () => {
+ expect(commandsMatch("tool --sign --slot 0", "tool --sign --slot 0")).toBe(true);
+ expect(commandsMatch("tool\t--sign\t--slot 0", "tool --sign --slot 0")).toBe(true);
+ expect(commandsMatch(" tool --sign ", "tool --sign")).toBe(true);
+ expect(commandsMatch("tool\n--sign", "tool --sign")).toBe(true);
+ });
+
+ // Reordering is deliberately NOT tolerated: it cannot be recognised without knowing which flags
+ // take values, so a reordered command is a new command and needs its own approval.
+ test("reordered options do not match", () => {
+ expect(commandsMatch("tool --sign --slot 0", "tool --slot 0 --sign")).toBe(false);
+ expect(commandsMatch(SIGNTOOL, SIGNTOOL.replace("/fd SHA256 /f cert.cer", "/f cert.cer /fd SHA256"))).toBe(false);
+ });
+
+ test("an inline value is not the same as a separated one", () => {
+ expect(commandsMatch("tool --fd=sha256", "tool --fd sha256")).toBe(false);
+ });
+
+ test("any changed, added or removed token does not match", () => {
+ const bound = "tool --sign --slot 0 app.exe";
+ expect(commandsMatch(bound, "tool --sign --slot 1 app.exe")).toBe(false);
+ expect(commandsMatch(bound, "tool --sign --slot 0 --login app.exe")).toBe(false);
+ expect(commandsMatch(bound, "tool --sign app.exe")).toBe(false);
+ expect(commandsMatch(bound, "tool --sign --slot 0 other.exe")).toBe(false);
+ expect(commandsMatch(bound, "/usr/bin/tool --sign --slot 0 app.exe")).toBe(false);
+ });
+
+ test("comparison is case-sensitive", () => {
+ expect(commandsMatch("tool --fd SHA256", "tool --fd sha256")).toBe(false);
+ });
+
+ test("quoting is part of the command", () => {
+ expect(commandsMatch('tool --csp "Infisical KSP"', 'tool --csp "Infisical KSP"')).toBe(true);
+ expect(commandsMatch('tool --csp "Infisical KSP"', "tool --csp Infisical KSP")).toBe(false);
+ });
+
+ // Redaction runs before the command is sent, so both sides carry the marker rather than the
+ // secret. Two different secrets therefore look identical, which is intended.
+ test("redacted secrets compare as equal", () => {
+ expect(commandsMatch("signtool sign /p *** app.exe", "signtool sign /p *** app.exe")).toBe(true);
+ });
+
+ test("empty and whitespace-only commands", () => {
+ expect(commandsMatch("", "")).toBe(true);
+ expect(commandsMatch(" ", "")).toBe(true);
+ expect(commandsMatch("tool", "")).toBe(false);
+ });
+});
+
+describe("isSameRequestedSigningWindow", () => {
+ const MACHINE = false;
+ const HUMAN = true;
+
+ // The case that made the pending-request lookup useless for signing clients: a retry asks for
+ // the same duration, but every call anchors the window at its own "now".
+ test("a client retry asking for the same duration later is the same ask", () => {
+ const first = { start: "2026-08-04T10:00:00.000Z", end: "2026-08-04T18:00:00.000Z" };
+ const retriedSecondsLater = { start: "2026-08-04T10:00:07.000Z", end: "2026-08-04T18:00:07.000Z" };
+ const retriedHoursLater = { start: "2026-08-04T15:30:00.000Z", end: "2026-08-04T23:30:00.000Z" };
+
+ expect(isSameRequestedSigningWindow(MACHINE, first, retriedSecondsLater)).toBe(true);
+ expect(isSameRequestedSigningWindow(MACHINE, first, retriedHoursLater)).toBe(true);
+ });
+
+ test("a client asking for a different duration is a new ask", () => {
+ const eightHours = { start: "2026-08-04T10:00:00.000Z", end: "2026-08-04T18:00:00.000Z" };
+ const oneHour = { start: "2026-08-04T10:00:00.000Z", end: "2026-08-04T11:00:00.000Z" };
+
+ expect(isSameRequestedSigningWindow(MACHINE, eightHours, oneHour)).toBe(false);
+ });
+
+ // A person picks absolute times, so two windows of equal length at different times are two
+ // different asks and must not collapse into one.
+ test("equal-length windows at different times stay distinct for a person", () => {
+ const morning = { start: "2026-08-04T10:00:00.000Z", end: "2026-08-04T11:00:00.000Z" };
+ const midday = { start: "2026-08-04T11:00:00.000Z", end: "2026-08-04T12:00:00.000Z" };
+
+ expect(isSameRequestedSigningWindow(HUMAN, morning, midday)).toBe(false);
+ expect(isSameRequestedSigningWindow(HUMAN, morning, { ...morning })).toBe(true);
+ });
+
+ test("a count-only request with no window at all is the same ask", () => {
+ expect(isSameRequestedSigningWindow(MACHINE, {}, {})).toBe(true);
+ expect(isSameRequestedSigningWindow(HUMAN, {}, {})).toBe(true);
+ });
+
+ // With no start there is no duration, so falling back to the instant keeps two different
+ // absolute ends apart instead of treating both unknowns as equal.
+ test("an end with no start falls back to comparing the instant", () => {
+ const a = { end: "2026-08-04T18:00:00.000Z" };
+ const b = { end: "2026-08-04T19:00:00.000Z" };
+
+ expect(isSameRequestedSigningWindow(MACHINE, a, b)).toBe(false);
+ expect(isSameRequestedSigningWindow(MACHINE, a, { ...a })).toBe(true);
+ });
+
+ test("an unparseable timestamp does not read as a match", () => {
+ const good = { start: "2026-08-04T10:00:00.000Z", end: "2026-08-04T18:00:00.000Z" };
+ const broken = { start: "not a date", end: "2026-08-04T18:00:00.000Z" };
+
+ expect(isSameRequestedSigningWindow(MACHINE, good, broken)).toBe(false);
+ });
+
+ test("a window is never the same ask as no window", () => {
+ const windowed = { start: "2026-08-04T10:00:00.000Z", end: "2026-08-04T18:00:00.000Z" };
+
+ expect(isSameRequestedSigningWindow(MACHINE, windowed, {})).toBe(false);
+ expect(isSameRequestedSigningWindow(HUMAN, windowed, {})).toBe(false);
+ });
+});
diff --git a/backend/src/services/approval-policy/code-signing/code-signing-policy-fns.ts b/backend/src/services/approval-policy/code-signing/code-signing-policy-fns.ts
new file mode 100644
index 0000000000..cccc4446a7
--- /dev/null
+++ b/backend/src/services/approval-policy/code-signing/code-signing-policy-fns.ts
@@ -0,0 +1,125 @@
+import RE2 from "re2";
+
+import { CodeSigningScopeField } from "./code-signing-policy-enums";
+import { TCodeSigningScope } from "./code-signing-policy-types";
+
+export const normalizeCodeSigningScope = (scope: TCodeSigningScope | undefined): TCodeSigningScope | undefined => {
+ if (!scope) return undefined;
+
+ const declared: TCodeSigningScope = {};
+ let hasAny = false;
+ for (const field of Object.values(CodeSigningScopeField)) {
+ const value = scope[field]?.trim();
+ if (value) {
+ declared[field] = value;
+ hasAny = true;
+ }
+ }
+
+ return hasAny ? declared : undefined;
+};
+
+export type TObservedSigningContext = {
+ [CodeSigningScopeField.Command]?: string;
+ [CodeSigningScopeField.SigningApplication]?: string;
+ [CodeSigningScopeField.SigningApplicationHash]?: string;
+ [CodeSigningScopeField.Hostname]?: string;
+ [CodeSigningScopeField.OsUsername]?: string;
+ [CodeSigningScopeField.IpAddress]?: string;
+ [CodeSigningScopeField.DataHash]?: string;
+};
+
+export const buildObservedSigningContext = ({
+ clientMetadata,
+ ipAddress,
+ dataHash
+}: {
+ clientMetadata?: {
+ command?: string;
+ tool?: string;
+ signingApplicationHash?: string;
+ hostname?: string;
+ osUsername?: string;
+ };
+ ipAddress?: string;
+ dataHash: string;
+}): TObservedSigningContext => ({
+ [CodeSigningScopeField.Command]: clientMetadata?.command,
+ [CodeSigningScopeField.SigningApplication]: clientMetadata?.tool,
+ [CodeSigningScopeField.SigningApplicationHash]: clientMetadata?.signingApplicationHash,
+ [CodeSigningScopeField.Hostname]: clientMetadata?.hostname,
+ [CodeSigningScopeField.OsUsername]: clientMetadata?.osUsername,
+ [CodeSigningScopeField.IpAddress]: ipAddress,
+ [CodeSigningScopeField.DataHash]: dataHash
+});
+
+const WHITESPACE_RE = new RE2("\\s+", "g");
+
+/**
+ * Whether two signing commands are the same command.
+ *
+ * The comparison is exact apart from whitespace, which is collapsed on both sides so that a run of
+ * spaces or a tab where the other side has one space still matches. Anything else about the command
+ * differing, including the order of its options, makes it a different command and needs its own
+ * approval.
+ */
+export const commandsMatch = (bound: string, observed: string): boolean =>
+ bound.trim().replace(WHITESPACE_RE, " ") === observed.trim().replace(WHITESPACE_RE, " ");
+
+const CASE_INSENSITIVE_FIELDS: readonly CodeSigningScopeField[] = [
+ CodeSigningScopeField.Hostname,
+ CodeSigningScopeField.DataHash,
+ CodeSigningScopeField.SigningApplicationHash,
+ // IPv6 is hex, so the same address can be written in either case.
+ CodeSigningScopeField.IpAddress
+];
+
+export const getCodeSigningScopeMismatches = (
+ bound: TCodeSigningScope | null | undefined,
+ observed: TObservedSigningContext
+): CodeSigningScopeField[] => {
+ if (!bound) return [];
+
+ return Object.values(CodeSigningScopeField).filter((field) => {
+ const boundValue = bound[field]?.trim();
+ if (!boundValue) return false;
+ const observedValue = observed[field]?.trim();
+ if (!observedValue) return true;
+ if (field === CodeSigningScopeField.Command) {
+ return !commandsMatch(boundValue, observedValue);
+ }
+ if (CASE_INSENSITIVE_FIELDS.includes(field)) {
+ return boundValue.toLowerCase() !== observedValue.toLowerCase();
+ }
+ return boundValue !== observedValue;
+ });
+};
+
+type TRequestedSigningWindow = { start?: string; end?: string };
+
+/**
+ * Whether two requested signing windows are the same ask, which depends on who is asking.
+ *
+ * A signing client re-derives its window from a configured duration on every call, so a retry asks
+ * for identical terms at a later absolute window. Comparing instants would never match and every
+ * retry would open a duplicate request. A person picks absolute times, where 10:00-11:00 and
+ * 11:00-12:00 are two different asks that merely share a duration.
+ */
+export const isSameRequestedSigningWindow = (
+ isHumanRequester: boolean,
+ pending: TRequestedSigningWindow,
+ incoming: TRequestedSigningWindow
+): boolean => {
+ const sameEnd = (pending.end ?? null) === (incoming.end ?? null);
+ if (isHumanRequester) return sameEnd;
+
+ if (!pending.start || !pending.end || !incoming.start || !incoming.end) return sameEnd;
+
+ const durationOf = (start: string, end: string) => new Date(end).getTime() - new Date(start).getTime();
+
+ const pendingDuration = durationOf(pending.start, pending.end);
+ const incomingDuration = durationOf(incoming.start, incoming.end);
+ // A stored window whose timestamps will not parse is a malformed record, not a match.
+ if (Number.isNaN(pendingDuration) || Number.isNaN(incomingDuration)) return false;
+ return pendingDuration === incomingDuration;
+};
diff --git a/backend/src/services/approval-policy/code-signing/code-signing-policy-schemas.ts b/backend/src/services/approval-policy/code-signing/code-signing-policy-schemas.ts
index 8e5266e67b..331c11a91e 100644
--- a/backend/src/services/approval-policy/code-signing/code-signing-policy-schemas.ts
+++ b/backend/src/services/approval-policy/code-signing/code-signing-policy-schemas.ts
@@ -1,3 +1,4 @@
+import RE2 from "re2";
import { z } from "zod";
import { ms } from "@app/lib/ms";
@@ -10,6 +11,7 @@ import {
BaseCreateApprovalRequestSchema,
BaseUpdateApprovalPolicySchema
} from "../approval-policy-schemas";
+import { CodeSigningScopeField } from "./code-signing-policy-enums";
export const CodeSigningPolicyInputsSchema = z.object({
signerId: z.string().uuid(),
@@ -30,6 +32,46 @@ const WindowDurationSchema = z
)
.optional();
+const SHA256_HEX_RE = new RE2("^[a-fA-F0-9]{64}$");
+
+const scopeText = (max: number) =>
+ z
+ .string()
+ .trim()
+ .max(max)
+ .optional()
+ .transform((value) => (value === "" ? undefined : value));
+
+const scopeSha256 = (message: string) =>
+ z
+ .string()
+ .trim()
+ .max(64)
+ .optional()
+ .transform((value) => (value === "" ? undefined : value))
+ .refine((value) => value === undefined || SHA256_HEX_RE.test(value), message);
+
+export const CodeSigningScopeSchema = z.object({
+ [CodeSigningScopeField.Command]: scopeText(2048),
+ [CodeSigningScopeField.SigningApplication]: scopeText(256),
+ [CodeSigningScopeField.SigningApplicationHash]: scopeSha256(
+ "Signing application checksum must be a 64-character SHA-256 hex string"
+ ),
+ [CodeSigningScopeField.Hostname]: scopeText(256),
+ [CodeSigningScopeField.OsUsername]: scopeText(256),
+ [CodeSigningScopeField.IpAddress]: z
+ .string()
+ .trim()
+ .max(45)
+ .optional()
+ .transform((value) => (value === "" ? undefined : value))
+ .refine((value) => value === undefined || z.string().ip().safeParse(value).success, "Must be a valid IP address"),
+ [CodeSigningScopeField.DataHash]: scopeSha256("Data digest must be a 64-character SHA-256 hex string")
+});
+
+export const CODE_SIGNING_SCOPE_API_DESCRIPTION =
+ "Optional parameters to scope this approval to (command, signingApplication, signingApplicationHash, hostname, osUsername, ipAddress, dataHash). Every value declared here must match at signing time or the sign call is denied; parameters left out are not restricted. A command must match exactly, apart from whitespace, so a different order of options is a different command. ipAddress is compared against the address the sign call arrives from and dataHash against the digest of the submitted payload, so those two hold even if a caller reports something else.";
+
export const CodeSigningPolicyConstraintsSchema = z
.object({
maxWindowDuration: WindowDurationSchema,
@@ -46,7 +88,8 @@ export const CodeSigningPolicyRequestDataSchema = z.object({
justification: z.string().max(512).optional(),
requestedWindowStart: z.string().datetime().optional(),
requestedWindowEnd: z.string().datetime().optional(),
- requestedSignings: z.number().int().positive().optional()
+ requestedSignings: z.number().int().positive().optional(),
+ scope: CodeSigningScopeSchema.optional()
});
export const CodeSigningPolicySchema = BaseApprovalPolicySchema.extend({
@@ -86,6 +129,7 @@ export const CodeSigningRequestGrantSchema = BaseApprovalRequestGrantSchema.exte
signerId: z.string().uuid(),
signerName: z.string(),
maxSignings: z.number().int().positive().optional(),
- windowStart: z.string().datetime().optional()
+ windowStart: z.string().datetime().optional(),
+ scope: CodeSigningScopeSchema.optional()
})
});
diff --git a/backend/src/services/approval-policy/code-signing/code-signing-policy-types.ts b/backend/src/services/approval-policy/code-signing/code-signing-policy-types.ts
index 666d6bbd1c..ae5144e73d 100644
--- a/backend/src/services/approval-policy/code-signing/code-signing-policy-types.ts
+++ b/backend/src/services/approval-policy/code-signing/code-signing-policy-types.ts
@@ -7,7 +7,8 @@ import {
CodeSigningPolicyRequestDataSchema,
CodeSigningPolicySchema,
CodeSigningRequestGrantSchema,
- CodeSigningRequestSchema
+ CodeSigningRequestSchema,
+ CodeSigningScopeSchema
} from "./code-signing-policy-schemas";
export type TCodeSigningPolicy = z.infer<typeof CodeSigningPolicySchema>;
@@ -19,3 +20,5 @@ export type TCodeSigningRequest = z.infer<typeof CodeSigningRequestSchema>;
export type TCodeSigningRequestData = z.infer<typeof CodeSigningPolicyRequestDataSchema>;
export type TCodeSigningGrantAttributes = z.infer<typeof CodeSigningRequestGrantSchema>["attributes"];
+
+export type TCodeSigningScope = z.infer<typeof CodeSigningScopeSchema>;
diff --git a/backend/src/services/signer/signer-enums.ts b/backend/src/services/signer/signer-enums.ts
index ba76bb030e..20291f0ece 100644
--- a/backend/src/services/signer/signer-enums.ts
+++ b/backend/src/services/signer/signer-enums.ts
@@ -30,3 +30,5 @@ export enum HsmKeyAlgorithm {
ECC_P256 = "ECC_P256",
ECC_P384 = "ECC_P384"
}
+
+export const SIGNER_APPROVAL_REQUIRED_ERROR_NAME = "ApprovalRequired";
diff --git a/backend/src/services/signer/signer-policy-service.ts b/backend/src/services/signer/signer-policy-service.ts
index b6cbe0efb1..94497f3b9c 100644
--- a/backend/src/services/signer/signer-policy-service.ts
+++ b/backend/src/services/signer/signer-policy-service.ts
@@ -29,6 +29,12 @@ import {
TApprovalRequestStepsDALFactory
} from "../approval-policy/approval-request-dal";
import { createApprovalRequestWithSteps, notifyStepApprovers } from "../approval-policy/approval-request-fns";
+import { CodeSigningScopeField } from "../approval-policy/code-signing/code-signing-policy-enums";
+import {
+ isSameRequestedSigningWindow,
+ normalizeCodeSigningScope
+} from "../approval-policy/code-signing/code-signing-policy-fns";
+import { TCodeSigningRequestData, TCodeSigningScope } from "../approval-policy/code-signing/code-signing-policy-types";
import { ActorType } from "../auth/auth-type";
import { TIdentityDALFactory } from "../identity/identity-dal";
import { TMembershipDALFactory } from "../membership/membership-dal";
@@ -228,6 +234,53 @@ export const signerPolicyServiceFactory = ({
return { effectiveSignings, effectiveWindowStart, effectiveWindowEnd };
};
+ const $findDuplicatePendingRequest = async ({
+ policyId,
+ signerId,
+ actor,
+ actorId,
+ scope,
+ effectiveSignings,
+ effectiveWindowStart,
+ effectiveWindowEnd
+ }: {
+ policyId: string;
+ signerId: string;
+ actor: TRequestToSignDTO["actor"];
+ actorId: string;
+ scope: TCodeSigningScope;
+ effectiveSignings?: number;
+ effectiveWindowStart?: string;
+ effectiveWindowEnd?: string;
+ }) => {
+ const isHumanRequester = actor === ActorType.USER;
+ const pendingRequests = await approvalRequestDAL.find({
+ policyId,
+ status: ApprovalRequestStatus.Pending,
+ scopeType: ApprovalPolicyScope.Signer,
+ scopeId: signerId,
+ ...(isHumanRequester ? { requesterId: actorId } : { machineIdentityId: actorId })
+ });
+
+ return pendingRequests.find((request) => {
+ const requestData = (request.requestData as { requestData?: TCodeSigningRequestData } | null)?.requestData;
+ const pendingScope = requestData?.scope;
+ if (!pendingScope) return false;
+
+ if ((requestData?.requestedSignings ?? null) !== (effectiveSignings ?? null)) return false;
+ const sameWindow = isSameRequestedSigningWindow(
+ isHumanRequester,
+ { start: requestData?.requestedWindowStart, end: requestData?.requestedWindowEnd },
+ { start: effectiveWindowStart, end: effectiveWindowEnd }
+ );
+ if (!sameWindow) return false;
+
+ return Object.values(CodeSigningScopeField).every(
+ (field) => (pendingScope[field] ?? null) === (scope[field] ?? null)
+ );
+ });
+ };
+
const $resolveGranteeEffectiveRoles = async ({
projectId,
signerId,
@@ -569,6 +622,21 @@ export const signerPolicyServiceFactory = ({
requestedWindowEnd: dto.requestedWindowEnd
}
);
+ const scope = normalizeCodeSigningScope(dto.scope);
+
+ if (scope) {
+ const duplicate = await $findDuplicatePendingRequest({
+ policyId: policy.id,
+ signerId: signer.id,
+ actor: dto.actor,
+ actorId: dto.actorId,
+ scope,
+ effectiveSignings,
+ effectiveWindowStart,
+ effectiveWindowEnd
+ });
+ if (duplicate) return duplicate;
+ }
const requester = await $resolveActorDisplay({
userId: dto.actor === ActorType.USER ? dto.actorId : null,
@@ -591,7 +659,8 @@ export const signerPolicyServiceFactory = ({
justification: dto.justification,
requestedSignings: effectiveSignings,
requestedWindowStart: effectiveWindowStart,
- requestedWindowEnd: effectiveWindowEnd
+ requestedWindowEnd: effectiveWindowEnd,
+ scope
},
justification: dto.justification,
requesterUserId: dto.actor === ActorType.USER ? dto.actorId : null,
@@ -656,6 +725,7 @@ export const signerPolicyServiceFactory = ({
requestedWindowEnd: dto.requestedWindowEnd
}
);
+ const scope = normalizeCodeSigningScope(dto.scope);
const granteeRoles = await $resolveGranteeEffectiveRoles({
projectId: signer.projectId,
@@ -702,7 +772,8 @@ export const signerPolicyServiceFactory = ({
justification: dto.justification,
requestedSignings: effectiveSignings,
requestedWindowStart: effectiveWindowStart,
- requestedWindowEnd: effectiveWindowEnd
+ requestedWindowEnd: effectiveWindowEnd,
+ scope
}
}
},
@@ -721,7 +792,8 @@ export const signerPolicyServiceFactory = ({
signerId: signer.id,
signerName: signer.name,
maxSignings: effectiveSignings,
- windowStart: effectiveWindowStart
+ windowStart: effectiveWindowStart,
+ scope
},
expiresAt: effectiveWindowEnd ? new Date(effectiveWindowEnd) : null
},
diff --git a/backend/src/services/signer/signer-service.ts b/backend/src/services/signer/signer-service.ts
index 163fc90fcf..389edede0a 100644
--- a/backend/src/services/signer/signer-service.ts
+++ b/backend/src/services/signer/signer-service.ts
@@ -45,6 +45,15 @@ import {
ApprovalRequestGrantStatus
} from "../approval-policy/approval-policy-enums";
import { TApprovalRequestDALFactory, TApprovalRequestGrantsDALFactory } from "../approval-policy/approval-request-dal";
+import {
+ CODE_SIGNING_SCOPE_FIELD_LABELS,
+ CodeSigningScopeField
+} from "../approval-policy/code-signing/code-signing-policy-enums";
+import {
+ buildObservedSigningContext,
+ getCodeSigningScopeMismatches,
+ TObservedSigningContext
+} from "../approval-policy/code-signing/code-signing-policy-fns";
import { TCodeSigningGrantAttributes } from "../approval-policy/code-signing/code-signing-policy-types";
import { ActorType } from "../auth/auth-type";
import { TCertificateBodyDALFactory } from "../certificate/certificate-body-dal";
@@ -63,7 +72,13 @@ import { TProjectDALFactory } from "../project/project-dal";
import { getProjectKmsCertificateKeyId } from "../project/project-fns";
import { isBuiltInSignerRole, unknownSignerRoleMessage } from "../signer-membership/signer-membership-service";
import { TSignerDALFactory } from "./signer-dal";
-import { CertKeySource, HsmKeyAlgorithm, SignerStatus, SigningOperationStatus } from "./signer-enums";
+import {
+ CertKeySource,
+ HsmKeyAlgorithm,
+ SIGNER_APPROVAL_REQUIRED_ERROR_NAME,
+ SignerStatus,
+ SigningOperationStatus
+} from "./signer-enums";
import { formatSignerIssuanceErrorReason } from "./signer-issuance-errors";
import {
issueHsmBackedSignerCertificate,
@@ -81,6 +96,7 @@ import {
TExportCertificateDTO,
TGetPublicKeyDTO,
TGetSignerDTO,
+ TGetSigningOperationDTO,
TListSignersDTO,
TListSigningOperationsDTO,
TReissueCertificateDTO,
@@ -202,6 +218,37 @@ const validateSigningAlgorithmForKey = (signingAlgorithm: SigningAlgorithm, keyA
}
};
+enum SigningGrantVerdict {
+ NotApplicable = "not-applicable",
+ Expired = "expired",
+ ScopeMismatch = "scope-mismatch",
+ Usable = "usable"
+}
+
+const classifyGrantForSigning = (
+ grant: { expiresAt?: Date | null; attributes?: unknown },
+ signerId: string,
+ observedContext: TObservedSigningContext,
+ now: Date
+): { verdict: SigningGrantVerdict; mismatchedFields: CodeSigningScopeField[] } => {
+ const attributes = grant.attributes as TCodeSigningGrantAttributes | null;
+ if (!attributes || attributes.signerId !== signerId) {
+ return { verdict: SigningGrantVerdict.NotApplicable, mismatchedFields: [] };
+ }
+ if (attributes.windowStart && new Date(attributes.windowStart) > now) {
+ return { verdict: SigningGrantVerdict.NotApplicable, mismatchedFields: [] };
+ }
+ if (grant.expiresAt && new Date(grant.expiresAt) < now) {
+ return { verdict: SigningGrantVerdict.Expired, mismatchedFields: [] };
+ }
+
+ const mismatchedFields = getCodeSigningScopeMismatches(attributes.scope, observedContext);
+ if (mismatchedFields.length > 0) {
+ return { verdict: SigningGrantVerdict.ScopeMismatch, mismatchedFields };
+ }
+ return { verdict: SigningGrantVerdict.Usable, mismatchedFields: [] };
+};
+
type TResolvedHsmReissue = {
isHsm: true;
switchingKeySource: boolean;
@@ -1400,6 +1447,152 @@ export const signerServiceFactory = ({
};
};
+ type TSigningAccessResolution = {
+ grantId: string | null;
+ matchedGrantAttributes: TCodeSigningGrantAttributes | null;
+ pendingOperationId: string | null;
+ deniedReason?: string;
+ };
+
+ const $resolveSigningAccess = async ({
+ signer,
+ projectId,
+ dto,
+ dataHash,
+ observedContext,
+ operationClientMetadata
+ }: {
+ signer: { id: string; name: string };
+ projectId: string;
+ dto: TSignDataDTO;
+ dataHash: string;
+ observedContext: TObservedSigningContext;
+ operationClientMetadata: Record<string, unknown> | null;
+ }): Promise<TSigningAccessResolution> =>
+ projectDAL.transaction(async (tx) => {
+ const [userGrants, identityGrants] = await Promise.all([
+ approvalRequestGrantsDAL.find(
+ {
+ granteeUserId: dto.actorId,
+ type: ApprovalPolicyType.CertCodeSigning,
+ status: ApprovalRequestGrantStatus.Active,
+ projectId,
+ revokedAt: null
+ },
+ { tx }
+ ),
+ approvalRequestGrantsDAL.find(
+ {
+ granteeMachineIdentityId: dto.actorId,
+ type: ApprovalPolicyType.CertCodeSigning,
+ status: ApprovalRequestGrantStatus.Active,
+ projectId,
+ revokedAt: null
+ },
+ { tx }
+ )
+ ]);
+
+ const activeGrants = [...userGrants, ...identityGrants];
+
+ let matchingGrant: (typeof activeGrants)[number] | undefined;
+
+ const now = new Date();
+ const expiredGrantIds: string[] = [];
+ const mismatchedScopeFields = new Set<CodeSigningScopeField>();
+
+ for (const grant of activeGrants) {
+ const { verdict, mismatchedFields } = classifyGrantForSigning(grant, signer.id, observedContext, now);
+
+ if (verdict === SigningGrantVerdict.Expired) {
+ expiredGrantIds.push(grant.id);
+ } else if (verdict === SigningGrantVerdict.ScopeMismatch) {
+ mismatchedFields.forEach((field) => mismatchedScopeFields.add(field));
+ } else if (verdict === SigningGrantVerdict.Usable) {
+ matchingGrant ??= grant;
+ }
+ }
+
+ await Promise.all(
+ expiredGrantIds.map((id) =>
+ approvalRequestGrantsDAL.updateById(id, { status: ApprovalRequestGrantStatus.Expired }, tx)
+ )
+ );
+
+ let selectedGrantBecameUnusable = false;
+
+ if (matchingGrant) {
+ const lockedGrant = await approvalRequestGrantsDAL.findByIdForUpdate(matchingGrant.id, tx);
+ if (!lockedGrant || lockedGrant.status !== ApprovalRequestGrantStatus.Active) {
+ matchingGrant = undefined;
+ selectedGrantBecameUnusable = true;
+ } else {
+ const lockedAttributes = lockedGrant.attributes as TCodeSigningGrantAttributes | null;
+ if (lockedAttributes?.maxSignings) {
+ const signingsUsed = await signingOperationDAL.countByGrantId(matchingGrant.id, tx);
+ if (signingsUsed >= lockedAttributes.maxSignings) {
+ await approvalRequestGrantsDAL.updateById(
+ matchingGrant.id,
+ { status: ApprovalRequestGrantStatus.Expired },
+ tx
+ );
+ matchingGrant = undefined;
+ selectedGrantBecameUnusable = true;
+ }
+ }
+ }
+ }
+
+ if (!matchingGrant) {
+ if (mismatchedScopeFields.size > 0 && !selectedGrantBecameUnusable) {
+ const fieldLabels = Array.from(mismatchedScopeFields)
+ .map((field) => CODE_SIGNING_SCOPE_FIELD_LABELS[field])
+ .join(", ");
+ return {
+ grantId: null,
+ matchedGrantAttributes: null,
+ pendingOperationId: null,
+ deniedReason:
+ `Signing with signer '${signer.name}' was denied: your approved access is scoped to specific signing parameters, ` +
+ `and this request does not match the approved ${fieldLabels}. ` +
+ `Sign with the parameters you were approved for, or request new signing access for these parameters.`
+ };
+ }
+ return {
+ grantId: null,
+ matchedGrantAttributes: null,
+ pendingOperationId: null,
+ deniedReason:
+ `Signing with signer '${signer.name}' requires approved access, but none is currently active. ` +
+ `Access may not have been requested or approved yet, may have expired, or may have reached its signature limit. ` +
+ `Request signing access for this signer and try again once it's approved.`
+ };
+ }
+
+ const pendingOperation = await signingOperationDAL.create(
+ {
+ signerId: dto.signerId,
+ projectId,
+ status: SigningOperationStatus.Pending,
+ signingAlgorithm: dto.signingAlgorithm,
+ dataHash,
+ actorType: dto.actor,
+ actorId: dto.actorId,
+ actorName: dto.actorName ?? null,
+ approvalGrantId: matchingGrant.id,
+ clientMetadata: operationClientMetadata
+ },
+ tx
+ );
+
+ return {
+ grantId: matchingGrant.id,
+ matchedGrantAttributes: matchingGrant.attributes as TCodeSigningGrantAttributes | null,
+ pendingOperationId: pendingOperation.id,
+ deniedReason: undefined
+ };
+ });
+
const $countPolicySteps = async (policyId: string): Promise<number> => {
const steps = await approvalPolicyDAL.findStepsByPolicyId(policyId);
return steps.length;
@@ -1484,114 +1677,38 @@ export const signerServiceFactory = ({
const requiresApproval = signer.approvalPolicyId ? (await $countPolicySteps(signer.approvalPolicyId)) > 0 : false;
+ const observedContext = buildObservedSigningContext({
+ clientMetadata: dto.clientMetadata,
+ ipAddress: dto.ipAddress,
+ dataHash
+ });
+ const operationClientMetadata =
+ dto.clientMetadata || dto.ipAddress ? { ...dto.clientMetadata, sourceIp: dto.ipAddress } : null;
+
let grantId: string | null = null;
- let matchedGrantAttrs: TCodeSigningGrantAttributes | null = null;
+ let matchedGrantAttributes: TCodeSigningGrantAttributes | null = null;
let pendingOperationId: string | null = null;
if (requiresApproval) {
- ({ grantId, matchedGrantAttrs, pendingOperationId } = await projectDAL.transaction(async (tx) => {
- const [userGrants, identityGrants] = await Promise.all([
- approvalRequestGrantsDAL.find(
- {
- granteeUserId: dto.actorId,
- type: ApprovalPolicyType.CertCodeSigning,
- status: ApprovalRequestGrantStatus.Active,
- projectId,
- revokedAt: null
- },
- { tx }
- ),
- approvalRequestGrantsDAL.find(
- {
- granteeMachineIdentityId: dto.actorId,
- type: ApprovalPolicyType.CertCodeSigning,
- status: ApprovalRequestGrantStatus.Active,
- projectId,
- revokedAt: null
- },
- { tx }
- )
- ]);
-
- const activeGrants = [...userGrants, ...identityGrants];
-
- let matchingGrant: (typeof activeGrants)[number] | undefined;
-
- const now = new Date();
- const expiredGrantIds: string[] = [];
-
- for (const grant of activeGrants) {
- const attrs = grant.attributes as TCodeSigningGrantAttributes | null;
- if (attrs && attrs.signerId === signer.id) {
- const windowNotStarted = attrs.windowStart && new Date(attrs.windowStart) > now;
- if (!windowNotStarted) {
- if (grant.expiresAt && new Date(grant.expiresAt) < now) {
- expiredGrantIds.push(grant.id);
- } else if (!matchingGrant) {
- matchingGrant = grant;
- }
- }
- }
- }
-
- await Promise.all(
- expiredGrantIds.map((id) =>
- approvalRequestGrantsDAL.updateById(id, { status: ApprovalRequestGrantStatus.Expired }, tx)
- )
- );
-
- if (matchingGrant) {
- const lockedGrant = await approvalRequestGrantsDAL.findByIdForUpdate(matchingGrant.id, tx);
- if (!lockedGrant || lockedGrant.status !== ApprovalRequestGrantStatus.Active) {
- matchingGrant = undefined;
- } else {
- const matchAttrs = lockedGrant.attributes as TCodeSigningGrantAttributes | null;
- if (matchAttrs?.maxSignings) {
- const usedCount = await signingOperationDAL.countByGrantId(matchingGrant.id, tx);
- if (usedCount >= matchAttrs.maxSignings) {
- await approvalRequestGrantsDAL.updateById(
- matchingGrant.id,
- { status: ApprovalRequestGrantStatus.Expired },
- tx
- );
- matchingGrant = undefined;
- }
- }
- }
- }
-
- if (!matchingGrant) {
- throw new ForbiddenRequestError({
- message:
- `Signing with signer '${signer.name}' requires approved access, but none is currently active. ` +
- `Access may not have been requested or approved yet, may have expired, or may have reached its signature limit. ` +
- `Request signing access for this signer and try again once it's approved.`,
- name: "ApprovalRequired"
- });
- }
+ const access = await $resolveSigningAccess({
+ signer,
+ projectId,
+ dto,
+ dataHash,
+ observedContext,
+ operationClientMetadata
+ });
- const pendingOp = await signingOperationDAL.create(
- {
- signerId: dto.signerId,
- projectId,
- status: SigningOperationStatus.Pending,
- signingAlgorithm: dto.signingAlgorithm,
- dataHash,
- actorType: dto.actor,
- actorId: dto.actorId,
- actorName: dto.actorName ?? null,
- approvalGrantId: matchingGrant.id,
- clientMetadata: dto.clientMetadata ?? null
- },
- tx
- );
+ if (access.deniedReason) {
+ throw new ForbiddenRequestError({
+ message: access.deniedReason,
+ name: SIGNER_APPROVAL_REQUIRED_ERROR_NAME
+ });
+ }
- return {
- grantId: matchingGrant.id,
- matchedGrantAttrs: matchingGrant.attributes as TCodeSigningGrantAttributes | null,
- pendingOperationId: pendingOp.id
- };
- }));
+ grantId = access.grantId;
+ matchedGrantAttributes = access.matchedGrantAttributes;
+ pendingOperationId = access.pendingOperationId;
}
let signatureBuffer: Buffer;
@@ -1640,7 +1757,7 @@ export const signerServiceFactory = ({
actorId: dto.actorId,
actorName: dto.actorName ?? null,
approvalGrantId: grantId,
- clientMetadata: dto.clientMetadata ?? null,
+ clientMetadata: operationClientMetadata,
errorMessage: errorMessage.substring(0, 255)
});
}
@@ -1665,15 +1782,15 @@ export const signerServiceFactory = ({
actorId: dto.actorId,
actorName: dto.actorName ?? null,
approvalGrantId: grantId,
- clientMetadata: dto.clientMetadata ?? null
+ clientMetadata: operationClientMetadata
},
tx
);
}
- if (grantId && matchedGrantAttrs?.maxSignings) {
+ if (grantId && matchedGrantAttributes?.maxSignings) {
const newCount = await signingOperationDAL.countByGrantId(grantId, tx);
- if (newCount >= matchedGrantAttrs.maxSignings) {
+ if (newCount >= matchedGrantAttributes.maxSignings) {
await approvalRequestGrantsDAL.updateById(grantId, { status: ApprovalRequestGrantStatus.Expired }, tx);
}
}
@@ -1794,6 +1911,30 @@ export const signerServiceFactory = ({
return { operations, totalCount, projectId: signer.projectId };
};
+ const getOperationById = async (dto: TGetSigningOperationDTO) => {
+ const signer = await signerDAL.findById(dto.signerId);
+ if (!signer) {
+ throw new NotFoundError({ message: `Signer with ID '${dto.signerId}' not found` });
+ }
+
+ const { permission } = await $loadSignerResourcePermission(
+ signer.id,
+ signer.projectId,
+ dto.actor,
+ dto.actorId,
+ dto.actorAuthMethod,
+ dto.actorOrgId
+ );
+ ForbiddenError.from(permission).throwUnlessCan(ResourcePermissionSignerActions.Read, ResourcePermissionSub.Signer);
+
+ const operation = await signingOperationDAL.findByIdWithActor(dto.operationId);
+ if (!operation || operation.signerId !== signer.id) {
+ throw new NotFoundError({ message: `Signing operation '${dto.operationId}' not found on this signer.` });
+ }
+
+ return { operation, signerName: signer.name, projectId: signer.projectId };
+ };
+
const attachIssuedCertificate = async (
signerId: string,
certificateId: string,
@@ -1981,6 +2122,7 @@ export const signerServiceFactory = ({
sign,
getPublicKey,
listOperations,
+ getOperationById,
attachIssuedCertificate,
markIssuanceFailed,
autoRenewCertificate
diff --git a/backend/src/services/signer/signer-types.ts b/backend/src/services/signer/signer-types.ts
index ef906fd3b0..22d7a2ea33 100644
--- a/backend/src/services/signer/signer-types.ts
+++ b/backend/src/services/signer/signer-types.ts
@@ -4,6 +4,7 @@ import { z } from "zod";
import { SigningAlgorithm } from "@app/lib/crypto/sign/types";
import { TProjectPermission } from "@app/lib/types";
+import { TCodeSigningScope } from "../approval-policy/code-signing/code-signing-policy-types";
import { CertKeyAlgorithm } from "../certificate/certificate-types";
import { CaType } from "../certificate-authority/certificate-authority-enums";
import { CertKeySource, SignerStatus, SigningOperationStatus } from "./signer-enums";
@@ -99,7 +100,11 @@ export type TSignDataDTO = {
tool?: string;
hostname?: string;
reportedIp?: string;
+ command?: string;
+ osUsername?: string;
+ signingApplicationHash?: string;
};
+ ipAddress?: string;
} & TActorPermission;
export type TGetPublicKeyDTO = {
@@ -113,6 +118,11 @@ export type TListSigningOperationsDTO = {
status?: SigningOperationStatus;
} & TActorPermission;
+export type TGetSigningOperationDTO = {
+ signerId: string;
+ operationId: string;
+} & TActorPermission;
+
export type TEnableSignerDTO = {
signerId: string;
} & TActorPermission;
@@ -173,6 +183,7 @@ export type TRequestToSignDTO = {
requestedSignings?: number;
requestedWindowStart?: string;
requestedWindowEnd?: string;
+ scope?: TCodeSigningScope;
} & TActorPermission;
export type TPreApproveSigningDTO = {
@@ -183,6 +194,7 @@ export type TPreApproveSigningDTO = {
requestedSignings?: number;
requestedWindowStart?: string;
requestedWindowEnd?: string;
+ scope?: TCodeSigningScope;
} & TActorPermission;
export type TRevokeSignerRequestDTO = {
diff --git a/backend/src/services/signer/signing-operation-dal.ts b/backend/src/services/signer/signing-operation-dal.ts
index 4bfba802e4..ec977d7716 100644
--- a/backend/src/services/signer/signing-operation-dal.ts
+++ b/backend/src/services/signer/signing-operation-dal.ts
@@ -13,6 +13,67 @@ export type TSigningOperationDALFactory = ReturnType<typeof signingOperationDALF
export const signingOperationDALFactory = (db: TDbClient) => {
const orm = ormify(db, TableName.PkiSigningOperations);
+ const $withActorJoins = (tx?: Knex) =>
+ (tx || db.replicaNode())(TableName.PkiSigningOperations)
+ .leftJoin(TableName.Users, (qb) => {
+ void qb
+ .on(`${TableName.PkiSigningOperations}.actorId`, `${TableName.Users}.id`)
+ .andOn(`${TableName.PkiSigningOperations}.actorType`, db.raw("?", [ActorType.USER]));
+ })
+ .leftJoin(TableName.Identity, (qb) => {
+ void qb
+ .on(`${TableName.PkiSigningOperations}.actorId`, `${TableName.Identity}.id`)
+ .andOn(`${TableName.PkiSigningOperations}.actorType`, db.raw("?", [ActorType.IDENTITY]));
+ })
+ .leftJoin(TableName.Membership, (qb) => {
+ void qb
+ .on(`${TableName.Membership}.actorUserId`, `${TableName.Users}.id`)
+ .andOn(`${TableName.Membership}.scopeProjectId`, `${TableName.PkiSigningOperations}.projectId`)
+ .andOn(`${TableName.Membership}.scope`, db.raw("?", [AccessScope.Project]));
+ })
+ .select(selectAllTableCols(TableName.PkiSigningOperations))
+ .select(
+ db.ref("email").withSchema(TableName.Users).as("userEmail"),
+ db.ref("username").withSchema(TableName.Users).as("userUsername"),
+ db.ref("firstName").withSchema(TableName.Users).as("userFirstName"),
+ db.ref("lastName").withSchema(TableName.Users).as("userLastName"),
+ db.ref("name").withSchema(TableName.Identity).as("identityName"),
+ db.ref("id").withSchema(TableName.Membership).as("membershipId")
+ );
+
+ const $mapActorRow = <T extends Record<string, unknown>>(row: T) => {
+ const { userEmail, userUsername, userFirstName, userLastName, identityName, membershipId, ...op } =
+ row as typeof row & {
+ userEmail?: string | null;
+ userUsername?: string | null;
+ userFirstName?: string | null;
+ userLastName?: string | null;
+ identityName?: string | null;
+ membershipId?: string | null;
+ actorName?: string | null;
+ actorType?: string;
+ };
+
+ let resolvedActorName: string | null = op.actorName ?? null;
+ if (!resolvedActorName) {
+ if (op.actorType === ActorType.USER) {
+ if (userFirstName || userLastName) {
+ resolvedActorName = [userFirstName, userLastName].filter(Boolean).join(" ");
+ } else {
+ resolvedActorName = userEmail || userUsername || null;
+ }
+ } else if (op.actorType === ActorType.IDENTITY) {
+ resolvedActorName = identityName || null;
+ }
+ }
+
+ return {
+ ...op,
+ actorName: resolvedActorName,
+ actorMembershipId: membershipId ?? null
+ };
+ };
+
const findBySignerId = async (
signerId: string,
{
@@ -27,33 +88,7 @@ export const signingOperationDALFactory = (db: TDbClient) => {
tx?: Knex
) => {
try {
- let query = (tx || db.replicaNode())(TableName.PkiSigningOperations)
- .where(`${TableName.PkiSigningOperations}.signerId`, signerId)
- .leftJoin(TableName.Users, (qb) => {
- void qb
- .on(`${TableName.PkiSigningOperations}.actorId`, `${TableName.Users}.id`)
- .andOn(`${TableName.PkiSigningOperations}.actorType`, db.raw("?", [ActorType.USER]));
- })
- .leftJoin(TableName.Identity, (qb) => {
- void qb
- .on(`${TableName.PkiSigningOperations}.actorId`, `${TableName.Identity}.id`)
- .andOn(`${TableName.PkiSigningOperations}.actorType`, db.raw("?", [ActorType.IDENTITY]));
- })
- .leftJoin(TableName.Membership, (qb) => {
- void qb
- .on(`${TableName.Membership}.actorUserId`, `${TableName.Users}.id`)
- .andOn(`${TableName.Membership}.scopeProjectId`, `${TableName.PkiSigningOperations}.projectId`)
- .andOn(`${TableName.Membership}.scope`, db.raw("?", [AccessScope.Project]));
- })
- .select(selectAllTableCols(TableName.PkiSigningOperations))
- .select(
- db.ref("email").withSchema(TableName.Users).as("userEmail"),
- db.ref("username").withSchema(TableName.Users).as("userUsername"),
- db.ref("firstName").withSchema(TableName.Users).as("userFirstName"),
- db.ref("lastName").withSchema(TableName.Users).as("userLastName"),
- db.ref("name").withSchema(TableName.Identity).as("identityName"),
- db.ref("id").withSchema(TableName.Membership).as("membershipId")
- );
+ let query = $withActorJoins(tx).where(`${TableName.PkiSigningOperations}.signerId`, signerId);
if (status) {
query = query.where(`${TableName.PkiSigningOperations}.status`, status);
@@ -64,41 +99,21 @@ export const signingOperationDALFactory = (db: TDbClient) => {
.offset(offset)
.limit(limit);
- return rows.map((row) => {
- const { userEmail, userUsername, userFirstName, userLastName, identityName, membershipId, ...op } =
- row as typeof row & {
- userEmail?: string | null;
- userUsername?: string | null;
- userFirstName?: string | null;
- userLastName?: string | null;
- identityName?: string | null;
- membershipId?: string | null;
- };
-
- let resolvedActorName: string | null = op.actorName ?? null;
- if (!resolvedActorName) {
- if (op.actorType === ActorType.USER) {
- if (userFirstName || userLastName) {
- resolvedActorName = [userFirstName, userLastName].filter(Boolean).join(" ");
- } else {
- resolvedActorName = userEmail || userUsername || null;
- }
- } else if (op.actorType === ActorType.IDENTITY) {
- resolvedActorName = identityName || null;
- }
- }
-
- return {
- ...op,
- actorName: resolvedActorName,
- actorMembershipId: membershipId ?? null
- };
- });
+ return rows.map($mapActorRow);
} catch (error) {
throw new DatabaseError({ error, name: "FindSigningOperationsBySignerId" });
}
};
+ const findByIdWithActor = async (operationId: string, tx?: Knex) => {
+ try {
+ const row = await $withActorJoins(tx).where(`${TableName.PkiSigningOperations}.id`, operationId).first();
+ return row ? $mapActorRow(row) : null;
+ } catch (error) {
+ throw new DatabaseError({ error, name: "FindSigningOperationByIdWithActor" });
+ }
+ };
+
const countBySignerId = async (signerId: string, status?: SigningOperationStatus, tx?: Knex) => {
try {
let query = (tx || db.replicaNode())(TableName.PkiSigningOperations).where({ signerId });
@@ -132,5 +147,5 @@ export const signingOperationDALFactory = (db: TDbClient) => {
}
};
- return { ...orm, findBySignerId, countBySignerId, countByGrantId };
+ return { ...orm, findBySignerId, findByIdWithActor, countBySignerId, countByGrantId };
};
diff --git a/docs/documentation/platform/pki/code-signing/approvals.mdx b/docs/documentation/platform/pki/code-signing/approvals.mdx
index 4f75f73113..91f3ed21ae 100644
--- a/docs/documentation/platform/pki/code-signing/approvals.mdx
+++ b/docs/documentation/platform/pki/code-signing/approvals.mdx
@@ -47,7 +47,7 @@ flowchart LR
Each step runs in order. Once the last step's required approvals are reached, Infisical issues an **active access record** bounded by the policy's per-approval limits. The Operator can then sign through the [PKCS#11 module](/documentation/platform/pki/code-signing/pkcs11-module) or the [Sign API](/api-reference/endpoints/code-signing/signers/sign).
-Administrators can also [pre-approve signing](#pre-approve-signing) directly when the approval flow isn't a fit, for example during an incident response where waiting on approvers would block recovery.
+Administrators can also [pre-approve signing](#approval-paths) directly when the approval flow isn't a fit, for example during an incident response where waiting on approvers would block recovery.
## Configure the approval policy
@@ -82,11 +82,97 @@ Open the Signer's **Approvals** tab and click the pencil icon on the **Approval
You can combine both. For example: `maxSignings=10` with `signing window=1h` issues access good for at most 10 sign calls within one hour of approval, whichever comes first.
+ [Scoping](#scoping-an-approval) is not configured here. Whoever opens a request or pre-approval chooses, per request, which signing parameters to lock it to.
</Step>
</Steps>
Press **Save policy**. The new policy applies to **new** requests; existing active access keeps its original terms until it expires or is revoked.
+<Warning>
+ **The signing window starts when the request is opened, not when it is approved.** A request that asks for 8 hours and waits 3 hours for an approver leaves 5 usable hours, and one approved after 8 hours is already expired. Set the window wide enough to cover how long approvals usually take.
+</Warning>
+
+## Scoping an approval
+
+By default an approval means "this member may sign N times before it expires". Expanding **Scope this request** on a request or pre-approval lets you narrow that to a specific signing situation. Every parameter is optional, and the ones you fill in are the only ones that get restricted.
+
+| Parameter | What it locks the approval to |
+|-----------|-------------------------------|
+| **Command** | The exact signing command that must be issued, compared character for character apart from whitespace. |
+| **Signing Application** | The signing tool's executable filename, exactly as it appears on the machine. Signing clients report `os.Executable`, so this is `signtool.exe` on Windows and `pkcs11-tool` on Linux, extension included. |
+| **Signing Application Checksum** | The SHA-256 checksum of the signing tool binary, so a modified or different tool no longer matches. |
+| **Hostname** | The machine the sign calls come from. |
+| **OS Username** | The operating system account running the signing tool. |
+| **IP Address** | The address sign calls have to arrive from, for example a build agent's egress address. Infisical reads the address off the sign call itself, the same way audit logs record it, so the caller cannot present a different one. |
+| **Data Digest** | The SHA-256 digest of the payload submitted for signing, which pins the approval to one artifact. Signing tools submit a digest of the file rather than the file itself, so this is not the same value as `sha256sum yourfile`. The [PKCS#11 module](/documentation/platform/pki/code-signing/pkcs11-module) and the Windows KSP fill it in for you. |
+
+<Warning>
+ **A parameter you fill in has to match every time.** If a scoped approval still has 999 signatures left but you switch to a different machine, tool, or command than the one you declared, those sign calls are denied. When signing suddenly stops working under an approval that clearly has signatures remaining, compare your current signing setup against the scope on the request: that mismatch is almost always the cause. To sign in a different situation, open a new request describing it.
+</Warning>
+
+<Note>
+ A command scope is compared exactly. Only whitespace is forgiven: a run of spaces or a tab where the approval has a single space still matches. Everything else counts as a different command and needs its own approval, including reordering the options, invoking the tool by a different path, changing an argument, and writing `--flag value` as `--flag=value`. Infisical cannot know which flags take values in an arbitrary tool, so it does not try to guess whether a rearranged command is equivalent.
+</Note>
+
+### How much each parameter can be trusted
+
+Two of these parameters are decided by Infisical rather than by the caller, which makes them the ones worth relying on when the goal is to genuinely limit what a credential can do:
+
+- **IP Address** is read from the connection on every sign call. You choose the address the approval is limited to, but whether a sign call is coming from it is decided by Infisical, not reported by the client, so a caller cannot claim to be somewhere they are not.
+
+ <Warning>
+ On a self-hosted instance this holds only once [`TRUSTED_PROXY_CIDRS`](/self-hosting/configuration/envars) names the reverse proxies in front of Infisical. Until it is set, forwarded-IP headers are honored from any source for backwards compatibility, so a caller can present an address that is not theirs. Set it before relying on an IP scope. Infisical Cloud is already configured this way.
+ </Warning>
+
+- **Data Digest** is computed from the payload submitted for signing. A caller can only obtain a signature over the bytes they actually sent, so an approval pinned to a digest cannot be turned into a signature over different content.
+
+The remaining parameters (command, signing application, checksum, hostname, OS username) are reported by the signing client. With the [PKCS#11 module](/documentation/platform/pki/code-signing/pkcs11-module) they are captured from the real signing process, so they describe what is happening on well-behaved machines and give approvers useful context. Someone calling the [Sign API](/api-reference/endpoints/code-signing/signers/sign) directly, however, can report whatever values they like. Treat them as identification, not as a security boundary, and reach for **IP address** and **data digest** when you need a limit that holds regardless of how the caller behaves.
+
+<Tip>
+ For release pipelines, the strongest combination is a **data digest** scope on the artifact you just built plus a signature count of **1**. The approval then covers exactly one signature over exactly one file, whatever tooling is used.
+</Tip>
+
+### Pre-qualifying a build artifact
+
+A pipeline can ask for approval of one specific artifact before it signs. Build first, hash the artifact, then open a request scoped to that digest: the approval it produces cannot sign anything else, so the approver is signing off on a file rather than on a window of time.
+
+The digest to declare is the SHA-256 of **the bytes your sign call submits**, because that is what Infisical hashes to check the scope. The recipe below therefore applies when the pipeline posts the file itself to the Sign API:
+
+```bash
+# 1. Hash the artifact you intend to sign
+DIGEST=$(sha256sum installer-v2.4.0.msi | cut -d' ' -f1)
+
+# 2. Ask for one signature over exactly that artifact
+curl -s -X POST "$INFISICAL_URL/api/v1/cert-manager/signers/$SIGNER_ID/requests" \
+ -H "Authorization: Bearer $TOKEN" \
+ -H "Content-Type: application/json" \
+ -d "{
+ \"justification\": \"Release v2.4.0 Windows installer\",
+ \"requestedSignings\": 1,
+ \"scope\": { \"dataHash\": \"$DIGEST\" }
+ }"
+
+# 3. Sign the file itself, so the digest Infisical computes is the one you declared
+curl -s -X POST "$INFISICAL_URL/api/v1/cert-manager/signers/$SIGNER_ID/sign" \
+ -H "Authorization: Bearer $TOKEN" \
+ -H "Content-Type: application/json" \
+ -d "{
+ \"data\": \"$(base64 -w0 installer-v2.4.0.msi)\",
+ \"signingAlgorithm\": \"RSASSA_PKCS1_V1_5_SHA_256\",
+ \"isDigest\": false
+ }"
+```
+
+<Warning>
+ **Do not use `sha256sum yourfile` when your tool pre-hashes.** Tools like `signtool` and `jarsigner` submit a digest rather than the file, so Infisical hashes that digest and the scope value becomes a digest of a digest. Declaring `sha256sum yourfile` in that case never matches and every sign call is denied. Let the [PKCS#11 module](/documentation/platform/pki/code-signing/pkcs11-module) or the Windows KSP fill the digest in for you instead of computing it by hand.
+</Warning>
+
+An approver reviews the request and approves it. The pipeline then signs that artifact, and only that artifact: any other payload is refused because Infisical recomputes the digest from whatever is submitted. An Administrator can do the same up front with **Pre-approve signing**, which skips the review step.
+
+<Note>
+ Signing tools that go through the [PKCS#11 module](/documentation/platform/pki/code-signing/pkcs11-module) do this automatically when signing is denied: the request they open is already scoped to the digest of the payload the denied call attempted, along with the command and machine it came from. Because that request is pinned to one artifact, a signature count above 1 only allows re-signing that same artifact.
+</Note>
+
## Access lifecycle
Every approved request becomes an **active access record**. On the Approvals tab it's a row in the Requests table with its own status, expiry, and signature counter.
@@ -123,6 +209,7 @@ There are two ways someone gets active access on a Signer: Administrators **pre-
| **Signatures allowed** | How many sign operations the access permits. Capped at the policy's **Signatures per approval**. Leave empty to fall back to the policy ceiling. |
| **When access begins** | Defaults to "now". |
| **When access expires** | Capped at the policy's **Signing window**. Leave empty to fall back to the policy ceiling. |
+ | **Scope this request** | Optional. Expand it to [scope](#scoping-an-approval) the access to a specific command, signing tool, checksum, machine, OS account, IP address, or payload digest. Useful for pre-approving a known build agent: set its address and the access only works from there. |
<Note>
Per-access values cannot exceed the policy ceilings. Requesting `maxSignings=10` against a policy that allows 3 returns a 400 with a clear message. Omitting a field that the policy caps simply clamps to the ceiling, never silently unlimited.
@@ -152,6 +239,11 @@ There are two ways someone gets active access on a Signer: Administrators **pre-
| **Signatures requested** | How many sign operations you need. Capped at the policy's **Signatures per approval**. Leave empty to fall back to the policy ceiling. |
| **When access begins** | When the access window should start once approvals complete. Defaults to "now". |
| **When access expires** | When the access window should end. Capped at the policy's **Signing window**. Leave empty to fall back to the policy ceiling. |
+ | **Scope this request** | Optional. Expand it to [scope](#scoping-an-approval) your access to the command, signing tool, checksum, machine, OS account, IP address, or payload digest you will sign with. Approvers see whatever you declare, and the access only covers matching sign calls. |
+
+ <Note>
+ Submitting a request with the same scope as one you already have pending returns the pending request instead of opening a duplicate. Signing clients that auto-request access can safely retry without flooding approvers.
+ </Note>
<Note>
Per-access values cannot exceed the policy ceilings. Requesting `maxSignings=10` against a policy that allows 3 returns a 400 with a clear message. Omitting a field that the policy caps simply clamps to the ceiling, never silently unlimited.
@@ -175,7 +267,7 @@ If you're an eligible approver for the **current** step of a pending request, an
Click the row on the Signer's **Approvals** tab. Full details: requester, recipient, justification, requested signings, requested window, and which step is currently pending.
</Step>
<Step title="Review">
- Verify who's asking, for how many signings, for how long, and why.
+ Verify who's asking, for how many signings, for how long, and why. If the requester scoped the request, the detail page lists every parameter the access will be limited to, so you can see exactly which signing situation you are approving.
</Step>
<Step title="Decide">
- **Approve** counts toward the current step's required approvals. When the last step's count is reached, the access record is created.
@@ -217,6 +309,9 @@ In-flight sign calls already in progress complete normally; revocation is checke
<Accordion title="What's the difference between Expired and Revoked?">
**Expired** is automatic: the window ended or the signature count was reached. **Revoked** is explicit: an Administrator (or the requester via cancel) ended the access before its natural expiry. Either way, signing under it is no longer possible. The status difference shows up in the audit log.
</Accordion>
+ <Accordion title="My sign call is denied even though I have active access.">
+ If the error mentions your access being scoped to specific signing parameters, the request was scoped and your sign call does not match one of the declared values. Open the request to see the scope, and compare it against what you are signing with now: a different machine, tool, command, IP address, or payload is enough to be denied even when signatures remain. Send the declared command, signing application, hostname or OS username in `clientMetadata` on the sign call, and to sign in a different situation open a new request describing it.
+ </Accordion>
<Accordion title="What happens to a pending request when I edit the policy?">
Pending requests run under the policy that was active when they were submitted. Edits affect only new requests. To force a refresh, revoke the pending request and have the requester submit again.
</Accordion>
diff --git a/docs/documentation/platform/pki/code-signing/overview.mdx b/docs/documentation/platform/pki/code-signing/overview.mdx
index eb51ddf26e..156587dd31 100644
--- a/docs/documentation/platform/pki/code-signing/overview.mdx
+++ b/docs/documentation/platform/pki/code-signing/overview.mdx
@@ -53,7 +53,7 @@ sequenceDiagram
```
1. A Product Admin creates a [Signer](/documentation/platform/pki/code-signing/signers) and picks the CA that issues its certificate.
-2. The Admin adds [members](/documentation/platform/pki/code-signing/signers#members) (users, machine identities, or groups) and picks a role for each.
+2. The Admin adds [members](/documentation/platform/pki/code-signing/signers#signer-roles) (users, machine identities, or groups) and picks a role for each.
3. Optionally, the Admin attaches an [approval policy](/documentation/platform/pki/code-signing/approvals) so signing requires sign-off.
4. Operators sign through the [PKCS#11 module](/documentation/platform/pki/code-signing/pkcs11-module), the [Windows KSP](/documentation/platform/pki/code-signing/windows-ksp) (`signtool`), or the [Sign API](/api-reference/endpoints/code-signing/signers/sign). Infisical produces the signature and records an audit entry on the Signer.
diff --git a/docs/documentation/platform/pki/code-signing/pkcs11-module.mdx b/docs/documentation/platform/pki/code-signing/pkcs11-module.mdx
index feac7565de..a79f1d2f7d 100644
--- a/docs/documentation/platform/pki/code-signing/pkcs11-module.mdx
+++ b/docs/documentation/platform/pki/code-signing/pkcs11-module.mdx
@@ -201,8 +201,12 @@ When a Signer has a policy attached, sign calls without active access normally f
Set one or both depending on what the Signer's policy expects. The values are capped at the policy's `maxWindow` / `maxSignings`.
+The request is [scoped](/documentation/platform/pki/code-signing/approvals#scoping-an-approval) to what the module saw: the command, the tool, the machine, the OS account, and the artifact. Approvers review the real signing situation, and the approval only covers that situation.
+
<Note>
- The first sign call **still fails** until an approver approves the auto-created request. Once approved, retry the sign and it succeeds. The module logs that the request was created so you know what to do.
+ The first sign call **still fails**, because an approver has to act on the request. Once approved, run the same command again and it succeeds.
+
+ The approval covers that exact command and artifact, so a different artifact, a changed argument, or reordered flags needs a new request. Widen the scope in Infisical when one approval should cover a batch.
</Note>
### Example CI workflow
@@ -214,7 +218,7 @@ Set one or both depending on what the Signer's policy expects. The values are ca
5. A reviewer approves the request in the Infisical UI.
6. Pipeline is rerun and the sign call succeeds under the freshly-issued access record.
-For fully unattended CI, have an Administrator **pre-approve** signing access via [Pre-approve signing](/documentation/platform/pki/code-signing/approvals#pre-approve-signing) before the pipeline runs.
+For fully unattended CI, have an Administrator **pre-approve** signing access via [Pre-approve signing](/documentation/platform/pki/code-signing/approvals#approval-paths) before the pipeline runs.
## Troubleshooting
@@ -236,7 +240,7 @@ Turn on debug logging in the config first. It'll usually tell you exactly what w
</Accordion>
<Accordion title="CKR_GENERAL_ERROR on sign">
Almost always means the server rejected the sign. Common reasons (visible in the debug log):
- - **No active access.** The Signer has an approval policy and you don't yet have access. See [Request to sign](/documentation/platform/pki/code-signing/approvals#request-to-sign).
+ - **No active access.** The Signer has an approval policy and you don't yet have access. See [Request to sign](/documentation/platform/pki/code-signing/approvals#approval-paths).
- **Access expired or signatures exhausted.** Request access again.
- **Signer is Disabled.** Re-enable it in the UI.
- **Certificate expired.** Issue a new one or wait for auto-renewal.
diff --git a/docs/documentation/platform/pki/code-signing/windows-ksp.mdx b/docs/documentation/platform/pki/code-signing/windows-ksp.mdx
index bdd9ded277..2e53014181 100644
--- a/docs/documentation/platform/pki/code-signing/windows-ksp.mdx
+++ b/docs/documentation/platform/pki/code-signing/windows-ksp.mdx
@@ -123,6 +123,8 @@ $env:INFISICAL_TOKEN = "<your-access-token>"
| `cache.token_ttl_seconds` | No | `300` | How long to reuse a login token before logging in again. |
| `cache.cert_ttl_seconds` | No | `3600` | How long to reuse a downloaded certificate. |
| `cache.signer_ttl_seconds` | No | `300` | How long to reuse the list of Signers. |
+| `approval.signing_duration` | No | None | Ask for an access window of this length when signing is denied for want of approved access (`30m`, `8h`, `2d`). The provider accepts 1m to 30d as a sanity check; the real limit is the Signer's approval policy. The window starts when the request is opened, not when it is approved, so allow for review time. |
+| `approval.signing_count` | No | None | Ask for access good for this many signing operations. |
| `log_level` | No | `info` | How much detail to log: `trace`, `debug`, `info`, `warn`, or `error`. |
| `log_file` | No | `%ProgramData%\Infisical\ksp.log` | Where to write the log. `signtool` has no window to print to, so the plug-in writes here by default. |
@@ -178,6 +180,48 @@ signtool verify /pa /v MyApp.exe
If your certificate comes from your own private CA (instead of one Windows already trusts), `signtool verify` shows the warning `A certificate chain could not be built to a trusted root authority` (`0x800B010A`). The signature is still valid; Windows just does not recognize who issued the certificate. To clear the warning, add your CA to the computer's Trusted Root store.
</Note>
+## Automatic signing access requests
+
+When a Signer has an approval policy, `signtool` fails until someone has active signing access. The provider can open that request for you on the first denied signing attempt. Add an `approval` block to `%ProgramData%\Infisical\config.json`:
+
+```json
+{
+ "server_url": "https://app.infisical.com",
+ "approval": {
+ "signing_duration": "8h",
+ "signing_count": 10
+ }
+}
+```
+
+- **`signing_duration`** asks for an access window of this length (`30m`, `8h`, `2d`).
+- **`signing_count`** asks for access good for this many signing operations.
+
+Set one or both, depending on what the Signer's policy expects. Both are capped by the policy's own limits.
+
+The request is [scoped](/documentation/platform/pki/code-signing/approvals#scoping-an-approval) to what the provider saw: the command, the host process, the machine, the Windows account, and the artifact. Approvers review the real signing situation, and the approval only covers that situation.
+
+<Warning>
+ Values following credential flags (`/p`, `-storepass`, `-keypass`, `-pass`, `--password`, and MSBuild's `/p:Password=`) are redacted before the command line leaves the machine, because it is stored on the approval record where approvers and auditors can read it. Everything else in the command line is sent as-is, so review your commands if they carry other sensitive arguments.
+</Warning>
+
+<Note>
+ The first signing attempt **still fails**, because an approver has to act on the request. Once approved, run the same command again and it succeeds.
+
+ The approval covers that exact command and artifact, so a different artifact, a changed argument, or reordered flags needs a new request. Widen the scope in Infisical when one approval should cover a batch.
+</Note>
+
+### Example CI workflow
+
+1. The pipeline runs `signtool sign ... /csp "Infisical Key Storage Provider" /kc <signer>`.
+2. No active access exists, so Infisical returns 403.
+3. The provider sees the `approval` block and opens a scoped signing request.
+4. This run fails.
+5. A reviewer approves the request in Infisical.
+6. The pipeline is rerun and signing succeeds under the freshly issued access.
+
+For fully unattended CI, have an Administrator [pre-approve signing](/documentation/platform/pki/code-signing/approvals#approval-paths) before the pipeline runs.
+
## Troubleshooting
The plug-in writes a log to `%ProgramData%\Infisical\ksp.log`. `signtool` itself only shows a short error code, so this log is the best place to see what actually went wrong and how to fix it. For more detail, set `log_level` to `debug`.
diff --git a/frontend/src/const/routes.ts b/frontend/src/const/routes.ts
index 1997dacf01..7df316e3e8 100644
--- a/frontend/src/const/routes.ts
+++ b/frontend/src/const/routes.ts
@@ -393,7 +393,7 @@ export const ROUTE_PATHS = Object.freeze({
),
SignerDetailByIDPage: setRoute(
"/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId",
- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId"
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/"
),
CodeSigningPage: setRoute(
"/organizations/$orgId/projects/cert-manager/$projectId/code-signing",
diff --git a/frontend/src/helpers/datetime.ts b/frontend/src/helpers/datetime.ts
index 74e272b897..aadf0a7a10 100644
--- a/frontend/src/helpers/datetime.ts
+++ b/frontend/src/helpers/datetime.ts
@@ -1,4 +1,5 @@
import { format } from "date-fns";
+import ms from "ms";
export enum Timezone {
Local = "local",
@@ -23,6 +24,22 @@ export const formatDateTime = ({
return format(date, dateFormat);
};
+export const toDateTimeLocalInputValue = (epochMs: number) => {
+ const date = new Date(epochMs);
+ const pad = (part: number) => String(part).padStart(2, "0");
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;
+};
+
+export const parseDurationMs = (duration?: string | null): number | null => {
+ if (!duration) return null;
+ try {
+ const parsed = ms(duration);
+ return typeof parsed === "number" && parsed > 0 ? parsed : null;
+ } catch {
+ return null;
+ }
+};
+
export const SECONDS_PER_DAY = 86400;
// Helper function to convert seconds to value and unit
diff --git a/frontend/src/hooks/api/approvalRequests/types.ts b/frontend/src/hooks/api/approvalRequests/types.ts
index d62987afcb..9ff15522fc 100644
--- a/frontend/src/hooks/api/approvalRequests/types.ts
+++ b/frontend/src/hooks/api/approvalRequests/types.ts
@@ -1,4 +1,5 @@
import { ApprovalPolicyScope, ApprovalPolicyType, ApproverType } from "../approvalPolicies";
+import { TCodeSigningScope } from "../signers/types";
export enum ApprovalRequestStatus {
Pending = "pending",
@@ -91,6 +92,7 @@ export type CodeSigningRequestData = {
requestedWindowStart?: string;
requestedWindowEnd?: string;
requestedSignings?: number;
+ scope?: TCodeSigningScope;
};
export type TApprovalRequest = {
diff --git a/frontend/src/hooks/api/signers/index.tsx b/frontend/src/hooks/api/signers/index.tsx
index b77b3bbc1a..c2da06ccfb 100644
--- a/frontend/src/hooks/api/signers/index.tsx
+++ b/frontend/src/hooks/api/signers/index.tsx
@@ -27,6 +27,7 @@ export {
useGetSigner,
useGetSignerPolicy,
useGetSignerPublicKey,
+ useGetSigningOperation,
useListEffectiveSignerMembers,
useListSignerMembers,
useListSignerRequests,
diff --git a/frontend/src/hooks/api/signers/queries.tsx b/frontend/src/hooks/api/signers/queries.tsx
index 08b35d0a69..dd636bfcbc 100644
--- a/frontend/src/hooks/api/signers/queries.tsx
+++ b/frontend/src/hooks/api/signers/queries.tsx
@@ -19,7 +19,8 @@ import {
TListSigningOperationsDTO,
TListSigningOperationsResponse,
TSigner,
- TSignerPolicy
+ TSignerPolicy,
+ TSigningOperationDetail
} from "./types";
const SIGNER_LIST_POLL_MS = 4000;
@@ -35,6 +36,8 @@ export const signerKeys = {
operations: (signerId: string) => [...signerKeys.all, "operations", signerId] as const,
operationsWithOpts: (filters: TListSigningOperationsDTO) =>
[...signerKeys.operations(filters.signerId), filters] as const,
+ operationById: (signerId: string, operationId: string) =>
+ [...signerKeys.operations(signerId), operationId] as const,
members: (signerId: string, kind: string) =>
[...signerKeys.all, "members", signerId, kind] as const,
effectiveMembers: (signerId: string, kind: "user" | "identity") =>
@@ -130,6 +133,19 @@ export const useListSigningOperations = (dto: TListSigningOperationsDTO) => {
});
};
+export const useGetSigningOperation = (signerId: string, operationId: string) => {
+ return useQuery({
+ queryKey: signerKeys.operationById(signerId, operationId),
+ queryFn: async () => {
+ const { data } = await apiRequest.get<TSigningOperationDetail>(
+ `/api/v1/cert-manager/signers/${signerId}/operations/${operationId}`
+ );
+ return data;
+ },
+ enabled: Boolean(signerId && operationId)
+ });
+};
+
const memberPathSegment = (kind: "user" | "identity" | "group") => {
if (kind === "user") return "users";
if (kind === "identity") return "identities";
diff --git a/frontend/src/hooks/api/signers/types.ts b/frontend/src/hooks/api/signers/types.ts
index cefe7771a2..522a94dd50 100644
--- a/frontend/src/hooks/api/signers/types.ts
+++ b/frontend/src/hooks/api/signers/types.ts
@@ -1,4 +1,5 @@
import { CaType } from "@app/hooks/api/ca/enums";
+import { SigningAlgorithm } from "@app/hooks/api/cmeks";
export type TGetUserSignerPermissionDTO = {
signerId: string;
@@ -77,6 +78,58 @@ export const getSignerStatusBadgeVariant = (status: SignerStatus) => {
}
};
+export enum CodeSigningScopeField {
+ Command = "command",
+ SigningApplication = "signingApplication",
+ SigningApplicationHash = "signingApplicationHash",
+ Hostname = "hostname",
+ OsUsername = "osUsername",
+ IpAddress = "ipAddress",
+ DataHash = "dataHash"
+}
+
+export const codeSigningScopeFieldLabels: Record<CodeSigningScopeField, string> = {
+ [CodeSigningScopeField.Command]: "Command",
+ [CodeSigningScopeField.SigningApplication]: "Signing Application",
+ [CodeSigningScopeField.SigningApplicationHash]: "Signing Application Checksum",
+ [CodeSigningScopeField.Hostname]: "Hostname",
+ [CodeSigningScopeField.OsUsername]: "OS Username",
+ [CodeSigningScopeField.IpAddress]: "IP Address",
+ [CodeSigningScopeField.DataHash]: "Data Digest"
+};
+
+export const codeSigningScopeFieldDescriptions: Record<CodeSigningScopeField, string> = {
+ [CodeSigningScopeField.Command]: "The exact signing command that must be issued.",
+ [CodeSigningScopeField.SigningApplication]:
+ "The signing tool executable, as its filename appears on the machine.",
+ [CodeSigningScopeField.SigningApplicationHash]: "Checksum of the signing tool binary.",
+ [CodeSigningScopeField.Hostname]: "The machine the signing requests come from.",
+ [CodeSigningScopeField.OsUsername]: "The operating system account running the signing tool.",
+ [CodeSigningScopeField.IpAddress]: "The address sign calls must come from.",
+ [CodeSigningScopeField.DataHash]: "SHA-256 hash of the payload being signed."
+};
+
+/** How each value is compared at signing time, mirroring the API's matching rules. */
+export const codeSigningScopeFieldMatchRules: Record<CodeSigningScopeField, string> = {
+ [CodeSigningScopeField.Command]:
+ "Compared exactly, apart from whitespace. Reordering the options counts as a different command.",
+ [CodeSigningScopeField.SigningApplication]: "Compared exactly, including capitalisation.",
+ [CodeSigningScopeField.SigningApplicationHash]:
+ "Compared as a hex digest, so capitalisation does not matter.",
+ [CodeSigningScopeField.Hostname]: "Compared without regard to capitalisation.",
+ [CodeSigningScopeField.OsUsername]: "Compared exactly, including capitalisation.",
+ [CodeSigningScopeField.IpAddress]: "Compared exactly, so one address per approval.",
+ [CodeSigningScopeField.DataHash]: "Only that exact payload can be signed."
+};
+
+export type TCodeSigningScope = Partial<Record<CodeSigningScopeField, string>>;
+
+export const MONOSPACED_SCOPE_FIELDS: readonly CodeSigningScopeField[] = [
+ CodeSigningScopeField.Command,
+ CodeSigningScopeField.DataHash,
+ CodeSigningScopeField.SigningApplicationHash
+];
+
export enum SigningOperationStatus {
Pending = "pending",
Success = "success",
@@ -91,6 +144,34 @@ export const signingOperationStatusLabels: Record<SigningOperationStatus, string
[SigningOperationStatus.Denied]: "Denied"
};
+export const getSigningOperationStatusBadgeVariant = (status: SigningOperationStatus) => {
+ switch (status) {
+ case SigningOperationStatus.Success:
+ return "success" as const;
+ case SigningOperationStatus.Failed:
+ return "danger" as const;
+ case SigningOperationStatus.Denied:
+ return "warning" as const;
+ default:
+ return "neutral" as const;
+ }
+};
+
+export const signingAlgorithmLabels: Record<SigningAlgorithm, string> = {
+ [SigningAlgorithm.RSASSA_PKCS1_V1_5_SHA_256]: "RSA PKCS#1 v1.5 (SHA-256)",
+ [SigningAlgorithm.RSASSA_PKCS1_V1_5_SHA_384]: "RSA PKCS#1 v1.5 (SHA-384)",
+ [SigningAlgorithm.RSASSA_PKCS1_V1_5_SHA_512]: "RSA PKCS#1 v1.5 (SHA-512)",
+ [SigningAlgorithm.RSASSA_PSS_SHA_256]: "RSA-PSS (SHA-256)",
+ [SigningAlgorithm.RSASSA_PSS_SHA_384]: "RSA-PSS (SHA-384)",
+ [SigningAlgorithm.RSASSA_PSS_SHA_512]: "RSA-PSS (SHA-512)",
+ [SigningAlgorithm.ECDSA_SHA_256]: "ECDSA (SHA-256)",
+ [SigningAlgorithm.ECDSA_SHA_384]: "ECDSA (SHA-384)",
+ [SigningAlgorithm.ECDSA_SHA_512]: "ECDSA (SHA-512)",
+ [SigningAlgorithm.ML_DSA_44]: "ML-DSA-44",
+ [SigningAlgorithm.ML_DSA_65]: "ML-DSA-65",
+ [SigningAlgorithm.ML_DSA_87]: "ML-DSA-87"
+};
+
export type TSigner = {
id: string;
projectId: string;
@@ -132,7 +213,7 @@ export type TSigningOperation = {
signerId: string;
projectId: string;
status: SigningOperationStatus;
- signingAlgorithm: string;
+ signingAlgorithm: SigningAlgorithm;
dataHash: string;
actorType: SigningActorType;
actorId: string;
@@ -143,6 +224,10 @@ export type TSigningOperation = {
tool?: string;
hostname?: string;
reportedIp?: string;
+ command?: string;
+ sourceIp?: string;
+ osUsername?: string;
+ signingApplicationHash?: string;
} | null;
errorMessage?: string | null;
createdAt: string;
@@ -224,7 +309,12 @@ export type TSignerRequest = {
status: SignerRequestStatus;
justification?: string | null;
currentStep: number;
- requestData: unknown;
+ requestData: {
+ version?: number;
+ requestData?: {
+ scope?: TCodeSigningScope;
+ } & Record<string, unknown>;
+ } | null;
expiresAt?: string | null;
scopeType?: string | null;
scopeId?: string | null;
@@ -330,6 +420,11 @@ export type TListSigningOperationsResponse = {
totalCount: number;
};
+export type TSigningOperationDetail = {
+ operation: TSigningOperation;
+ signerName: string;
+};
+
export type TListSignerMembersDTO = { signerId: string; kind: "user" | "identity" | "group" };
export type TListSignerMembersResponse = { memberships: TSignerMember[] };
@@ -417,6 +512,7 @@ export type TRequestToSignDTO = {
requestedSignings?: number;
requestedWindowStart?: string;
requestedWindowEnd?: string;
+ scope?: TCodeSigningScope;
};
export type TPreApproveSigningDTO = {
signerId: string;
@@ -426,5 +522,6 @@ export type TPreApproveSigningDTO = {
requestedSignings?: number;
requestedWindowStart?: string;
requestedWindowEnd?: string;
+ scope?: TCodeSigningScope;
};
export type TRevokeSignerRequestDTO = { signerId: string; requestId: string };
diff --git a/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx b/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx
index 287133bc9d..a896fb6bff 100644
--- a/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx
@@ -4,6 +4,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { useQuery } from "@tanstack/react-query";
import { Link, useNavigate, useParams, useSearch } from "@tanstack/react-router";
import { format } from "date-fns";
+import { twMerge } from "tailwind-merge";
import { createNotification } from "@app/components/notifications";
import { Button, ConfirmActionModal, ContentLoader, EmptyState } from "@app/components/v2";
@@ -19,6 +20,11 @@ import {
useCancelApprovalRequest
} from "@app/hooks/api/approvalRequests";
import { useGetPkiApplicationById } from "@app/hooks/api/pkiApplications";
+import {
+ CodeSigningScopeField,
+ codeSigningScopeFieldLabels,
+ MONOSPACED_SCOPE_FIELDS
+} from "@app/hooks/api/signers";
import {
ApprovalStepsSection,
@@ -89,6 +95,33 @@ const CodeSigningDetailsSection = ({
</div>
)}
</div>
+ {requestData.scope && Object.values(requestData.scope).some(Boolean) && (
+ <div className="mt-4 border-t border-mineshaft-600 pt-4">
+ <h4 className="mb-1 text-sm font-medium text-mineshaft-100">Request Scope</h4>
+ <p className="mb-3 text-xs text-mineshaft-400">
+ Signing is only allowed when every parameter below matches exactly.
+ </p>
+ <div className="flex flex-col gap-4">
+ {Object.values(CodeSigningScopeField)
+ .filter((field) => requestData.scope?.[field])
+ .map((field) => (
+ <div key={field}>
+ <span className="text-xs text-mineshaft-400">
+ {codeSigningScopeFieldLabels[field]}
+ </span>
+ <p
+ className={twMerge(
+ "text-sm break-all text-mineshaft-100",
+ MONOSPACED_SCOPE_FIELDS.includes(field) && "font-mono text-xs"
+ )}
+ >
+ {requestData.scope?.[field]}
+ </p>
+ </div>
+ ))}
+ </div>
+ </div>
+ )}
</div>
</div>
);
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningGrantsTab/CodeSigningGrantsTab.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningGrantsTab/CodeSigningGrantsTab.tsx
deleted file mode 100644
index 454e5c3b10..0000000000
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningGrantsTab/CodeSigningGrantsTab.tsx
+++ /dev/null
@@ -1,443 +0,0 @@
-import { useMemo, useState } from "react";
-import { useForm } from "react-hook-form";
-import { zodResolver } from "@hookform/resolvers/zod";
-import { useQuery } from "@tanstack/react-query";
-import { Link } from "@tanstack/react-router";
-import { format } from "date-fns";
-import {
- ChevronRightIcon,
- CircleCheckIcon,
- FilterIcon,
- InfoIcon,
- MoreHorizontalIcon,
- SearchIcon,
- XIcon
-} from "lucide-react";
-import { twMerge } from "tailwind-merge";
-import { z } from "zod";
-
-import { createNotification } from "@app/components/notifications";
-import { FormControl, TextArea } from "@app/components/v2";
-import {
- Badge,
- Button,
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
- Dialog,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
- DocumentationLinkBadge,
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuLabel,
- DropdownMenuSub,
- DropdownMenuSubContent,
- DropdownMenuSubTrigger,
- DropdownMenuTrigger,
- Empty,
- EmptyDescription,
- EmptyHeader,
- EmptyTitle,
- IconButton,
- InputGroup,
- InputGroupAddon,
- InputGroupInput,
- Pagination,
- Skeleton,
- Table,
- TableBody,
- TableCell,
- TableHead,
- TableHeader,
- TableRow
-} from "@app/components/v3";
-import { useOrganization, useProject } from "@app/context";
-import { getMemberLabel } from "@app/helpers/members";
-import { usePagination } from "@app/hooks";
-import { useGetWorkspaceUsers } from "@app/hooks/api";
-import {
- approvalGrantQuery,
- ApprovalGrantStatus,
- CodeSigningGrantAttributes,
- useRevokeApprovalGrant
-} from "@app/hooks/api/approvalGrants";
-import { ApprovalPolicyScope, ApprovalPolicyType } from "@app/hooks/api/approvalPolicies";
-import { useListProjectIdentityMemberships } from "@app/hooks/api/projectIdentityMembership/queries";
-
-import { PkiDocsUrls } from "../../../pki-docs-urls";
-
-const revokeGrantSchema = z.object({
- revocationReason: z.string().max(256).optional()
-});
-
-type TRevokeGrantForm = z.infer<typeof revokeGrantSchema>;
-
-const getStatusBadgeColor = (status: ApprovalGrantStatus) => {
- switch (status) {
- case ApprovalGrantStatus.Active:
- return "success";
- case ApprovalGrantStatus.Expired:
- return "neutral";
- case ApprovalGrantStatus.Revoked:
- return "danger";
- default:
- return "neutral";
- }
-};
-
-export const CodeSigningGrantsTab = () => {
- const { currentProject } = useProject();
- const { currentOrg } = useOrganization();
- const [search, setSearch] = useState("");
- const [filter, setFilter] = useState(ApprovalGrantStatus.Active);
- const [revokeModalOpen, setRevokeModalOpen] = useState(false);
- const [grantToRevoke, setGrantToRevoke] = useState<string | null>(null);
- const { data: members = [] } = useGetWorkspaceUsers(currentProject.id);
- const { data: identityMemberships } = useListProjectIdentityMemberships({
- projectId: currentProject.id
- });
-
- const projectId = currentProject?.id || "";
-
- const { data: grants = [], isPending: isGrantsLoading } = useQuery(
- approvalGrantQuery.list({
- policyType: ApprovalPolicyType.CertCodeSigning,
- scope: ApprovalPolicyScope.Project,
- id: projectId
- })
- );
-
- const { mutateAsync: revokeGrant, isPending: isRevoking } = useRevokeApprovalGrant();
-
- const {
- register,
- handleSubmit,
- reset,
- formState: { errors }
- } = useForm<TRevokeGrantForm>({
- resolver: zodResolver(revokeGrantSchema)
- });
-
- const { page, perPage, setPage, setPerPage, offset } = usePagination("", {
- initPerPage: 10
- });
-
- const getGrantedUser = (grantedUserId: string) => {
- const member = members?.find((m) => m.user.id === grantedUserId);
- if (member) {
- return getMemberLabel(member);
- }
- return grantedUserId;
- };
-
- const getGranteeName = (grant: {
- granteeUserId: string | null;
- granteeMachineIdentityId: string | null;
- }): string => {
- if (grant.granteeUserId) {
- return getGrantedUser(grant.granteeUserId);
- }
- if (grant.granteeMachineIdentityId) {
- const identity = identityMemberships?.identityMemberships?.find(
- (m) => m.identity.id === grant.granteeMachineIdentityId
- );
- return identity?.identity.name ?? grant.granteeMachineIdentityId;
- }
- return "Unknown";
- };
-
- const filteredGrants = useMemo(() => {
- let filtered = grants;
-
- if (search) {
- const searchLower = search.toLowerCase();
- filtered = filtered.filter((grant) => {
- const attrs = grant.attributes as CodeSigningGrantAttributes;
- const granteeName = getGranteeName(grant).toLowerCase();
- return (
- attrs.signerName?.toLowerCase().includes(searchLower) ||
- granteeName.includes(searchLower) ||
- grant.id.toLowerCase().includes(searchLower)
- );
- });
- }
-
- return filtered.filter((grant) => grant.status === filter);
- }, [grants, search, filter]);
-
- const paginatedGrants = useMemo(
- () => filteredGrants.slice(offset, offset + perPage),
- [filteredGrants, offset, perPage]
- );
-
- const openRevokeModal = (grantId: string) => {
- setGrantToRevoke(grantId);
- setRevokeModalOpen(true);
- };
-
- const closeRevokeModal = () => {
- setRevokeModalOpen(false);
- setGrantToRevoke(null);
- reset();
- };
-
- const handleRevokeGrant = async (data: TRevokeGrantForm) => {
- if (!grantToRevoke) return;
-
- try {
- await revokeGrant({
- policyType: ApprovalPolicyType.CertCodeSigning,
- grantId: grantToRevoke,
- revocationReason: data.revocationReason
- });
-
- createNotification({
- text: "Grant revoked successfully",
- type: "success"
- });
-
- closeRevokeModal();
- } catch {
- createNotification({
- text: "Failed to revoke grant",
- type: "error"
- });
- }
- };
-
- const isTableFiltered = filter !== ApprovalGrantStatus.Active;
-
- return (
- <Card>
- <CardHeader>
- <CardTitle>
- Signing Grants
- <DocumentationLinkBadge href={PkiDocsUrls.codeSigning.approvals.grantLifecycle} />
- </CardTitle>
- <CardDescription>View and revoke signing access grants.</CardDescription>
- </CardHeader>
- <CardContent>
- <div className="mb-4 flex items-center gap-2">
- <InputGroup className="flex-1">
- <InputGroupAddon>
- <SearchIcon />
- </InputGroupAddon>
- <InputGroupInput
- value={search}
- onChange={(e) => setSearch(e.target.value)}
- placeholder="Search signing grants..."
- />
- </InputGroup>
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <IconButton
- aria-label="Filter Grants"
- variant={isTableFiltered ? "project" : "outline"}
- size="md"
- className={twMerge(isTableFiltered && "text-primary")}
- >
- <FilterIcon className="size-4" />
- </IconButton>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end">
- <DropdownMenuLabel>Filter By</DropdownMenuLabel>
- <DropdownMenuItem
- onClick={(evt) => {
- evt.preventDefault();
- setFilter(ApprovalGrantStatus.Active);
- }}
- >
- Active Grants
- {filter === ApprovalGrantStatus.Active && (
- <CircleCheckIcon className="ml-auto size-4" />
- )}
- </DropdownMenuItem>
- <DropdownMenuSub>
- <DropdownMenuSubTrigger>
- Inactive Grants
- <ChevronRightIcon className="ml-auto size-4" />
- </DropdownMenuSubTrigger>
- <DropdownMenuSubContent>
- <DropdownMenuLabel>Filter by Status</DropdownMenuLabel>
- <DropdownMenuItem
- onClick={(evt) => {
- evt.preventDefault();
- setFilter(ApprovalGrantStatus.Expired);
- }}
- >
- Expired
- {filter === ApprovalGrantStatus.Expired && (
- <CircleCheckIcon className="ml-auto size-4" />
- )}
- </DropdownMenuItem>
- <DropdownMenuItem
- onClick={(evt) => {
- evt.preventDefault();
- setFilter(ApprovalGrantStatus.Revoked);
- }}
- >
- Revoked
- {filter === ApprovalGrantStatus.Revoked && (
- <CircleCheckIcon className="ml-auto size-4" />
- )}
- </DropdownMenuItem>
- </DropdownMenuSubContent>
- </DropdownMenuSub>
- </DropdownMenuContent>
- </DropdownMenu>
- </div>
-
- <Table>
- <TableHeader>
- <TableRow>
- <TableHead>Grantee</TableHead>
- <TableHead>Signer</TableHead>
- <TableHead>Status</TableHead>
- <TableHead>Granted</TableHead>
- <TableHead>Expires</TableHead>
- <TableHead className="w-5" />
- </TableRow>
- </TableHeader>
- <TableBody>
- {isGrantsLoading &&
- Array.from({ length: 6 }).map((_, i) => (
- <TableRow key={`cs-grant-skeleton-${i + 1}`}>
- {Array.from({ length: 6 }).map((__, j) => (
- <TableCell key={`cs-grant-skeleton-cell-${j + 1}`}>
- <Skeleton className="h-4 w-full" />
- </TableCell>
- ))}
- </TableRow>
- ))}
- {!isGrantsLoading &&
- paginatedGrants.map((grant) => {
- const attrs = grant.attributes as CodeSigningGrantAttributes;
- const isActive = grant.status === ApprovalGrantStatus.Active;
-
- return (
- <TableRow key={grant.id} className="group">
- <TableCell isTruncatable>{getGranteeName(grant)}</TableCell>
- <TableCell isTruncatable>{attrs.signerName || "-"}</TableCell>
- <TableCell>
- <Badge variant={getStatusBadgeColor(grant.status)} className="capitalize">
- {isActive ? "Active" : grant.status}
- </Badge>
- </TableCell>
- <TableCell className="whitespace-nowrap text-accent">
- {format(new Date(grant.createdAt), "MMM d, yyyy")}
- </TableCell>
- <TableCell className="whitespace-nowrap text-accent">
- {grant.expiresAt ? format(new Date(grant.expiresAt), "MMM d, yyyy") : "Never"}
- </TableCell>
- <TableCell onClick={(e) => e.stopPropagation()}>
- {isActive && (
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <IconButton variant="ghost" size="xs" aria-label="Grant actions">
- <MoreHorizontalIcon />
- </IconButton>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="end" className="min-w-40" sideOffset={2}>
- {grant.requestId && (
- <DropdownMenuItem asChild>
- <Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/approvals/$approvalRequestId"
- params={{
- orgId: currentOrg.id,
- projectId: currentProject.id,
- approvalRequestId: grant.requestId
- }}
- search={{ policyType: ApprovalPolicyType.CertCodeSigning }}
- >
- <InfoIcon />
- Request Details
- </Link>
- </DropdownMenuItem>
- )}
- <DropdownMenuItem
- variant="danger"
- onClick={(e) => {
- e.stopPropagation();
- openRevokeModal(grant.id);
- }}
- >
- <XIcon />
- Revoke Grant
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- )}
- </TableCell>
- </TableRow>
- );
- })}
- </TableBody>
- </Table>
-
- {!isGrantsLoading && !filteredGrants.length && (
- <Empty className="border border-solid">
- <EmptyHeader>
- <EmptyTitle>
- {grants.length ? "No signing grants match search" : "No signing grants yet"}
- </EmptyTitle>
- <EmptyDescription>
- {grants.length
- ? "Try clearing your filters or search."
- : "Approved signing requests will appear here as active grants."}
- </EmptyDescription>
- </EmptyHeader>
- </Empty>
- )}
-
- {Boolean(filteredGrants.length) && (
- <Pagination
- count={filteredGrants.length}
- page={page}
- perPage={perPage}
- onChangePage={setPage}
- onChangePerPage={setPerPage}
- />
- )}
- </CardContent>
-
- <Dialog open={revokeModalOpen} onOpenChange={(open) => !open && closeRevokeModal()}>
- <DialogContent className="max-w-lg">
- <DialogHeader className="gap-3">
- <DialogTitle>Revoke Signing Grant</DialogTitle>
- <DialogDescription>
- Are you sure you want to revoke this signing grant? This action cannot be undone.
- </DialogDescription>
- </DialogHeader>
- <form onSubmit={handleSubmit(handleRevokeGrant)}>
- <FormControl
- label="Revocation Reason (Optional)"
- isError={Boolean(errors.revocationReason)}
- errorText={errors.revocationReason?.message}
- >
- <TextArea
- {...register("revocationReason")}
- placeholder="Provide a reason for revoking this grant..."
- rows={4}
- />
- </FormControl>
- <DialogFooter>
- <Button variant="outline" onClick={closeRevokeModal} isDisabled={isRevoking}>
- Cancel
- </Button>
- <Button variant="danger" type="submit" isPending={isRevoking} isDisabled={isRevoking}>
- Revoke Grant
- </Button>
- </DialogFooter>
- </form>
- </DialogContent>
- </Dialog>
- </Card>
- );
-};
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningGrantsTab/index.ts b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningGrantsTab/index.ts
deleted file mode 100644
index 48998c7732..0000000000
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningGrantsTab/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { CodeSigningGrantsTab } from "./CodeSigningGrantsTab";
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/CodeSigningPolicyTab.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/CodeSigningPolicyTab.tsx
deleted file mode 100644
index e406c29fc7..0000000000
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/CodeSigningPolicyTab.tsx
+++ /dev/null
@@ -1,90 +0,0 @@
-import { PlusIcon } from "lucide-react";
-
-import { createNotification } from "@app/components/notifications";
-import { PermissionDeniedBanner } from "@app/components/permissions";
-import { DeleteActionModal } from "@app/components/v2";
-import {
- Button,
- Card,
- CardAction,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
- DocumentationLinkBadge
-} from "@app/components/v3";
-import { useProject, useProjectPermission } from "@app/context";
-import { usePopUp } from "@app/hooks";
-import { ApprovalPolicyType, useDeleteApprovalPolicy } from "@app/hooks/api/approvalPolicies";
-import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
-
-import { PkiDocsUrls } from "../../../pki-docs-urls";
-import { CodeSigningPoliciesTable } from "./components/CodeSigningPoliciesTable";
-import { CodeSigningPolicyModal } from "./components/CodeSigningPolicyModal";
-
-export const CodeSigningPolicyTab = () => {
- const { currentProject } = useProject();
- const { memberships } = useProjectPermission();
-
- const isAdmin = memberships.some((m) =>
- m.roles.some((r) => r.role === ProjectMembershipRole.Admin)
- );
-
- const { mutateAsync: deleteApprovalPolicy } = useDeleteApprovalPolicy();
-
- const { handlePopUpToggle, popUp, handlePopUpOpen, handlePopUpClose } = usePopUp([
- "policy",
- "deletePolicy"
- ] as const);
-
- if (!isAdmin) {
- return <PermissionDeniedBanner />;
- }
-
- const handleDeletePolicy = async () => {
- const policyId = (popUp?.deletePolicy?.data as { policyId: string })?.policyId;
- if (!currentProject?.id) return;
- if (!policyId) return;
-
- await deleteApprovalPolicy({
- policyType: ApprovalPolicyType.CertCodeSigning,
- policyId
- });
- createNotification({
- text: "Successfully deleted policy",
- type: "success"
- });
- handlePopUpClose("deletePolicy");
- };
-
- return (
- <Card>
- <CardHeader>
- <CardTitle>
- Signing Policies
- <DocumentationLinkBadge href={PkiDocsUrls.codeSigning.approvals.policy} />
- </CardTitle>
- <CardDescription>
- Define policies that require approval before signing operations.
- </CardDescription>
- <CardAction>
- <Button variant="project" onClick={() => handlePopUpOpen("policy")}>
- <PlusIcon />
- Create Policy
- </Button>
- </CardAction>
- </CardHeader>
- <CardContent>
- <CodeSigningPoliciesTable handlePopUpOpen={handlePopUpOpen} />
- </CardContent>
- <CodeSigningPolicyModal popUp={popUp} handlePopUpToggle={handlePopUpToggle} />
- <DeleteActionModal
- isOpen={popUp.deletePolicy.isOpen}
- deleteKey="delete"
- title="Are you sure you want to delete this signing policy?"
- onChange={(isOpen) => handlePopUpToggle("deletePolicy", isOpen)}
- onDeleteApproved={handleDeletePolicy}
- />
- </Card>
- );
-};
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPoliciesTable.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPoliciesTable.tsx
deleted file mode 100644
index 7c5f39bb4b..0000000000
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPoliciesTable.tsx
+++ /dev/null
@@ -1,132 +0,0 @@
-import { useMemo } from "react";
-import { useQuery } from "@tanstack/react-query";
-import { format } from "date-fns";
-import { MoreHorizontalIcon, PencilIcon, Trash2Icon } from "lucide-react";
-
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuTrigger,
- Empty,
- EmptyDescription,
- EmptyHeader,
- EmptyTitle,
- IconButton,
- Skeleton,
- Table,
- TableBody,
- TableCell,
- TableHead,
- TableHeader,
- TableRow
-} from "@app/components/v3";
-import { useProject } from "@app/context";
-import {
- approvalPolicyQuery,
- ApprovalPolicyScope,
- ApprovalPolicyType,
- TApprovalPolicy
-} from "@app/hooks/api/approvalPolicies";
-import { UsePopUpState } from "@app/hooks/usePopUp";
-
-type Props = {
- handlePopUpOpen: (
- popUpName: keyof UsePopUpState<["policy", "deletePolicy"]>,
- data?: { policyId: string; policy?: TApprovalPolicy }
- ) => void;
-};
-
-export const CodeSigningPoliciesTable = ({ handlePopUpOpen }: Props) => {
- const { currentProject } = useProject();
- const projectId = currentProject?.id || "";
-
- const { data: policies = [], isPending: isPoliciesLoading } = useQuery(
- approvalPolicyQuery.list({
- policyType: ApprovalPolicyType.CertCodeSigning,
- scope: ApprovalPolicyScope.Project,
- scopeId: projectId
- })
- );
-
- const sortedPolicies = useMemo(() => {
- return [...policies].sort(
- (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
- );
- }, [policies]);
-
- return (
- <>
- <Table>
- <TableHeader>
- <TableRow>
- <TableHead>Policy Name</TableHead>
- <TableHead>Approval Steps</TableHead>
- <TableHead>Created</TableHead>
- <TableHead className="w-5" />
- </TableRow>
- </TableHeader>
- <TableBody>
- {isPoliciesLoading &&
- Array.from({ length: 3 }).map((_, i) => (
- <TableRow key={`cs-policy-skeleton-${i + 1}`}>
- {Array.from({ length: 4 }).map((__, j) => (
- <TableCell key={`cs-policy-skeleton-cell-${j + 1}`}>
- <Skeleton className="h-4 w-full" />
- </TableCell>
- ))}
- </TableRow>
- ))}
- {!isPoliciesLoading &&
- sortedPolicies.map((policy) => (
- <TableRow key={policy.id} className="group">
- <TableCell isTruncatable>
- <span className="font-medium text-foreground">{policy.name}</span>
- </TableCell>
- <TableCell className="text-accent">
- {policy.steps.length} step{policy.steps.length !== 1 ? "s" : ""}
- </TableCell>
- <TableCell className="whitespace-nowrap text-accent">
- {format(new Date(policy.createdAt), "MMM d, yyyy")}
- </TableCell>
- <TableCell>
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <IconButton variant="ghost" size="xs" aria-label="Policy actions">
- <MoreHorizontalIcon />
- </IconButton>
- </DropdownMenuTrigger>
- <DropdownMenuContent className="min-w-40" align="end" sideOffset={2}>
- <DropdownMenuItem
- onClick={() => handlePopUpOpen("policy", { policyId: policy.id, policy })}
- >
- <PencilIcon />
- Edit Policy
- </DropdownMenuItem>
- <DropdownMenuItem
- variant="danger"
- onClick={() => handlePopUpOpen("deletePolicy", { policyId: policy.id })}
- >
- <Trash2Icon />
- Delete Policy
- </DropdownMenuItem>
- </DropdownMenuContent>
- </DropdownMenu>
- </TableCell>
- </TableRow>
- ))}
- </TableBody>
- </Table>
- {!isPoliciesLoading && !sortedPolicies.length && (
- <Empty className="border border-solid">
- <EmptyHeader>
- <EmptyTitle>No signing policies yet</EmptyTitle>
- <EmptyDescription>
- Create a policy to require approval before signing operations.
- </EmptyDescription>
- </EmptyHeader>
- </Empty>
- )}
- </>
- );
-};
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicyModal.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicyModal.tsx
deleted file mode 100644
index 268f15f348..0000000000
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicyModal.tsx
+++ /dev/null
@@ -1,256 +0,0 @@
-import { useEffect, useState } from "react";
-import { FormProvider, useForm } from "react-hook-form";
-import { Tab } from "@headlessui/react";
-import { zodResolver } from "@hookform/resolvers/zod";
-
-import { PolicyApprovalSteps } from "@app/components/approvals";
-import { createNotification } from "@app/components/notifications";
-import { Button, Modal, ModalContent } from "@app/components/v2";
-import { useProject } from "@app/context";
-import {
- ApprovalPolicyScope,
- ApprovalPolicyType,
- TApprovalPolicy,
- useCreateApprovalPolicy,
- useUpdateApprovalPolicy
-} from "@app/hooks/api/approvalPolicies";
-import { UsePopUpState } from "@app/hooks/usePopUp";
-
-import { CodeSigningPolicyDetailsStep } from "./CodeSigningPolicySteps/CodeSigningPolicyDetailsStep";
-import { CodeSigningPolicyReviewStep } from "./CodeSigningPolicySteps/CodeSigningPolicyReviewStep";
-import { CodeSigningPolicyFormSchema, TCodeSigningPolicyForm } from "./CodeSigningPolicySchema";
-
-type Props = {
- popUp: UsePopUpState<["policy"]>;
- handlePopUpToggle: (popUpName: keyof UsePopUpState<["policy"]>, state?: boolean) => void;
-};
-
-type CodeSigningConstraints = {
- maxWindowDuration?: string;
- maxSignings?: number;
-};
-
-const FORM_STEPS: { name: string; key: string; fields: (keyof TCodeSigningPolicyForm)[] }[] = [
- {
- name: "Configuration",
- key: "configuration",
- fields: ["name", "constraints"]
- },
- { name: "Approval Sequence", key: "approvals", fields: ["steps"] },
- { name: "Review", key: "review", fields: [] }
-];
-
-export const CodeSigningPolicyModal = ({ popUp, handlePopUpToggle }: Props) => {
- const { currentProject } = useProject();
- const isOpen = popUp?.policy?.isOpen;
- const policyData = popUp?.policy?.data as
- | { policyId: string; policy: TApprovalPolicy }
- | undefined;
-
- const [selectedStepIndex, setSelectedStepIndex] = useState(0);
-
- const formMethods = useForm<TCodeSigningPolicyForm>({
- resolver: zodResolver(CodeSigningPolicyFormSchema),
- defaultValues: {
- name: "",
- maxRequestTtl: null,
- constraints: {
- maxWindowDuration: "",
- maxSignings: undefined
- },
- bypassForMachineIdentities: false,
- steps: [
- {
- name: "",
- requiredApprovals: 1,
- notifyApprovers: true,
- approvers: []
- }
- ]
- }
- });
-
- const { handleSubmit, trigger, reset } = formMethods;
-
- const { mutateAsync: createPolicy, isPending: isCreating } = useCreateApprovalPolicy();
- const { mutateAsync: updatePolicy, isPending: isUpdating } = useUpdateApprovalPolicy();
-
- useEffect(() => {
- if (policyData?.policy) {
- const constraints = policyData.policy.constraints.constraints as CodeSigningConstraints;
- reset({
- name: policyData.policy.name,
- maxRequestTtl: policyData.policy.maxRequestTtl,
- constraints: {
- maxWindowDuration: constraints.maxWindowDuration ?? "",
- maxSignings: constraints.maxSignings
- },
- bypassForMachineIdentities: policyData.policy.bypassForMachineIdentities ?? false,
- steps: policyData.policy.steps.map((step) => ({
- ...step,
- name: step.name || ""
- }))
- });
- } else {
- reset({
- name: "",
- maxRequestTtl: null,
- constraints: {
- maxWindowDuration: undefined,
- maxSignings: undefined
- },
- bypassForMachineIdentities: false,
- steps: [
- {
- name: "",
- requiredApprovals: 1,
- notifyApprovers: true,
- approvers: []
- }
- ]
- });
- }
- setSelectedStepIndex(0);
- }, [policyData, reset, isOpen]);
-
- const onSubmit = async (data: TCodeSigningPolicyForm) => {
- if (!currentProject?.id) return;
-
- const cleanedData = {
- ...data,
- constraints: {
- maxWindowDuration: data.constraints.maxWindowDuration || undefined,
- maxSignings: data.constraints.maxSignings || undefined
- }
- };
-
- if (policyData?.policyId) {
- await updatePolicy({
- policyType: ApprovalPolicyType.CertCodeSigning,
- policyId: policyData.policyId,
- ...cleanedData
- });
- createNotification({
- text: "Successfully updated policy",
- type: "success"
- });
- } else {
- await createPolicy({
- policyType: ApprovalPolicyType.CertCodeSigning,
- scope: ApprovalPolicyScope.Project,
- scopeId: currentProject.id,
- conditions: [],
- ...cleanedData
- });
- createNotification({
- text: "Successfully created policy",
- type: "success"
- });
- }
- handlePopUpToggle("policy", false);
- };
-
- const isStepValid = async (index: number) => {
- const { fields } = FORM_STEPS[index];
- if (fields.length === 0) return true;
- return trigger(fields);
- };
-
- const isFinalStep = selectedStepIndex === FORM_STEPS.length - 1;
-
- const handleNext = async () => {
- if (isFinalStep) {
- await handleSubmit(onSubmit)();
- return;
- }
-
- const isValid = await isStepValid(selectedStepIndex);
-
- if (!isValid) return;
-
- setSelectedStepIndex((prev) => prev + 1);
- };
-
- const handlePrev = () => {
- if (selectedStepIndex === 0) {
- handlePopUpToggle("policy", false);
- return;
- }
-
- setSelectedStepIndex((prev) => prev - 1);
- };
-
- const isTabEnabled = async (index: number) => {
- let isEnabled = true;
- for (let i = index - 1; i >= 0; i -= 1) {
- // eslint-disable-next-line no-await-in-loop
- isEnabled = isEnabled && (await isStepValid(i));
- }
-
- return isEnabled;
- };
-
- return (
- <Modal isOpen={isOpen} onOpenChange={(open) => handlePopUpToggle("policy", open)}>
- <ModalContent
- title={policyData?.policyId ? "Edit Signing Policy" : "Create Signing Policy"}
- subTitle="Configure a signing policy requiring approval before signing operations"
- className="max-w-3xl"
- >
- <FormProvider {...formMethods}>
- <form>
- <Tab.Group selectedIndex={selectedStepIndex} onChange={setSelectedStepIndex}>
- <Tab.List className="-pb-1 mb-6 w-full border-b-2 border-mineshaft-600">
- {FORM_STEPS.map((step, index) => (
- <Tab
- onClick={async (e) => {
- e.preventDefault();
- const isEnabled = await isTabEnabled(index);
- setSelectedStepIndex((prev) => (isEnabled ? index : prev));
- }}
- className={({ selected }) =>
- `-mb-[0.14rem] whitespace-nowrap ${index > selectedStepIndex ? "opacity-30" : ""} px-4 py-2 text-sm font-medium outline-hidden disabled:opacity-60 ${
- selected
- ? "border-b-2 border-mineshaft-300 text-mineshaft-200"
- : "text-bunker-300"
- }`
- }
- key={step.key}
- >
- {index + 1}. {step.name}
- </Tab>
- ))}
- </Tab.List>
- <Tab.Panels>
- <Tab.Panel>
- <CodeSigningPolicyDetailsStep />
- </Tab.Panel>
- <Tab.Panel>
- <PolicyApprovalSteps />
- </Tab.Panel>
- <Tab.Panel>
- <CodeSigningPolicyReviewStep />
- </Tab.Panel>
- </Tab.Panels>
- </Tab.Group>
-
- <div className="mt-6 flex justify-between border-t border-mineshaft-600 pt-4">
- <Button type="button" variant="outline_bg" onClick={handlePrev}>
- {selectedStepIndex === 0 ? "Cancel" : "Back"}
- </Button>
- <Button
- type="button"
- onClick={handleNext}
- isLoading={isCreating || isUpdating}
- isDisabled={isCreating || isUpdating}
- >
- {isFinalStep && (policyData?.policyId ? "Update" : "Create")}
- {!isFinalStep && "Next"}
- </Button>
- </div>
- </form>
- </FormProvider>
- </ModalContent>
- </Modal>
- );
-};
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySchema.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySchema.tsx
deleted file mode 100644
index 99de3fcdfc..0000000000
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySchema.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import ms from "ms";
-import { z } from "zod";
-
-import { ApprovalStepsSchema } from "@app/components/approvals";
-
-const DurationSchema = (
- min = 60,
- max = 2592000,
- msg = "Duration must be between 1 minute and 30 days"
-) =>
- z.string().refine(
- (val) => {
- if (!val || val === "") return true;
- const duration = ms(val) / 1000;
- return duration >= min && duration <= max;
- },
- { message: msg }
- );
-
-export const CodeSigningPolicyFormSchema = z.object({
- name: z.string().min(1, "Policy name is required").max(128),
- maxRequestTtl: DurationSchema(
- 86400,
- 2592000,
- "Duration must be between 1 day and 30 days"
- ).nullish(),
- constraints: z
- .object({
- maxWindowDuration: DurationSchema().optional(),
- maxSignings: z.preprocess(
- (val) => (val === "" || val === undefined || val === null ? undefined : Number(val)),
- z.number().int().positive().optional()
- )
- })
- .refine(
- (data) => (data.maxWindowDuration && data.maxWindowDuration !== "") || data.maxSignings,
- {
- message: "At least one constraint (max window duration or max signings) is required"
- }
- ),
- bypassForMachineIdentities: z.boolean().optional().default(false),
- steps: ApprovalStepsSchema
-});
-
-export type TCodeSigningPolicyForm = z.infer<typeof CodeSigningPolicyFormSchema>;
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySteps/CodeSigningPolicyDetailsStep.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySteps/CodeSigningPolicyDetailsStep.tsx
deleted file mode 100644
index 6b2d988eef..0000000000
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySteps/CodeSigningPolicyDetailsStep.tsx
+++ /dev/null
@@ -1,128 +0,0 @@
-import { Controller, useFormContext } from "react-hook-form";
-
-import { TtlFormLabel } from "@app/components/features";
-import { Checkbox, FormControl, Input } from "@app/components/v2";
-
-import { TCodeSigningPolicyForm } from "../CodeSigningPolicySchema";
-
-export const CodeSigningPolicyDetailsStep = () => {
- const {
- control,
- formState: { errors }
- } = useFormContext<TCodeSigningPolicyForm>();
-
- const constraintsError = errors.constraints?.root?.message;
-
- return (
- <div className="flex flex-col gap-4">
- <div className="flex w-full gap-4">
- <Controller
- control={control}
- name="name"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Policy Name"
- className="mb-0 flex-1"
- isRequired
- isError={Boolean(error)}
- errorText={error?.message}
- >
- <Input {...field} placeholder="Enter policy name" />
- </FormControl>
- )}
- />
-
- <Controller
- control={control}
- name="maxRequestTtl"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label={<TtlFormLabel label="Max. Request TTL" />}
- className="mb-0"
- isError={Boolean(error)}
- errorText={error?.message}
- helperText="Maximum time a request can be pending (optional)"
- >
- <Input
- {...field}
- value={field.value || ""}
- placeholder="e.g., 7d"
- onChange={(e) => {
- if (!e.target.value || e.target.value === "") {
- field.onChange(null);
- return;
- }
- field.onChange(e.target.value);
- }}
- />
- </FormControl>
- )}
- />
- </div>
-
- <Controller
- control={control}
- name="constraints.maxWindowDuration"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Max Window Duration"
- isError={Boolean(error)}
- errorText={error?.message}
- helperText="Maximum signing window duration (e.g., 1h, 1d)"
- >
- <Input
- {...field}
- value={field.value ?? ""}
- placeholder="e.g., 1h"
- onChange={(e) => field.onChange(e.target.value)}
- />
- </FormControl>
- )}
- />
-
- <Controller
- control={control}
- name="constraints.maxSignings"
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Max Signings"
- isError={Boolean(error)}
- errorText={error?.message}
- helperText="Maximum number of signings per approved request"
- >
- <Input
- {...field}
- value={field.value ?? ""}
- placeholder="e.g., 10"
- onChange={(e) => field.onChange(e.target.value)}
- />
- </FormControl>
- )}
- />
-
- {constraintsError && <p className="text-xs text-red">{constraintsError}</p>}
-
- <Controller
- control={control}
- name="bypassForMachineIdentities"
- render={({ field: { value, onChange } }) => (
- <div className="mt-2 items-center">
- <Checkbox
- id="csBypassForMachineIdentities"
- isChecked={value}
- onCheckedChange={onChange}
- checkIndicatorBg="text-primary"
- >
- <span className="text-sm text-mineshaft-200">
- Bypass approval for machine identities
- </span>
- <p className="text-xs text-mineshaft-400">
- When enabled, machine identities can sign without requiring approval
- </p>
- </Checkbox>
- </div>
- )}
- />
- </div>
- );
-};
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySteps/CodeSigningPolicyReviewStep.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySteps/CodeSigningPolicyReviewStep.tsx
deleted file mode 100644
index 189869fb34..0000000000
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySteps/CodeSigningPolicyReviewStep.tsx
+++ /dev/null
@@ -1,161 +0,0 @@
-import { useFormContext } from "react-hook-form";
-import { faUsers } from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-
-import { useProject } from "@app/context";
-import { getMemberLabel } from "@app/helpers/members";
-import { useGetWorkspaceUsers, useListWorkspaceGroups } from "@app/hooks/api";
-import { ApproverType } from "@app/hooks/api/approvalPolicies";
-
-import { TCodeSigningPolicyForm } from "../CodeSigningPolicySchema";
-
-const ReviewField = ({ label, value }: { label: string; value: string | number }) => (
- <div className="flex items-baseline gap-x-4">
- <span className="w-[180px] shrink-0 text-sm text-mineshaft-400">{label}</span>
- <span className="text-sm font-medium text-mineshaft-200">{value}</span>
- </div>
-);
-
-export const CodeSigningPolicyReviewStep = () => {
- const { watch } = useFormContext<TCodeSigningPolicyForm>();
- const { currentProject } = useProject();
- const projectId = currentProject?.id || "";
-
- const { data: members = [] } = useGetWorkspaceUsers(projectId);
- const { data: groups = [] } = useListWorkspaceGroups(projectId);
-
- const { name, constraints, maxRequestTtl, bypassForMachineIdentities, steps } = watch();
-
- const getApproverLabel = (approverId: string, approverType: ApproverType) => {
- if (approverType === ApproverType.User) {
- const member = members?.find((m) => m.user.id === approverId);
- if (member) {
- return getMemberLabel(member);
- }
- } else if (approverType === ApproverType.Group) {
- const group = groups?.find(({ group: g }) => g.id === approverId);
- if (group) {
- return group.group.name;
- }
- }
- return approverId;
- };
-
- return (
- <div className="space-y-6">
- <div>
- <div className="mb-3 border-b border-mineshaft-600 pb-2">
- <h3 className="text-sm font-medium text-mineshaft-200">Signing Policy Configuration</h3>
- </div>
- <div className="grid grid-cols-2 gap-2">
- <ReviewField label="Policy Name" value={name || "Not set"} />
- <ReviewField label="Max. Request TTL" value={maxRequestTtl || "Not set"} />
- {constraints.maxWindowDuration && (
- <ReviewField label="Max Window Duration" value={constraints.maxWindowDuration} />
- )}
- {constraints.maxSignings && (
- <ReviewField label="Max Signings" value={constraints.maxSignings} />
- )}
- <ReviewField
- label="Machine Identity Bypass"
- value={bypassForMachineIdentities ? "Enabled" : "Disabled"}
- />
- </div>
- </div>
-
- <div>
- <div className="mb-3 border-b border-mineshaft-600 pb-2">
- <h3 className="text-sm font-medium text-mineshaft-200">Approval Sequence</h3>
- </div>
- <div className="space-y-3">
- {steps.map((step, index) => {
- const userApprovers = step.approvers.filter((a) => a.type === ApproverType.User);
- const groupApprovers = step.approvers.filter((a) => a.type === ApproverType.Group);
-
- return (
- <div
- key={`step-${index + 1}`}
- className="rounded border border-mineshaft-600 bg-mineshaft-700 p-3"
- >
- <div className="mb-3 flex items-center justify-between">
- <div className="flex items-center gap-2">
- <span className="flex h-6 w-6 items-center justify-center rounded-full bg-primary/20 text-xs font-medium text-primary">
- {index + 1}
- </span>
- <div>
- <span className="text-sm font-medium text-mineshaft-200">
- Step {index + 1}
- {step.name && (
- <span className="ml-2 text-xs text-mineshaft-400">({step.name})</span>
- )}
- </span>
- </div>
- </div>
- <div className="text-xs text-mineshaft-400">
- Requires {step.requiredApprovals} approval
- {step.requiredApprovals !== 1 ? "s" : ""}
- </div>
- </div>
-
- <div className="space-y-2">
- {userApprovers.length > 0 && (
- <div>
- <div className="mb-1 text-xs text-mineshaft-400">
- User Approvers ({userApprovers.length}):
- </div>
- <div className="flex flex-wrap gap-2">
- {userApprovers.map((approver, approverIndex) => (
- <div
- key={`step-${index + 1}-user-${approverIndex + 1}`}
- className="flex items-center gap-1.5 rounded bg-mineshaft-700 px-2 py-1 text-xs text-mineshaft-300"
- >
- <FontAwesomeIcon icon={faUsers} className="text-mineshaft-400" />
- <span className="text-mineshaft-200">
- {getApproverLabel(approver.id, ApproverType.User)}
- </span>
- </div>
- ))}
- </div>
- </div>
- )}
-
- {groupApprovers.length > 0 && (
- <div>
- <div className="mb-1 text-xs text-mineshaft-400">
- Group Approvers ({groupApprovers.length}):
- </div>
- <div className="flex flex-wrap gap-2">
- {groupApprovers.map((approver, approverIndex) => (
- <div
- key={`step-${index + 1}-group-${approverIndex + 1}`}
- className="flex items-center gap-1.5 rounded bg-mineshaft-700 px-2 py-1 text-xs text-mineshaft-300"
- >
- <FontAwesomeIcon icon={faUsers} className="text-mineshaft-400" />
- <span className="text-mineshaft-200">
- {getApproverLabel(approver.id, ApproverType.Group)}
- </span>
- </div>
- ))}
- </div>
- </div>
- )}
-
- {step.approvers.length === 0 && (
- <span className="text-xs text-mineshaft-500">No approvers defined</span>
- )}
- </div>
- </div>
- );
- })}
- </div>
- </div>
-
- <div className="rounded-md border border-primary/30 bg-primary/5 p-3">
- <p className="text-xs text-mineshaft-300">
- Please review all the details above. Submit to save this policy or go back to make
- changes.
- </p>
- </div>
- </div>
- );
-};
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/index.ts b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/index.ts
deleted file mode 100644
index c75cdc1848..0000000000
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { CodeSigningPolicyTab } from "./CodeSigningPolicyTab";
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/CodeSigningRequestsTab.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/CodeSigningRequestsTab.tsx
deleted file mode 100644
index 81adc162d8..0000000000
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/CodeSigningRequestsTab.tsx
+++ /dev/null
@@ -1,387 +0,0 @@
-import { useMemo, useState } from "react";
-import {
- faCheckCircle,
- faChevronRight,
- faExclamationCircle,
- faFileCircleQuestion,
- faFilter,
- faMagnifyingGlass
-} from "@fortawesome/free-solid-svg-icons";
-import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
-import { useQuery } from "@tanstack/react-query";
-import { useNavigate } from "@tanstack/react-router";
-import { format } from "date-fns";
-import { twMerge } from "tailwind-merge";
-
-import { ProjectPermissionCan } from "@app/components/permissions";
-import {
- Button,
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuItem,
- DropdownMenuLabel,
- DropdownMenuTrigger,
- DropdownSubMenu,
- DropdownSubMenuContent,
- DropdownSubMenuTrigger,
- EmptyState,
- IconButton,
- Input,
- Pagination,
- Table,
- TableContainer,
- TableSkeleton,
- TBody,
- Td,
- Th,
- THead,
- Tr
-} from "@app/components/v2";
-import { Badge, DocumentationLinkBadge } from "@app/components/v3";
-import { useOrganization, useProject, useProjectPermission, useUser } from "@app/context";
-import {
- ProjectPermissionCodeSigningActions,
- ProjectPermissionSub
-} from "@app/context/ProjectPermissionContext";
-import { usePagination } from "@app/hooks";
-import {
- ApprovalPolicyScope,
- ApprovalPolicyType,
- ApproverType
-} from "@app/hooks/api/approvalPolicies";
-import {
- approvalRequestQuery,
- ApprovalRequestStatus,
- ApprovalRequestStepStatus,
- CodeSigningRequestData,
- TApprovalRequest
-} from "@app/hooks/api/approvalRequests";
-
-import { PkiDocsUrls } from "../../../pki-docs-urls";
-import { RequestSigningAccessModal } from "./RequestSigningAccessModal";
-
-const getStatusBadgeColor = (status: ApprovalRequestStatus) => {
- switch (status) {
- case ApprovalRequestStatus.Pending:
- return "project";
- case ApprovalRequestStatus.Approved:
- return "success";
- case ApprovalRequestStatus.Rejected:
- return "danger";
- case ApprovalRequestStatus.Expired:
- return "neutral";
- default:
- return "neutral";
- }
-};
-
-const checkIfUserNeedsToApprove = (
- request: TApprovalRequest,
- userId: string,
- userGroups: string[]
-): boolean => {
- if (request.type === ApprovalPolicyType.CertCodeSigning && request.requesterId === userId)
- return false;
-
- const currentStep = request.steps.find(
- (step) => step.status === ApprovalRequestStepStatus.InProgress
- );
-
- if (!currentStep) return false;
-
- const isApprover = currentStep.approvers.some((approver) =>
- approver.type === ApproverType.User ? approver.id === userId : userGroups.includes(approver.id)
- );
-
- if (!isApprover) return false;
-
- const hasAlreadyApproved = currentStep.approvals.some(
- (approval) => approval.approverUserId === userId
- );
-
- return !hasAlreadyApproved;
-};
-
-export const CodeSigningRequestsTab = () => {
- const { currentProject } = useProject();
- const { currentOrg } = useOrganization();
- const { memberships } = useProjectPermission();
- const { user } = useUser();
- const [search, setSearch] = useState("");
- const [filter, setFilter] = useState(ApprovalRequestStatus.Pending);
- const [isRequestModalOpen, setIsRequestModalOpen] = useState(false);
- const navigate = useNavigate();
-
- const projectId = currentProject?.id || "";
- const userId = user?.id || "";
- const userGroups = memberships.map((el) => el.actorGroupId).filter(Boolean);
-
- const { data: requests = [], isPending: isRequestsLoading } = useQuery(
- approvalRequestQuery.list({
- policyType: ApprovalPolicyType.CertCodeSigning,
- scope: ApprovalPolicyScope.Project,
- scopeId: projectId
- })
- );
-
- const { page, perPage, setPage, setPerPage, offset } = usePagination("", {
- initPerPage: 10
- });
-
- const filteredRequests = useMemo(() => {
- let filtered = requests;
-
- if (search) {
- const searchLower = search.toLowerCase();
- filtered = filtered.filter((request) => {
- const reqData = request.requestData.requestData as CodeSigningRequestData;
- const signerName = reqData.signerName || "";
- const requesterName = request.requesterName || "";
- return (
- signerName.toLowerCase().includes(searchLower) ||
- requesterName.toLowerCase().includes(searchLower)
- );
- });
- }
-
- if (filter) {
- filtered = filtered.filter((request) => request.status === filter);
- }
-
- return filtered;
- }, [requests, search, filter]);
-
- const paginatedRequests = filteredRequests.slice(offset, offset + perPage);
- const isTableFiltered = filter !== ApprovalRequestStatus.Pending;
-
- return (
- <div className="mb-6 rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
- <div className="mb-4 flex items-start justify-between">
- <div>
- <div className="flex items-center gap-x-2">
- <p className="text-xl font-medium text-mineshaft-100">Signing Requests</p>
- <DocumentationLinkBadge href={PkiDocsUrls.codeSigning.approvals.requestToSign} />
- </div>
- <p className="text-sm text-bunker-300">Review and manage signing requests</p>
- </div>
- <ProjectPermissionCan
- I={ProjectPermissionCodeSigningActions.Sign}
- a={ProjectPermissionSub.CodeSigners}
- >
- {(isAllowed) => (
- <Button
- colorSchema="secondary"
- size="sm"
- isDisabled={!isAllowed}
- onClick={() => setIsRequestModalOpen(true)}
- >
- Request Signing Access
- </Button>
- )}
- </ProjectPermissionCan>
- </div>
- <div className="mb-4 flex gap-2">
- <DropdownMenu>
- <DropdownMenuTrigger asChild>
- <IconButton
- ariaLabel="Filter Requests"
- variant="plain"
- size="sm"
- className={twMerge(
- "flex h-9.5 w-[2.6rem] items-center justify-center overflow-hidden border border-mineshaft-600 bg-mineshaft-800 p-0 transition-all hover:border-primary/60 hover:bg-primary/10",
- isTableFiltered && "border-primary/50 text-primary"
- )}
- >
- <FontAwesomeIcon icon={faFilter} />
- </IconButton>
- </DropdownMenuTrigger>
- <DropdownMenuContent align="start" className="p-0">
- <DropdownMenuLabel>Filter By</DropdownMenuLabel>
- <DropdownMenuItem
- onClick={(evt) => {
- evt.preventDefault();
- setFilter(ApprovalRequestStatus.Pending);
- }}
- icon={
- filter === ApprovalRequestStatus.Pending && <FontAwesomeIcon icon={faCheckCircle} />
- }
- iconPos="right"
- >
- Open Requests
- </DropdownMenuItem>
- <DropdownSubMenu>
- <DropdownSubMenuTrigger
- iconPos="right"
- icon={<FontAwesomeIcon icon={faChevronRight} size="sm" />}
- >
- Closed Requests
- </DropdownSubMenuTrigger>
- <DropdownSubMenuContent className="max-h-80 thin-scrollbar overflow-y-auto rounded-l-none">
- <DropdownMenuLabel className="sticky top-0 bg-mineshaft-900">
- Filter by Status
- </DropdownMenuLabel>
- <DropdownMenuItem
- onClick={(evt) => {
- evt.preventDefault();
- setFilter(ApprovalRequestStatus.Approved);
- }}
- icon={
- filter === ApprovalRequestStatus.Approved && (
- <FontAwesomeIcon icon={faCheckCircle} />
- )
- }
- iconPos="right"
- >
- Approved
- </DropdownMenuItem>
- <DropdownMenuItem
- onClick={(evt) => {
- evt.preventDefault();
- setFilter(ApprovalRequestStatus.Cancelled);
- }}
- icon={
- filter === ApprovalRequestStatus.Cancelled && (
- <FontAwesomeIcon icon={faCheckCircle} />
- )
- }
- iconPos="right"
- >
- Cancelled
- </DropdownMenuItem>
- <DropdownMenuItem
- onClick={(evt) => {
- evt.preventDefault();
- setFilter(ApprovalRequestStatus.Rejected);
- }}
- icon={
- filter === ApprovalRequestStatus.Rejected && (
- <FontAwesomeIcon icon={faCheckCircle} />
- )
- }
- iconPos="right"
- >
- Rejected
- </DropdownMenuItem>
- <DropdownMenuItem
- onClick={(evt) => {
- evt.preventDefault();
- setFilter(ApprovalRequestStatus.Expired);
- }}
- icon={
- filter === ApprovalRequestStatus.Expired && (
- <FontAwesomeIcon icon={faCheckCircle} />
- )
- }
- iconPos="right"
- >
- Expired
- </DropdownMenuItem>
- </DropdownSubMenuContent>
- </DropdownSubMenu>
- </DropdownMenuContent>
- </DropdownMenu>
- <Input
- value={search}
- onChange={(e) => setSearch(e.target.value)}
- leftIcon={<FontAwesomeIcon icon={faMagnifyingGlass} />}
- placeholder="Search requests..."
- />
- </div>
- <TableContainer>
- <Table>
- <THead>
- <Tr>
- <Th>Requester</Th>
- <Th>Signer</Th>
- <Th>Status</Th>
- <Th>Requested</Th>
- <Th className="w-5" />
- </Tr>
- </THead>
- <TBody>
- {isRequestsLoading && <TableSkeleton columns={5} innerKey="cs-requests" />}
- {!isRequestsLoading && paginatedRequests.length === 0 && (
- <Tr>
- <Td colSpan={5}>
- <EmptyState title="No signing requests found" icon={faFileCircleQuestion} />
- </Td>
- </Tr>
- )}
- {paginatedRequests.map((request) => {
- const needsApproval = checkIfUserNeedsToApprove(request, userId, userGroups);
- const reqData = request.requestData.requestData as CodeSigningRequestData;
- return (
- <Tr
- key={request.id}
- className="h-14 cursor-pointer transition-colors hover:bg-mineshaft-700"
- onClick={() =>
- navigate({
- to: "/organizations/$orgId/projects/cert-manager/$projectId/approvals/$approvalRequestId",
- params: {
- orgId: currentOrg.id,
- projectId,
- approvalRequestId: request.id
- },
- search: {
- policyType: ApprovalPolicyType.CertCodeSigning
- }
- })
- }
- >
- <Td>
- <div>
- <div className="text-sm font-medium text-mineshaft-100">
- {request.requesterName || "Unknown"}
- </div>
- <div className="text-xs text-mineshaft-400">{request.requesterEmail}</div>
- </div>
- </Td>
- <Td>
- <span className="text-sm text-mineshaft-200">
- {reqData.signerName || "Unknown Signer"}
- </span>
- </Td>
- <Td>
- <div className="flex items-center gap-2">
- {needsApproval ? (
- <div className="flex items-center gap-1 rounded bg-primary/20 px-2 py-0.5 text-xs text-primary">
- <FontAwesomeIcon icon={faExclamationCircle} className="h-3 w-3" />
- <span>Approval Required</span>
- </div>
- ) : (
- <Badge
- className="capitalize"
- variant={getStatusBadgeColor(request.status as ApprovalRequestStatus)}
- >
- {request.status.split("-").join(" ")}
- </Badge>
- )}
- </div>
- </Td>
- <Td>
- <span className="text-sm text-mineshaft-400">
- {format(new Date(request.createdAt), "MMM d, yyyy")}
- </span>
- </Td>
- <Td>
- <FontAwesomeIcon icon={faChevronRight} className="text-bunker-300" />
- </Td>
- </Tr>
- );
- })}
- </TBody>
- </Table>
- </TableContainer>
- {filteredRequests.length > perPage && (
- <Pagination
- count={filteredRequests.length}
- page={page}
- perPage={perPage}
- onChangePage={setPage}
- onChangePerPage={setPerPage}
- />
- )}
- <RequestSigningAccessModal isOpen={isRequestModalOpen} onOpenChange={setIsRequestModalOpen} />
- </div>
- );
-};
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/RequestSigningAccessModal.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/RequestSigningAccessModal.tsx
deleted file mode 100644
index 1946942559..0000000000
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/RequestSigningAccessModal.tsx
+++ /dev/null
@@ -1,352 +0,0 @@
-import { useEffect, useMemo } from "react";
-import { Controller, useForm } from "react-hook-form";
-import { zodResolver } from "@hookform/resolvers/zod";
-import { useQuery } from "@tanstack/react-query";
-import { z } from "zod";
-
-import { createNotification } from "@app/components/notifications";
-import {
- Button,
- FormControl,
- Input,
- Modal,
- ModalClose,
- ModalContent,
- Select,
- SelectItem,
- TextArea
-} from "@app/components/v2";
-import { useProject } from "@app/context";
-import {
- approvalPolicyQuery,
- ApprovalPolicyScope,
- ApprovalPolicyType,
- TApprovalPolicy
-} from "@app/hooks/api/approvalPolicies";
-import { useCreateApprovalRequest } from "@app/hooks/api/approvalRequests/mutations";
-import { TSigner, useListSigners } from "@app/hooks/api/signers";
-
-type Props = {
- isOpen: boolean;
- onOpenChange: (isOpen: boolean) => void;
- signer?: TSigner;
-};
-
-const toDatetimeLocalValue = (date: Date): string => {
- const pad = (n: number) => String(n).padStart(2, "0");
- return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;
-};
-
-const getDefaultWindowStart = () => toDatetimeLocalValue(new Date());
-const getDefaultWindowEnd = () => {
- const d = new Date();
- d.setHours(d.getHours() + 4);
- return toDatetimeLocalValue(d);
-};
-
-const formSchema = z
- .object({
- signerId: z.string().min(1, "Signer is required"),
- justification: z.string().max(512).optional(),
- windowStart: z.string().optional(),
- windowEnd: z.string().optional(),
- requestedSignings: z.preprocess(
- (val) => (val === "" || val === undefined || val === null ? undefined : Number(val)),
- z.number().int().positive().optional()
- )
- })
- .superRefine((data, ctx) => {
- if (data.windowStart) {
- const start = new Date(data.windowStart);
- if (start < new Date()) {
- ctx.addIssue({
- code: z.ZodIssueCode.custom,
- message: "Start time cannot be in the past",
- path: ["windowStart"]
- });
- }
- }
- if (data.windowStart && data.windowEnd) {
- const start = new Date(data.windowStart);
- const end = new Date(data.windowEnd);
- if (end <= start) {
- ctx.addIssue({
- code: z.ZodIssueCode.custom,
- message: "End time must be after start time",
- path: ["windowEnd"]
- });
- }
- }
- });
-
-type FormData = z.infer<typeof formSchema>;
-
-const Content = ({ onOpenChange, signer: presetSigner }: Props) => {
- const { projectId } = useProject();
- const { mutateAsync: createApprovalRequest, isPending: isSubmitting } =
- useCreateApprovalRequest();
-
- const { data: signersData } = useListSigners({ projectId, limit: 100 });
-
- const { data: policies = [] } = useQuery(
- approvalPolicyQuery.list({
- policyType: ApprovalPolicyType.CertCodeSigning,
- scope: ApprovalPolicyScope.Project,
- scopeId: projectId
- })
- );
-
- const signers = useMemo(
- () => (signersData?.signers ?? []).filter((s) => s.approvalPolicyId),
- [signersData?.signers]
- );
-
- const policyMap = useMemo(() => {
- const map = new Map<string, TApprovalPolicy>();
- policies.forEach((policy) => {
- map.set(policy.id, policy);
- });
- return map;
- }, [policies]);
-
- const form = useForm<FormData>({
- resolver: zodResolver(formSchema),
- mode: "onChange",
- defaultValues: {
- signerId: presetSigner?.id ?? "",
- justification: "",
- windowStart: getDefaultWindowStart(),
- windowEnd: getDefaultWindowEnd(),
- requestedSignings: 1
- }
- });
-
- const {
- control,
- handleSubmit,
- watch,
- setValue,
- trigger,
- formState: { isValid }
- } = form;
-
- const selectedSignerId = watch("signerId");
-
- const selectedSigner = useMemo(
- () => presetSigner ?? signers.find((s) => s.id === selectedSignerId),
- [presetSigner, signers, selectedSignerId]
- );
-
- const selectedPolicy = useMemo(
- () =>
- selectedSigner?.approvalPolicyId ? policyMap.get(selectedSigner.approvalPolicyId) : undefined,
- [selectedSigner, policyMap]
- );
-
- const { hasTimeConstraint, hasCountConstraint } = useMemo(() => {
- if (!selectedPolicy) return { hasTimeConstraint: false, hasCountConstraint: false };
- const constraints = selectedPolicy.constraints?.constraints as
- | { maxWindowDuration?: string; maxSignings?: number }
- | undefined;
- return {
- hasTimeConstraint: Boolean(constraints?.maxWindowDuration),
- hasCountConstraint: Boolean(constraints?.maxSignings)
- };
- }, [selectedPolicy]);
-
- useEffect(() => {
- if (hasTimeConstraint) {
- setValue("windowStart", getDefaultWindowStart());
- setValue("windowEnd", getDefaultWindowEnd());
- } else {
- setValue("windowStart", undefined);
- setValue("windowEnd", undefined);
- }
-
- if (hasCountConstraint) {
- setValue("requestedSignings", 1);
- } else {
- setValue("requestedSignings", undefined);
- }
-
- trigger();
- }, [hasTimeConstraint, hasCountConstraint, setValue, trigger]);
-
- const onSubmit = async (formData: FormData) => {
- if (!selectedSigner || !selectedPolicy) return;
-
- let requestedWindowStart: string | undefined;
- let requestedWindowEnd: string | undefined;
-
- if (hasTimeConstraint && formData.windowStart && formData.windowEnd) {
- requestedWindowStart = new Date(formData.windowStart).toISOString();
- requestedWindowEnd = new Date(formData.windowEnd).toISOString();
- }
-
- await createApprovalRequest({
- policyType: ApprovalPolicyType.CertCodeSigning,
- scope: ApprovalPolicyScope.Project,
- scopeId: projectId,
- justification: formData.justification || null,
- requestData: {
- signerId: selectedSigner.id,
- approvalPolicyId: selectedSigner.approvalPolicyId!,
- signerName: selectedSigner.name,
- ...(requestedWindowStart && { requestedWindowStart }),
- ...(requestedWindowEnd && { requestedWindowEnd }),
- ...(hasCountConstraint &&
- formData.requestedSignings != null && { requestedSignings: formData.requestedSignings })
- }
- });
-
- createNotification({
- text: "Signing access request submitted successfully",
- type: "success"
- });
-
- onOpenChange(false);
- };
-
- return (
- <form onSubmit={handleSubmit(onSubmit)}>
- {presetSigner ? (
- <FormControl label="Signer">
- <Input
- value={
- presetSigner.certificateCommonName
- ? `${presetSigner.name} (${presetSigner.certificateCommonName})`
- : presetSigner.name
- }
- isReadOnly
- />
- </FormControl>
- ) : (
- <Controller
- name="signerId"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Signer"
- errorText={error?.message}
- isError={Boolean(error?.message)}
- helperText="Select the signer you want to request signing access for"
- >
- <Select
- value={field.value}
- onValueChange={field.onChange}
- placeholder="Select a signer..."
- className="w-full"
- >
- {signers.map((signer) => (
- <SelectItem key={signer.id} value={signer.id}>
- {signer.name}
- {signer.certificateCommonName ? ` (${signer.certificateCommonName})` : ""}
- </SelectItem>
- ))}
- </Select>
- </FormControl>
- )}
- />
- )}
- {hasTimeConstraint && (
- <div className="grid grid-cols-2 gap-4">
- <Controller
- name="windowStart"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Valid From"
- errorText={error?.message}
- isError={Boolean(error?.message)}
- >
- <Input type="datetime-local" {...field} />
- </FormControl>
- )}
- />
- <Controller
- name="windowEnd"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Valid Until"
- errorText={error?.message}
- isError={Boolean(error?.message)}
- >
- <Input type="datetime-local" {...field} />
- </FormControl>
- )}
- />
- </div>
- )}
- {hasCountConstraint && (
- <Controller
- name="requestedSignings"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <FormControl
- label="Number of Signings"
- errorText={error?.message}
- isError={Boolean(error?.message)}
- helperText="How many signing operations you need"
- >
- <Input
- placeholder="5"
- {...field}
- value={field.value ?? ""}
- onChange={(e) => field.onChange(e.target.value)}
- />
- </FormControl>
- )}
- />
- )}
- <Controller
- name="justification"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <FormControl
- errorText={error?.message}
- isError={Boolean(error?.message)}
- label="Justification"
- isOptional
- >
- <TextArea placeholder="I need to sign the v2.0.0 release artifacts..." {...field} />
- </FormControl>
- )}
- />
- <div className="mt-6 flex items-center">
- <Button
- className="mr-4"
- size="sm"
- type="submit"
- colorSchema="secondary"
- isLoading={isSubmitting}
- isDisabled={isSubmitting || !isValid || !selectedSigner}
- >
- Request Signing Access
- </Button>
- <ModalClose asChild>
- <Button colorSchema="secondary" variant="plain">
- Cancel
- </Button>
- </ModalClose>
- </div>
- </form>
- );
-};
-
-export const RequestSigningAccessModal = (props: Props) => {
- const { isOpen, onOpenChange, signer } = props;
-
- return (
- <Modal isOpen={isOpen} onOpenChange={onOpenChange}>
- <ModalContent
- className="max-w-2xl pb-2"
- title="Request Signing Access"
- subTitle="Request approval to sign with a code signing key"
- key={signer?.id ?? "no-preset"}
- >
- <Content {...props} />
- </ModalContent>
- </Modal>
- );
-};
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/index.ts b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/index.ts
deleted file mode 100644
index fe33c6a655..0000000000
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/index.ts
+++ /dev/null
@@ -1 +0,0 @@
-export { CodeSigningRequestsTab } from "./CodeSigningRequestsTab";
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/PreApproveSigningModal.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/PreApproveSigningModal.tsx
deleted file mode 100644
index 08e8c59d2b..0000000000
--- a/frontend/src/pages/cert-manager/SignerDetailPage/components/PreApproveSigningModal.tsx
+++ /dev/null
@@ -1,312 +0,0 @@
-import { useEffect, useMemo, useState } from "react";
-import { Controller, useForm } from "react-hook-form";
-import { zodResolver } from "@hookform/resolvers/zod";
-import ms from "ms";
-import { z } from "zod";
-
-import { createNotification } from "@app/components/notifications";
-import {
- Button,
- Dialog,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
- Field,
- FieldContent,
- FieldDescription,
- FieldError,
- FieldGroup,
- FieldLabel,
- FilterableSelect,
- Input,
- TextArea
-} from "@app/components/v3";
-import {
- SignerMemberRole,
- TEffectiveSignerMember,
- useGetSignerPolicy,
- useListEffectiveSignerMembers,
- usePreApproveSigning
-} from "@app/hooks/api/signers";
-
-type Props = {
- isOpen: boolean;
- onOpenChange: (open: boolean) => void;
- signerId: string;
-};
-
-type MemberOption = { value: string; label: string; kind: "user" | "identity" };
-
-const schema = z
- .object({
- granteeKey: z.string().min(1, "Pick a member"),
- requestedSignings: z.preprocess(
- (v) => {
- if (v === "" || v === null || v === undefined) return null;
- const n = typeof v === "number" ? v : Number(v);
- return Number.isNaN(n) ? v : n;
- },
- z
- .union([z.number().int("Must be a whole number").min(1, "Must be at least 1"), z.null()])
- .optional()
- ),
- requestedWindowStart: z.string().optional(),
- requestedWindowEnd: z.string().optional(),
- justification: z.string().trim().min(1, "Reason is required").max(2048)
- })
- .refine((d) => d.requestedSignings || d.requestedWindowEnd, {
- message: "Provide a signature count or a window end",
- path: ["requestedSignings"]
- });
-
-type FormData = z.infer<typeof schema>;
-
-const HOURS_24_MS = 24 * 60 * 60 * 1000;
-const isoLocal = (epochMs: number) => {
- const d = new Date(epochMs);
- const pad = (n: number) => String(n).padStart(2, "0");
- return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;
-};
-
-const parseWindowMs = (s?: string | null): number | null => {
- if (!s) return null;
- try {
- const n = ms(s);
- return typeof n === "number" && n > 0 ? n : null;
- } catch {
- return null;
- }
-};
-
-export const PreApproveSigningModal = ({ isOpen, onOpenChange, signerId }: Props) => {
- const users = useListEffectiveSignerMembers({ signerId, kind: "user" });
- const identities = useListEffectiveSignerMembers({ signerId, kind: "identity" });
- const { data: policy } = useGetSignerPolicy(signerId);
- const preApprove = usePreApproveSigning();
- const [submitting, setSubmitting] = useState(false);
-
- const maxSignings = policy?.constraints?.maxSignings ?? null;
- const maxWindowDuration = policy?.constraints?.maxWindowDuration ?? null;
-
- const memberOptions: MemberOption[] = useMemo(() => {
- const opts: MemberOption[] = [];
- (users.data?.members ?? []).forEach((m: TEffectiveSignerMember) => {
- if (!m.actorUserId) return;
- if (m.role === SignerMemberRole.Auditor) return;
- opts.push({
- value: `user:${m.actorUserId}`,
- label: m.details?.name || m.details?.username || m.details?.email || m.actorUserId,
- kind: "user"
- });
- });
- (identities.data?.members ?? []).forEach((m: TEffectiveSignerMember) => {
- if (!m.actorIdentityId) return;
- if (m.role === SignerMemberRole.Auditor) return;
- opts.push({
- value: `identity:${m.actorIdentityId}`,
- label: m.details?.name || m.actorIdentityId,
- kind: "identity"
- });
- });
- return opts;
- }, [users.data, identities.data]);
-
- const buildDefaults = (): FormData => {
- const now = Date.now();
- const allowedMs = parseWindowMs(maxWindowDuration);
- return {
- granteeKey: "",
- requestedSignings: maxSignings ?? null,
- requestedWindowStart: isoLocal(now),
- requestedWindowEnd: isoLocal(now + (allowedMs ?? HOURS_24_MS)),
- justification: ""
- };
- };
-
- const { control, handleSubmit, reset } = useForm<FormData>({
- resolver: zodResolver(schema),
- defaultValues: buildDefaults()
- });
-
- useEffect(() => {
- if (!isOpen) reset(buildDefaults());
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [maxSignings, maxWindowDuration]);
-
- const handleClose = (open: boolean) => {
- if (!open) reset(buildDefaults());
- onOpenChange(open);
- };
-
- const onSubmit = async (data: FormData) => {
- setSubmitting(true);
- try {
- const [kind, id] = data.granteeKey.split(":");
- await preApprove.mutateAsync({
- signerId,
- granteeUserId: kind === "user" ? id : undefined,
- granteeIdentityId: kind === "identity" ? id : undefined,
- justification: data.justification,
- requestedSignings: data.requestedSignings ?? undefined,
- requestedWindowStart: data.requestedWindowStart
- ? new Date(data.requestedWindowStart).toISOString()
- : undefined,
- requestedWindowEnd: data.requestedWindowEnd
- ? new Date(data.requestedWindowEnd).toISOString()
- : undefined
- });
- handleClose(false);
- } catch (err) {
- createNotification({
- type: "error",
- text: err instanceof Error ? err.message : "Failed to pre-approve"
- });
- } finally {
- setSubmitting(false);
- }
- };
-
- return (
- <Dialog open={isOpen} onOpenChange={handleClose}>
- <DialogContent className="max-w-lg">
- <DialogHeader>
- <DialogTitle>Pre-approve signing</DialogTitle>
- <DialogDescription>
- Grant an Operator or machine identity a signed-off window without an approval flow.
- </DialogDescription>
- </DialogHeader>
-
- <form onSubmit={handleSubmit(onSubmit)} className="space-y-6">
- <FieldGroup>
- <Controller
- name="granteeKey"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <Field>
- <FieldLabel>Member</FieldLabel>
- <FieldContent>
- <FilterableSelect
- options={memberOptions}
- value={memberOptions.find((o) => o.value === field.value) ?? null}
- onChange={(selected) =>
- field.onChange((selected as MemberOption | null)?.value ?? "")
- }
- placeholder="Pick a member..."
- isError={Boolean(error)}
- />
- <FieldError errors={[error]} />
- </FieldContent>
- </Field>
- )}
- />
-
- <Controller
- name="requestedSignings"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <Field>
- <FieldLabel>How many signatures</FieldLabel>
- <FieldContent>
- <Input
- type="number"
- min={1}
- max={maxSignings ?? undefined}
- value={field.value ?? ""}
- onChange={(e) => {
- const raw = e.target.value;
- field.onChange(raw === "" ? null : Number(raw));
- }}
- placeholder={
- maxSignings
- ? `Up to ${maxSignings}`
- : "Leave empty to rely on the time window"
- }
- isError={Boolean(error)}
- />
- <FieldDescription>
- {maxSignings
- ? `Policy caps each approval at ${maxSignings} signature${maxSignings === 1 ? "" : "s"}.`
- : "Leave empty to rely on the time window."}
- </FieldDescription>
- <FieldError errors={[error]} />
- </FieldContent>
- </Field>
- )}
- />
-
- <div className="grid grid-cols-2 gap-3">
- <Controller
- name="requestedWindowStart"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <Field>
- <FieldLabel>Starts</FieldLabel>
- <FieldContent>
- <Input
- type="datetime-local"
- value={field.value ?? ""}
- onChange={(e) => field.onChange(e.target.value || undefined)}
- isError={Boolean(error)}
- />
- <FieldDescription>When access begins.</FieldDescription>
- <FieldError errors={[error]} />
- </FieldContent>
- </Field>
- )}
- />
- <Controller
- name="requestedWindowEnd"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <Field>
- <FieldLabel>Ends</FieldLabel>
- <FieldContent>
- <Input
- type="datetime-local"
- value={field.value ?? ""}
- onChange={(e) => field.onChange(e.target.value || undefined)}
- isError={Boolean(error)}
- />
- <FieldDescription>When access expires.</FieldDescription>
- <FieldError errors={[error]} />
- </FieldContent>
- </Field>
- )}
- />
- </div>
-
- <Controller
- name="justification"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <Field>
- <FieldLabel>Reason</FieldLabel>
- <FieldContent>
- <TextArea
- {...field}
- placeholder="Why is this being pre-approved?"
- rows={3}
- isError={Boolean(error)}
- />
- <FieldError errors={[error]} />
- </FieldContent>
- </Field>
- )}
- />
- </FieldGroup>
-
- <DialogFooter>
- <Button variant="outline" onClick={() => handleClose(false)}>
- Cancel
- </Button>
- <Button type="submit" variant="project" isPending={submitting}>
- Pre-approve
- </Button>
- </DialogFooter>
- </form>
- </DialogContent>
- </Dialog>
- );
-};
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/PreApproveSigningSheet.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/PreApproveSigningSheet.tsx
new file mode 100644
index 0000000000..7d33ceb6f7
--- /dev/null
+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/PreApproveSigningSheet.tsx
@@ -0,0 +1,339 @@
+import { useEffect, useMemo, useState } from "react";
+import { Controller, useForm } from "react-hook-form";
+import { zodResolver } from "@hookform/resolvers/zod";
+import { BadgeCheckIcon } from "lucide-react";
+import { z } from "zod";
+
+import {
+ Button,
+ DocumentationLinkBadge,
+ Field,
+ FieldContent,
+ FieldDescription,
+ FieldError,
+ FieldGroup,
+ FieldLabel,
+ FilterableSelect,
+ Input,
+ Sheet,
+ SheetContent,
+ SheetFooter,
+ SheetHeader,
+ SheetTitle,
+ TextArea
+} from "@app/components/v3";
+import { parseDurationMs, toDateTimeLocalInputValue } from "@app/helpers/datetime";
+import {
+ SignerMemberRole,
+ TEffectiveSignerMember,
+ useGetSignerPolicy,
+ useListEffectiveSignerMembers,
+ usePreApproveSigning
+} from "@app/hooks/api/signers";
+import {
+ pickDeclaredScope,
+ ScopeFieldsFormSection,
+ SigningScopeSchema
+} from "@app/pages/cert-manager/components/ScopeFieldsFormSection";
+import { PkiDocsUrls } from "@app/pages/cert-manager/pki-docs-urls";
+
+type Props = {
+ isOpen: boolean;
+ onOpenChange: (open: boolean) => void;
+ signerId: string;
+};
+
+type MemberOption = { value: string; label: string; kind: "user" | "identity" };
+
+const schema = z
+ .object({
+ granteeKey: z.string().min(1, "Pick a member"),
+ requestedSignings: z.preprocess(
+ (v) => {
+ if (v === "" || v === null || v === undefined) return null;
+ const n = typeof v === "number" ? v : Number(v);
+ return Number.isNaN(n) ? v : n;
+ },
+ z
+ .union([z.number().int("Must be a whole number").min(1, "Must be at least 1"), z.null()])
+ .optional()
+ ),
+ requestedWindowStart: z.string().optional(),
+ requestedWindowEnd: z.string().optional(),
+ justification: z.string().trim().min(1, "Reason is required").max(2048),
+ scope: SigningScopeSchema
+ })
+ .refine((d) => d.requestedSignings || d.requestedWindowEnd, {
+ message: "Provide a signature count or a window end",
+ path: ["requestedSignings"]
+ });
+
+type FormData = z.infer<typeof schema>;
+
+const DEFAULT_SIGNING_WINDOW_MS = 24 * 60 * 60 * 1000;
+
+export const PreApproveSigningSheet = ({ isOpen, onOpenChange, signerId }: Props) => {
+ const users = useListEffectiveSignerMembers({ signerId, kind: "user" });
+ const identities = useListEffectiveSignerMembers({ signerId, kind: "identity" });
+ const { data: policy } = useGetSignerPolicy(signerId);
+ const preApprove = usePreApproveSigning();
+ const [submitting, setSubmitting] = useState(false);
+
+ const maxSignings = policy?.constraints?.maxSignings ?? null;
+ const maxWindowDuration = policy?.constraints?.maxWindowDuration ?? null;
+ const memberOptions: MemberOption[] = useMemo(() => {
+ const opts: MemberOption[] = [];
+ (users.data?.members ?? []).forEach((m: TEffectiveSignerMember) => {
+ if (!m.actorUserId) return;
+ if (m.role === SignerMemberRole.Auditor) return;
+ opts.push({
+ value: `user:${m.actorUserId}`,
+ label: m.details?.name || m.details?.username || m.details?.email || m.actorUserId,
+ kind: "user"
+ });
+ });
+ (identities.data?.members ?? []).forEach((m: TEffectiveSignerMember) => {
+ if (!m.actorIdentityId) return;
+ if (m.role === SignerMemberRole.Auditor) return;
+ opts.push({
+ value: `identity:${m.actorIdentityId}`,
+ label: m.details?.name || m.actorIdentityId,
+ kind: "identity"
+ });
+ });
+ return opts;
+ }, [users.data, identities.data]);
+
+ const buildDefaults = (): FormData => {
+ const now = Date.now();
+ const allowedMs = parseDurationMs(maxWindowDuration);
+ return {
+ granteeKey: "",
+ requestedSignings: maxSignings ?? null,
+ requestedWindowStart: toDateTimeLocalInputValue(now),
+ requestedWindowEnd: toDateTimeLocalInputValue(now + (allowedMs ?? DEFAULT_SIGNING_WINDOW_MS)),
+ justification: "",
+ scope: []
+ };
+ };
+
+ const { control, handleSubmit, reset } = useForm<FormData>({
+ resolver: zodResolver(schema),
+ defaultValues: buildDefaults()
+ });
+
+ useEffect(() => {
+ if (!isOpen) reset(buildDefaults());
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [maxSignings, maxWindowDuration]);
+
+ const handleClose = (open: boolean) => {
+ if (!open) reset(buildDefaults());
+ onOpenChange(open);
+ };
+
+ const onSubmit = async (data: FormData) => {
+ setSubmitting(true);
+ try {
+ const [kind, id] = data.granteeKey.split(":");
+ await preApprove.mutateAsync({
+ signerId,
+ granteeUserId: kind === "user" ? id : undefined,
+ granteeIdentityId: kind === "identity" ? id : undefined,
+ justification: data.justification,
+ requestedSignings: data.requestedSignings ?? undefined,
+ requestedWindowStart: data.requestedWindowStart
+ ? new Date(data.requestedWindowStart).toISOString()
+ : undefined,
+ requestedWindowEnd: data.requestedWindowEnd
+ ? new Date(data.requestedWindowEnd).toISOString()
+ : undefined,
+ scope: pickDeclaredScope(data.scope)
+ });
+ handleClose(false);
+ } catch {
+ // The mutation cache reports the failure, so showing it here would duplicate the toast.
+ // Caught only so the sheet stays open for another attempt.
+ } finally {
+ setSubmitting(false);
+ }
+ };
+
+ return (
+ <Sheet open={isOpen} onOpenChange={handleClose}>
+ <SheetContent className="flex h-full max-h-full flex-col gap-y-0 sm:max-w-[1100px]">
+ <SheetHeader className="border-b">
+ <SheetTitle>
+ <div className="flex w-full items-start gap-2">
+ <div className="flex h-10 w-10 items-center justify-center rounded-md bg-warning/10 text-warning">
+ <BadgeCheckIcon className="h-5 w-5" />
+ </div>
+ <div>
+ <div className="flex items-center gap-x-2 text-mineshaft-300">
+ Pre-approve signing
+ </div>
+ <p className="text-sm leading-4 text-mineshaft-400">
+ Grant an Operator or machine identity a signed-off window without an approval
+ flow.
+ </p>
+ </div>
+ </div>
+ </SheetTitle>
+ </SheetHeader>
+
+ <form className="flex min-h-0 flex-1 flex-col" onSubmit={handleSubmit(onSubmit)}>
+ <div className="flex min-h-0 flex-1 overflow-hidden">
+ <div className="flex min-w-0 flex-1 flex-col gap-y-2 overflow-y-auto px-8 py-6">
+ <FieldGroup>
+ <Controller
+ name="granteeKey"
+ control={control}
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>Member</FieldLabel>
+ <FieldContent>
+ <FilterableSelect
+ options={memberOptions}
+ value={memberOptions.find((o) => o.value === field.value) ?? null}
+ onChange={(selected) =>
+ field.onChange((selected as MemberOption | null)?.value ?? "")
+ }
+ placeholder="Pick a member..."
+ isError={Boolean(error)}
+ />
+ <FieldError errors={[error]} />
+ </FieldContent>
+ </Field>
+ )}
+ />
+
+ <Controller
+ name="requestedSignings"
+ control={control}
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>How many signatures</FieldLabel>
+ <FieldContent>
+ <Input
+ type="number"
+ min={1}
+ max={maxSignings ?? undefined}
+ value={field.value ?? ""}
+ onChange={(e) => {
+ const raw = e.target.value;
+ field.onChange(raw === "" ? null : Number(raw));
+ }}
+ placeholder={
+ maxSignings
+ ? `Up to ${maxSignings}`
+ : "Leave empty to rely on the time window"
+ }
+ isError={Boolean(error)}
+ />
+ <FieldDescription>
+ {maxSignings
+ ? `Policy caps each approval at ${maxSignings} signature${maxSignings === 1 ? "" : "s"}.`
+ : "Leave empty to rely on the time window."}
+ </FieldDescription>
+ <FieldError errors={[error]} />
+ </FieldContent>
+ </Field>
+ )}
+ />
+
+ <div className="grid grid-cols-2 gap-3">
+ <Controller
+ name="requestedWindowStart"
+ control={control}
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>Starts</FieldLabel>
+ <FieldContent>
+ <Input
+ type="datetime-local"
+ value={field.value ?? ""}
+ onChange={(e) => field.onChange(e.target.value || undefined)}
+ isError={Boolean(error)}
+ />
+ <FieldDescription>When access begins.</FieldDescription>
+ <FieldError errors={[error]} />
+ </FieldContent>
+ </Field>
+ )}
+ />
+ <Controller
+ name="requestedWindowEnd"
+ control={control}
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>Ends</FieldLabel>
+ <FieldContent>
+ <Input
+ type="datetime-local"
+ value={field.value ?? ""}
+ onChange={(e) => field.onChange(e.target.value || undefined)}
+ isError={Boolean(error)}
+ />
+ <FieldDescription>When access expires.</FieldDescription>
+ <FieldError errors={[error]} />
+ </FieldContent>
+ </Field>
+ )}
+ />
+ </div>
+
+ <ScopeFieldsFormSection control={control} />
+
+ <Controller
+ name="justification"
+ control={control}
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>Reason</FieldLabel>
+ <FieldContent>
+ <TextArea
+ {...field}
+ placeholder="Why is this being pre-approved?"
+ rows={3}
+ isError={Boolean(error)}
+ />
+ <FieldError errors={[error]} />
+ </FieldContent>
+ </Field>
+ )}
+ />
+ </FieldGroup>
+ </div>
+
+ <aside className="hidden w-80 shrink-0 flex-col gap-4 overflow-y-auto border-l border-border px-6 py-6 lg:flex">
+ <div className="mb-auto">
+ <div className="flex items-center justify-between gap-2">
+ <p className="text-[11px] font-medium tracking-wider text-muted uppercase">
+ Pre-approving
+ </p>
+ <DocumentationLinkBadge href={PkiDocsUrls.codeSigning.approvals.preApprove} />
+ </div>
+ <p className="mt-4 text-sm font-semibold text-foreground">What this does</p>
+ <p className="mt-2 text-sm leading-relaxed text-muted">
+ Pre-approving skips the review step: the moment you save, the member you pick can
+ sign. It produces the same access record an approved request would, so it appears
+ on the Approvals tab with its own signature counter and expiry, and you can revoke
+ it there at any time.
+ </p>
+ </div>
+ </aside>
+ </div>
+
+ <SheetFooter className="flex-row items-center justify-end border-t">
+ <Button type="button" variant="outline" onClick={() => handleClose(false)}>
+ Cancel
+ </Button>
+ <Button type="submit" variant="project" isPending={submitting}>
+ Pre-approve
+ </Button>
+ </SheetFooter>
+ </form>
+ </SheetContent>
+ </Sheet>
+ );
+};
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/RequestToSignModal.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/RequestToSignModal.tsx
deleted file mode 100644
index 505088a1ac..0000000000
--- a/frontend/src/pages/cert-manager/SignerDetailPage/components/RequestToSignModal.tsx
+++ /dev/null
@@ -1,252 +0,0 @@
-import { useEffect, useState } from "react";
-import { Controller, useForm } from "react-hook-form";
-import { zodResolver } from "@hookform/resolvers/zod";
-import ms from "ms";
-import { z } from "zod";
-
-import { createNotification } from "@app/components/notifications";
-import {
- Button,
- Dialog,
- DialogContent,
- DialogDescription,
- DialogFooter,
- DialogHeader,
- DialogTitle,
- Field,
- FieldContent,
- FieldDescription,
- FieldError,
- FieldGroup,
- FieldLabel,
- Input,
- TextArea
-} from "@app/components/v3";
-import { useGetSignerPolicy, useRequestToSign } from "@app/hooks/api/signers";
-
-type Props = {
- isOpen: boolean;
- onOpenChange: (open: boolean) => void;
- signerId: string;
-};
-
-const schema = z
- .object({
- requestedSignings: z.preprocess(
- (v) => {
- if (v === "" || v === null || v === undefined) return null;
- const n = typeof v === "number" ? v : Number(v);
- return Number.isNaN(n) ? v : n;
- },
- z
- .union([z.number().int("Must be a whole number").min(1, "Must be at least 1"), z.null()])
- .optional()
- ),
- requestedWindowStart: z.string().optional(),
- requestedWindowEnd: z.string().optional(),
- justification: z.string().trim().min(1, "Reason is required").max(2048)
- })
- .refine((d) => d.requestedSignings || d.requestedWindowEnd, {
- message: "Provide a signature count or a window end",
- path: ["requestedSignings"]
- });
-
-type FormData = z.infer<typeof schema>;
-
-const HOURS_24_MS = 24 * 60 * 60 * 1000;
-
-const isoLocal = (epochMs: number) => {
- const d = new Date(epochMs);
- const pad = (n: number) => String(n).padStart(2, "0");
- return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;
-};
-
-const parseWindowMs = (s?: string | null): number | null => {
- if (!s) return null;
- try {
- const n = ms(s);
- return typeof n === "number" && n > 0 ? n : null;
- } catch {
- return null;
- }
-};
-
-export const RequestToSignModal = ({ isOpen, onOpenChange, signerId }: Props) => {
- const requestToSign = useRequestToSign();
- const { data: policy } = useGetSignerPolicy(signerId);
- const [submitting, setSubmitting] = useState(false);
-
- const maxSignings = policy?.constraints?.maxSignings ?? null;
- const maxWindowDuration = policy?.constraints?.maxWindowDuration ?? null;
-
- const buildDefaults = (): FormData => {
- const now = Date.now();
- const allowedMs = parseWindowMs(maxWindowDuration);
- return {
- requestedSignings: maxSignings ?? null,
- requestedWindowStart: isoLocal(now),
- requestedWindowEnd: isoLocal(now + (allowedMs ?? HOURS_24_MS)),
- justification: ""
- };
- };
-
- const { control, handleSubmit, reset } = useForm<FormData>({
- resolver: zodResolver(schema),
- defaultValues: buildDefaults()
- });
-
- useEffect(() => {
- if (!isOpen) reset(buildDefaults());
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [maxSignings, maxWindowDuration]);
-
- const handleClose = (open: boolean) => {
- if (!open) reset(buildDefaults());
- onOpenChange(open);
- };
-
- const onSubmit = async (data: FormData) => {
- setSubmitting(true);
- try {
- await requestToSign.mutateAsync({
- signerId,
- justification: data.justification,
- requestedSignings: data.requestedSignings ?? undefined,
- requestedWindowStart: data.requestedWindowStart
- ? new Date(data.requestedWindowStart).toISOString()
- : undefined,
- requestedWindowEnd: data.requestedWindowEnd
- ? new Date(data.requestedWindowEnd).toISOString()
- : undefined
- });
- handleClose(false);
- } catch (err) {
- createNotification({
- type: "error",
- text: err instanceof Error ? err.message : "Failed to open request"
- });
- } finally {
- setSubmitting(false);
- }
- };
-
- return (
- <Dialog open={isOpen} onOpenChange={handleClose}>
- <DialogContent className="max-w-lg">
- <DialogHeader>
- <DialogTitle>Request to sign</DialogTitle>
- <DialogDescription>
- Ask the approvers to let you sign. Pick how many signatures you need and when.
- </DialogDescription>
- </DialogHeader>
-
- <form onSubmit={handleSubmit(onSubmit)} className="space-y-6">
- <FieldGroup>
- <Controller
- name="requestedSignings"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <Field>
- <FieldLabel>How many signatures</FieldLabel>
- <FieldContent>
- <Input
- type="number"
- min={1}
- max={maxSignings ?? undefined}
- value={field.value ?? ""}
- onChange={(e) => {
- const raw = e.target.value;
- field.onChange(raw === "" ? null : Number(raw));
- }}
- placeholder={
- maxSignings
- ? `Up to ${maxSignings}`
- : "Leave empty to rely on the time window"
- }
- isError={Boolean(error)}
- />
- <FieldDescription>
- {maxSignings
- ? `Policy caps each approval at ${maxSignings} signature${maxSignings === 1 ? "" : "s"}.`
- : "Leave empty to rely on the time window instead."}
- </FieldDescription>
- <FieldError errors={[error]} />
- </FieldContent>
- </Field>
- )}
- />
-
- <div className="grid grid-cols-2 gap-3">
- <Controller
- name="requestedWindowStart"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <Field>
- <FieldLabel>Starts</FieldLabel>
- <FieldContent>
- <Input
- type="datetime-local"
- value={field.value ?? ""}
- onChange={(e) => field.onChange(e.target.value || undefined)}
- isError={Boolean(error)}
- />
- <FieldDescription>When access starts.</FieldDescription>
- <FieldError errors={[error]} />
- </FieldContent>
- </Field>
- )}
- />
- <Controller
- name="requestedWindowEnd"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <Field>
- <FieldLabel>Ends</FieldLabel>
- <FieldContent>
- <Input
- type="datetime-local"
- value={field.value ?? ""}
- onChange={(e) => field.onChange(e.target.value || undefined)}
- isError={Boolean(error)}
- />
- <FieldDescription>When access ends.</FieldDescription>
- <FieldError errors={[error]} />
- </FieldContent>
- </Field>
- )}
- />
- </div>
-
- <Controller
- name="justification"
- control={control}
- render={({ field, fieldState: { error } }) => (
- <Field>
- <FieldLabel>Reason</FieldLabel>
- <FieldContent>
- <TextArea
- {...field}
- placeholder="What are you signing?"
- rows={3}
- isError={Boolean(error)}
- />
- <FieldError errors={[error]} />
- </FieldContent>
- </Field>
- )}
- />
- </FieldGroup>
-
- <DialogFooter>
- <Button variant="outline" onClick={() => handleClose(false)}>
- Cancel
- </Button>
- <Button type="submit" variant="project" isPending={submitting}>
- Send request
- </Button>
- </DialogFooter>
- </form>
- </DialogContent>
- </Dialog>
- );
-};
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/RequestToSignSheet.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/RequestToSignSheet.tsx
new file mode 100644
index 0000000000..88773a70d8
--- /dev/null
+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/RequestToSignSheet.tsx
@@ -0,0 +1,276 @@
+import { useEffect, useState } from "react";
+import { Controller, useForm } from "react-hook-form";
+import { zodResolver } from "@hookform/resolvers/zod";
+import { PenToolIcon } from "lucide-react";
+import { z } from "zod";
+
+import {
+ Button,
+ DocumentationLinkBadge,
+ Field,
+ FieldContent,
+ FieldDescription,
+ FieldError,
+ FieldGroup,
+ FieldLabel,
+ Input,
+ Sheet,
+ SheetContent,
+ SheetFooter,
+ SheetHeader,
+ SheetTitle,
+ TextArea
+} from "@app/components/v3";
+import { parseDurationMs, toDateTimeLocalInputValue } from "@app/helpers/datetime";
+import { useGetSignerPolicy, useRequestToSign } from "@app/hooks/api/signers";
+import {
+ pickDeclaredScope,
+ ScopeFieldsFormSection,
+ SigningScopeSchema
+} from "@app/pages/cert-manager/components/ScopeFieldsFormSection";
+import { PkiDocsUrls } from "@app/pages/cert-manager/pki-docs-urls";
+
+type Props = {
+ isOpen: boolean;
+ onOpenChange: (open: boolean) => void;
+ signerId: string;
+};
+
+const schema = z
+ .object({
+ requestedSignings: z.preprocess(
+ (v) => {
+ if (v === "" || v === null || v === undefined) return null;
+ const n = typeof v === "number" ? v : Number(v);
+ return Number.isNaN(n) ? v : n;
+ },
+ z
+ .union([z.number().int("Must be a whole number").min(1, "Must be at least 1"), z.null()])
+ .optional()
+ ),
+ requestedWindowStart: z.string().optional(),
+ requestedWindowEnd: z.string().optional(),
+ justification: z.string().trim().min(1, "Reason is required").max(2048),
+ scope: SigningScopeSchema
+ })
+ .refine((d) => d.requestedSignings || d.requestedWindowEnd, {
+ message: "Provide a signature count or a window end",
+ path: ["requestedSignings"]
+ });
+
+type FormData = z.infer<typeof schema>;
+
+const DEFAULT_SIGNING_WINDOW_MS = 24 * 60 * 60 * 1000;
+
+export const RequestToSignSheet = ({ isOpen, onOpenChange, signerId }: Props) => {
+ const requestToSign = useRequestToSign();
+ const { data: policy } = useGetSignerPolicy(signerId);
+ const [submitting, setSubmitting] = useState(false);
+
+ const maxSignings = policy?.constraints?.maxSignings ?? null;
+ const maxWindowDuration = policy?.constraints?.maxWindowDuration ?? null;
+
+ const buildDefaults = (): FormData => {
+ const now = Date.now();
+ const allowedMs = parseDurationMs(maxWindowDuration);
+ return {
+ requestedSignings: maxSignings ?? null,
+ requestedWindowStart: toDateTimeLocalInputValue(now),
+ requestedWindowEnd: toDateTimeLocalInputValue(now + (allowedMs ?? DEFAULT_SIGNING_WINDOW_MS)),
+ justification: "",
+ scope: []
+ };
+ };
+
+ const { control, handleSubmit, reset } = useForm<FormData>({
+ resolver: zodResolver(schema),
+ defaultValues: buildDefaults()
+ });
+
+ useEffect(() => {
+ if (!isOpen) reset(buildDefaults());
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [maxSignings, maxWindowDuration]);
+
+ const handleClose = (open: boolean) => {
+ if (!open) reset(buildDefaults());
+ onOpenChange(open);
+ };
+
+ const onSubmit = async (data: FormData) => {
+ setSubmitting(true);
+ try {
+ await requestToSign.mutateAsync({
+ signerId,
+ justification: data.justification,
+ requestedSignings: data.requestedSignings ?? undefined,
+ requestedWindowStart: data.requestedWindowStart
+ ? new Date(data.requestedWindowStart).toISOString()
+ : undefined,
+ requestedWindowEnd: data.requestedWindowEnd
+ ? new Date(data.requestedWindowEnd).toISOString()
+ : undefined,
+ scope: pickDeclaredScope(data.scope)
+ });
+ handleClose(false);
+ } catch {
+ // The mutation cache reports the failure, so showing it here would duplicate the toast.
+ // Caught only so the sheet stays open for another attempt.
+ } finally {
+ setSubmitting(false);
+ }
+ };
+
+ return (
+ <Sheet open={isOpen} onOpenChange={handleClose}>
+ <SheetContent className="flex h-full max-h-full flex-col gap-y-0 sm:max-w-[1100px]">
+ <SheetHeader className="border-b">
+ <SheetTitle>
+ <div className="flex w-full items-start gap-2">
+ <div className="flex h-10 w-10 items-center justify-center rounded-md bg-project/10 text-project">
+ <PenToolIcon className="h-5 w-5" />
+ </div>
+ <div>
+ <div className="flex items-center gap-x-2 text-mineshaft-300">Request to sign</div>
+ <p className="text-sm leading-4 text-mineshaft-400">
+ Ask the approvers to let you sign. Pick how many signatures you need and when.
+ </p>
+ </div>
+ </div>
+ </SheetTitle>
+ </SheetHeader>
+
+ <form className="flex min-h-0 flex-1 flex-col" onSubmit={handleSubmit(onSubmit)}>
+ <div className="flex min-h-0 flex-1 overflow-hidden">
+ <div className="flex min-w-0 flex-1 flex-col gap-y-2 overflow-y-auto px-8 py-6">
+ <FieldGroup>
+ <Controller
+ name="requestedSignings"
+ control={control}
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>How many signatures</FieldLabel>
+ <FieldContent>
+ <Input
+ type="number"
+ min={1}
+ max={maxSignings ?? undefined}
+ value={field.value ?? ""}
+ onChange={(e) => {
+ const raw = e.target.value;
+ field.onChange(raw === "" ? null : Number(raw));
+ }}
+ placeholder={
+ maxSignings
+ ? `Up to ${maxSignings}`
+ : "Leave empty to rely on the time window"
+ }
+ isError={Boolean(error)}
+ />
+ <FieldDescription>
+ {maxSignings
+ ? `Policy caps each approval at ${maxSignings} signature${maxSignings === 1 ? "" : "s"}.`
+ : "Leave empty to rely on the time window instead."}
+ </FieldDescription>
+ <FieldError errors={[error]} />
+ </FieldContent>
+ </Field>
+ )}
+ />
+
+ <div className="grid grid-cols-2 gap-3">
+ <Controller
+ name="requestedWindowStart"
+ control={control}
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>Starts</FieldLabel>
+ <FieldContent>
+ <Input
+ type="datetime-local"
+ value={field.value ?? ""}
+ onChange={(e) => field.onChange(e.target.value || undefined)}
+ isError={Boolean(error)}
+ />
+ <FieldDescription>When access starts.</FieldDescription>
+ <FieldError errors={[error]} />
+ </FieldContent>
+ </Field>
+ )}
+ />
+ <Controller
+ name="requestedWindowEnd"
+ control={control}
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>Ends</FieldLabel>
+ <FieldContent>
+ <Input
+ type="datetime-local"
+ value={field.value ?? ""}
+ onChange={(e) => field.onChange(e.target.value || undefined)}
+ isError={Boolean(error)}
+ />
+ <FieldDescription>When access ends.</FieldDescription>
+ <FieldError errors={[error]} />
+ </FieldContent>
+ </Field>
+ )}
+ />
+ </div>
+
+ <ScopeFieldsFormSection control={control} />
+
+ <Controller
+ name="justification"
+ control={control}
+ render={({ field, fieldState: { error } }) => (
+ <Field>
+ <FieldLabel>Reason</FieldLabel>
+ <FieldContent>
+ <TextArea
+ {...field}
+ placeholder="What are you signing?"
+ rows={3}
+ isError={Boolean(error)}
+ />
+ <FieldError errors={[error]} />
+ </FieldContent>
+ </Field>
+ )}
+ />
+ </FieldGroup>
+ </div>
+
+ <aside className="hidden w-80 shrink-0 flex-col gap-4 overflow-y-auto border-l border-border px-6 py-6 lg:flex">
+ <div className="mb-auto">
+ <div className="flex items-center justify-between gap-2">
+ <p className="text-[11px] font-medium tracking-wider text-muted uppercase">
+ Requesting access
+ </p>
+ <DocumentationLinkBadge href={PkiDocsUrls.codeSigning.approvals.requestToSign} />
+ </div>
+ <p className="mt-4 text-sm font-semibold text-foreground">What happens next</p>
+ <p className="mt-2 text-sm leading-relaxed text-muted">
+ Your request goes to this signer&apos;s approvers, and you cannot sign until one
+ of them approves it. On approval it becomes an access record with the signatures
+ and window you asked for. The window is measured from when you send the request,
+ not from when it is approved, so allow for review time.
+ </p>
+ </div>
+ </aside>
+ </div>
+
+ <SheetFooter className="flex-row items-center justify-end border-t">
+ <Button type="button" variant="outline" onClick={() => handleClose(false)}>
+ Cancel
+ </Button>
+ <Button type="submit" variant="project" isPending={submitting}>
+ Send request
+ </Button>
+ </SheetFooter>
+ </form>
+ </SheetContent>
+ </Sheet>
+ );
+};
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/SignerRequestsTab/SignerRequestsTab.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/SignerRequestsTab/SignerRequestsTab.tsx
index c37a7286ec..6b1c747874 100644
--- a/frontend/src/pages/cert-manager/SignerDetailPage/components/SignerRequestsTab/SignerRequestsTab.tsx
+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/SignerRequestsTab/SignerRequestsTab.tsx
@@ -48,8 +48,8 @@ import {
useListSignerRequests
} from "@app/hooks/api/signers";
-import { PreApproveSigningModal } from "../PreApproveSigningModal";
-import { RequestToSignModal } from "../RequestToSignModal";
+import { PreApproveSigningSheet } from "../PreApproveSigningSheet";
+import { RequestToSignSheet } from "../RequestToSignSheet";
import { ExpiresCell } from "./ExpiresCell";
import { KindIcon } from "./KindIcon";
import { RevokeRequestDialog } from "./RevokeRequestDialog";
@@ -361,12 +361,12 @@ export const SignerRequestsTab = ({ signerId, canPreApprove, canRequestSign }: P
</CardContent>
</Card>
- <RequestToSignModal
+ <RequestToSignSheet
isOpen={isRequestOpen}
onOpenChange={setIsRequestOpen}
signerId={signerId}
/>
- <PreApproveSigningModal
+ <PreApproveSigningSheet
isOpen={isPreApproveOpen}
onOpenChange={setIsPreApproveOpen}
signerId={signerId}
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/SigningOperationsTable.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/SigningOperationsTable.tsx
index d973451704..e61c6902af 100644
--- a/frontend/src/pages/cert-manager/SignerDetailPage/components/SigningOperationsTable.tsx
+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/SigningOperationsTable.tsx
@@ -30,9 +30,10 @@ import {
} from "@app/components/v3";
import { useOrganization } from "@app/context";
import {
+ getSigningOperationStatusBadgeVariant,
SIGNER_TABLE_PAGE_SIZE,
SigningActorType,
- SigningOperationStatus,
+ signingAlgorithmLabels,
signingOperationStatusLabels,
TSigner,
TSigningOperation,
@@ -47,31 +48,6 @@ type Props = {
projectId: string;
};
-const getStatusBadgeVariant = (status: SigningOperationStatus) => {
- switch (status) {
- case SigningOperationStatus.Success:
- return "success" as const;
- case SigningOperationStatus.Failed:
- return "danger" as const;
- case SigningOperationStatus.Denied:
- return "warning" as const;
- default:
- return "neutral" as const;
- }
-};
-
-const ALGORITHM_DISPLAY: Record<string, string> = {
- RSASSA_PKCS1_V1_5_SHA_256: "RSA PKCS#1 v1.5 (SHA-256)",
- RSASSA_PKCS1_V1_5_SHA_384: "RSA PKCS#1 v1.5 (SHA-384)",
- RSASSA_PKCS1_V1_5_SHA_512: "RSA PKCS#1 v1.5 (SHA-512)",
- RSASSA_PSS_SHA_256: "RSA-PSS (SHA-256)",
- RSASSA_PSS_SHA_384: "RSA-PSS (SHA-384)",
- RSASSA_PSS_SHA_512: "RSA-PSS (SHA-512)",
- ECDSA_SHA_256: "ECDSA (SHA-256)",
- ECDSA_SHA_384: "ECDSA (SHA-384)",
- ECDSA_SHA_512: "ECDSA (SHA-512)"
-};
-
const getActorDisplayName = (actorType: SigningActorType, actorName?: string | null) => {
if (actorName) return actorName;
@@ -181,20 +157,34 @@ export const SigningOperationsTable = ({ signer, signerId, projectId }: Props) =
))}
{!isLoading &&
operations.map((op) => (
- <TableRow key={op.id} className="[&>td]:py-3">
+ <TableRow
+ key={op.id}
+ className="cursor-pointer transition-colors hover:bg-mineshaft-700 [&>td]:py-3"
+ onClick={() =>
+ navigate({
+ to: "/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId/operations/$operationId",
+ params: {
+ orgId: currentOrg.id,
+ projectId,
+ signerId,
+ operationId: op.id
+ }
+ })
+ }
+ >
<TableCell>{format(new Date(op.createdAt), "MMM d, yyyy HH:mm:ss")}</TableCell>
<TableCell>
- <Badge variant={getStatusBadgeVariant(op.status)}>
+ <Badge variant={getSigningOperationStatusBadgeVariant(op.status)}>
{signingOperationStatusLabels[op.status] ?? op.status}
</Badge>
</TableCell>
<TableCell className="text-xs">
- {ALGORITHM_DISPLAY[op.signingAlgorithm] ?? op.signingAlgorithm}
+ {signingAlgorithmLabels[op.signingAlgorithm] ?? op.signingAlgorithm}
</TableCell>
<TableCell className="max-w-[120px] truncate font-mono text-xs">
{op.dataHash}
</TableCell>
- <TableCell>
+ <TableCell onClick={(e) => e.stopPropagation()}>
<Tooltip>
<TooltipTrigger asChild>
<div className="flex items-center gap-1.5">
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/index.ts b/frontend/src/pages/cert-manager/SignerDetailPage/components/index.ts
index c6a38f6941..d4efa097d4 100644
--- a/frontend/src/pages/cert-manager/SignerDetailPage/components/index.ts
+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/index.ts
@@ -1,7 +1,7 @@
export { EditSignerModal } from "./EditSignerModal";
export { EditSignerPolicyModal } from "./EditSignerPolicyModal";
-export { PreApproveSigningModal } from "./PreApproveSigningModal";
-export { RequestToSignModal } from "./RequestToSignModal";
+export { PreApproveSigningSheet } from "./PreApproveSigningSheet";
+export { RequestToSignSheet } from "./RequestToSignSheet";
export { SignerApprovalPolicyTab } from "./SignerApprovalPolicyTab";
export { SignerMembersTab } from "./SignerMembersTab";
export { SignerRequestsTab } from "./SignerRequestsTab";
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/route.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/route.tsx
index 1bc34de1dd..328f75d4ca 100644
--- a/frontend/src/pages/cert-manager/SignerDetailPage/route.tsx
+++ b/frontend/src/pages/cert-manager/SignerDetailPage/route.tsx
@@ -9,7 +9,7 @@ const SignerDetailSearchSchema = z.object({
});
export const Route = createFileRoute(
- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId"
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/"
)({
component: SignerDetailPage,
validateSearch: zodValidator(SignerDetailSearchSchema),
diff --git a/frontend/src/pages/cert-manager/SigningOperationDetailPage/SigningOperationDetailPage.tsx b/frontend/src/pages/cert-manager/SigningOperationDetailPage/SigningOperationDetailPage.tsx
new file mode 100644
index 0000000000..595de938e3
--- /dev/null
+++ b/frontend/src/pages/cert-manager/SigningOperationDetailPage/SigningOperationDetailPage.tsx
@@ -0,0 +1,186 @@
+import { Helmet } from "react-helmet";
+import { Link, useParams } from "@tanstack/react-router";
+import { format } from "date-fns";
+import { ChevronLeftIcon, FileSignatureIcon, HardDriveIcon, UserIcon } from "lucide-react";
+
+import {
+ Badge,
+ Card,
+ CardContent,
+ CopyButton,
+ Detail,
+ DetailGroup,
+ DetailGroupHeader,
+ DetailLabel,
+ DetailValue,
+ Empty,
+ EmptyDescription,
+ EmptyTitle,
+ PageLoader
+} from "@app/components/v3";
+import { useOrganization, useProject } from "@app/context";
+import {
+ getSigningOperationStatusBadgeVariant,
+ SigningActorType,
+ signingAlgorithmLabels,
+ signingOperationStatusLabels,
+ useGetSigningOperation
+} from "@app/hooks/api/signers";
+
+const ROUTE_ID =
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/operations/$operationId" as const;
+
+const MonoValue = ({ value }: { value: string }) => (
+ <DetailValue className="flex items-center gap-2 font-mono text-xs break-all">
+ {value}
+ <CopyButton value={value} ariaLabel="Copy value" />
+ </DetailValue>
+);
+
+export const SigningOperationDetailPage = () => {
+ const { signerId, operationId } = useParams({ from: ROUTE_ID });
+ const { currentOrg } = useOrganization();
+ const { currentProject } = useProject();
+ const { data, isPending } = useGetSigningOperation(signerId, operationId);
+
+ if (isPending) return <PageLoader />;
+
+ if (!data) {
+ return (
+ <div className="mx-auto flex max-w-4xl flex-col px-6 py-6">
+ <Empty className="border border-solid">
+ <EmptyTitle>Signing operation not found</EmptyTitle>
+ <EmptyDescription>
+ The operation may belong to a different signer, or you may not have access to it.
+ </EmptyDescription>
+ </Empty>
+ </div>
+ );
+ }
+
+ const { operation, signerName } = data;
+ const metadata = operation.clientMetadata;
+
+ return (
+ <div className="mx-auto flex max-w-5xl flex-col gap-y-4 px-6 py-6">
+ <Helmet>
+ <title>Signing Operation | {signerName}</title>
+ </Helmet>
+
+ <Link
+ to="/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId"
+ params={{ orgId: currentOrg.id, projectId: currentProject.id, signerId }}
+ search={{ selectedTab: "activity" }}
+ className="flex w-fit items-center gap-1 text-sm text-muted transition-colors hover:text-foreground"
+ >
+ <ChevronLeftIcon className="size-4" />
+ Back to {signerName}
+ </Link>
+
+ <div className="flex items-start gap-3">
+ <div className="flex h-10 w-10 items-center justify-center rounded-md bg-mineshaft-800 text-muted">
+ <FileSignatureIcon className="h-5 w-5" />
+ </div>
+ <div className="min-w-0">
+ <div className="flex items-center gap-2">
+ <h1 className="text-xl font-semibold text-foreground">Signing Operation</h1>
+ <Badge variant={getSigningOperationStatusBadgeVariant(operation.status)}>
+ {signingOperationStatusLabels[operation.status] ?? operation.status}
+ </Badge>
+ </div>
+ <p className="text-sm text-muted">
+ {format(new Date(operation.createdAt), "MMM d, yyyy 'at' HH:mm:ss")} · {signerName}
+ </p>
+ </div>
+ </div>
+
+ <Card>
+ <CardContent>
+ <DetailGroup>
+ <div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
+ <Detail>
+ <DetailLabel>Algorithm</DetailLabel>
+ <DetailValue>
+ {signingAlgorithmLabels[operation.signingAlgorithm] ?? operation.signingAlgorithm}
+ </DetailValue>
+ </Detail>
+ <Detail>
+ <DetailLabel>Actor</DetailLabel>
+ <DetailValue className="flex items-center gap-1.5">
+ {operation.actorType === SigningActorType.User ? (
+ <UserIcon className="size-3.5 text-muted" />
+ ) : (
+ <HardDriveIcon className="size-3.5 text-muted" />
+ )}
+ {operation.actorName ?? operation.actorId}
+ </DetailValue>
+ </Detail>
+ </div>
+ <Detail>
+ <DetailLabel>Data Digest (SHA-256)</DetailLabel>
+ <MonoValue value={operation.dataHash} />
+ </Detail>
+ {operation.errorMessage && (
+ <Detail>
+ <DetailLabel>Error</DetailLabel>
+ <DetailValue className="text-danger">{operation.errorMessage}</DetailValue>
+ </Detail>
+ )}
+
+ {metadata && Object.values(metadata).some(Boolean) && (
+ <>
+ <DetailGroupHeader className="mt-2 border-t border-border pt-4">
+ Client Context
+ </DetailGroupHeader>
+ {metadata.command && (
+ <Detail>
+ <DetailLabel>Command</DetailLabel>
+ <MonoValue value={metadata.command} />
+ </Detail>
+ )}
+ <div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
+ {metadata.tool && (
+ <Detail>
+ <DetailLabel>Signing Application</DetailLabel>
+ <DetailValue>{metadata.tool}</DetailValue>
+ </Detail>
+ )}
+ {metadata.hostname && (
+ <Detail>
+ <DetailLabel>Hostname</DetailLabel>
+ <DetailValue>{metadata.hostname}</DetailValue>
+ </Detail>
+ )}
+ {metadata.osUsername && (
+ <Detail>
+ <DetailLabel>OS Username</DetailLabel>
+ <DetailValue>{metadata.osUsername}</DetailValue>
+ </Detail>
+ )}
+ {metadata.sourceIp && (
+ <Detail>
+ <DetailLabel>IP Address</DetailLabel>
+ <DetailValue>{metadata.sourceIp}</DetailValue>
+ </Detail>
+ )}
+ {metadata.reportedIp && (
+ <Detail>
+ <DetailLabel>Reported IP</DetailLabel>
+ <DetailValue>{metadata.reportedIp}</DetailValue>
+ </Detail>
+ )}
+ </div>
+ {metadata.signingApplicationHash && (
+ <Detail>
+ <DetailLabel>Signing Application Checksum</DetailLabel>
+ <MonoValue value={metadata.signingApplicationHash} />
+ </Detail>
+ )}
+ </>
+ )}
+ </DetailGroup>
+ </CardContent>
+ </Card>
+ </div>
+ );
+};
diff --git a/frontend/src/pages/cert-manager/SigningOperationDetailPage/route.tsx b/frontend/src/pages/cert-manager/SigningOperationDetailPage/route.tsx
new file mode 100644
index 0000000000..8c47b6d806
--- /dev/null
+++ b/frontend/src/pages/cert-manager/SigningOperationDetailPage/route.tsx
@@ -0,0 +1,22 @@
+import { createFileRoute } from "@tanstack/react-router";
+
+import { SigningOperationDetailPage } from "./SigningOperationDetailPage";
+
+export const Route = createFileRoute(
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/operations/$operationId"
+)({
+ component: SigningOperationDetailPage,
+ beforeLoad: ({ context }) => {
+ return {
+ breadcrumbs: [
+ ...context.breadcrumbs,
+ {
+ label: "Code Signing"
+ },
+ {
+ label: "Signing Operation"
+ }
+ ]
+ };
+ }
+});
diff --git a/frontend/src/pages/cert-manager/components/ScopeFieldsFormSection.tsx b/frontend/src/pages/cert-manager/components/ScopeFieldsFormSection.tsx
new file mode 100644
index 0000000000..459254c11f
--- /dev/null
+++ b/frontend/src/pages/cert-manager/components/ScopeFieldsFormSection.tsx
@@ -0,0 +1,271 @@
+import {
+ ArrayPath,
+ Control,
+ Controller,
+ FieldValues,
+ Path,
+ useFieldArray,
+ useWatch
+} from "react-hook-form";
+import { Info, ListFilter, Plus, Trash2 } from "lucide-react";
+import { z } from "zod";
+
+import {
+ Button,
+ Empty,
+ EmptyContent,
+ EmptyMedia,
+ EmptyTitle,
+ Field,
+ FieldContent,
+ FieldDescription,
+ FieldError,
+ FieldTitle,
+ Input,
+ Select,
+ SelectContent,
+ SelectItem,
+ SelectTrigger,
+ SelectValue,
+ Tooltip,
+ TooltipContent,
+ TooltipTrigger
+} from "@app/components/v3";
+import {
+ CodeSigningScopeField,
+ codeSigningScopeFieldDescriptions,
+ codeSigningScopeFieldLabels,
+ codeSigningScopeFieldMatchRules,
+ MONOSPACED_SCOPE_FIELDS,
+ TCodeSigningScope
+} from "@app/hooks/api/signers";
+
+const MAX_COMMAND_LENGTH = 2048;
+const MAX_SCOPE_TEXT_LENGTH = 256;
+const SHA256_HEX = /^[a-fA-F0-9]{64}$/;
+
+const validateScopeValue = (field: CodeSigningScopeField, value: string): string | undefined => {
+ switch (field) {
+ case CodeSigningScopeField.SigningApplicationHash:
+ case CodeSigningScopeField.DataHash:
+ return SHA256_HEX.test(value) ? undefined : "Must be a 64-character SHA-256 hex digest";
+ case CodeSigningScopeField.IpAddress:
+ return z.string().ip().safeParse(value).success ? undefined : "Must be a valid IP address";
+ case CodeSigningScopeField.Command:
+ return value.length <= MAX_COMMAND_LENGTH
+ ? undefined
+ : `Must be ${MAX_COMMAND_LENGTH} characters or fewer`;
+ default:
+ return value.length <= MAX_SCOPE_TEXT_LENGTH
+ ? undefined
+ : `Must be ${MAX_SCOPE_TEXT_LENGTH} characters or fewer`;
+ }
+};
+
+export const SigningScopeSchema = z
+ .array(
+ z.object({
+ field: z.nativeEnum(CodeSigningScopeField),
+ value: z.string().trim()
+ })
+ )
+ .superRefine((entries, ctx) => {
+ const seen = new Set<CodeSigningScopeField>();
+ entries.forEach((entry, index) => {
+ if (!entry.value) {
+ ctx.addIssue({
+ code: z.ZodIssueCode.custom,
+ path: [index, "value"],
+ message: "Enter a value, or remove this parameter"
+ });
+ return;
+ }
+ const problem = validateScopeValue(entry.field, entry.value);
+ if (problem) {
+ ctx.addIssue({ code: z.ZodIssueCode.custom, path: [index, "value"], message: problem });
+ }
+ if (seen.has(entry.field)) {
+ ctx.addIssue({
+ code: z.ZodIssueCode.custom,
+ path: [index, "field"],
+ message: `${codeSigningScopeFieldLabels[entry.field]} is already scoped`
+ });
+ }
+ seen.add(entry.field);
+ });
+ });
+
+type TScopeEntry = { field: CodeSigningScopeField; value: string };
+
+export const pickDeclaredScope = (
+ entries: TScopeEntry[] | undefined
+): TCodeSigningScope | undefined => {
+ const declared: TCodeSigningScope = {};
+ entries?.forEach(({ field, value }) => {
+ const trimmed = value?.trim();
+ if (trimmed) declared[field] = trimmed;
+ });
+ return Object.keys(declared).length > 0 ? declared : undefined;
+};
+
+const FIELD_PLACEHOLDERS: Record<CodeSigningScopeField, string> = {
+ [CodeSigningScopeField.Command]: "signtool sign /fd sha256 /f cert.pfx installer-v2.4.0.msi",
+ [CodeSigningScopeField.SigningApplication]: "signtool.exe",
+ [CodeSigningScopeField.SigningApplicationHash]:
+ "8f677ab944beafd2cc37af6c173beb116b91b2400c9dfd3b7ae218b15b3c11b3",
+ [CodeSigningScopeField.Hostname]: "win-build-agent-02",
+ [CodeSigningScopeField.OsUsername]: "svc-release",
+ [CodeSigningScopeField.IpAddress]: "203.0.113.10",
+ [CodeSigningScopeField.DataHash]:
+ "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"
+};
+
+const SCOPE_FIELD_ORDER = Object.values(CodeSigningScopeField);
+
+const ScopeFieldHint = ({ field }: { field?: CodeSigningScopeField }) => {
+ if (!field) return null;
+
+ return (
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span className="mt-2.5 shrink-0">
+ <Info className="size-3.5 text-muted" />
+ </span>
+ </TooltipTrigger>
+ <TooltipContent className="max-w-xs space-y-1.5">
+ <p>{codeSigningScopeFieldDescriptions[field]}</p>
+ <p>{codeSigningScopeFieldMatchRules[field]}</p>
+ </TooltipContent>
+ </Tooltip>
+ );
+};
+
+type Props<TFieldValues extends FieldValues & { scope?: TScopeEntry[] }> = {
+ control: Control<TFieldValues>;
+};
+
+export const ScopeFieldsFormSection = <
+ TFieldValues extends FieldValues & { scope?: TScopeEntry[] }
+>({
+ control
+}: Props<TFieldValues>) => {
+ const { fields, append, remove } = useFieldArray({
+ control,
+ name: "scope" as ArrayPath<TFieldValues>
+ });
+ const entries = useWatch({ control, name: "scope" as Path<TFieldValues> }) as
+ | TScopeEntry[]
+ | undefined;
+ const used = new Set(entries?.map((entry) => entry?.field));
+ const nextUnused = SCOPE_FIELD_ORDER.find((field) => !used.has(field));
+ const addParameter = () => {
+ if (nextUnused) append({ field: nextUnused, value: "" } as never);
+ };
+
+ return (
+ <div>
+ <FieldTitle>Scope this request (Optional)</FieldTitle>
+ <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.
+ </FieldDescription>
+
+ <div className="mt-3">
+ <div className="flex flex-col gap-2">
+ {fields.length === 0 && (
+ <Empty className="border py-8">
+ <EmptyMedia variant="icon">
+ <ListFilter />
+ </EmptyMedia>
+ <EmptyTitle>No parameters added</EmptyTitle>
+ <EmptyContent>
+ <Button type="button" variant="outline" size="sm" onClick={addParameter}>
+ <Plus className="size-4" /> Add parameter
+ </Button>
+ </EmptyContent>
+ </Empty>
+ )}
+
+ {fields.map((row, index) => (
+ <div key={row.id} className="flex items-start gap-2">
+ <Controller
+ name={`scope.${index}.field` as Path<TFieldValues>}
+ control={control}
+ render={({ field, fieldState: { error } }) => (
+ <Field className="w-48 shrink-0">
+ <FieldContent>
+ <Select value={field.value} onValueChange={field.onChange}>
+ <SelectTrigger className="w-full" isError={Boolean(error)}>
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent position="popper">
+ {SCOPE_FIELD_ORDER.map((scopeField) => (
+ <SelectItem
+ key={scopeField}
+ value={scopeField}
+ description={codeSigningScopeFieldDescriptions[scopeField]}
+ >
+ {codeSigningScopeFieldLabels[scopeField]}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ <FieldError errors={[error]} />
+ </FieldContent>
+ </Field>
+ )}
+ />
+ <ScopeFieldHint field={entries?.[index]?.field} />
+ <Controller
+ name={`scope.${index}.value` as Path<TFieldValues>}
+ control={control}
+ render={({ field, fieldState: { error } }) => {
+ const selected = entries?.[index]?.field;
+ return (
+ <Field className="flex-1">
+ <FieldContent>
+ <Input
+ {...field}
+ value={field.value ?? ""}
+ placeholder={selected ? FIELD_PLACEHOLDERS[selected] : ""}
+ className={
+ selected && MONOSPACED_SCOPE_FIELDS.includes(selected)
+ ? "font-mono text-xs"
+ : undefined
+ }
+ isError={Boolean(error)}
+ />
+ <FieldError errors={[error]} />
+ </FieldContent>
+ </Field>
+ );
+ }}
+ />
+ <Button
+ type="button"
+ variant="ghost"
+ size="sm"
+ aria-label="Remove parameter"
+ onClick={() => remove(index)}
+ >
+ <Trash2 className="size-4" />
+ </Button>
+ </div>
+ ))}
+
+ {nextUnused && fields.length > 0 && (
+ <Button
+ type="button"
+ variant="outline"
+ size="sm"
+ className="w-fit"
+ onClick={addParameter}
+ >
+ <Plus className="size-4" /> Add parameter
+ </Button>
+ )}
+ </div>
+ </div>
+ </div>
+ );
+};
diff --git a/frontend/src/routeTree.gen.ts b/frontend/src/routeTree.gen.ts
index 3d5c51ede8..b95aca8039 100644
--- a/frontend/src/routeTree.gen.ts
+++ b/frontend/src/routeTree.gen.ts
@@ -166,7 +166,6 @@ import { Route as certManagerPkiSubscriberDetailsByIDPageRouteImport } from './p
import { Route as certManagerPkiSyncDetailsByIDPageRouteImport } from './pages/cert-manager/PkiSyncDetailsByIDPage/route'
import { Route as certManagerHsmConnectorDetailsByIDPageRouteImport } from './pages/cert-manager/HsmConnectorDetailsByIDPage/route'
import { Route as certManagerDiscoveryDetailsByIDPageRouteImport } from './pages/cert-manager/DiscoveryDetailsByIDPage/route'
-import { Route as certManagerSignerDetailPageRouteImport } from './pages/cert-manager/SignerDetailPage/route'
import { Route as certManagerCertificateDetailsByIDPageRouteImport } from './pages/cert-manager/CertificateDetailsByIDPage/route'
import { Route as certManagerCertificateProfileDetailsByIDPageRouteImport } from './pages/cert-manager/CertificateProfileDetailsByIDPage/route'
import { Route as certManagerCertificatePolicyDetailsByIDPageRouteImport } from './pages/cert-manager/CertificatePolicyDetailsByIDPage/route'
@@ -251,6 +250,7 @@ import { Route as secretManagerIntegrationsAwsSecretManagerAuthorizePageRouteImp
import { Route as secretManagerIntegrationsAwsParameterStoreConfigurePageRouteImport } from './pages/secret-manager/integrations/AwsParameterStoreConfigurePage/route'
import { Route as secretManagerIntegrationsAwsParameterStoreAuthorizePageRouteImport } from './pages/secret-manager/integrations/AwsParameterStoreAuthorizePage/route'
import { Route as certManagerInstallationDetailsByIDPageRouteImport } from './pages/cert-manager/InstallationDetailsByIDPage/route'
+import { Route as certManagerSignerDetailPageRouteImport } from './pages/cert-manager/SignerDetailPage/route'
import { Route as secretManagerIntegrationsVercelOauthCallbackPageRouteImport } from './pages/secret-manager/integrations/VercelOauthCallbackPage/route'
import { Route as secretManagerSecretSyncDetailsByIDPageRouteImport } from './pages/secret-manager/SecretSyncDetailsByIDPage/route'
import { Route as secretManagerIntegrationsNetlifyOauthCallbackPageRouteImport } from './pages/secret-manager/integrations/NetlifyOauthCallbackPage/route'
@@ -261,6 +261,7 @@ import { Route as secretManagerIntegrationsGcpSecretManagerOauthCallbackPageRout
import { Route as secretManagerIntegrationsBitbucketOauthCallbackPageRouteImport } from './pages/secret-manager/integrations/BitbucketOauthCallbackPage/route'
import { Route as secretManagerIntegrationsAzureKeyVaultOauthCallbackPageRouteImport } from './pages/secret-manager/integrations/AzureKeyVaultOauthCallbackPage/route'
import { Route as secretManagerIntegrationsAzureAppConfigurationOauthCallbackPageRouteImport } from './pages/secret-manager/integrations/AzureAppConfigurationOauthCallbackPage/route'
+import { Route as certManagerSigningOperationDetailPageRouteImport } from './pages/cert-manager/SigningOperationDetailPage/route'
import { Route as secretManagerCommitsPageRouteImport } from './pages/secret-manager/CommitsPage/route'
import { Route as secretManagerCommitDetailsPageComponentsRollbackPreviewTabRouteImport } from './pages/secret-manager/CommitDetailsPage/components/RollbackPreviewTab/route'
import { Route as secretManagerCommitDetailsPageRouteImport } from './pages/secret-manager/CommitDetailsPage/route'
@@ -382,6 +383,10 @@ const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManager
createFileRoute(
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/applications',
)()
+const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdImport =
+ createFileRoute(
+ '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId',
+ )()
const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementProjectIdSecretManagerLayoutCommitsEnvironmentFolderIdImport =
createFileRoute(
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/commits/$environment/$folderId',
@@ -1676,6 +1681,16 @@ const projectGroupDetailsByIDPageRouteCertManagerRoute =
getParentRoute: () => certManagerLayoutRoute,
} as any)
+const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRoute =
+ AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdImport.update(
+ {
+ id: '/$signerId',
+ path: '/$signerId',
+ getParentRoute: () =>
+ AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningRoute,
+ } as any,
+ )
+
const secretManagerSecretDashboardPageRouteRoute =
secretManagerSecretDashboardPageRouteImport.update({
id: '/secrets/$envSlug',
@@ -1730,14 +1745,6 @@ const certManagerDiscoveryDetailsByIDPageRouteRoute =
AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutDiscoveryRoute,
} as any)
-const certManagerSignerDetailPageRouteRoute =
- certManagerSignerDetailPageRouteImport.update({
- id: '/$signerId',
- path: '/$signerId',
- getParentRoute: () =>
- AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningRoute,
- } as any)
-
const certManagerCertificateDetailsByIDPageRouteRoute =
certManagerCertificateDetailsByIDPageRouteImport.update({
id: '/certificates/$certificateId',
@@ -2423,6 +2430,14 @@ const certManagerInstallationDetailsByIDPageRouteRoute =
AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutDiscoveryRoute,
} as any)
+const certManagerSignerDetailPageRouteRoute =
+ certManagerSignerDetailPageRouteImport.update({
+ id: '/',
+ path: '/',
+ getParentRoute: () =>
+ AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRoute,
+ } as any)
+
const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementProjectIdSecretManagerLayoutCommitsEnvironmentFolderIdCommitIdRoute =
AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementProjectIdSecretManagerLayoutCommitsEnvironmentFolderIdCommitIdImport.update(
{
@@ -2515,6 +2530,14 @@ const secretManagerIntegrationsAzureAppConfigurationOauthCallbackPageRouteRoute
} as any,
)
+const certManagerSigningOperationDetailPageRouteRoute =
+ certManagerSigningOperationDetailPageRouteImport.update({
+ id: '/operations/$operationId',
+ path: '/operations/$operationId',
+ getParentRoute: () =>
+ AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRoute,
+ } as any)
+
const secretManagerCommitsPageRouteRoute =
secretManagerCommitsPageRouteImport.update({
id: '/',
@@ -3775,13 +3798,6 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof certManagerCertificateDetailsByIDPageRouteImport
parentRoute: typeof certManagerLayoutImport
}
- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId': {
- id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId'
- path: '/$signerId'
- fullPath: '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId'
- preLoaderRoute: typeof certManagerSignerDetailPageRouteImport
- parentRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningImport
- }
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/$discoveryId': {
id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/$discoveryId'
path: '/$discoveryId'
@@ -3831,6 +3847,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof secretManagerSecretDashboardPageRouteImport
parentRoute: typeof secretManagerLayoutImport
}
+ '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId': {
+ id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId'
+ path: '/$signerId'
+ fullPath: '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId'
+ preLoaderRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdImport
+ parentRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningImport
+ }
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/groups/$groupId': {
id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/groups/$groupId'
path: '/groups/$groupId'
@@ -3950,6 +3973,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof projectRoleDetailsBySlugPageRouteSecretScanningImport
parentRoute: typeof secretScanningLayoutImport
}
+ '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/': {
+ id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/'
+ path: '/'
+ fullPath: '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId/'
+ preLoaderRoute: typeof certManagerSignerDetailPageRouteImport
+ parentRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdImport
+ }
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/installations/$installationId': {
id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/installations/$installationId'
path: '/installations/$installationId'
@@ -4433,6 +4463,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof secretManagerCommitsPageRouteImport
parentRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementProjectIdSecretManagerLayoutCommitsEnvironmentFolderIdImport
}
+ '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/operations/$operationId': {
+ id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/operations/$operationId'
+ path: '/operations/$operationId'
+ fullPath: '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId/operations/$operationId'
+ preLoaderRoute: typeof certManagerSigningOperationDetailPageRouteImport
+ parentRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdImport
+ }
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/azure-app-configuration/oauth2/callback': {
id: '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/azure-app-configuration/oauth2/callback'
path: '/azure-app-configuration/oauth2/callback'
@@ -4654,16 +4691,34 @@ const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManager
AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCertificateTemplatesRouteChildren,
)
+interface AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRouteChildren {
+ certManagerSignerDetailPageRouteRoute: typeof certManagerSignerDetailPageRouteRoute
+ certManagerSigningOperationDetailPageRouteRoute: typeof certManagerSigningOperationDetailPageRouteRoute
+}
+
+const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRouteChildren: AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRouteChildren =
+ {
+ certManagerSignerDetailPageRouteRoute:
+ certManagerSignerDetailPageRouteRoute,
+ certManagerSigningOperationDetailPageRouteRoute:
+ certManagerSigningOperationDetailPageRouteRoute,
+ }
+
+const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRouteWithChildren =
+ AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRoute._addFileChildren(
+ AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRouteChildren,
+ )
+
interface AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningRouteChildren {
certManagerCodeSigningPageRouteRoute: typeof certManagerCodeSigningPageRouteRoute
- certManagerSignerDetailPageRouteRoute: typeof certManagerSignerDetailPageRouteRoute
+ AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRoute: typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRouteWithChildren
}
const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningRouteChildren: AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningRouteChildren =
{
certManagerCodeSigningPageRouteRoute: certManagerCodeSigningPageRouteRoute,
- certManagerSignerDetailPageRouteRoute:
- certManagerSignerDetailPageRouteRoute,
+ AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRoute:
+ AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRouteWithChildren,
}
const AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningRouteWithChildren =
@@ -5959,7 +6014,6 @@ export interface FileRoutesByFullPath {
'/organizations/$orgId/projects/cert-manager/$projectId/certificate-policies/$policyId': typeof certManagerCertificatePolicyDetailsByIDPageRouteRoute
'/organizations/$orgId/projects/cert-manager/$projectId/certificate-profiles/$profileId': typeof certManagerCertificateProfileDetailsByIDPageRouteRoute
'/organizations/$orgId/projects/cert-manager/$projectId/certificates/$certificateId': typeof certManagerCertificateDetailsByIDPageRouteRoute
- '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId': typeof certManagerSignerDetailPageRouteRoute
'/organizations/$orgId/projects/cert-manager/$projectId/discovery/$discoveryId': typeof certManagerDiscoveryDetailsByIDPageRouteRoute
'/organizations/$orgId/projects/cert-manager/$projectId/hsm-connectors/$connectorId': typeof certManagerHsmConnectorDetailsByIDPageRouteRoute
'/organizations/$orgId/projects/cert-manager/$projectId/integrations/$syncId': typeof certManagerPkiSyncDetailsByIDPageRouteRoute
@@ -5967,6 +6021,7 @@ export interface FileRoutesByFullPath {
'/organizations/$orgId/projects/secret-management/$projectId/integrations/$integrationId': typeof secretManagerIntegrationsDetailsByIDPageRouteRoute
'/organizations/$orgId/projects/secret-management/$projectId/integrations/select-integration-auth': typeof secretManagerIntegrationsSelectIntegrationAuthPageRouteRoute
'/organizations/$orgId/projects/secret-management/$projectId/secrets/$envSlug': typeof secretManagerSecretDashboardPageRouteRoute
+ '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRouteWithChildren
'/organizations/$orgId/projects/cert-manager/$projectId/groups/$groupId': typeof projectGroupDetailsByIDPageRouteCertManagerRoute
'/organizations/$orgId/projects/cert-manager/$projectId/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteCertManagerRoute
'/organizations/$orgId/projects/cert-manager/$projectId/members/$membershipId': typeof projectMemberDetailsByIDPageRouteCertManagerRoute
@@ -5984,6 +6039,7 @@ export interface FileRoutesByFullPath {
'/organizations/$orgId/projects/secret-scanning/$projectId/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteSecretScanningRoute
'/organizations/$orgId/projects/secret-scanning/$projectId/members/$membershipId': typeof projectMemberDetailsByIDPageRouteSecretScanningRoute
'/organizations/$orgId/projects/secret-scanning/$projectId/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRouteSecretScanningRoute
+ '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId/': typeof certManagerSignerDetailPageRouteRoute
'/organizations/$orgId/projects/cert-manager/$projectId/discovery/installations/$installationId': typeof certManagerInstallationDetailsByIDPageRouteRoute
'/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/authorize': typeof secretManagerIntegrationsAwsParameterStoreAuthorizePageRouteRoute
'/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/create': typeof secretManagerIntegrationsAwsParameterStoreConfigurePageRouteRoute
@@ -6053,6 +6109,7 @@ export interface FileRoutesByFullPath {
'/organizations/$orgId/projects/secret-scanning/$projectId/data-sources/$type/$dataSourceId': typeof secretScanningSecretScanningDataSourceByIdPageRouteRoute
'/organizations/$orgId/projects/secret-management/$projectId/commits/$environment/$folderId': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementProjectIdSecretManagerLayoutCommitsEnvironmentFolderIdRouteWithChildren
'/organizations/$orgId/projects/secret-management/$projectId/commits/$environment/$folderId/': typeof secretManagerCommitsPageRouteRoute
+ '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId/operations/$operationId': typeof certManagerSigningOperationDetailPageRouteRoute
'/organizations/$orgId/projects/secret-management/$projectId/integrations/azure-app-configuration/oauth2/callback': typeof secretManagerIntegrationsAzureAppConfigurationOauthCallbackPageRouteRoute
'/organizations/$orgId/projects/secret-management/$projectId/integrations/azure-key-vault/oauth2/callback': typeof secretManagerIntegrationsAzureKeyVaultOauthCallbackPageRouteRoute
'/organizations/$orgId/projects/secret-management/$projectId/integrations/bitbucket/oauth2/callback': typeof secretManagerIntegrationsBitbucketOauthCallbackPageRouteRoute
@@ -6212,7 +6269,6 @@ export interface FileRoutesByTo {
'/organizations/$orgId/projects/cert-manager/$projectId/certificate-policies/$policyId': typeof certManagerCertificatePolicyDetailsByIDPageRouteRoute
'/organizations/$orgId/projects/cert-manager/$projectId/certificate-profiles/$profileId': typeof certManagerCertificateProfileDetailsByIDPageRouteRoute
'/organizations/$orgId/projects/cert-manager/$projectId/certificates/$certificateId': typeof certManagerCertificateDetailsByIDPageRouteRoute
- '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId': typeof certManagerSignerDetailPageRouteRoute
'/organizations/$orgId/projects/cert-manager/$projectId/discovery/$discoveryId': typeof certManagerDiscoveryDetailsByIDPageRouteRoute
'/organizations/$orgId/projects/cert-manager/$projectId/hsm-connectors/$connectorId': typeof certManagerHsmConnectorDetailsByIDPageRouteRoute
'/organizations/$orgId/projects/cert-manager/$projectId/integrations/$syncId': typeof certManagerPkiSyncDetailsByIDPageRouteRoute
@@ -6237,6 +6293,7 @@ export interface FileRoutesByTo {
'/organizations/$orgId/projects/secret-scanning/$projectId/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteSecretScanningRoute
'/organizations/$orgId/projects/secret-scanning/$projectId/members/$membershipId': typeof projectMemberDetailsByIDPageRouteSecretScanningRoute
'/organizations/$orgId/projects/secret-scanning/$projectId/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRouteSecretScanningRoute
+ '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId': typeof certManagerSignerDetailPageRouteRoute
'/organizations/$orgId/projects/cert-manager/$projectId/discovery/installations/$installationId': typeof certManagerInstallationDetailsByIDPageRouteRoute
'/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/authorize': typeof secretManagerIntegrationsAwsParameterStoreAuthorizePageRouteRoute
'/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/create': typeof secretManagerIntegrationsAwsParameterStoreConfigurePageRouteRoute
@@ -6305,6 +6362,7 @@ export interface FileRoutesByTo {
'/organizations/$orgId/projects/secret-management/$projectId/integrations/windmill/create': typeof secretManagerIntegrationsWindmillConfigurePageRouteRoute
'/organizations/$orgId/projects/secret-scanning/$projectId/data-sources/$type/$dataSourceId': typeof secretScanningSecretScanningDataSourceByIdPageRouteRoute
'/organizations/$orgId/projects/secret-management/$projectId/commits/$environment/$folderId': typeof secretManagerCommitsPageRouteRoute
+ '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId/operations/$operationId': typeof certManagerSigningOperationDetailPageRouteRoute
'/organizations/$orgId/projects/secret-management/$projectId/integrations/azure-app-configuration/oauth2/callback': typeof secretManagerIntegrationsAzureAppConfigurationOauthCallbackPageRouteRoute
'/organizations/$orgId/projects/secret-management/$projectId/integrations/azure-key-vault/oauth2/callback': typeof secretManagerIntegrationsAzureKeyVaultOauthCallbackPageRouteRoute
'/organizations/$orgId/projects/secret-management/$projectId/integrations/bitbucket/oauth2/callback': typeof secretManagerIntegrationsBitbucketOauthCallbackPageRouteRoute
@@ -6497,7 +6555,6 @@ export interface FileRoutesById {
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/certificate-policies/$policyId': typeof certManagerCertificatePolicyDetailsByIDPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/certificate-profiles/$profileId': typeof certManagerCertificateProfileDetailsByIDPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/certificates/$certificateId': typeof certManagerCertificateDetailsByIDPageRouteRoute
- '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId': typeof certManagerSignerDetailPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/$discoveryId': typeof certManagerDiscoveryDetailsByIDPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/hsm-connectors/$connectorId': typeof certManagerHsmConnectorDetailsByIDPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/integrations/$syncId': typeof certManagerPkiSyncDetailsByIDPageRouteRoute
@@ -6505,6 +6562,7 @@ export interface FileRoutesById {
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/$integrationId': typeof secretManagerIntegrationsDetailsByIDPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/select-integration-auth': typeof secretManagerIntegrationsSelectIntegrationAuthPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/secrets/$envSlug': typeof secretManagerSecretDashboardPageRouteRoute
+ '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsCertManagerProjectIdCertManagerLayoutCodeSigningSignerIdRouteWithChildren
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/groups/$groupId': typeof projectGroupDetailsByIDPageRouteCertManagerRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteCertManagerRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/members/$membershipId': typeof projectMemberDetailsByIDPageRouteCertManagerRoute
@@ -6522,6 +6580,7 @@ export interface FileRoutesById {
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/identities/$identityId': typeof projectIdentityDetailsByIDPageRouteSecretScanningRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/members/$membershipId': typeof projectMemberDetailsByIDPageRouteSecretScanningRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/roles/$roleSlug': typeof projectRoleDetailsBySlugPageRouteSecretScanningRoute
+ '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/': typeof certManagerSignerDetailPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/installations/$installationId': typeof certManagerInstallationDetailsByIDPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/aws-parameter-store/authorize': typeof secretManagerIntegrationsAwsParameterStoreAuthorizePageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/aws-parameter-store/create': typeof secretManagerIntegrationsAwsParameterStoreConfigurePageRouteRoute
@@ -6591,6 +6650,7 @@ export interface FileRoutesById {
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/data-sources/$type/$dataSourceId': typeof secretScanningSecretScanningDataSourceByIdPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/commits/$environment/$folderId': typeof AuthenticateInjectOrgDetailsOrgLayoutOrganizationsOrgIdProjectsSecretManagementProjectIdSecretManagerLayoutCommitsEnvironmentFolderIdRouteWithChildren
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/commits/$environment/$folderId/': typeof secretManagerCommitsPageRouteRoute
+ '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/operations/$operationId': typeof certManagerSigningOperationDetailPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/azure-app-configuration/oauth2/callback': typeof secretManagerIntegrationsAzureAppConfigurationOauthCallbackPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/azure-key-vault/oauth2/callback': typeof secretManagerIntegrationsAzureKeyVaultOauthCallbackPageRouteRoute
'/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/bitbucket/oauth2/callback': typeof secretManagerIntegrationsBitbucketOauthCallbackPageRouteRoute
@@ -6775,7 +6835,6 @@ export interface FileRouteTypes {
| '/organizations/$orgId/projects/cert-manager/$projectId/certificate-policies/$policyId'
| '/organizations/$orgId/projects/cert-manager/$projectId/certificate-profiles/$profileId'
| '/organizations/$orgId/projects/cert-manager/$projectId/certificates/$certificateId'
- | '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId'
| '/organizations/$orgId/projects/cert-manager/$projectId/discovery/$discoveryId'
| '/organizations/$orgId/projects/cert-manager/$projectId/hsm-connectors/$connectorId'
| '/organizations/$orgId/projects/cert-manager/$projectId/integrations/$syncId'
@@ -6783,6 +6842,7 @@ export interface FileRouteTypes {
| '/organizations/$orgId/projects/secret-management/$projectId/integrations/$integrationId'
| '/organizations/$orgId/projects/secret-management/$projectId/integrations/select-integration-auth'
| '/organizations/$orgId/projects/secret-management/$projectId/secrets/$envSlug'
+ | '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId'
| '/organizations/$orgId/projects/cert-manager/$projectId/groups/$groupId'
| '/organizations/$orgId/projects/cert-manager/$projectId/identities/$identityId'
| '/organizations/$orgId/projects/cert-manager/$projectId/members/$membershipId'
@@ -6800,6 +6860,7 @@ export interface FileRouteTypes {
| '/organizations/$orgId/projects/secret-scanning/$projectId/identities/$identityId'
| '/organizations/$orgId/projects/secret-scanning/$projectId/members/$membershipId'
| '/organizations/$orgId/projects/secret-scanning/$projectId/roles/$roleSlug'
+ | '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId/'
| '/organizations/$orgId/projects/cert-manager/$projectId/discovery/installations/$installationId'
| '/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/authorize'
| '/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/create'
@@ -6869,6 +6930,7 @@ export interface FileRouteTypes {
| '/organizations/$orgId/projects/secret-scanning/$projectId/data-sources/$type/$dataSourceId'
| '/organizations/$orgId/projects/secret-management/$projectId/commits/$environment/$folderId'
| '/organizations/$orgId/projects/secret-management/$projectId/commits/$environment/$folderId/'
+ | '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId/operations/$operationId'
| '/organizations/$orgId/projects/secret-management/$projectId/integrations/azure-app-configuration/oauth2/callback'
| '/organizations/$orgId/projects/secret-management/$projectId/integrations/azure-key-vault/oauth2/callback'
| '/organizations/$orgId/projects/secret-management/$projectId/integrations/bitbucket/oauth2/callback'
@@ -7027,7 +7089,6 @@ export interface FileRouteTypes {
| '/organizations/$orgId/projects/cert-manager/$projectId/certificate-policies/$policyId'
| '/organizations/$orgId/projects/cert-manager/$projectId/certificate-profiles/$profileId'
| '/organizations/$orgId/projects/cert-manager/$projectId/certificates/$certificateId'
- | '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId'
| '/organizations/$orgId/projects/cert-manager/$projectId/discovery/$discoveryId'
| '/organizations/$orgId/projects/cert-manager/$projectId/hsm-connectors/$connectorId'
| '/organizations/$orgId/projects/cert-manager/$projectId/integrations/$syncId'
@@ -7052,6 +7113,7 @@ export interface FileRouteTypes {
| '/organizations/$orgId/projects/secret-scanning/$projectId/identities/$identityId'
| '/organizations/$orgId/projects/secret-scanning/$projectId/members/$membershipId'
| '/organizations/$orgId/projects/secret-scanning/$projectId/roles/$roleSlug'
+ | '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId'
| '/organizations/$orgId/projects/cert-manager/$projectId/discovery/installations/$installationId'
| '/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/authorize'
| '/organizations/$orgId/projects/secret-management/$projectId/integrations/aws-parameter-store/create'
@@ -7120,6 +7182,7 @@ export interface FileRouteTypes {
| '/organizations/$orgId/projects/secret-management/$projectId/integrations/windmill/create'
| '/organizations/$orgId/projects/secret-scanning/$projectId/data-sources/$type/$dataSourceId'
| '/organizations/$orgId/projects/secret-management/$projectId/commits/$environment/$folderId'
+ | '/organizations/$orgId/projects/cert-manager/$projectId/code-signing/$signerId/operations/$operationId'
| '/organizations/$orgId/projects/secret-management/$projectId/integrations/azure-app-configuration/oauth2/callback'
| '/organizations/$orgId/projects/secret-management/$projectId/integrations/azure-key-vault/oauth2/callback'
| '/organizations/$orgId/projects/secret-management/$projectId/integrations/bitbucket/oauth2/callback'
@@ -7310,7 +7373,6 @@ export interface FileRouteTypes {
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/certificate-policies/$policyId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/certificate-profiles/$profileId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/certificates/$certificateId'
- | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/$discoveryId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/hsm-connectors/$connectorId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/integrations/$syncId'
@@ -7318,6 +7380,7 @@ export interface FileRouteTypes {
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/$integrationId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/select-integration-auth'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/secrets/$envSlug'
+ | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/groups/$groupId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/identities/$identityId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/members/$membershipId'
@@ -7335,6 +7398,7 @@ export interface FileRouteTypes {
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/identities/$identityId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/members/$membershipId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/roles/$roleSlug'
+ | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/installations/$installationId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/aws-parameter-store/authorize'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/aws-parameter-store/create'
@@ -7404,6 +7468,7 @@ export interface FileRouteTypes {
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout/data-sources/$type/$dataSourceId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/commits/$environment/$folderId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/commits/$environment/$folderId/'
+ | '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/operations/$operationId'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/azure-app-configuration/oauth2/callback'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/azure-key-vault/oauth2/callback'
| '/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/bitbucket/oauth2/callback'
@@ -8515,10 +8580,6 @@ export const routeTree = rootRoute
"filePath": "cert-manager/CertificateDetailsByIDPage/route.tsx",
"parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout"
},
- "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId": {
- "filePath": "cert-manager/SignerDetailPage/route.tsx",
- "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing"
- },
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/$discoveryId": {
"filePath": "cert-manager/DiscoveryDetailsByIDPage/route.tsx",
"parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery"
@@ -8547,6 +8608,14 @@ export const routeTree = rootRoute
"filePath": "secret-manager/SecretDashboardPage/route.tsx",
"parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout"
},
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId": {
+ "filePath": "",
+ "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing",
+ "children": [
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/",
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/operations/$operationId"
+ ]
+ },
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/groups/$groupId": {
"filePath": "project/GroupDetailsByIDPage/route-cert-manager.tsx",
"parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout"
@@ -8615,6 +8684,10 @@ export const routeTree = rootRoute
"filePath": "project/RoleDetailsBySlugPage/route-secret-scanning.tsx",
"parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-scanning/$projectId/_secret-scanning-layout"
},
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/": {
+ "filePath": "cert-manager/SignerDetailPage/route.tsx",
+ "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId"
+ },
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery/installations/$installationId": {
"filePath": "cert-manager/InstallationDetailsByIDPage/route.tsx",
"parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/discovery"
@@ -8895,6 +8968,10 @@ export const routeTree = rootRoute
"filePath": "secret-manager/CommitsPage/route.tsx",
"parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/commits/$environment/$folderId"
},
+ "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId/operations/$operationId": {
+ "filePath": "cert-manager/SigningOperationDetailPage/route.tsx",
+ "parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/$signerId"
+ },
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations/azure-app-configuration/oauth2/callback": {
"filePath": "secret-manager/integrations/AzureAppConfigurationOauthCallbackPage/route.tsx",
"parent": "/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/secret-management/$projectId/_secret-manager-layout/integrations"
diff --git a/frontend/src/routes.ts b/frontend/src/routes.ts
index 5a653562f5..c86e84c25f 100644
--- a/frontend/src/routes.ts
+++ b/frontend/src/routes.ts
@@ -299,7 +299,10 @@ const certManagerRoutes = route("/organizations/$orgId/projects/cert-manager/$pr
route("/requests", "cert-manager/RequestsPage/route.tsx"),
route("/code-signing", [
index("cert-manager/CodeSigningPage/route.tsx"),
- route("/$signerId", "cert-manager/SignerDetailPage/route.tsx")
+ route("/$signerId", [
+ index("cert-manager/SignerDetailPage/route.tsx"),
+ route("/operations/$operationId", "cert-manager/SigningOperationDetailPage/route.tsx")
+ ])
]),
route("/approvals", [
index("cert-manager/ApprovalsPage/route.tsx"),