Skip to content

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

Address greptile comments

Carlos Monastyrskie64070765980
diff --git a/backend/src/services/pki-sync/cloudflare-custom-certificate/cloudflare-custom-certificate-pki-sync-fns.ts b/backend/src/services/pki-sync/cloudflare-custom-certificate/cloudflare-custom-certificate-pki-sync-fns.ts
index 7ec58d84e3..149f6290d8 100644
--- a/backend/src/services/pki-sync/cloudflare-custom-certificate/cloudflare-custom-certificate-pki-sync-fns.ts
+++ b/backend/src/services/pki-sync/cloudflare-custom-certificate/cloudflare-custom-certificate-pki-sync-fns.ts
@@ -75,16 +75,19 @@ export const cloudflareCustomCertificatePkiSyncFactory = ({
request.get<{
result: CloudflareEdgeCertificate[];
result_info: { page: number; per_page: number; total_pages: number; total_count: number };
- }>(`${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${zoneId}/custom_certificates`, {
- headers: {
- Authorization: `Bearer ${apiToken}`,
- "Content-Type": "application/json"
- },
- params: {
- page: currentPage,
- per_page: perPage
+ }>(
+ `${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${encodeURIComponent(zoneId)}/custom_certificates`,
+ {
+ headers: {
+ Authorization: `Bearer ${apiToken}`,
+ "Content-Type": "application/json"
+ },
+ params: {
+ page: currentPage,
+ per_page: perPage
+ }
}
- }),
+ ),
{ operation: "list-edge-certificates", syncId }
);
@@ -253,7 +256,7 @@ export const cloudflareCustomCertificatePkiSyncFactory = ({
const patchResponse = await withRateLimitRetry(
() =>
request.patch<{ result: CloudflareEdgeCertificate }>(
- `${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${zoneId}/custom_certificates/${existingCloudflareId}`,
+ `${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${encodeURIComponent(zoneId)}/custom_certificates/${existingCloudflareId}`,
{
certificate: fullCertificate,
private_key: privateKey,
@@ -285,7 +288,7 @@ export const cloudflareCustomCertificatePkiSyncFactory = ({
const response = await withRateLimitRetry(
() =>
request.post<{ result: CloudflareEdgeCertificate }>(
- `${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${zoneId}/custom_certificates`,
+ `${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${encodeURIComponent(zoneId)}/custom_certificates`,
{
certificate: fullCertificate,
private_key: privateKey,
@@ -366,7 +369,7 @@ export const cloudflareCustomCertificatePkiSyncFactory = ({
await withRateLimitRetry(
() =>
request.delete(
- `${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${zoneId}/custom_certificates/${cloudflareCertId}`,
+ `${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${encodeURIComponent(zoneId)}/custom_certificates/${cloudflareCertId}`,
{
headers: {
Authorization: `Bearer ${apiToken}`
@@ -515,7 +518,7 @@ export const cloudflareCustomCertificatePkiSyncFactory = ({
await withRateLimitRetry(
() =>
request.delete(
- `${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${zoneId}/custom_certificates/${cloudflareCertId}`,
+ `${IntegrationUrls.CLOUDFLARE_API_URL}/client/v4/zones/${encodeURIComponent(zoneId)}/custom_certificates/${cloudflareCertId}`,
{
headers: {
Authorization: `Bearer ${apiToken}`