@budibase/worker 2.22.4 → 2.22.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__mocks__/node-fetch.ts +1 -2
- package/package.json +6 -6
- package/scripts/test.sh +4 -4
- package/src/api/controllers/global/auth.ts +3 -4
- package/src/api/routes/global/tests/auth.spec.ts +1 -4
- package/src/api/routes/global/tests/scim.spec.ts +3 -0
- package/src/features.ts +1 -0
- package/src/migrations/functions/globalInfoSyncUsers.ts +1 -1
- package/src/sdk/auth/tests/auth.spec.ts +2 -0
- package/src/tests/TestConfiguration.ts +0 -1
- package/src/tests/structures/groups.ts +1 -1
- package/src/utilities/templates.ts +0 -2
package/__mocks__/node-fetch.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/worker",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.22.
|
|
4
|
+
"version": "2.22.7",
|
|
5
5
|
"description": "Budibase background service",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
"author": "Budibase",
|
|
38
38
|
"license": "GPL-3.0",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@budibase/backend-core": "2.22.
|
|
41
|
-
"@budibase/pro": "2.22.
|
|
42
|
-
"@budibase/string-templates": "2.22.
|
|
43
|
-
"@budibase/types": "2.22.
|
|
40
|
+
"@budibase/backend-core": "2.22.7",
|
|
41
|
+
"@budibase/pro": "2.22.7",
|
|
42
|
+
"@budibase/string-templates": "2.22.7",
|
|
43
|
+
"@budibase/types": "2.22.7",
|
|
44
44
|
"@koa/router": "8.0.8",
|
|
45
45
|
"@techpass/passport-openidconnect": "0.3.2",
|
|
46
46
|
"@types/global-agent": "2.1.1",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "a3c764383e3f2e3153d5fe6035c610b5f103c4e3"
|
|
112
112
|
}
|
package/scripts/test.sh
CHANGED
|
@@ -4,10 +4,10 @@ set -e
|
|
|
4
4
|
if [[ -n $CI ]]
|
|
5
5
|
then
|
|
6
6
|
# Running in ci, where resources are limited
|
|
7
|
-
echo "jest --coverage --maxWorkers=2
|
|
8
|
-
jest --coverage --maxWorkers=2
|
|
7
|
+
echo "jest --coverage --maxWorkers=2 --forceExit --bail $@"
|
|
8
|
+
jest --coverage --maxWorkers=2 --forceExit --bail $@
|
|
9
9
|
else
|
|
10
10
|
# --maxWorkers performs better in development
|
|
11
|
-
echo "jest --coverage --
|
|
12
|
-
jest --coverage --
|
|
11
|
+
echo "jest --coverage --detectOpenHandles $@"
|
|
12
|
+
jest --coverage --detectOpenHandles $@
|
|
13
13
|
fi
|
|
@@ -225,7 +225,7 @@ export async function oidcCallbackUrl() {
|
|
|
225
225
|
return ssoCallbackUrl(ConfigType.OIDC)
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
export const oidcStrategyFactory = async (ctx: any
|
|
228
|
+
export const oidcStrategyFactory = async (ctx: any) => {
|
|
229
229
|
const config = await configs.getOIDCConfig()
|
|
230
230
|
if (!config) {
|
|
231
231
|
return ctx.throw(400, "OIDC config not found")
|
|
@@ -247,7 +247,7 @@ export const oidcPreAuth = async (ctx: Ctx, next: any) => {
|
|
|
247
247
|
if (!configId) {
|
|
248
248
|
ctx.throw(400, "OIDC config id is required")
|
|
249
249
|
}
|
|
250
|
-
const strategy = await oidcStrategyFactory(ctx
|
|
250
|
+
const strategy = await oidcStrategyFactory(ctx)
|
|
251
251
|
|
|
252
252
|
setCookie(ctx, configId, Cookie.OIDC_CONFIG)
|
|
253
253
|
|
|
@@ -268,8 +268,7 @@ export const oidcPreAuth = async (ctx: Ctx, next: any) => {
|
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
export const oidcCallback = async (ctx: any, next: any) => {
|
|
271
|
-
const
|
|
272
|
-
const strategy = await oidcStrategyFactory(ctx, configId)
|
|
271
|
+
const strategy = await oidcStrategyFactory(ctx)
|
|
273
272
|
|
|
274
273
|
return passport.authenticate(
|
|
275
274
|
strategy,
|
|
@@ -168,10 +168,7 @@ describe("/api/global/auth", () => {
|
|
|
168
168
|
let user: User
|
|
169
169
|
|
|
170
170
|
async function testSSOUser() {
|
|
171
|
-
|
|
172
|
-
sendMailMock,
|
|
173
|
-
user.email
|
|
174
|
-
)
|
|
171
|
+
await config.api.auth.requestPasswordReset(sendMailMock, user.email)
|
|
175
172
|
expect(sendMailMock).not.toHaveBeenCalled()
|
|
176
173
|
}
|
|
177
174
|
|
|
@@ -704,6 +704,7 @@ describe("scim", () => {
|
|
|
704
704
|
expect(response).toEqual({
|
|
705
705
|
Resources: expect.arrayContaining(
|
|
706
706
|
groups.map(g => {
|
|
707
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
707
708
|
const { members, ...groupData } = g
|
|
708
709
|
return groupData
|
|
709
710
|
})
|
|
@@ -723,6 +724,7 @@ describe("scim", () => {
|
|
|
723
724
|
expect(response).toEqual({
|
|
724
725
|
Resources: expect.arrayContaining(
|
|
725
726
|
groups.map(g => {
|
|
727
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
726
728
|
const { members, displayName, ...groupData } = g
|
|
727
729
|
return groupData
|
|
728
730
|
})
|
|
@@ -872,6 +874,7 @@ describe("scim", () => {
|
|
|
872
874
|
qs: "excludedAttributes=members",
|
|
873
875
|
})
|
|
874
876
|
|
|
877
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
875
878
|
const { members, ...expectedResponse } = group
|
|
876
879
|
|
|
877
880
|
expect(response).toEqual(expectedResponse)
|
package/src/features.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { platform } from "@budibase/backend-core"
|
|
|
9
9
|
* Description:
|
|
10
10
|
* Re-sync the global-db users to the global-info db users
|
|
11
11
|
*/
|
|
12
|
-
export const run = async (
|
|
12
|
+
export const run = async () => {
|
|
13
13
|
const users = (await usersSdk.db.allUsers()) as User[]
|
|
14
14
|
const promises = []
|
|
15
15
|
for (let user of users) {
|
|
@@ -6,6 +6,8 @@ import { TestConfiguration } from "../../../tests"
|
|
|
6
6
|
describe("auth", () => {
|
|
7
7
|
const config = new TestConfiguration()
|
|
8
8
|
|
|
9
|
+
afterAll(config.afterAll)
|
|
10
|
+
|
|
9
11
|
describe("resetUpdate", () => {
|
|
10
12
|
it("providing a valid code will update the password", async () => {
|
|
11
13
|
await context.doInTenant(structures.tenant.id(), async () => {
|
|
@@ -5,7 +5,7 @@ import { UserGroup as UserGroupType, UserGroupRoles } from "@budibase/types"
|
|
|
5
5
|
export function UserGroup(): UserGroupType {
|
|
6
6
|
const appsCount = generator.integer({ min: 0, max: 3 })
|
|
7
7
|
const roles = Array.from({ length: appsCount }).reduce(
|
|
8
|
-
(p: UserGroupRoles
|
|
8
|
+
(p: UserGroupRoles) => {
|
|
9
9
|
return {
|
|
10
10
|
...p,
|
|
11
11
|
[db.generateAppID()]: generator.pickone(["ADMIN", "POWER", "BASIC"]),
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { tenancy, configs } from "@budibase/backend-core"
|
|
2
|
-
import { SettingsInnerConfig } from "@budibase/types"
|
|
3
2
|
import {
|
|
4
3
|
InternalTemplateBinding,
|
|
5
4
|
LOGO_URL,
|
|
6
5
|
EmailTemplatePurpose,
|
|
7
6
|
} from "../constants"
|
|
8
7
|
import { checkSlashesInUrl } from "./index"
|
|
9
|
-
import { getLicensedConfig } from "./configs"
|
|
10
8
|
|
|
11
9
|
const BASE_COMPANY = "Budibase"
|
|
12
10
|
import * as pro from "@budibase/pro"
|