merge with master

This commit is contained in:
Martin McKeaveney 2022-02-10 18:57:26 +01:00
commit d1cebc61a9
17 changed files with 52 additions and 48 deletions

View File

@ -38,7 +38,7 @@ jobs:
wc -l values.preprod.yaml wc -l values.preprod.yaml
- name: Deploy to Preprod Environment - name: Deploy to Preprod Environment
uses: deliverybot/helm@v1 uses: glopezep/helm@v1.7.1
with: with:
release: budibase-preprod release: budibase-preprod
namespace: budibase namespace: budibase

View File

@ -111,6 +111,10 @@ spec:
value: {{ .Values.globals.smtp.from | quote }} value: {{ .Values.globals.smtp.from | quote }}
- name: APPS_URL - name: APPS_URL
value: http://app-service:{{ .Values.services.apps.port }} value: http://app-service:{{ .Values.services.apps.port }}
- name: GOOGLE_CLIENT_ID
value: {{ .Values.globals.google.clientId | quote }}
- name: GOOGLE_CLIENT_SECRET
value: {{ .Values.globals.google.secret | quote }}
image: budibase/worker:{{ .Values.globals.appVersion }} image: budibase/worker:{{ .Values.globals.appVersion }}
imagePullPolicy: Always imagePullPolicy: Always
name: bbworker name: bbworker

View File

