@budibase/worker 2.4.5-alpha.1 → 2.4.6-alpha.0
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/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/worker",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.6-alpha.0",
|
|
5
|
+
"description": "Budibase background service",
|
|
5
6
|
"main": "src/index.ts",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
@@ -35,10 +36,10 @@
|
|
|
35
36
|
"author": "Budibase",
|
|
36
37
|
"license": "GPL-3.0",
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@budibase/backend-core": "2.4.
|
|
39
|
-
"@budibase/pro": "2.4.5
|
|
40
|
-
"@budibase/string-templates": "2.4.
|
|
41
|
-
"@budibase/types": "2.4.
|
|
39
|
+
"@budibase/backend-core": "2.4.6-alpha.0",
|
|
40
|
+
"@budibase/pro": "2.4.5",
|
|
41
|
+
"@budibase/string-templates": "2.4.6-alpha.0",
|
|
42
|
+
"@budibase/types": "2.4.6-alpha.0",
|
|
42
43
|
"@koa/router": "8.0.8",
|
|
43
44
|
"@sentry/node": "6.17.7",
|
|
44
45
|
"@techpass/passport-openidconnect": "0.3.2",
|
|
@@ -100,5 +101,5 @@
|
|
|
100
101
|
"typescript": "4.7.3",
|
|
101
102
|
"update-dotenv": "1.1.1"
|
|
102
103
|
},
|
|
103
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "4f53f6ab3082d330b95a9ed27ccc04c0f79889c0"
|
|
104
105
|
}
|
|
@@ -4,6 +4,7 @@ jest.mock("nodemailer")
|
|
|
4
4
|
import { TestConfiguration, mocks, structures } from "../../../../tests"
|
|
5
5
|
const sendMailMock = mocks.email.mock()
|
|
6
6
|
import { events, tenancy, accounts as _accounts } from "@budibase/backend-core"
|
|
7
|
+
import * as userSdk from "../../../../sdk/users"
|
|
7
8
|
|
|
8
9
|
const accounts = jest.mocked(_accounts)
|
|
9
10
|
|
|
@@ -468,6 +469,20 @@ describe("/api/global/users", () => {
|
|
|
468
469
|
config.authHeaders(nonAdmin)
|
|
469
470
|
)
|
|
470
471
|
})
|
|
472
|
+
|
|
473
|
+
describe("sso users", () => {
|
|
474
|
+
function createSSOUser() {
|
|
475
|
+
return config.doInTenant(() => {
|
|
476
|
+
const user = structures.users.ssoUser()
|
|
477
|
+
return userSdk.save(user, { requirePassword: false })
|
|
478
|
+
})
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
it("should be able to update an sso user that has no password", async () => {
|
|
482
|
+
const user = await createSSOUser()
|
|
483
|
+
await config.api.users.saveUser(user)
|
|
484
|
+
})
|
|
485
|
+
})
|
|
471
486
|
})
|
|
472
487
|
|
|
473
488
|
describe("POST /api/global/users/bulk (delete)", () => {
|
package/src/sdk/users/users.ts
CHANGED
|
@@ -131,6 +131,11 @@ const buildUser = async (
|
|
|
131
131
|
): Promise<User> => {
|
|
132
132
|
let { password, _id } = user
|
|
133
133
|
|
|
134
|
+
// don't require a password if the db user doesn't already have one
|
|
135
|
+
if (dbUser && !dbUser.password) {
|
|
136
|
+
opts.requirePassword = false
|
|
137
|
+
}
|
|
138
|
+
|
|
134
139
|
let hashedPassword
|
|
135
140
|
if (password) {
|
|
136
141
|
if (await isPreventPasswordActions(user)) {
|