Skip to content

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

chore: switch templating engine away from mustache

Meetb416e79d63eb
diff --git a/backend/package-lock.json b/backend/package-lock.json
index 3a15d68578..31521fb7d3 100644
--- a/backend/package-lock.json
+++ b/backend/package-lock.json
@@ -66,7 +66,6 @@
"lodash.isequal": "^4.5.0",
"mongodb": "^6.8.1",
"ms": "^2.1.3",
- "mustache": "^4.2.0",
"mysql2": "^3.9.8",
"nanoid": "^3.3.4",
"nodemailer": "^6.9.9",
@@ -111,7 +110,6 @@
"@types/jsrp": "^0.2.6",
"@types/libsodium-wrappers": "^0.7.13",
"@types/lodash.isequal": "^4.5.8",
- "@types/mustache": "^4.2.5",
"@types/node": "^20.9.5",
"@types/nodemailer": "^6.4.14",
"@types/passport-github": "^1.1.12",
@@ -7079,13 +7077,6 @@
"resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz",
"integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g=="
},
- "node_modules/@types/mustache": {
- "version": "4.2.5",
- "resolved": "https://registry.npmjs.org/@types/mustache/-/mustache-4.2.5.tgz",
- "integrity": "sha512-PLwiVvTBg59tGFL/8VpcGvqOu3L4OuveNvPi0EYbWchRdEVP++yRUXJPFl+CApKEq13017/4Nf7aQ5lTtHUNsA==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/@types/node": {
"version": "20.9.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.5.tgz",
@@ -13729,15 +13720,6 @@
"node": ">= 6"
}
},
- "node_modules/mustache": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz",
- "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==",
- "license": "MIT",
- "bin": {
- "mustache": "bin/mustache"
- }
- },
"node_modules/mylas": {
"version": "2.1.13",
"resolved": "https://registry.npmjs.org/mylas/-/mylas-2.1.13.tgz",
diff --git a/backend/package.json b/backend/package.json
index dfa293e710..314a77306b 100644
--- a/backend/package.json
+++ b/backend/package.json
@@ -71,7 +71,6 @@
"@types/jsrp": "^0.2.6",
"@types/libsodium-wrappers": "^0.7.13",
"@types/lodash.isequal": "^4.5.8",
- "@types/mustache": "^4.2.5",
"@types/node": "^20.9.5",
"@types/nodemailer": "^6.4.14",
"@types/passport-github": "^1.1.12",
@@ -160,12 +159,11 @@
"jwks-rsa": "^3.1.0",
"knex": "^3.0.1",
"ldapjs": "^3.0.7",
- "ldif": "^0.5.1",
+ "ldif": "0.5.1",
"libsodium-wrappers": "^0.7.13",
"lodash.isequal": "^4.5.0",
"mongodb": "^6.8.1",
"ms": "^2.1.3",
- "mustache": "^4.2.0",
"mysql2": "^3.9.8",
"nanoid": "^3.3.4",
"nodemailer": "^6.9.9",
diff --git a/backend/src/ee/services/dynamic-secret/providers/ldap.ts b/backend/src/ee/services/dynamic-secret/providers/ldap.ts
index 07ea470fe2..5e6bd5e160 100644
--- a/backend/src/ee/services/dynamic-secret/providers/ldap.ts
+++ b/backend/src/ee/services/dynamic-secret/providers/ldap.ts
@@ -1,6 +1,6 @@
import ldapjs from "ldapjs";
import ldif from "ldif";
-import mustache from "mustache";
+import { compile } from "handlebars";
import { customAlphabet } from "nanoid";
import { z } from "zod";
@@ -40,7 +40,8 @@ const generateLDIF = ({
EncodedPassword: encodePassword(password)
};
- const renderedLdif = mustache.render(ldifTemplate, data);
+ const renderTemplate = compile(ldifTemplate);
+ const renderedLdif = renderTemplate(data);
return renderedLdif;
};