@ -1,5 +1,5 @@
{ {
"version": "1.0.50-alpha.7", "version": "1.0.57",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*" "packages/*"

View File

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

View File

@ -11,6 +11,8 @@ module.exports = {
COUCH_DB_URL: process.env.COUCH_DB_URL, COUCH_DB_URL: process.env.COUCH_DB_URL,
COUCH_DB_USERNAME: process.env.COUCH_DB_USER, COUCH_DB_USERNAME: process.env.COUCH_DB_USER,
COUCH_DB_PASSWORD: process.env.COUCH_DB_PASSWORD, COUCH_DB_PASSWORD: process.env.COUCH_DB_PASSWORD,
GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID,
GOOGLE_CLIENT_SECRET: process.env.GOOGLE_CLIENT_SECRET,
SALT_ROUNDS: process.env.SALT_ROUNDS, SALT_ROUNDS: process.env.SALT_ROUNDS,
REDIS_URL: process.env.REDIS_URL, REDIS_URL: process.env.REDIS_URL,
REDIS_PASSWORD: process.env.REDIS_PASSWORD, REDIS_PASSWORD: process.env.REDIS_PASSWORD,

View File

@ -1,22 +1,17 @@
const { getScopedConfig } = require("../../../db/utils")
const { getGlobalDB } = require("../../../tenancy")
const google = require("../google") const google = require("../google")
const { Configs, Cookies } = require("../../../constants") const { Cookies } = require("../../../constants")
const { clearCookie, getCookie } = require("../../../utils") const { clearCookie, getCookie } = require("../../../utils")
const { getDB } = require("../../../db") const { getDB } = require("../../../db")
const environment = require("../../../environment")
async function preAuth(passport, ctx, next) { async function preAuth(passport, ctx, next) {
const db = getGlobalDB()
// get the relevant config // get the relevant config
const config = await getScopedConfig(db, { const googleConfig = {
type: Configs.GOOGLE, clientID: environment.GOOGLE_CLIENT_ID,
workspace: ctx.query.workspace, clientSecret: environment.GOOGLE_CLIENT_SECRET,
}) }
const publicConfig = await getScopedConfig(db, { let callbackUrl = `${environment.PLATFORM_URL}/api/global/auth/datasource/google/callback`
type: Configs.SETTINGS, const strategy = await google.strategyFactory(googleConfig, callbackUrl)
})
let callbackUrl = `${publicConfig.platformUrl}/api/global/auth/datasource/google/callback`
const strategy = await google.strategyFactory(config, callbackUrl)
if (!ctx.query.appId || !ctx.query.datasourceId) { if (!ctx.query.appId || !ctx.query.datasourceId) {
ctx.throw(400, "appId and datasourceId query params not present.") ctx.throw(400, "appId and datasourceId query params not present.")
@ -30,18 +25,13 @@ async function preAuth(passport, ctx, next) {
} }
async function postAuth(passport, ctx, next) { async function postAuth(passport, ctx, next) {
const db = getGlobalDB() // get the relevant config
const config = {
clientID: environment.GOOGLE_CLIENT_ID,
clientSecret: environment.GOOGLE_CLIENT_SECRET,
}
const config = await getScopedConfig(db, { let callbackUrl = `${environment.PLATFORM_URL}/api/global/auth/datasource/google/callback`
type: Configs.GOOGLE,
workspace: ctx.query.workspace,
})
const publicConfig = await getScopedConfig(db, {
type: Configs.SETTINGS,
})
let callbackUrl = `${publicConfig.platformUrl}/api/global/auth/datasource/google/callback`
const strategy = await google.strategyFactory( const strategy = await google.strategyFactory(
config, config,
callbackUrl, callbackUrl,

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/bbui", "name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.", "description": "A UI solution used in the different Budibase projects.",
"version": "1.0.50-alpha.7", "version": "1.0.57",
"license": "MPL-2.0", "license": "MPL-2.0",
"svelte": "src/index.js", "svelte": "src/index.js",
"module": "dist/bbui.es.js", "module": "dist/bbui.es.js",

View File

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

View File

@ -17,7 +17,7 @@
ds = await preAuthStep() ds = await preAuthStep()
} }
window.open( window.open(
`/api/global/auth/${tenantId}/datasource/google?datasourceId=${datasource._id}&appId=${$store.appId}`, `/api/global/auth/${tenantId}/datasource/google?datasourceId=${ds._id}&appId=${$store.appId}`,
"_blank" "_blank"
) )
}} }}

View File

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

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/client", "name": "@budibase/client",
"version": "1.0.50-alpha.7", "version": "1.0.57",
"license": "MPL-2.0", "license": "MPL-2.0",
"module": "dist/budibase-client.js", "module": "dist/budibase-client.js",
"main": "dist/budibase-client.js", "main": "dist/budibase-client.js",
@ -19,9 +19,9 @@
"dev:builder": "rollup -cw" "dev:builder": "rollup -cw"
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^1.0.50-alpha.7", "@budibase/bbui": "^1.0.57",
"@budibase/frontend-core": "^1.0.50-alpha.7", "@budibase/frontend-core": "^1.0.50-alpha.7",
"@budibase/string-templates": "^1.0.50-alpha.7", "@budibase/string-templates": "^1.0.57",
"regexparam": "^1.3.0", "regexparam": "^1.3.0",
"rollup-plugin-polyfill-node": "^0.8.0", "rollup-plugin-polyfill-node": "^0.8.0",
"shortid": "^2.2.15", "shortid": "^2.2.15",

View File

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

View File

@ -1,7 +1,6 @@
const { definitions } = require("../../integrations") const { definitions } = require("../../integrations")
exports.fetch = async function (ctx) { exports.fetch = async function (ctx) {
// TODO: fetch these from a github repo etc
ctx.status = 200 ctx.status = 200
ctx.body = definitions ctx.body = definitions
} }

View File

@ -11,6 +11,7 @@ const arangodb = require("./arangodb")
const rest = require("./rest") const rest = require("./rest")
const googlesheets = require("./googlesheets") const googlesheets = require("./googlesheets")
const { SourceNames } = require("../definitions/datasource") const { SourceNames } = require("../definitions/datasource")
const environment = require("../environment")
const DEFINITIONS = { const DEFINITIONS = {
[SourceNames.POSTGRES]: postgres.schema, [SourceNames.POSTGRES]: postgres.schema,
@ -24,7 +25,6 @@ const DEFINITIONS = {
[SourceNames.MYSQL]: mysql.schema, [SourceNames.MYSQL]: mysql.schema,
[SourceNames.ARANGODB]: arangodb.schema, [SourceNames.ARANGODB]: arangodb.schema,
[SourceNames.REST]: rest.schema, [SourceNames.REST]: rest.schema,
[SourceNames.GOOGLE_SHEETS]: googlesheets.schema,
} }
const INTEGRATIONS = { const INTEGRATIONS = {
@ -39,7 +39,6 @@ const INTEGRATIONS = {
[SourceNames.MYSQL]: mysql.integration, [SourceNames.MYSQL]: mysql.integration,
[SourceNames.ARANGODB]: arangodb.integration, [SourceNames.ARANGODB]: arangodb.integration,
[SourceNames.REST]: rest.integration, [SourceNames.REST]: rest.integration,
[SourceNames.GOOGLE_SHEETS]: googlesheets.integration,
} }
// optionally add oracle integration if the oracle binary can be installed // optionally add oracle integration if the oracle binary can be installed
@ -49,6 +48,11 @@ if (!(process.arch === "arm64" && process.platform === "darwin")) {
INTEGRATIONS[SourceNames.ORACLE] = oracle.integration INTEGRATIONS[SourceNames.ORACLE] = oracle.integration
} }
if (environment.SELF_HOSTED) {
DEFINITIONS[SourceNames.GOOGLE_SHEETS] = googlesheets.schema
INTEGRATIONS[SourceNames.GOOGLE_SHEETS] = googlesheets.integration
}
module.exports = { module.exports = {
definitions: DEFINITIONS, definitions: DEFINITIONS,
integrations: INTEGRATIONS, integrations: INTEGRATIONS,

View File

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

View File

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

View File

@ -80,6 +80,11 @@ router
updateTenant, updateTenant,
authController.googleAuth authController.googleAuth
) )
.get(
"/api/global/auth/:tenantId/datasource/:provider/callback",
updateTenant,
authController.datasourceAuth
)
.get( .get(
"/api/global/auth/:tenantId/oidc/configs/:configId", "/api/global/auth/:tenantId/oidc/configs/:configId",
updateTenant, updateTenant,