Skip to content

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

Address PR comments

Carlos Monastyrski93f290bc25ce
diff --git a/backend/src/services/approval-policy/approval-policy-service.ts b/backend/src/services/approval-policy/approval-policy-service.ts
index a2926bcb0d..9e39cb8869 100644
--- a/backend/src/services/approval-policy/approval-policy-service.ts
+++ b/backend/src/services/approval-policy/approval-policy-service.ts
@@ -6,6 +6,7 @@ import { TPermissionServiceFactory } from "@app/ee/services/permission/permissio
import {
ProjectPermissionApprovalRequestActions,
ProjectPermissionApprovalRequestGrantActions,
+ ProjectPermissionCodeSigningActions,
ProjectPermissionSub
} from "@app/ee/services/permission/project-permission";
import { BadRequestError, ForbiddenRequestError, NotFoundError } from "@app/lib/errors";
@@ -423,10 +424,17 @@ export const approvalPolicyServiceFactory = ({
actionProjectType: ActionProjectType.Any
});
- ForbiddenError.from(permission).throwUnlessCan(
- ProjectPermissionApprovalRequestActions.Create,
- ProjectPermissionSub.ApprovalRequests
- );
+ if (policyType === ApprovalPolicyType.CertCodeSigning) {
+ ForbiddenError.from(permission).throwUnlessCan(
+ ProjectPermissionCodeSigningActions.Sign,
+ ProjectPermissionSub.CodeSigners
+ );
+ } else {
+ ForbiddenError.from(permission).throwUnlessCan(
+ ProjectPermissionApprovalRequestActions.Create,
+ ProjectPermissionSub.ApprovalRequests
+ );
+ }
const fac = APPROVAL_POLICY_FACTORY_MAP[policyType](policyType);
diff --git a/backend/src/services/certificate/certificate-service.ts b/backend/src/services/certificate/certificate-service.ts
index 32df0ab380..a39214f27b 100644
--- a/backend/src/services/certificate/certificate-service.ts
+++ b/backend/src/services/certificate/certificate-service.ts
@@ -10,7 +10,7 @@ import {
ProjectPermissionSub
} from "@app/ee/services/permission/project-permission";
import { crypto } from "@app/lib/crypto/cryptography";
-import { BadRequestError, NotFoundError } from "@app/lib/errors";
+import { BadRequestError, DatabaseError, NotFoundError } from "@app/lib/errors";
import { TCertificateBodyDALFactory } from "@app/services/certificate/certificate-body-dal";
import { TCertificateDALFactory } from "@app/services/certificate/certificate-dal";
import { TCertificateAuthorityCertDALFactory } from "@app/services/certificate-authority/certificate-authority-cert-dal";
@@ -286,7 +286,23 @@ export const certificateServiceFactory = ({
})
);
- const deletedCert = await certificateDAL.deleteById(cert.id);
+ let deletedCert;
+ try {
+ deletedCert = await certificateDAL.deleteById(cert.id);
+ } catch (err) {
+ const innerError = err instanceof DatabaseError ? (err.error as { code?: string; constraint?: string }) : null;
+ if (innerError?.code === "23503") {
+ if (innerError.constraint === "pki_signers_certificateid_foreign") {
+ throw new BadRequestError({
+ message: "Cannot delete certificate because it is currently in use by a code signing signer"
+ });
+ }
+ throw new BadRequestError({
+ message: "Cannot delete certificate because it is referenced by another resource"
+ });
+ }
+ throw err;
+ }
// Trigger auto sync for PKI syncs connected to this certificate
await triggerAutoSyncForCertificate(cert.id, {
diff --git a/docs/docs.json b/docs/docs.json
index f21a27060a..0481a25792 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -760,8 +760,8 @@
{
"group": "Approvals",
"pages": [
- "documentation/platform/pki/code-signing/approval-policies",
- "documentation/platform/pki/code-signing/approval-requests",
+ "documentation/platform/pki/code-signing/signing-policies",
+ "documentation/platform/pki/code-signing/signing-requests",
"documentation/platform/pki/code-signing/grants"
]
},
diff --git a/docs/documentation/platform/pki/code-signing/approval-policies.mdx b/docs/documentation/platform/pki/code-signing/approval-policies.mdx
deleted file mode 100644
index 6eafa7a672..0000000000
--- a/docs/documentation/platform/pki/code-signing/approval-policies.mdx
+++ /dev/null
@@ -1,97 +0,0 @@
----
-title: "Approval Policies"
-sidebarTitle: "Approval Policies"
-description: "Learn how to configure approval policies for code signing operations."
----
-
-In Infisical, code signing approval workflows add a human review step before signing operations can be performed, helping organizations enforce separation of duties and maintain compliance for software supply chain security.
-
-## When to Use Approval Workflows
-
-Approval workflows are recommended when:
-
-- **Separation of duties is required**: Your organization requires different people to request and authorize code signing.
-- **Release signing needs oversight**: Signing production releases, firmware, or customer-facing artifacts requires additional review.
-- **Compliance mandates review**: Regulatory frameworks or internal policies require documented approval before signing.
-- **Preventing unauthorized signing**: You want to ensure artifacts are only signed after proper validation.
-
-## Approval Modes
-
-Infisical supports three approval modes that control how signing grants are issued:
-
-### Manual
-
-Each approved request grants exactly **one signing operation**. This is the strictest mode. Every artifact signature requires a separate approval.
-
-This mode is recommended for high-security environments where each signing operation must be individually authorized.
-
-### Time Window
-
-Each approved request grants signing access for a **defined time period**. You can sign unlimited times within the window.
-
-This mode is recommended for release cycles where a team needs to sign multiple artifacts during a release window (e.g., a 4-hour release deployment).
-
-<Note>
- - The policy defines a `maxWindowDuration` that constrains how long a window can be (from 1 minute to 30 days).
- - The requester specifies the desired `windowStart` and `windowEnd` within that constraint.
-</Note>
-
-### N-Signings
-
-Each approved request grants a **fixed number of signing operations**. Once the quota is exhausted, the grant expires automatically.
-
-This mode is recommended for CI pipelines that need to sign a known number of artifacts per build (e.g., 10 JARs per release).
-
-<Note>
- The policy defines a `maxSignings` that caps the number of signings a requester can ask for.
-</Note>
-
-## Creating an Approval Policy
-
-An approval policy defines the workflow that must be completed before signing access is granted for a specific signer.
-
-Key features of approval policies include:
-
-- **Approval mode selection**: Choose between Manual, Time Window, or N-Signings mode.
-- **Multi-step workflows**: Configure sequential approval steps where each step must be completed before the next begins.
-- **Flexible approvers**: Assign individual users or groups as eligible approvers for each step.
-- **Required approval count**: Specify how many approvals are needed per step (e.g., require 2 out of 5 eligible approvers).
-- **Request expiration**: Set a maximum time-to-live (TTL) for pending requests.
-
-To create an approval policy, head to your Certificate Management Project > **Code Signing > Approvals > Policies** and press **Create Policy**.
-
-<Steps>
- <Step title="Configuring the policy">
- Configure the basic policy settings:
-
- - **Policy Name**: A descriptive name for the policy such as `release-signing-approval`.
- - **Approval Mode**: The mode that fits your workflow:
- - **Manual**: One approval = one signature.
- - **Time Window**: Approval grants access for a time period. Configure the **Max. Window Duration** (e.g., `4h`, `1d`).
- - **N-Signings**: Approval grants a fixed quota. Configure the **Max. Signings** count.
- - **Max. Request TTL**: The maximum time a request can remain pending before it expires (optional).
- - **Bypass approval for machine identities**: When enabled, machine identities can sign without requiring approval.
-
- ![Create approval policy - configuration](/images/platform/pki/code-signing/approval-policy-create.png)
- </Step>
- <Step title="Configuring the approval sequence">
- Configure the approval steps. Each step defines who can approve and how many approvals are required:
-
- - **Step Name**: An optional name for the step such as `Security Team Review`.
- - **Approvers**: The individual users or groups who are eligible to approve this step.
- - **Required Approvals**: The number of approvals needed to complete this step.
-
- You can add multiple steps to create a sequential approval workflow. For example:
- 1. **Team Lead Review**: Requires 1 approval from the team leads group
- 2. **Security Review**: Requires 2 approvals from the security team
-
- Each step must be completed in order before the signing grant is issued.
-
- ![Create approval policy - approval sequence](/images/platform/pki/code-signing/approval-policy-steps.png)
- </Step>
- <Step title="Reviewing and creating the policy">
- Review your policy configuration and press **Create** to save the policy.
-
- ![Create approval policy - review](/images/platform/pki/code-signing/approval-policy-review.png)
- </Step>
-</Steps>
diff --git a/docs/documentation/platform/pki/code-signing/grants.mdx b/docs/documentation/platform/pki/code-signing/grants.mdx
index 9b62ee9879..7ec6974f87 100644
--- a/docs/documentation/platform/pki/code-signing/grants.mdx
+++ b/docs/documentation/platform/pki/code-signing/grants.mdx
@@ -4,7 +4,7 @@ sidebarTitle: "Grants"
description: "Learn how to view and manage signing grants."
---
-A grant is the authorization that allows a user or machine identity to perform signing operations with a specific signer. Grants are automatically created when an [approval request](/documentation/platform/pki/code-signing/approval-requests) is fully approved.
+A grant is the authorization that allows a user or machine identity to perform signing operations with a specific signer. Grants are automatically created when a [signing request](/documentation/platform/pki/code-signing/signing-requests) is fully approved.
## Viewing Grants
@@ -20,22 +20,22 @@ Head to **Code Signing > Approvals > Grants** to view all grants. You can filter
Administrators can revoke an active grant at any time. To revoke a grant, press the **Revoke** action on the grant row and optionally provide a reason.
-Once revoked, the grant can no longer be used for signing operations. The user must request a new grant through the approval workflow.
+Once revoked, the grant can no longer be used for signing operations. The user must request a new grant through the signing workflow.
## FAQ
<AccordionGroup>
<Accordion title="I approved a request but the grant wasn't issued">
- If the approval policy has multiple steps, your approval may have completed only one step. The grant is issued only after all approval steps are completed. Check the request details to see which step is currently pending.
+ If the signing policy has multiple steps, your approval may have completed only one step. The grant is issued only after all approval steps are completed. Check the request details to see which step is currently pending.
</Accordion>
<Accordion title="My grant expired before I finished signing">
- Depending on the approval mode:
- - **Time Window**: Your window end time has passed. Request a new grant with a longer window.
- - **N-Signings**: You used all your allotted signings. Request a new grant with a higher count.
- - **Manual**: Manual grants are single-use. Request a new grant for each signing operation.
+ Depending on the policy constraints:
+ - **Time Window**: Your valid until date has passed. Request a new grant with a longer window.
+ - **N-Signings**: You used all your allowed sign operations. Request a new grant with a higher count.
+ - **No constraints**: Grants without constraints are single-use. Request a new grant for each signing operation.
</Accordion>
<Accordion title="Can I extend an active grant?">
- Grants cannot be extended. You need to create a new approval request for additional signing access.
+ Grants cannot be extended. You need to create a new signing request for additional signing access.
</Accordion>
<Accordion title="What happens to in-flight signing operations when a grant is revoked?">
If a signing operation is already being processed when the grant is revoked, the operation will complete. Subsequent signing attempts with the revoked grant will be denied.
diff --git a/docs/documentation/platform/pki/code-signing/overview.mdx b/docs/documentation/platform/pki/code-signing/overview.mdx
index 1bfc7b7d1b..7796519112 100644
--- a/docs/documentation/platform/pki/code-signing/overview.mdx
+++ b/docs/documentation/platform/pki/code-signing/overview.mdx
@@ -26,8 +26,8 @@ sequenceDiagram
</div>
1. A **Signer** is created and bound to a certificate with the `codeSigning` extended key usage.
-2. Optionally, an **Approval Policy** is attached to govern who can use the signer and under what conditions. Without a policy, authorized users and identities can sign immediately.
-3. When a policy is configured, users or machine identities **request signing access** through the approval workflow. Once approved, the caller receives a **grant** that authorizes signing operations.
+2. Optionally, a **Signing Policy** is attached to govern who can use the signer and under what conditions. Without a policy, authorized users and identities can sign immediately.
+3. When a policy is configured, users or machine identities **request signing access** through the signing workflow. Once approved, the caller receives a **grant** that authorizes signing operations.
4. The signing tool (e.g., jarsigner) calls the Infisical API, either directly or through the [PKCS#11 module](/documentation/platform/pki/code-signing/pkcs11-module), and the signature is computed server-side.
5. Every signing operation is recorded as an immutable **audit entry** on the signer.
@@ -35,15 +35,16 @@ sequenceDiagram
### Signers
-A [signer](/documentation/platform/pki/code-signing/signers) is a named code-signing identity bound to a certificate. It represents a signing capability within a project. Signers hold no private key material locally. All cryptographic operations happen on the Infisical server.
+A [signer](/documentation/platform/pki/code-signing/signers) is a named code-signer bound to a certificate. It represents a signing capability within a project. Signers hold no private key material locally. All cryptographic operations happen on the Infisical server.
-### Approval Policies
+### Signing Policies
-[Approval policies](/documentation/platform/pki/code-signing/approval-policies) optionally define the rules that must be satisfied before signing can occur. When a signer has an approval policy, Infisical supports three approval modes:
+[Signing policies](/documentation/platform/pki/code-signing/signing-policies) optionally define the rules that must be satisfied before signing can occur. Policies support constraints such as:
-- **Manual**: Each approval grants exactly one signing operation.
-- **Time Window**: Approval grants signing access for a defined time period.
-- **N-Signings**: Approval grants a fixed number of signing operations.
+- **Time Window**: Signing access is granted for a defined time period. The policy can define a maximum window duration.
+- **N-Signings**: Signing access is granted for a fixed number of operations. The policy can define a maximum number of allowed sign operations.
+
+Without any constraints, each approved request grants exactly one signing operation.
### Signing Operations
@@ -57,9 +58,9 @@ The Infisical [PKCS#11 module](/documentation/platform/pki/code-signing/pkcs11-m
<CardGroup cols={2}>
<Card title="Create a Signer" href="/documentation/platform/pki/code-signing/signers">
- Set up a code-signing identity and bind it to a certificate.
+ Set up a code-signer and bind it to a certificate.
</Card>
- <Card title="Configure Approvals" href="/documentation/platform/pki/code-signing/approval-policies">
- Define approval policies to control who can sign and when.
+ <Card title="Configure Signing Policies" href="/documentation/platform/pki/code-signing/signing-policies">
+ Define signing policies to control who can sign and when.
</Card>
</CardGroup>
diff --git a/docs/documentation/platform/pki/code-signing/signers.mdx b/docs/documentation/platform/pki/code-signing/signers.mdx
index b735e93c1c..d9e996f1eb 100644
--- a/docs/documentation/platform/pki/code-signing/signers.mdx
+++ b/docs/documentation/platform/pki/code-signing/signers.mdx
@@ -4,14 +4,14 @@ sidebarTitle: "Signers"
description: "Learn how to create and manage code-signing identities."
---
-In Infisical, a signer is a named code-signing identity bound to an X.509 certificate with the `codeSigning` extended key usage (EKU). Each signer represents a signing capability within a project, for example `release-signer` for production releases or `ci-signer` for CI pipeline artifacts.
+In Infisical, a signer is a named code-signer bound to an X.509 certificate with the `codeSigning` extended key usage (EKU). Each signer represents a signing capability within a project, for example `release-signer` for production releases or `ci-signer` for CI pipeline artifacts.
Private keys never leave the Infisical server. When a signing operation is requested, the server retrieves the key, computes the signature, and returns only the signature bytes. This ensures that signing keys cannot be exfiltrated from build environments.
## Key Characteristics
- **Bound to a certificate**: Every signer must be linked to a certificate that has the `codeSigning` EKU.
-- **Optional approval policy**: A signer can optionally be associated with an [approval policy](/documentation/platform/pki/code-signing/approval-policies) that governs who can sign and under what conditions. Without a policy, signing is allowed without approval.
+- **Optional signing policy**: A signer can optionally be associated with a [signing policy](/documentation/platform/pki/code-signing/signing-policies) that governs who can sign and under what conditions. Without a policy, signing is allowed without approval.
- **Supports RSA and ECDSA**: Signers support RSA (2048, 3072, 4096-bit) and ECDSA (P-256, P-384, P-521) key types depending on the certificate.
- **Tracks signing history**: Every signing operation is recorded with actor, algorithm, data hash, and grant information.
@@ -25,8 +25,8 @@ Private keys never leave the Infisical server. When a signing operation is reque
Only certificates with the `codeSigning` extended key usage will be available when creating a signer. If you don't see your certificate, verify that it was issued with the correct EKU.
</Note>
</Step>
- <Step title="(Optional) Creating an approval policy">
- If you want to require approval before signing, head to **Code Signing > Approvals > Policies** and press **Create Policy**. See [Approval Policies](/documentation/platform/pki/code-signing/approval-policies) for details. Without a policy, any authorized user or identity can sign immediately.
+ <Step title="(Optional) Creating a signing policy">
+ If you want to require approval before signing, head to **Code Signing > Approvals > Signing Policies** and press **Create Policy**. See [Signing Policies](/documentation/platform/pki/code-signing/signing-policies) for details. Without a policy, any authorized user or identity can sign immediately.
</Step>
<Step title="Creating the signer">
Head to your Certificate Management Project > **Code Signing > Signers** and press **Create Signer**.
@@ -38,7 +38,7 @@ Private keys never leave the Infisical server. When a signing operation is reque
- **Name**: A slug-friendly name for the signer such as `release-signer`.
- **Description**: An optional description of the signer's purpose.
- **Certificate**: The code-signing certificate to bind to this signer.
- - **Approval Policy** (optional): The approval policy that governs signing access for this signer. If omitted, signing is allowed without approval.
+ - **Signing Policy** (optional): The signing policy that governs signing access for this signer. If omitted, signing is allowed without approval.
Press **Create** to save the signer.
</Step>
@@ -97,12 +97,12 @@ curl --request POST \
<AccordionGroup>
<Accordion title="Can I use the same certificate for multiple signers?">
- Yes. Multiple signers can reference the same certificate, each with a different approval policy. This is useful if you want different approval workflows for different teams using the same signing key.
+ Yes. Multiple signers can reference the same certificate, each with a different signing policy. This is useful if you want different approval workflows for different teams using the same signing key.
</Accordion>
<Accordion title="What happens if my certificate expires?">
Signing requests will be rejected if the signer's certificate has expired. You should issue a new certificate and update the signer's certificate binding before expiry.
</Accordion>
<Accordion title="Can machine identities sign without human approval?">
- Yes, depending on the approval policy configuration. If the policy allows machine identity bypass or uses automatic approval modes, machine identities can sign without human intervention after obtaining a grant.
+ Yes, depending on the signing policy configuration. If the policy allows machine identity bypass, machine identities can sign without human intervention after obtaining a grant.
</Accordion>
</AccordionGroup>
diff --git a/docs/documentation/platform/pki/code-signing/signing-policies.mdx b/docs/documentation/platform/pki/code-signing/signing-policies.mdx
new file mode 100644
index 0000000000..3f929e75d4
--- /dev/null
+++ b/docs/documentation/platform/pki/code-signing/signing-policies.mdx
@@ -0,0 +1,95 @@
+---
+title: "Signing Policies"
+sidebarTitle: "Signing Policies"
+description: "Learn how to configure signing policies for code signing operations."
+---
+
+In Infisical, code signing policies add a human review step before signing operations can be performed, helping organizations enforce separation of duties and maintain compliance for software supply chain security.
+
+## When to Use Signing Policies
+
+Signing policies are recommended when:
+
+- **Separation of duties is required**: Your organization requires different people to request and authorize code signing.
+- **Release signing needs oversight**: Signing production releases, firmware, or customer-facing artifacts requires additional review.
+- **Compliance mandates review**: Regulatory frameworks or internal policies require documented approval before signing.
+- **Preventing unauthorized signing**: You want to ensure artifacts are only signed after proper validation.
+
+## Policy Constraints
+
+Signing policies support optional constraints that control how signing grants are issued:
+
+### Time Window
+
+Each approved request grants signing access for a **defined time period**. You can sign unlimited times within the window.
+
+This constraint is recommended for release cycles where a team needs to sign multiple artifacts during a release window (e.g., a 4-hour release deployment).
+
+<Note>
+ - The policy defines a **Max. Window Duration** that constrains how long a window can be (from 1 minute to 30 days).
+ - The requester specifies the desired **Valid From** and **Valid Until** dates within that constraint.
+</Note>
+
+### N-Signings
+
+Each approved request grants a **fixed number of signing operations**. Once the quota is exhausted, the grant expires automatically.
+
+This constraint is recommended for CI pipelines that need to sign a known number of artifacts per build (e.g., 10 JARs per release).
+
+<Note>
+ The policy defines a **Max. Signings** count that caps the number of allowed sign operations a requester can ask for.
+</Note>
+
+### No Constraints
+
+When no constraints are configured, each approved request grants exactly **one signing operation**. This is the strictest mode. Every artifact signature requires a separate approval.
+
+This is recommended for high-security environments where each signing operation must be individually authorized.
+
+## Creating a Signing Policy
+
+A signing policy defines the workflow that must be completed before signing access is granted for a specific signer.
+
+Key features of signing policies include:
+
+- **Multi-step workflows**: Configure sequential approval steps where each step must be completed before the next begins.
+- **Flexible approvers**: Assign individual users or groups as eligible approvers for each step.
+- **Required approval count**: Specify how many approvals are needed per step (e.g., require 2 out of 5 eligible approvers).
+- **Request expiration**: Set a maximum time-to-live (TTL) for pending requests.
+- **Optional constraints**: Configure time window or N-signings constraints to control the scope of each grant.
+
+To create a signing policy, head to your Certificate Management Project > **Code Signing > Approvals > Signing Policies** and press **Create Policy**.
+
+<Steps>
+ <Step title="Configuring the policy">
+ Configure the basic policy settings:
+
+ - **Policy Name**: A descriptive name for the policy such as `release-signing-approval`.
+ - **Max. Window Duration** (optional): The maximum time window a requester can ask for (e.g., `4h`, `1d`). Leave empty if you do not need time-based grants.
+ - **Max. Signings** (optional): The maximum number of allowed sign operations a requester can ask for. Leave empty if you do not need quota-based grants.
+ - **Max. Request TTL**: The maximum time a request can remain pending before it expires (optional).
+ - **Bypass approval for machine identities**: When enabled, machine identities can sign without requiring approval.
+
+ ![Create signing policy - configuration](/images/platform/pki/code-signing/approval-policy-create.png)
+ </Step>
+ <Step title="Configuring the approval sequence">
+ Configure the approval steps. Each step defines who can approve and how many approvals are required:
+
+ - **Step Name**: An optional name for the step such as `Security Team Review`.
+ - **Approvers**: The individual users or groups who are eligible to approve this step.
+ - **Required Approvals**: The number of approvals needed to complete this step.
+
+ You can add multiple steps to create a sequential approval workflow. For example:
+ 1. **Team Lead Review**: Requires 1 approval from the team leads group
+ 2. **Security Review**: Requires 2 approvals from the security team
+
+ Each step must be completed in order before the signing grant is issued.
+
+ ![Create signing policy - approval sequence](/images/platform/pki/code-signing/approval-policy-steps.png)
+ </Step>
+ <Step title="Reviewing and creating the policy">
+ Review your policy configuration and press **Create** to save the policy.
+
+ ![Create signing policy - review](/images/platform/pki/code-signing/approval-policy-review.png)
+ </Step>
+</Steps>
diff --git a/docs/documentation/platform/pki/code-signing/approval-requests.mdx b/docs/documentation/platform/pki/code-signing/signing-requests.mdx
similarity index 66%
rename from docs/documentation/platform/pki/code-signing/approval-requests.mdx
rename to docs/documentation/platform/pki/code-signing/signing-requests.mdx
index c8089b960f..f26299eec3 100644
--- a/docs/documentation/platform/pki/code-signing/approval-requests.mdx
+++ b/docs/documentation/platform/pki/code-signing/signing-requests.mdx
@@ -1,26 +1,26 @@
---
-title: "Approval Requests"
-sidebarTitle: "Approval Requests"
-description: "Learn how to request, approve, and reject signing access through approval workflows."
+title: "Signing Requests"
+sidebarTitle: "Signing Requests"
+description: "Learn how to request, approve, and reject signing access through signing workflows."
---
## Requesting Signing Access
-When a user or machine identity needs to sign artifacts, they must first request signing access through the approval workflow.
+When a user or machine identity needs to sign artifacts, they must first request signing access through the signing workflow.
-Head to your Certificate Management Project > **Code Signing > Approvals > Requests** and press **Request Signing Access**.
+Head to your Certificate Management Project > **Code Signing > Approvals > Signing Requests** and press **Request Signing Access**.
-![Approval requests page](/images/platform/pki/code-signing/approval-requests.png)
+![Signing requests page](/images/platform/pki/code-signing/approval-requests.png)
<Steps>
<Step title="Selecting a signer and configuring parameters">
- Select the signer you want to use. The form will automatically load the approval mode associated with that signer's policy.
+ Select the signer you want to use. The form will automatically load the constraints associated with that signer's policy.
- Depending on the approval mode, provide the required parameters:
+ Depending on the policy constraints, provide the required parameters:
- - **Manual**: No additional parameters needed.
- - **Time Window**: Specify the **Window Start** and **Window End** for when you need signing access.
- - **N-Signings**: Specify the **Number of Signings** you need.
+ - **No constraints**: No additional parameters needed. The grant will allow a single signing operation.
+ - **Time Window**: Specify the **Valid From** and **Valid Until** dates for when you need signing access.
+ - **N-Signings**: Specify the **Allowed Sign Operations** you need.
- **Justification**: Optionally provide a reason for the request (e.g., "Release v2.4.0 signing").
![Request signing access](/images/platform/pki/code-signing/request-access-params.png)
@@ -32,7 +32,7 @@ Head to your Certificate Management Project > **Code Signing > Approvals > Reque
## Viewing Requests
-Head to **Code Signing > Approvals > Requests** to view all approval requests. You can filter requests by status:
+Head to **Code Signing > Approvals > Signing Requests** to view all signing requests. You can filter requests by status:
- **Open**: Requests currently pending approval
- **Approved**: Requests that have been approved and grants issued
@@ -46,13 +46,13 @@ Head to **Code Signing > Approvals > Requests** to view all approval requests. Y
<Step title="Opening the request">
Press on a pending request to view its details.
- ![Approval request detail](/images/platform/pki/code-signing/approval-request-detail.png)
+ ![Signing request detail](/images/platform/pki/code-signing/approval-request-detail.png)
</Step>
<Step title="Reviewing the request details">
Review the signing access request information including:
- Requester name
- Signer name and certificate
- - Approval mode and parameters (time window, signing count, etc.)
+ - Grant parameters (valid from/until, allowed sign operations, etc.)
- Justification
</Step>
<Step title="Approve or add comments">
diff --git a/docs/documentation/platform/pki/concepts/code-signing.mdx b/docs/documentation/platform/pki/concepts/code-signing.mdx
index d7bc0b0047..eb9465af11 100644
--- a/docs/documentation/platform/pki/concepts/code-signing.mdx
+++ b/docs/documentation/platform/pki/concepts/code-signing.mdx
@@ -23,7 +23,7 @@ Without code signing, there is no cryptographic proof that a piece of software i
Infisical provides a managed code signing workflow built on top of its PKI infrastructure:
1. **[Signers](/documentation/platform/pki/code-signing/signers)** are identities bound to a certificate with the `codeSigning` extended key usage. Private keys never leave Infisical; signing operations happen server-side.
-2. **[Approval policies](/documentation/platform/pki/code-signing/approval-policies)** optionally add a human review step before signing is allowed, enforcing separation of duties.
+2. **[Signing policies](/documentation/platform/pki/code-signing/signing-policies)** optionally add a human review step before signing is allowed, enforcing separation of duties.
3. **[Grants](/documentation/platform/pki/code-signing/grants)** are time-limited or count-limited authorizations issued after approval, controlling exactly when and how many times a user can sign.
4. **[PKCS#11 module](/documentation/platform/pki/code-signing/pkcs11-module)** lets standard signing tools (jarsigner, osslsigncode, cosign, etc.) use Infisical signers without code changes.
diff --git a/docs/images/platform/pki/code-signing/approval-policy-create.png b/docs/images/platform/pki/code-signing/approval-policy-create.png
index f9266afe46..c09df259f8 100644
Binary files a/docs/images/platform/pki/code-signing/approval-policy-create.png and b/docs/images/platform/pki/code-signing/approval-policy-create.png differ
diff --git a/docs/images/platform/pki/code-signing/approval-policy-review.png b/docs/images/platform/pki/code-signing/approval-policy-review.png
index 5bbe8ed557..abd01eb7dd 100644
Binary files a/docs/images/platform/pki/code-signing/approval-policy-review.png and b/docs/images/platform/pki/code-signing/approval-policy-review.png differ
diff --git a/docs/images/platform/pki/code-signing/approval-policy-steps.png b/docs/images/platform/pki/code-signing/approval-policy-steps.png
index 748ab35917..7bbb9b1fb3 100644
Binary files a/docs/images/platform/pki/code-signing/approval-policy-steps.png and b/docs/images/platform/pki/code-signing/approval-policy-steps.png differ
diff --git a/docs/images/platform/pki/code-signing/approval-request-detail.png b/docs/images/platform/pki/code-signing/approval-request-detail.png
index c170623b9f..1155ebcff7 100644
Binary files a/docs/images/platform/pki/code-signing/approval-request-detail.png and b/docs/images/platform/pki/code-signing/approval-request-detail.png differ
diff --git a/docs/images/platform/pki/code-signing/approval-requests.png b/docs/images/platform/pki/code-signing/approval-requests.png
index a819c86841..ead5be7411 100644
Binary files a/docs/images/platform/pki/code-signing/approval-requests.png and b/docs/images/platform/pki/code-signing/approval-requests.png differ
diff --git a/docs/images/platform/pki/code-signing/grants.png b/docs/images/platform/pki/code-signing/grants.png
index 60c87fa5b2..14cab842cf 100644
Binary files a/docs/images/platform/pki/code-signing/grants.png and b/docs/images/platform/pki/code-signing/grants.png differ
diff --git a/docs/images/platform/pki/code-signing/request-access-params.png b/docs/images/platform/pki/code-signing/request-access-params.png
index 5f1079c5a9..54bc7d1407 100644
Binary files a/docs/images/platform/pki/code-signing/request-access-params.png and b/docs/images/platform/pki/code-signing/request-access-params.png differ
diff --git a/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx b/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx
index 26d68634b2..69f1937c3e 100644
--- a/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalRequestDetailPage/ApprovalRequestDetailPage.tsx
@@ -28,50 +28,66 @@ import {
const ROUTE_ID =
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/approval-requests/$approvalRequestId" as const;
-const deriveApprovalModeLabel = (requestData: CodeSigningRequestData): string => {
- const hasTime = Boolean(requestData.requestedWindowStart);
- const hasCount = Boolean(requestData.requestedSignings);
- if (hasTime && hasCount) return "Combined";
- if (hasTime) return "Time-based";
- if (hasCount) return "Count-based";
- return "Manual";
-};
-
-const CodeSigningDetailsSection = ({ requestData }: { requestData: CodeSigningRequestData }) => {
+const CodeSigningDetailsSection = ({
+ requestData,
+ requesterName,
+ requesterEmail
+}: {
+ requestData: CodeSigningRequestData;
+ requesterName?: string;
+ requesterEmail?: string;
+}) => {
return (
- <div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-5">
- <h3 className="mb-4 text-lg font-medium text-mineshaft-100">Signing Access Details</h3>
- <div className="grid grid-cols-2 gap-4">
- <div>
- <span className="text-xs text-mineshaft-400">Signer</span>
- <p className="text-sm text-mineshaft-100">{requestData.signerName}</p>
- </div>
- <div>
- <span className="text-xs text-mineshaft-400">Approval Mode</span>
- <p className="text-sm text-mineshaft-100">{deriveApprovalModeLabel(requestData)}</p>
+ <div className="flex flex-col gap-4">
+ <div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
+ <h2 className="text-lg font-medium text-mineshaft-100">
+ Signing access for {requestData.signerName}
+ </h2>
+ <div className="mt-4 flex items-center gap-3">
+ <div className="flex h-10 w-10 items-center justify-center rounded-full bg-mineshaft-700 text-sm font-medium text-mineshaft-200">
+ {(requesterName || "U")
+ .split(" ")
+ .map((n) => n[0])
+ .join("")
+ .slice(0, 2)
+ .toUpperCase()}
+ </div>
+ <div>
+ <p className="text-sm font-medium text-mineshaft-100">{requesterName || "Unknown"}</p>
+ {requesterEmail && <p className="text-sm text-mineshaft-400">{requesterEmail}</p>}
+ </div>
</div>
- {requestData.requestedWindowStart && requestData.requestedWindowEnd && (
- <>
- <div>
- <span className="text-xs text-mineshaft-400">Window Start</span>
- <p className="text-sm text-mineshaft-100">
- {format(new Date(requestData.requestedWindowStart), "yyyy-MM-dd, hh:mm aaa")}
- </p>
- </div>
- <div>
- <span className="text-xs text-mineshaft-400">Window End</span>
- <p className="text-sm text-mineshaft-100">
- {format(new Date(requestData.requestedWindowEnd), "yyyy-MM-dd, hh:mm aaa")}
- </p>
- </div>
- </>
- )}
- {requestData.requestedSignings && (
+ </div>
+ <div className="rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-5">
+ <h3 className="mb-4 text-lg font-medium text-mineshaft-100">Signing Access Details</h3>
+ <div className="grid grid-cols-2 gap-4">
<div>
- <span className="text-xs text-mineshaft-400">Requested Signings</span>
- <p className="text-sm text-mineshaft-100">{requestData.requestedSignings}</p>
+ <span className="text-xs text-mineshaft-400">Signer</span>
+ <p className="text-sm text-mineshaft-100">{requestData.signerName}</p>
</div>
- )}
+ {requestData.requestedWindowStart && requestData.requestedWindowEnd && (
+ <>
+ <div>
+ <span className="text-xs text-mineshaft-400">Valid From</span>
+ <p className="text-sm text-mineshaft-100">
+ {format(new Date(requestData.requestedWindowStart), "yyyy-MM-dd, hh:mm aaa")}
+ </p>
+ </div>
+ <div>
+ <span className="text-xs text-mineshaft-400">Valid Until</span>
+ <p className="text-sm text-mineshaft-100">
+ {format(new Date(requestData.requestedWindowEnd), "yyyy-MM-dd, hh:mm aaa")}
+ </p>
+ </div>
+ </>
+ )}
+ {requestData.requestedSignings && (
+ <div>
+ <span className="text-xs text-mineshaft-400">Allowed Sign Operations</span>
+ <p className="text-sm text-mineshaft-100">{requestData.requestedSignings}</p>
+ </div>
+ )}
+ </div>
</div>
</div>
);
@@ -112,11 +128,14 @@ const PageContent = () => {
type: "success"
});
navigate({
- to: "/organizations/$orgId/projects/cert-manager/$projectId/approvals",
+ to: isCodeSigning
+ ? "/organizations/$orgId/projects/cert-manager/$projectId/code-signing"
+ : "/organizations/$orgId/projects/cert-manager/$projectId/approvals",
params: {
orgId: currentProject.orgId,
projectId: currentProject.id
- }
+ },
+ search: isCodeSigning ? { tab: "approvals" } : undefined
});
}
}
@@ -171,15 +190,13 @@ const PageContent = () => {
return (
<>
<div className="flex items-center gap-3">
- <h1 className="text-2xl font-semibold text-mineshaft-100">
- Code Signing Access Request
- </h1>
+ <h1 className="text-2xl font-semibold text-mineshaft-100">Signing Request</h1>
<Badge variant={getStatusBadgeVariant(request.status)}>
{getStatusLabel(request.status)}
</Badge>
</div>
<p className="mt-1 text-sm text-mineshaft-400">
- Signing access request for signer{" "}
+ Signing request for signer{" "}
<span className="font-medium text-mineshaft-200">{reqData.signerName}</span> by{" "}
{request.requesterName || "Unknown"}
</p>
@@ -212,7 +229,13 @@ const PageContent = () => {
const renderDetailsSection = () => {
if (isCodeSigning) {
const reqData = request.requestData.requestData as CodeSigningRequestData;
- return <CodeSigningDetailsSection requestData={reqData} />;
+ return (
+ <CodeSigningDetailsSection
+ requestData={reqData}
+ requesterName={request.requesterName}
+ requesterEmail={request.requesterEmail}
+ />
+ );
}
return <CertificateDetailsSection request={request} />;
};
@@ -221,13 +244,17 @@ const PageContent = () => {
<div className="container mx-auto flex flex-col justify-between bg-bunker-800 font-inter text-white">
<div className="mx-auto mb-6 w-full max-w-8xl">
<Link
- to="/organizations/$orgId/projects/cert-manager/$projectId/approvals"
+ to={
+ isCodeSigning
+ ? "/organizations/$orgId/projects/cert-manager/$projectId/code-signing"
+ : "/organizations/$orgId/projects/cert-manager/$projectId/approvals"
+ }
params={{ orgId: currentOrg.id, projectId: currentProject.id }}
- search={{ section: isCodeSigning ? "code-signing" : "certificates" }}
+ search={isCodeSigning ? { tab: "approvals" } : { section: "certificates" }}
className="mb-4 flex items-center gap-x-2 text-sm text-mineshaft-400 hover:text-mineshaft-200"
>
<FontAwesomeIcon icon={faChevronLeft} />
- Approvals List
+ {isCodeSigning ? "Signing Requests" : "Approvals List"}
</Link>
<div className="mb-6 flex items-start justify-between">
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/ApprovalsPage.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/ApprovalsPage.tsx
index 85227c5cc7..c7a769f2e0 100644
--- a/frontend/src/pages/cert-manager/ApprovalsPage/ApprovalsPage.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalsPage/ApprovalsPage.tsx
@@ -39,8 +39,12 @@ export const ApprovalsPage = () => {
<div className="mx-auto mb-6 w-full max-w-8xl">
<PageHeader
scope={currentProject.type}
- title={isCodeSigning ? "Code Signing Approvals" : "Certificate Approvals"}
- description="Manage approval workflows, update policy settings, and monitor request statuses."
+ title={isCodeSigning ? "Code Signing" : "Certificate Approvals"}
+ description={
+ isCodeSigning
+ ? "Manage signing policies, review signing requests, and monitor grants."
+ : "Manage approval workflows, update policy settings, and monitor request statuses."
+ }
/>
{!isCodeSigning && (
@@ -74,10 +78,10 @@ export const ApprovalsPage = () => {
>
<TabList>
<Tab variant="project" value={CodeSigningApprovalTabs.Requests}>
- Requests
+ Signing Requests
</Tab>
<Tab variant="project" value={CodeSigningApprovalTabs.Policies}>
- Policies
+ Signing Policies
</Tab>
<Tab variant="project" value={CodeSigningApprovalTabs.Grants}>
Grants
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningGrantsTab/CodeSigningGrantsTab.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningGrantsTab/CodeSigningGrantsTab.tsx
index 25cec3fb24..5a2da22b95 100644
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningGrantsTab/CodeSigningGrantsTab.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningGrantsTab/CodeSigningGrantsTab.tsx
@@ -200,13 +200,6 @@ export const CodeSigningGrantsTab = () => {
}
};
- const getGrantModeLabel = (attrs: CodeSigningGrantAttributes) => {
- if (attrs.maxSignings === 1) return "Manual";
- if (attrs.maxSignings && attrs.maxSignings > 1) return `${attrs.maxSignings} signings`;
- if (attrs.windowStart) return "Time Window";
- return "-";
- };
-
const isTableFiltered = filter !== ApprovalGrantStatus.Active;
return (
@@ -303,7 +296,6 @@ export const CodeSigningGrantsTab = () => {
<Tr>
<Th>Grantee</Th>
<Th>Signer</Th>
- <Th>Mode</Th>
<Th>Status</Th>
<Th>Granted</Th>
<Th>Expires</Th>
@@ -311,7 +303,7 @@ export const CodeSigningGrantsTab = () => {
</Tr>
</THead>
<TBody>
- {isGrantsLoading && <TableSkeleton columns={7} innerKey="cs-grants" />}
+ {isGrantsLoading && <TableSkeleton columns={6} innerKey="cs-grants" />}
{!isGrantsLoading &&
paginatedGrants.map((grant) => {
const attrs = grant.attributes as CodeSigningGrantAttributes;
@@ -325,11 +317,6 @@ export const CodeSigningGrantsTab = () => {
{attrs.signerName || "-"}
</span>
</Td>
- <Td>
- <span className="text-sm text-mineshaft-200">
- {getGrantModeLabel(attrs)}
- </span>
- </Td>
<Td>
<Badge
variant={
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/CodeSigningPolicyTab.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/CodeSigningPolicyTab.tsx
index e42b08897c..27aeb1c3a2 100644
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/CodeSigningPolicyTab.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/CodeSigningPolicyTab.tsx
@@ -52,7 +52,7 @@ export const CodeSigningPolicyTab = () => {
<div className="mb-4 flex items-center">
<div className="flex-1">
<div className="flex items-center gap-x-2">
- <p className="text-xl font-medium text-mineshaft-100">Approval Policies</p>
+ <p className="text-xl font-medium text-mineshaft-100">Signing Policies</p>
</div>
<p className="text-sm text-bunker-300">
Define policies that require approval before signing operations
@@ -74,7 +74,7 @@ export const CodeSigningPolicyTab = () => {
<DeleteActionModal
isOpen={popUp.deletePolicy.isOpen}
deleteKey="delete"
- title="Are you sure you want to delete this policy?"
+ title="Are you sure you want to delete this signing policy?"
onChange={(isOpen) => handlePopUpToggle("deletePolicy", isOpen)}
onDeleteApproved={handleDeletePolicy}
/>
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
index 3e5cf56d62..1b21dabfa4 100644
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPoliciesTable.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPoliciesTable.tsx
@@ -1,11 +1,8 @@
import { useMemo } from "react";
import {
- faClock,
faEdit,
faEllipsisV,
faFileCircleQuestion,
- faHandPointer,
- faHashtag,
faTrash
} from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
@@ -37,11 +34,6 @@ import {
} from "@app/hooks/api/approvalPolicies";
import { UsePopUpState } from "@app/hooks/usePopUp";
-type CodeSigningConstraints = {
- maxWindowDuration?: string;
- maxSignings?: number;
-};
-
type Props = {
handlePopUpOpen: (
popUpName: keyof UsePopUpState<["policy", "deletePolicy"]>,
@@ -66,47 +58,25 @@ export const CodeSigningPoliciesTable = ({ handlePopUpOpen }: Props) => {
);
}, [policies]);
- const getApprovalModeConfig = (policy: TApprovalPolicy) => {
- const constraints = policy.constraints?.constraints as CodeSigningConstraints | undefined;
- const hasTime = Boolean(constraints?.maxWindowDuration);
- const hasCount = Boolean(constraints?.maxSignings);
- if (hasTime && hasCount) return { label: "Combined", icon: faClock };
- if (hasTime) return { label: "Time-based", icon: faClock };
- if (hasCount) return { label: "Count-based", icon: faHashtag };
- return { label: "Manual", icon: faHandPointer };
- };
-
return (
<TableContainer>
<Table>
<THead>
<Tr>
<Th>Policy Name</Th>
- <Th>Approval Mode</Th>
<Th>Approval Steps</Th>
<Th>Created</Th>
<Th className="w-5" />
</Tr>
</THead>
<TBody>
- {isPoliciesLoading && <TableSkeleton columns={5} innerKey="cs-approval-policies" />}
+ {isPoliciesLoading && <TableSkeleton columns={4} innerKey="cs-approval-policies" />}
{!isPoliciesLoading &&
sortedPolicies.map((policy) => (
<Tr key={policy.id} className="group">
<Td>
<div className="text-sm font-medium text-mineshaft-100">{policy.name}</div>
</Td>
- <Td>
- {(() => {
- const config = getApprovalModeConfig(policy);
- return (
- <span className="inline-flex items-center gap-1.5 rounded bg-mineshaft-600 px-2 py-0.5 text-xs text-mineshaft-200">
- <FontAwesomeIcon icon={config.icon} className="h-3 w-3" />
- {config.label}
- </span>
- );
- })()}
- </Td>
<Td>
<span className="text-sm text-mineshaft-200">
{policy.steps.length} step{policy.steps.length !== 1 ? "s" : ""}
@@ -154,7 +124,7 @@ export const CodeSigningPoliciesTable = ({ handlePopUpOpen }: Props) => {
</TBody>
</Table>
{!isPoliciesLoading && !sortedPolicies.length && (
- <EmptyState title="No approval policies found" icon={faFileCircleQuestion} />
+ <EmptyState title="No signing policies found" icon={faFileCircleQuestion} />
)}
</TableContainer>
);
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
index bc0e4c97ce..62d2ae3fb1 100644
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicyModal.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicyModal.tsx
@@ -54,7 +54,7 @@ export const CodeSigningPolicyModal = ({ popUp, handlePopUpToggle }: Props) => {
name: "",
maxRequestTtl: null,
constraints: {
- maxWindowDuration: undefined,
+ maxWindowDuration: "",
maxSignings: undefined
},
bypassForMachineIdentities: false,
@@ -81,7 +81,7 @@ export const CodeSigningPolicyModal = ({ popUp, handlePopUpToggle }: Props) => {
name: policyData.policy.name,
maxRequestTtl: policyData.policy.maxRequestTtl,
constraints: {
- maxWindowDuration: constraints.maxWindowDuration,
+ maxWindowDuration: constraints.maxWindowDuration ?? "",
maxSignings: constraints.maxSignings
},
bypassForMachineIdentities: policyData.policy.bypassForMachineIdentities ?? false,
@@ -115,11 +115,19 @@ export const CodeSigningPolicyModal = ({ popUp, handlePopUpToggle }: Props) => {
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,
- ...data
+ ...cleanedData
});
createNotification({
text: "Successfully updated policy",
@@ -130,7 +138,7 @@ export const CodeSigningPolicyModal = ({ popUp, handlePopUpToggle }: Props) => {
policyType: ApprovalPolicyType.CertCodeSigning,
projectId: currentProject.id,
conditions: [],
- ...data
+ ...cleanedData
});
createNotification({
text: "Successfully created policy",
@@ -183,12 +191,8 @@ export const CodeSigningPolicyModal = ({ popUp, handlePopUpToggle }: Props) => {
return (
<Modal isOpen={isOpen} onOpenChange={(open) => handlePopUpToggle("policy", open)}>
<ModalContent
- title={
- policyData?.policyId
- ? "Edit Code Signing Approval Policy"
- : "Create Code Signing Approval Policy"
- }
- subTitle="Configure a code signing approval policy requiring approval before signing operations"
+ 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}>
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
index 18c71b3a25..8aae0e8c6a 100644
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySchema.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningPolicyTab/components/CodeSigningPolicySchema.tsx
@@ -26,7 +26,10 @@ export const CodeSigningPolicyFormSchema = z.object({
).nullish(),
constraints: z.object({
maxWindowDuration: DurationSchema().optional(),
- maxSignings: z.coerce.number().int().positive().optional()
+ maxSignings: z.preprocess(
+ (val) => (val === "" || val === undefined || val === null ? undefined : Number(val)),
+ z.number().int().positive().optional()
+ )
}),
bypassForMachineIdentities: z.boolean().optional().default(false),
steps: ApprovalStepsSchema
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
index 0efddaeaa3..ffa0950dce 100644
--- 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
@@ -63,19 +63,13 @@ export const CodeSigningPolicyDetailsStep = () => {
label="Max Window Duration"
isError={Boolean(error)}
errorText={error?.message}
- helperText="Maximum signing window duration (e.g., 1h, 1d). Leave empty for single-use approval."
+ helperText="Maximum signing window duration (e.g., 1h, 1d)"
>
<Input
{...field}
- value={field.value || ""}
+ value={field.value ?? ""}
placeholder="e.g., 1h"
- onChange={(e) => {
- if (!e.target.value || e.target.value === "") {
- field.onChange(undefined);
- return;
- }
- field.onChange(e.target.value);
- }}
+ onChange={(e) => field.onChange(e.target.value)}
/>
</FormControl>
)}
@@ -89,20 +83,13 @@ export const CodeSigningPolicyDetailsStep = () => {
label="Max Signings"
isError={Boolean(error)}
errorText={error?.message}
- helperText="Maximum number of signings per approved request. Leave empty for unlimited within the time window."
+ helperText="Maximum number of signings per approved request"
>
<Input
{...field}
- type="number"
value={field.value ?? ""}
placeholder="e.g., 10"
- onChange={(e) => {
- if (!e.target.value || e.target.value === "") {
- field.onChange(undefined);
- return;
- }
- field.onChange(Number(e.target.value));
- }}
+ onChange={(e) => field.onChange(e.target.value)}
/>
</FormControl>
)}
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
index 5fb9dda6fc..189869fb34 100644
--- 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
@@ -9,15 +9,6 @@ import { ApproverType } from "@app/hooks/api/approvalPolicies";
import { TCodeSigningPolicyForm } from "../CodeSigningPolicySchema";
-const deriveApprovalModeLabel = (constraints: TCodeSigningPolicyForm["constraints"]): string => {
- const hasTime = Boolean(constraints.maxWindowDuration);
- const hasCount = Boolean(constraints.maxSignings);
- if (hasTime && hasCount) return "Combined";
- if (hasTime) return "Time-based";
- if (hasCount) return "Count-based";
- return "Manual (single-use)";
-};
-
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>
@@ -54,12 +45,11 @@ export const CodeSigningPolicyReviewStep = () => {
<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">Policy Configuration</h3>
+ <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"} />
- <ReviewField label="Approval Mode" value={deriveApprovalModeLabel(constraints)} />
{constraints.maxWindowDuration && (
<ReviewField label="Max Window Duration" value={constraints.maxWindowDuration} />
)}
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/CodeSigningRequestsTab.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/CodeSigningRequestsTab.tsx
index d33658b04a..c3d3c64eed 100644
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/CodeSigningRequestsTab.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/CodeSigningRequestsTab.tsx
@@ -13,6 +13,7 @@ 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,
@@ -38,6 +39,10 @@ import {
} from "@app/components/v2";
import { Badge } 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 { ApprovalPolicyType, ApproverType } from "@app/hooks/api/approvalPolicies";
import {
@@ -145,13 +150,25 @@ export const CodeSigningRequestsTab = () => {
<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">Approval Requests</p>
+ <p className="text-xl font-medium text-mineshaft-100">Signing Requests</p>
</div>
- <p className="text-sm text-bunker-300">Review and manage approval requests</p>
+ <p className="text-sm text-bunker-300">Review and manage signing requests</p>
</div>
- <Button colorSchema="secondary" size="sm" onClick={() => setIsRequestModalOpen(true)}>
- Request Signing Access
- </Button>
+ <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>
@@ -276,7 +293,7 @@ export const CodeSigningRequestsTab = () => {
{!isRequestsLoading && paginatedRequests.length === 0 && (
<Tr>
<Td colSpan={5}>
- <EmptyState title="No approval requests found" icon={faFileCircleQuestion} />
+ <EmptyState title="No signing requests found" icon={faFileCircleQuestion} />
</Td>
</Tr>
)}
diff --git a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/RequestSigningAccessModal.tsx b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/RequestSigningAccessModal.tsx
index d1ce0c2867..7a04def107 100644
--- a/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/RequestSigningAccessModal.tsx
+++ b/frontend/src/pages/cert-manager/ApprovalsPage/components/CodeSigningRequestsTab/RequestSigningAccessModal.tsx
@@ -241,7 +241,7 @@ const Content = ({ onOpenChange }: Props) => {
control={control}
render={({ field, fieldState: { error } }) => (
<FormControl
- label="Window Start"
+ label="Valid From"
errorText={error?.message}
isError={Boolean(error?.message)}
>
@@ -254,7 +254,7 @@ const Content = ({ onOpenChange }: Props) => {
control={control}
render={({ field, fieldState: { error } }) => (
<FormControl
- label="Window End"
+ label="Valid Until"
errorText={error?.message}
isError={Boolean(error?.message)}
>
diff --git a/frontend/src/pages/cert-manager/CodeSigningPage/CodeSigningPage.tsx b/frontend/src/pages/cert-manager/CodeSigningPage/CodeSigningPage.tsx
index 81029c7443..510e6d9c1d 100644
--- a/frontend/src/pages/cert-manager/CodeSigningPage/CodeSigningPage.tsx
+++ b/frontend/src/pages/cert-manager/CodeSigningPage/CodeSigningPage.tsx
@@ -1,6 +1,7 @@
import { useState } from "react";
import { Helmet } from "react-helmet";
import { useTranslation } from "react-i18next";
+import { useSearch } from "@tanstack/react-router";
import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
import { useProject } from "@app/context";
@@ -26,8 +27,11 @@ enum ApprovalSubTabs {
export const CodeSigningPage = () => {
const { t } = useTranslation();
const { currentProject } = useProject();
+ const { tab } = useSearch({ strict: false }) as { tab?: string };
const [isCreateOpen, setIsCreateOpen] = useState(false);
- const [activeTab, setActiveTab] = useState(CodeSigningTabs.Signers);
+ const [activeTab, setActiveTab] = useState(
+ tab === "approvals" ? CodeSigningTabs.Approvals : CodeSigningTabs.Signers
+ );
const [approvalSubTab, setApprovalSubTab] = useState(ApprovalSubTabs.Requests);
return (
diff --git a/frontend/src/pages/cert-manager/CodeSigningPage/route.tsx b/frontend/src/pages/cert-manager/CodeSigningPage/route.tsx
index 418e6592e5..75325e7d72 100644
--- a/frontend/src/pages/cert-manager/CodeSigningPage/route.tsx
+++ b/frontend/src/pages/cert-manager/CodeSigningPage/route.tsx
@@ -1,11 +1,18 @@
import { createFileRoute } from "@tanstack/react-router";
+import { zodValidator } from "@tanstack/zod-adapter";
+import { z } from "zod";
import { CodeSigningPage } from "./CodeSigningPage";
+const CodeSigningSearchSchema = z.object({
+ tab: z.enum(["signers", "approvals"]).optional()
+});
+
export const Route = createFileRoute(
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/projects/cert-manager/$projectId/_cert-manager-layout/code-signing/"
)({
component: CodeSigningPage,
+ validateSearch: zodValidator(CodeSigningSearchSchema),
beforeLoad: ({ context }) => {
return {
breadcrumbs: [
diff --git a/frontend/src/pages/cert-manager/SignerDetailPage/components/SignerOverviewSection.tsx b/frontend/src/pages/cert-manager/SignerDetailPage/components/SignerOverviewSection.tsx
index 4c2789d88f..0e03569d6e 100644
--- a/frontend/src/pages/cert-manager/SignerDetailPage/components/SignerOverviewSection.tsx
+++ b/frontend/src/pages/cert-manager/SignerDetailPage/components/SignerOverviewSection.tsx
@@ -62,7 +62,7 @@ export const SignerOverviewSection = ({ signer, projectId, onEdit }: Props) => {
<div className="flex flex-col gap-5">
<UnstableCard>
<UnstableCardHeader className="border-b">
- <UnstableCardTitle>Signing Identity</UnstableCardTitle>
+ <UnstableCardTitle>Siger Details</UnstableCardTitle>
<UnstableCardDescription>Signer configuration and key details</UnstableCardDescription>
{onEdit && (
<UnstableCardAction>