@budibase/worker 2.5.3 → 2.5.5-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 +9 -8
- package/scripts/dev/manage.js +1 -0
- package/src/api/controllers/global/users.ts +2 -2
- package/src/api/routes/global/configs.ts +9 -1
- package/src/api/routes/global/tests/scim.spec.ts +966 -0
- package/src/api/routes/global/tests/users.spec.ts +10 -4
- package/src/api/routes/index.ts +4 -6
- package/src/environment.ts +0 -1
- package/src/index.ts +7 -7
- package/src/initPro.ts +13 -0
- package/src/middleware/handleScimBody.ts +12 -0
- package/src/sdk/users/users.ts +7 -44
- package/src/tests/TestConfiguration.ts +50 -1
- package/src/tests/api/index.ts +7 -0
- package/src/tests/api/scim/groups.ts +94 -0
- package/src/tests/api/scim/shared.ts +44 -0
- package/src/tests/api/scim/users.ts +94 -0
- package/src/tests/jestEnv.ts +0 -1
- package/src/tests/jestSetup.ts +0 -2
- package/src/elasticApm.ts +0 -10
- package/src/tests/logging.ts +0 -34
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/worker",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.5-alpha.0",
|
|
5
5
|
"description": "Budibase background service",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"build:docker": "docker build . -t worker-service --label version=$BUDIBASE_RELEASE_VERSION",
|
|
23
23
|
"dev:stack:init": "node ./scripts/dev/manage.js init",
|
|
24
24
|
"dev:builder": "npm run dev:stack:init && nodemon",
|
|
25
|
+
"dev:built": "yarn run dev:stack:init && yarn run run:docker",
|
|
25
26
|
"test": "bash scripts/test.sh",
|
|
26
27
|
"test:watch": "jest --watch",
|
|
27
28
|
"env:multi:enable": "node scripts/multiTenancy.js enable",
|
|
@@ -36,10 +37,10 @@
|
|
|
36
37
|
"author": "Budibase",
|
|
37
38
|
"license": "GPL-3.0",
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@budibase/backend-core": "
|
|
40
|
-
"@budibase/pro": "2.5.
|
|
41
|
-
"@budibase/string-templates": "
|
|
42
|
-
"@budibase/types": "
|
|
40
|
+
"@budibase/backend-core": "2.5.5-alpha.0",
|
|
41
|
+
"@budibase/pro": "2.5.4",
|
|
42
|
+
"@budibase/string-templates": "2.5.5-alpha.0",
|
|
43
|
+
"@budibase/types": "2.5.5-alpha.0",
|
|
43
44
|
"@koa/router": "8.0.8",
|
|
44
45
|
"@sentry/node": "6.17.7",
|
|
45
46
|
"@techpass/passport-openidconnect": "0.3.2",
|
|
@@ -56,7 +57,6 @@
|
|
|
56
57
|
"koa-body": "4.2.0",
|
|
57
58
|
"koa-compress": "4.0.1",
|
|
58
59
|
"koa-passport": "4.1.4",
|
|
59
|
-
"koa-pino-logger": "3.0.0",
|
|
60
60
|
"koa-send": "5.0.1",
|
|
61
61
|
"koa-session": "5.13.1",
|
|
62
62
|
"koa-static": "5.0.0",
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
"passport-google-oauth": "2.0.0",
|
|
67
67
|
"passport-jwt": "4.0.0",
|
|
68
68
|
"passport-local": "1.0.0",
|
|
69
|
-
"pino-pretty": "4.8.0",
|
|
70
69
|
"pouchdb": "7.3.0",
|
|
71
70
|
"pouchdb-all-dbs": "1.1.1",
|
|
72
71
|
"server-destroy": "1.0.1"
|
|
@@ -79,6 +78,7 @@
|
|
|
79
78
|
"@types/jsonwebtoken": "8.5.1",
|
|
80
79
|
"@types/koa": "2.13.4",
|
|
81
80
|
"@types/koa__router": "8.0.8",
|
|
81
|
+
"@types/lodash": "^4.14.191",
|
|
82
82
|
"@types/node": "14.18.20",
|
|
83
83
|
"@types/node-fetch": "2.6.1",
|
|
84
84
|
"@types/pouchdb": "6.4.0",
|
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
"copyfiles": "2.4.1",
|
|
90
90
|
"eslint": "6.8.0",
|
|
91
91
|
"jest": "28.1.1",
|
|
92
|
+
"lodash": "4.17.21",
|
|
92
93
|
"nodemon": "2.0.15",
|
|
93
94
|
"pouchdb-adapter-memory": "7.2.2",
|
|
94
95
|
"prettier": "2.3.1",
|
|
@@ -101,5 +102,5 @@
|
|
|
101
102
|
"typescript": "4.7.3",
|
|
102
103
|
"update-dotenv": "1.1.1"
|
|
103
104
|
},
|
|
104
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "84e8cc00315e223433e388b72fae3bd048ff5760"
|
|
105
106
|
}
|
package/scripts/dev/manage.js
CHANGED
|
@@ -177,7 +177,7 @@ export const destroy = async (ctx: any) => {
|
|
|
177
177
|
ctx.throw(400, "Unable to delete self.")
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
await userSdk.destroy(id
|
|
180
|
+
await userSdk.destroy(id)
|
|
181
181
|
|
|
182
182
|
ctx.body = {
|
|
183
183
|
message: `User ${id} deleted.`,
|
|
@@ -197,7 +197,7 @@ export const search = async (ctx: any) => {
|
|
|
197
197
|
if (body.paginated === false) {
|
|
198
198
|
await getAppUsers(ctx)
|
|
199
199
|
} else {
|
|
200
|
-
const paginated = await userSdk.paginatedUsers(body)
|
|
200
|
+
const paginated = await userSdk.core.paginatedUsers(body)
|
|
201
201
|
// user hashed password shouldn't ever be returned
|
|
202
202
|
for (let user of paginated.data) {
|
|
203
203
|
if (user) {
|
|
@@ -58,6 +58,13 @@ function oidcValidation() {
|
|
|
58
58
|
}).unknown(true)
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
function scimValidation() {
|
|
62
|
+
// prettier-ignore
|
|
63
|
+
return Joi.object({
|
|
64
|
+
enabled: Joi.boolean().required(),
|
|
65
|
+
}).unknown(true)
|
|
66
|
+
}
|
|
67
|
+
|
|
61
68
|
function buildConfigSaveValidation() {
|
|
62
69
|
// prettier-ignore
|
|
63
70
|
return auth.joiValidator.body(Joi.object({
|
|
@@ -74,7 +81,8 @@ function buildConfigSaveValidation() {
|
|
|
74
81
|
{ is: ConfigType.SETTINGS, then: settingValidation() },
|
|
75
82
|
{ is: ConfigType.ACCOUNT, then: Joi.object().unknown(true) },
|
|
76
83
|
{ is: ConfigType.GOOGLE, then: googleValidation() },
|
|
77
|
-
{ is: ConfigType.OIDC, then: oidcValidation() }
|
|
84
|
+
{ is: ConfigType.OIDC, then: oidcValidation() },
|
|
85
|
+
{ is: ConfigType.SCIM, then: scimValidation() }
|
|
78
86
|
],
|
|
79
87
|
}),
|
|
80
88
|
}).required().unknown(true),
|