From 615d0390d5ed4f15b6e89dbb0e9ee0cee4135019 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Wed, 6 Oct 2021 16:50:15 +0100 Subject: [PATCH 1/2] Honour cookie domain when custom sso is enabled --- packages/worker/src/api/controllers/global/auth.js | 12 +++++++++--- packages/worker/src/environment.js | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/worker/src/api/controllers/global/auth.js b/packages/worker/src/api/controllers/global/auth.js index f3188d7777..4e5603b596 100644 --- a/packages/worker/src/api/controllers/global/auth.js +++ b/packages/worker/src/api/controllers/global/auth.js @@ -41,13 +41,19 @@ async function authInternal(ctx, user, err = null, info = null) { return ctx.throw(403, info ? info : "Unauthorized") } - // just store the user ID - ctx.cookies.set(Cookies.Auth, user.token, { + const config = { expires, path: "/", httpOnly: false, overwrite: true, - }) + } + + if (env.COOKIE_DOMAIN) { + config.domain = env.COOKIE_DOMAIN + } + + // just store the user ID + ctx.cookies.set(Cookies.Auth, user.token, config) } exports.authenticate = async (ctx, next) => { diff --git a/packages/worker/src/environment.js b/packages/worker/src/environment.js index 0ef83a327e..74bd40314c 100644 --- a/packages/worker/src/environment.js +++ b/packages/worker/src/environment.js @@ -41,6 +41,7 @@ module.exports = { SMTP_PORT: process.env.SMTP_PORT, SMTP_FROM_ADDRESS: process.env.SMTP_FROM_ADDRESS, PLATFORM_URL: process.env.PLATFORM_URL, + COOKIE_DOMAIN: process.env.COOKIE_DOMAIN, _set(key, value) { process.env[key] = value module.exports[key] = value From 6e11aa2cec89fd28de32e979d3d2d9a6ca31e75e Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 6 Oct 2021 16:12:27 +0000 Subject: [PATCH 2/2] v0.9.153-alpha.2 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 9ac2a8d4d2..6f4c9adb93 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 88d5ace67b..abf2895197 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index facc46b82d..84be0ebe09 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 9ee2044a1a..fc1a14d4cf 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.153-alpha.1", - "@budibase/client": "^0.9.153-alpha.1", + "@budibase/bbui": "^0.9.153-alpha.2", + "@budibase/client": "^0.9.153-alpha.2", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.153-alpha.1", + "@budibase/string-templates": "^0.9.153-alpha.2", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 37d316b17a..183c4d8e52 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 3e932a9f1c..8527b24acb 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.153-alpha.1", + "@budibase/bbui": "^0.9.153-alpha.2", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.153-alpha.1", + "@budibase/string-templates": "^0.9.153-alpha.2", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 6a04c3f4e9..1964f0569a 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.153-alpha.1", - "@budibase/client": "^0.9.153-alpha.1", - "@budibase/string-templates": "^0.9.153-alpha.1", + "@budibase/auth": "^0.9.153-alpha.2", + "@budibase/client": "^0.9.153-alpha.2", + "@budibase/string-templates": "^0.9.153-alpha.2", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 401f34013e..52858874c2 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index f0d196b2e6..51162af912 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.153-alpha.1", - "@budibase/string-templates": "^0.9.153-alpha.1", + "@budibase/auth": "^0.9.153-alpha.2", + "@budibase/string-templates": "^0.9.153-alpha.2", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0",