Skip to content

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

fix: define the same api version for sync and app connection.

adilson962252cea338
diff --git a/backend/src/services/app-connection/rundeck/rundeck-connection-fns.ts b/backend/src/services/app-connection/rundeck/rundeck-connection-fns.ts
index 0afef9b07f..23aa1e0fc2 100644
--- a/backend/src/services/app-connection/rundeck/rundeck-connection-fns.ts
+++ b/backend/src/services/app-connection/rundeck/rundeck-connection-fns.ts
@@ -9,6 +9,8 @@ import { AppConnection } from "../app-connection-enums";
import { RundeckConnectionMethod } from "./rundeck-connection-enums";
import { TRundeckConnection, TRundeckConnectionConfig, TRundeckProject } from "./rundeck-connection-types";
+export const RUNDECK_API_VERSION = "58";
+
export const getRundeckInstanceUrl = async (config: TRundeckConnectionConfig) => {
const instanceUrl = removeTrailingSlash(config.credentials.instanceUrl);
@@ -30,7 +32,7 @@ export const validateRundeckConnectionCredentials = async (config: TRundeckConne
const { apiToken } = config.credentials;
try {
- await request.get(`${instanceUrl}/api/14/projects`, {
+ await request.get(`${instanceUrl}/api/${RUNDECK_API_VERSION}/projects`, {
headers: {
"X-Rundeck-Auth-Token": apiToken,
Accept: "application/json"
@@ -56,7 +58,7 @@ export const listRundeckProjects = async (appConnection: TRundeckConnection): Pr
const { apiToken } = appConnection.credentials;
try {
- const { data } = await request.get<TRundeckProject[]>(`${instanceUrl}/api/14/projects`, {
+ const { data } = await request.get<TRundeckProject[]>(`${instanceUrl}/api/${RUNDECK_API_VERSION}/projects`, {
headers: {
"X-Rundeck-Auth-Token": apiToken,
Accept: "application/json"
diff --git a/backend/src/services/app-connection/rundeck/rundeck-connection-service.ts b/backend/src/services/app-connection/rundeck/rundeck-connection-service.ts
index fdd0866f4d..1b698bc78e 100644
--- a/backend/src/services/app-connection/rundeck/rundeck-connection-service.ts
+++ b/backend/src/services/app-connection/rundeck/rundeck-connection-service.ts
@@ -17,7 +17,7 @@ export const rundeckConnectionService = (getAppConnection: TGetAppConnectionFunc
try {
const projects = await listRundeckProjects(appConnection);
- return projects ?? [];
+ return projects;
} catch (error) {
logger.error(error, "Failed to establish connection with Rundeck");
return [];
diff --git a/backend/src/services/secret-sync/rundeck/rundeck-sync-fns.ts b/backend/src/services/secret-sync/rundeck/rundeck-sync-fns.ts
index d09379f399..05daa47e3b 100644
--- a/backend/src/services/secret-sync/rundeck/rundeck-sync-fns.ts
+++ b/backend/src/services/secret-sync/rundeck/rundeck-sync-fns.ts
@@ -4,6 +4,7 @@ import { AxiosError } from "axios";
import { request } from "@app/lib/config/request";
import { getRundeckInstanceUrl } from "@app/services/app-connection/rundeck";
+import { RUNDECK_API_VERSION } from "@app/services/app-connection/rundeck/rundeck-connection-fns";
import { matchesSchema } from "@app/services/secret-sync/secret-sync-fns";
import { SecretSyncError } from "../secret-sync-errors";
@@ -12,7 +13,6 @@ import { TSecretMap } from "../secret-sync-types";
import { TRundeckSyncWithCredentials } from "./rundeck-sync-types";
// Rundeck Key Storage API version (matches the native Rundeck integration)
-const RUNDECK_STORAGE_API_VERSION = 44;
const RUNDECK_SECRET_CONTENT_TYPE = "application/x-rundeck-data-password";
@@ -41,7 +41,7 @@ const getRundeckClientDetails = async (secretSync: TRundeckSyncWithCredentials)
const storagePath = getRundeckStoragePath(destinationConfig.project, destinationConfig.path);
return {
- baseUrl: `${instanceUrl}/api/${RUNDECK_STORAGE_API_VERSION}/storage/${storagePath}`,
+ baseUrl: `${instanceUrl}/api/${RUNDECK_API_VERSION}/storage/${storagePath}`,
headers: {
"X-Rundeck-Auth-Token": connection.credentials.apiToken
}