Skip to content

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

Foramt privatekey

x032205a349dda4bccd
diff --git a/backend/src/services/app-connection/github/github-connection-fns.ts b/backend/src/services/app-connection/github/github-connection-fns.ts
index 2d4e70e3a2..164aa31d94 100644
--- a/backend/src/services/app-connection/github/github-connection-fns.ts
+++ b/backend/src/services/app-connection/github/github-connection-fns.ts
@@ -119,7 +119,7 @@ export const getGitHubAppAuthToken = async (
) => {
const appCfg = getConfig();
const appId = appCfg.INF_APP_CONNECTION_GITHUB_APP_ID;
- const appPrivateKey = appCfg.INF_APP_CONNECTION_GITHUB_APP_PRIVATE_KEY;
+ let appPrivateKey = appCfg.INF_APP_CONNECTION_GITHUB_APP_PRIVATE_KEY;
if (!appId || !appPrivateKey) {
throw new InternalServerError({
@@ -127,6 +127,11 @@ export const getGitHubAppAuthToken = async (
});
}
+ appPrivateKey = appPrivateKey
+ .split("\n")
+ .map((line) => line.trim())
+ .join("\n");
+
if (appConnection.method !== GitHubConnectionMethod.App) {
throw new InternalServerError({ message: "Cannot generate GitHub App token for non-app connection" });
}