@budibase/worker 2.13.32 → 2.13.34

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.32",
4
+ "version": "2.13.34",
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.32",
41
- "@budibase/pro": "2.13.32",
42
- "@budibase/string-templates": "2.13.32",
43
- "@budibase/types": "2.13.32",
40
+ "@budibase/backend-core": "2.13.34",
41
+ "@budibase/pro": "2.13.34",
42
+ "@budibase/string-templates": "2.13.34",
43
+ "@budibase/types": "2.13.34",
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": "e0118d45fe9dcd9fc6649380f67c6656d27f39c8"
110
+ "gitHead": "8ede1fcd5b6bc60717484411057faa89aeeba832"
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(ctx, Cookie.DatasourceAuth)
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 = auth.jwt.sign(authToken, coreEnv.JWT_SECRET)
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 = auth.jwt.sign(configId, coreEnv.JWT_SECRET)
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