infisical icon indicating copy to clipboard operation
infisical copied to clipboard

Add PKI template presets

Open carlosmonastyrski opened this issue 1 month ago • 2 comments

Description 📣

Add certificate template presets with industry-standard configurations for TLS server/client, code signing, device, user, email protection, and dual-purpose server certificates

Type ✨

  • [ ] Bug fix
  • [ ] New feature
  • [ ] Improvement
  • [ ] Breaking change
  • [ ] Documentation

Tests 🛠️

# Here's some code block to paste some code snippets

carlosmonastyrski avatar Nov 14 '25 04:11 carlosmonastyrski

:white_check_mark: Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
:white_check_mark: Open Source Security 0 0 0 0 0 issues

:computer: Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

maidul98 avatar Nov 14 '25 04:11 maidul98

Greptile Overview

Greptile Summary

Adds certificate template presets to the PKI certificate management UI, allowing users to quickly configure templates with industry-standard settings for common use cases.

Key Changes:

  • New preset selector dropdown in template creation modal with 7 preset options (TLS Server, TLS Client, Code Signing, Device, User, Email Protection, Dual-Purpose Server)
  • Form automatically populates with appropriate key usages, extended key usages, SANs, and algorithm selections when preset is selected
  • Preset automatically resets to "Custom" when user manually modifies any form field
  • Improved type safety by converting string literal arrays to enums (CertSubjectAttributeInclude, CertSanInclude)
  • All presets include reasonable defaults for validity (365 days) and wildcard patterns for flexible certificate issuance

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - it's a frontend-only enhancement with well-structured code
  • The changes are isolated to the frontend certificate template UI with no API modifications or breaking changes. The implementation follows TypeScript best practices with proper type safety, uses standard React patterns, and adds useful UX improvements. The presets align with industry standards for PKI certificate configurations.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
frontend/src/pages/cert-manager/PoliciesPage/components/CertificateTemplatesV2Tab/shared/template-presets.ts 5/5 New file adding certificate template presets with industry-standard configurations for TLS, code signing, device, user, and email protection certificates
frontend/src/pages/cert-manager/PoliciesPage/components/CertificateTemplatesV2Tab/CreateTemplateModal.tsx 5/5 Added preset selection dropdown with automatic form population and logic to reset to custom when user modifies form fields
frontend/src/pages/cert-manager/PoliciesPage/components/CertificateTemplatesV2Tab/shared/certificate-constants.ts 5/5 Converted string literal arrays to enums for type safety and added preset IDs and algorithm families constants
frontend/src/pages/cert-manager/PoliciesPage/components/CertificateTemplatesV2Tab/shared/schemas.ts 5/5 Updated validation schemas to use enums instead of string literals and added preset field validation

greptile-apps[bot] avatar Nov 14 '25 04:11 greptile-apps[bot]