diff --git a/packages/server/src/tests/utilities/TestConfiguration.js b/packages/server/src/tests/utilities/TestConfiguration.js index 4bafb4079e..eb1280306d 100644 --- a/packages/server/src/tests/utilities/TestConfiguration.js +++ b/packages/server/src/tests/utilities/TestConfiguration.js @@ -17,12 +17,12 @@ const supertest = require("supertest") const { cleanup } = require("../../utilities/fileSystem") const { Cookies, Headers } = require("@budibase/backend-core").constants const { jwt } = require("@budibase/backend-core").auth -const auth = require("@budibase/backend-core") +const core = require("@budibase/backend-core") const { getGlobalDB } = require("@budibase/backend-core/tenancy") const { createASession } = require("@budibase/backend-core/sessions") const { user: userCache } = require("@budibase/backend-core/cache") const CouchDB = require("../../db") -auth.init(CouchDB) +core.init(CouchDB) const GLOBAL_USER_ID = "us_uuid1" const EMAIL = "babs@babs.com" diff --git a/packages/server/src/utilities/rowProcessor/index.js b/packages/server/src/utilities/rowProcessor/index.js index 9229a061e4..4f5d72c179 100644 --- a/packages/server/src/utilities/rowProcessor/index.js +++ b/packages/server/src/utilities/rowProcessor/index.js @@ -5,7 +5,11 @@ const { attachmentsRelativeURL } = require("../index") const { processFormulas } = require("./utils") const { deleteFiles } = require("../../utilities/fileSystem/utilities") const { ObjectStoreBuckets } = require("../../constants") -const { isProdAppID, getDeployedAppID, dbExists } = require("@budibase/auth/db") +const { + isProdAppID, + getDeployedAppID, + dbExists, +} = require("@budibase/backend-core/db") const CouchDB = require("../../db") const BASE_AUTO_ID = 1 diff --git a/packages/worker/src/api/controllers/global/auth.js b/packages/worker/src/api/controllers/global/auth.js index 07eb1bf8e0..ef7f6fdfdc 100644 --- a/packages/worker/src/api/controllers/global/auth.js +++ b/packages/worker/src/api/controllers/global/auth.js @@ -1,4 +1,4 @@ -const authPkg = require("@budibase/backend-core") +const core = require("@budibase/backend-core") const { getScopedConfig } = require("@budibase/backend-core/db") const { google } = require("@budibase/backend-core/src/middleware") const { oidc } = require("@budibase/backend-core/src/middleware") @@ -11,9 +11,9 @@ const { getGlobalUserByEmail, hash, platformLogout, -} = authPkg.utils -const { Cookies, Headers } = authPkg.constants -const { passport } = authPkg.auth +} = core.utils +const { Cookies, Headers } = core.constants +const { passport } = core.auth const { checkResetPasswordCode } = require("../../../utilities/redis") const { getGlobalDB, @@ -152,7 +152,7 @@ exports.logout = async ctx => { exports.googlePreAuth = async (ctx, next) => { const db = getGlobalDB() - const config = await authPkg.db.getScopedConfig(db, { + const config = await core.db.getScopedConfig(db, { type: Configs.GOOGLE, workspace: ctx.query.workspace, }) @@ -167,7 +167,7 @@ exports.googlePreAuth = async (ctx, next) => { exports.googleAuth = async (ctx, next) => { const db = getGlobalDB() - const config = await authPkg.db.getScopedConfig(db, { + const config = await core.db.getScopedConfig(db, { type: Configs.GOOGLE, workspace: ctx.query.workspace, }) @@ -187,7 +187,7 @@ exports.googleAuth = async (ctx, next) => { async function oidcStrategyFactory(ctx, configId) { const db = getGlobalDB() - const config = await authPkg.db.getScopedConfig(db, { + const config = await core.db.getScopedConfig(db, { type: Configs.OIDC, group: ctx.query.group, }) diff --git a/packages/worker/src/api/routes/tests/utilities/TestConfiguration.js b/packages/worker/src/api/routes/tests/utilities/TestConfiguration.js index 05cfffac72..a8824b3db0 100644 --- a/packages/worker/src/api/routes/tests/utilities/TestConfiguration.js +++ b/packages/worker/src/api/routes/tests/utilities/TestConfiguration.js @@ -6,12 +6,12 @@ const { Cookies } = require("@budibase/backend-core").constants const { Configs, LOGO_URL } = require("../../../../constants") const { getGlobalUserByEmail } = require("@budibase/backend-core").utils const { createASession } = require("@budibase/backend-core/sessions") -const { newid } = require("../../../../../../auth/src/hashing") +const { newid } = require("@budibase/backend-core/src/hashing") const { TENANT_ID } = require("./structures") -const auth = require("@budibase/backend-core") +const core = require("@budibase/backend-core") const CouchDB = require("../../../../db") const { doInTenant } = require("@budibase/backend-core/tenancy") -auth.init(CouchDB) +core.init(CouchDB) class TestConfiguration { constructor(openServer = true) {