Merge branch 'master' of github.com:Budibase/budibase into develop

This commit is contained in:
mike12345567 2022-03-15 10:56:39 +00:00
commit 51e5e1e90f
15 changed files with 52 additions and 44 deletions

View File

@ -63,6 +63,7 @@ jobs:
run: |
git config user.name "Budibase Helm Bot"
git config user.email "<>"
git reset --hard
git pull
helm package charts/budibase
git checkout gh-pages

View File

@ -1,5 +1,5 @@
{
"version": "1.0.86-alpha.0",
"version": "1.0.88",
"npmClient": "yarn",
"packages": [
"packages/*"

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/backend-core",
"version": "1.0.86-alpha.0",
"version": "1.0.88",
"description": "Budibase backend core libraries used in server and worker",
"main": "src/index.js",
"author": "Budibase",

View File

@ -5,7 +5,7 @@ const { getSession, updateSessionTTL } = require("../security/sessions")
const { buildMatcherRegex, matches } = require("./matchers")
const env = require("../environment")
const { SEPARATOR, ViewNames, queryGlobalView } = require("../../db")
const { getGlobalDB } = require("../tenancy")
const { getGlobalDB, doInTenant } = require("../tenancy")
const { decrypt } = require("../security/encryption")
function finalise(
@ -25,7 +25,8 @@ async function checkApiKey(apiKey, populateUser) {
}
const decrypted = decrypt(apiKey)
const tenantId = decrypted.split(SEPARATOR)[0]
const db = getGlobalDB(tenantId)
return doInTenant(tenantId, async () => {
const db = getGlobalDB()
// api key is encrypted in the database
const userId = await queryGlobalView(
ViewNames.BY_API_KEY,
@ -35,10 +36,14 @@ async function checkApiKey(apiKey, populateUser) {
db
)
if (userId) {
return { valid: true, user: await getUser(userId, tenantId, populateUser) }
return {
valid: true,
user: await getUser(userId, tenantId, populateUser),
}
} else {
throw "Invalid API key"
}
})
}
/**

View File

@ -40,7 +40,7 @@ exports.getRedisOptions = (clustered = false) => {
let redisProtocolUrl
// fully qualified redis URL
if (/rediss?/.test(REDIS_URL)) {
if (/rediss?:\/\//.test(REDIS_URL)) {
redisProtocolUrl = REDIS_URL
}

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.",
"version": "1.0.86-alpha.0",
"version": "1.0.88",
"license": "MPL-2.0",
"svelte": "src/index.js",
"module": "dist/bbui.es.js",
@ -38,7 +38,7 @@
],
"dependencies": {
"@adobe/spectrum-css-workflow-icons": "^1.2.1",
"@budibase/string-templates": "^1.0.86-alpha.0",
"@budibase/string-templates": "^1.0.88",
"@spectrum-css/actionbutton": "^1.0.1",
"@spectrum-css/actiongroup": "^1.0.1",
"@spectrum-css/avatar": "^3.0.2",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
"version": "1.0.86-alpha.0",
"version": "1.0.88",
"license": "GPL-3.0",
"private": true,
"scripts": {
@ -65,10 +65,10 @@
}
},
"dependencies": {
"@budibase/bbui": "^1.0.86-alpha.0",
"@budibase/client": "^1.0.86-alpha.0",
"@budibase/frontend-core": "^1.0.86-alpha.0",
"@budibase/string-templates": "^1.0.86-alpha.0",
"@budibase/bbui": "^1.0.88",
"@budibase/client": "^1.0.88",
"@budibase/frontend-core": "^1.0.88",
"@budibase/string-templates": "^1.0.88",
"@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
"version": "1.0.86-alpha.0",
"version": "1.0.88",
"description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js",
"bin": {

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/client",
"version": "1.0.86-alpha.0",
"version": "1.0.88",
"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": "^1.0.86-alpha.0",
"@budibase/frontend-core": "^1.0.86-alpha.0",
"@budibase/string-templates": "^1.0.86-alpha.0",
"@budibase/bbui": "^1.0.88",
"@budibase/frontend-core": "^1.0.88",
"@budibase/string-templates": "^1.0.88",
"@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3",

View File

@ -1,12 +1,12 @@
{
"name": "@budibase/frontend-core",
"version": "1.0.86-alpha.0",
"version": "1.0.88",
"description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase",
"license": "MPL-2.0",
"svelte": "src/index.js",
"dependencies": {
"@budibase/bbui": "^1.0.86-alpha.0",
"@budibase/bbui": "^1.0.88",
"lodash": "^4.17.21",
"svelte": "^3.46.2"
}

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
"version": "1.0.86-alpha.0",
"version": "1.0.88",
"description": "Budibase Web Server",
"main": "src/index.ts",
"repository": {
@ -71,9 +71,9 @@
"license": "GPL-3.0",
"dependencies": {
"@apidevtools/swagger-parser": "^10.0.3",
"@budibase/backend-core": "^1.0.86-alpha.0",
"@budibase/client": "^1.0.86-alpha.0",
"@budibase/string-templates": "^1.0.86-alpha.0",
"@budibase/backend-core": "^1.0.88",
"@budibase/client": "^1.0.88",
"@budibase/string-templates": "^1.0.88",
"@bull-board/api": "^3.7.0",
"@bull-board/koa": "^3.7.0",
"@elastic/elasticsearch": "7.10.0",

View File

@ -51,9 +51,6 @@ class QueryRunner {
} else {
sql = sql.replace(binding, variable)
}
// const indexOfBinding = sql.indexOf(binding)
// const constantStr = `'${binding}'`
// sql = sql.replace(sql.indexOf(constantStr) === indexOfBinding - 1 ? constantStr : binding, variable)
}
// replicate the knex structure
fields.sql = sql

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/string-templates",
"version": "1.0.86-alpha.0",
"version": "1.0.88",
"description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs",
"module": "dist/bundle.mjs",

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
"version": "1.0.86-alpha.0",
"version": "1.0.88",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@ -34,8 +34,8 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
"@budibase/backend-core": "^1.0.86-alpha.0",
"@budibase/string-templates": "^1.0.86-alpha.0",
"@budibase/backend-core": "^1.0.88",
"@budibase/string-templates": "^1.0.88",
"@koa/router": "^8.0.0",
"@sentry/node": "^6.0.0",
"@techpass/passport-openidconnect": "^0.3.0",

View File

@ -85,7 +85,12 @@ exports.setInitInfo = ctx => {
}
exports.getInitInfo = ctx => {
try {
ctx.body = getCookie(ctx, Cookies.Init) || {}
} catch (err) {
clearCookie(ctx, Cookies.Init)
ctx.body = {}
}
}
/**