mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 03:28:43 +00:00
Merge pull request #4320 from Infisical/daniel/vault-migration-path-fix
fix: improve vault folders mapping
This commit is contained in:
@@ -19,7 +19,7 @@ export const registerExternalMigrationRouter = async (server: FastifyZodProvider
|
||||
config: {
|
||||
rateLimit: writeLimit
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
const data = await req.file({
|
||||
limits: {
|
||||
@@ -69,7 +69,7 @@ export const registerExternalMigrationRouter = async (server: FastifyZodProvider
|
||||
mappingType: z.nativeEnum(VaultMappingType)
|
||||
})
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
handler: async (req) => {
|
||||
await server.services.migration.importVaultData({
|
||||
actorId: req.permission.id,
|
||||
|
||||
@@ -254,9 +254,7 @@ export const transformToInfisicalFormatNamespaceToProjects = (
|
||||
let currentFolderId: string | undefined;
|
||||
let currentPath = "";
|
||||
|
||||
if (path.includes("/")) {
|
||||
const pathParts = path.split("/").filter(Boolean);
|
||||
|
||||
const folderParts = pathParts;
|
||||
|
||||
// create nested folder structure for the entire path
|
||||
@@ -278,7 +276,6 @@ export const transformToInfisicalFormatNamespaceToProjects = (
|
||||
currentFolderId = folderMap.get(folderKey)!;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const [key, value] of Object.entries(secretData)) {
|
||||
secrets.push({
|
||||
|
||||
Reference in New Issue
Block a user