Skip to content

Commit

Permalink
Merge pull request #15196 from Budibase/fix/disallow-plugin-app-import
Browse files Browse the repository at this point in the history
Reject plugins when importing apps
  • Loading branch information
mike12345567 authored Dec 17, 2024
2 parents c9bdf6f + 77eb805 commit 1b6f113
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/server/src/sdk/app/backups/imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,16 @@ export async function importApp(
if (stillEncrypted) {
throw new Error("Files are encrypted but no password has been supplied.")
}
const isPlugin = !!contents.find(name => name === "plugin.min.js")
if (isPlugin) {
throw new Error("Supplied file is a plugin - cannot import as app.")
}
const isInvalid = !contents.find(name => name === DB_EXPORT_FILE)
if (isInvalid) {
throw new Error(
"App export does not appear to be valid - no DB file found."
)
}
// have to handle object import
if (contents.length && opts.importObjStoreContents) {
let promises = []
Expand Down

0 comments on commit 1b6f113

Please sign in to comment.