Skip to content

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

fix: filter by file type to avoid deletion of folders

adilsond25be07e99bd
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 353d179c0b..a39051a08c 100644
--- a/backend/src/services/secret-sync/rundeck/rundeck-sync-fns.ts
+++ b/backend/src/services/secret-sync/rundeck/rundeck-sync-fns.ts
@@ -17,6 +17,7 @@ import { TRundeckSyncWithCredentials } from "./rundeck-sync-types";
const RUNDECK_SECRET_CONTENT_TYPE = "application/x-rundeck-data-password";
type TRundeckStorageResource = {
+ type: string;
name: string;
};
@@ -53,7 +54,7 @@ const getRundeckClientDetails = async (secretSync: TRundeckSyncWithCredentials)
const listRundeckSecretKeys = async (baseUrl: string, headers: Record<string, string>): Promise<string[]> => {
try {
const { data } = await request.get<TRundeckStorageListResponse>(baseUrl, { headers });
- return data.resources.map((resource) => resource.name);
+ return data.resources.filter((resource) => resource.type === "file").map((resource) => resource.name);
} catch (error) {
// The storage path does not exist until the first secret is written - treat as empty
if (error instanceof AxiosError && error.response?.status === 404) {