@budibase/worker 2.13.33 → 2.13.35
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,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/worker",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.13.
|
|
4
|
+
"version": "2.13.35",
|
|
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.13.
|
|
41
|
-
"@budibase/pro": "2.13.
|
|
42
|
-
"@budibase/string-templates": "2.13.
|
|
43
|
-
"@budibase/types": "2.13.
|
|
40
|
+
"@budibase/backend-core": "2.13.35",
|
|
41
|
+
"@budibase/pro": "2.13.35",
|
|
42
|
+
"@budibase/string-templates": "2.13.35",
|
|
43
|
+
"@budibase/types": "2.13.35",
|
|
44
44
|
"@koa/router": "8.0.8",
|
|
45
45
|
"@techpass/passport-openidconnect": "0.3.2",
|
|
46
46
|
"@types/global-agent": "2.1.1",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "5c98ab7536b59b95c63de6e4d0200ecfd1103b02"
|
|
111
111
|
}
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
PasswordResetRequest,
|
|
16
16
|
PasswordResetUpdateRequest,
|
|
17
17
|
GoogleInnerConfig,
|
|
18
|
+
DatasourceAuthCookie,
|
|
18
19
|
} from "@budibase/types"
|
|
19
20
|
import env from "../../../environment"
|
|
20
21
|
|
|
@@ -148,7 +149,13 @@ export const datasourcePreAuth = async (ctx: any, next: any) => {
|
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
export const datasourceAuth = async (ctx: any, next: any) => {
|
|
151
|
-
const authStateCookie = getCookie(
|
|
152
|
+
const authStateCookie = getCookie<DatasourceAuthCookie>(
|
|
153
|
+
ctx,
|
|
154
|
+
Cookie.DatasourceAuth
|
|
155
|
+
)
|
|
156
|
+
if (!authStateCookie) {
|
|
157
|
+
throw new Error("Unable to retrieve datasource authentication cookie")
|
|
158
|
+
}
|
|
152
159
|
const provider = authStateCookie.provider
|
|
153
160
|
const { middleware } = require(`@budibase/backend-core`)
|
|
154
161
|
const handler = middleware.datasource[provider]
|
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
ConfigType,
|
|
36
36
|
} from "@budibase/types"
|
|
37
37
|
import API from "./api"
|
|
38
|
+
import jwt, { Secret } from "jsonwebtoken"
|
|
38
39
|
|
|
39
40
|
class TestConfiguration {
|
|
40
41
|
server: any
|
|
@@ -209,7 +210,7 @@ class TestConfiguration {
|
|
|
209
210
|
sessionId: "sessionid",
|
|
210
211
|
tenantId: user.tenantId,
|
|
211
212
|
}
|
|
212
|
-
const authCookie =
|
|
213
|
+
const authCookie = jwt.sign(authToken, coreEnv.JWT_SECRET as Secret)
|
|
213
214
|
return {
|
|
214
215
|
Accept: "application/json",
|
|
215
216
|
...this.cookieHeader([`${constants.Cookie.Auth}=${authCookie}`]),
|
|
@@ -327,7 +328,7 @@ class TestConfiguration {
|
|
|
327
328
|
// CONFIGS - OIDC
|
|
328
329
|
|
|
329
330
|
getOIDConfigCookie(configId: string) {
|
|
330
|
-
const token =
|
|
331
|
+
const token = jwt.sign(configId, coreEnv.JWT_SECRET as Secret)
|
|
331
332
|
return this.cookieHeader([[`${constants.Cookie.OIDC_CONFIG}=${token}`]])
|
|
332
333
|
}
|
|
333
334
|
|