Merge branch 'feature/environment-variables' of github.com:Budibase/budibase into feature/environment-variables
This commit is contained in:
commit
29a6bbbb90
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "2.2.12-alpha.41",
|
"version": "2.2.12-alpha.43",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/backend-core",
|
"name": "@budibase/backend-core",
|
||||||
"version": "2.2.12-alpha.41",
|
"version": "2.2.12-alpha.43",
|
||||||
"description": "Budibase backend core libraries used in server and worker",
|
"description": "Budibase backend core libraries used in server and worker",
|
||||||
"main": "dist/src/index.js",
|
"main": "dist/src/index.js",
|
||||||
"types": "dist/src/index.d.ts",
|
"types": "dist/src/index.d.ts",
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/nano": "10.1.1",
|
"@budibase/nano": "10.1.1",
|
||||||
"@budibase/types": "2.2.12-alpha.41",
|
"@budibase/types": "2.2.12-alpha.43",
|
||||||
"@shopify/jest-koa-mocks": "5.0.1",
|
"@shopify/jest-koa-mocks": "5.0.1",
|
||||||
"@techpass/passport-openidconnect": "0.3.2",
|
"@techpass/passport-openidconnect": "0.3.2",
|
||||||
"aws-cloudfront-sign": "2.2.0",
|
"aws-cloudfront-sign": "2.2.0",
|
||||||
|
|
|
@ -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": "2.2.12-alpha.41",
|
"version": "2.2.12-alpha.43",
|
||||||
"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",
|
||||||
|
@ -38,7 +38,7 @@
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@adobe/spectrum-css-workflow-icons": "1.2.1",
|
"@adobe/spectrum-css-workflow-icons": "1.2.1",
|
||||||
"@budibase/string-templates": "2.2.12-alpha.41",
|
"@budibase/string-templates": "2.2.12-alpha.43",
|
||||||
"@spectrum-css/accordion": "3.0.24",
|
"@spectrum-css/accordion": "3.0.24",
|
||||||
"@spectrum-css/actionbutton": "1.0.1",
|
"@spectrum-css/actionbutton": "1.0.1",
|
||||||
"@spectrum-css/actiongroup": "1.0.1",
|
"@spectrum-css/actiongroup": "1.0.1",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const ignoredClasses = [".flatpickr-calendar"]
|
const ignoredClasses = [".flatpickr-calendar", ".spectrum-Popover"]
|
||||||
let clickHandlers = []
|
let clickHandlers = []
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -19,7 +19,7 @@ const handleClick = event => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore clicks for modals, unless the handler is registered from a modal
|
// Ignore clicks for modals, unless the handler is registered from a modal
|
||||||
const sourceInModal = handler.element.closest(".spectrum-Modal") != null
|
const sourceInModal = handler.anchor.closest(".spectrum-Modal") != null
|
||||||
const clickInModal = event.target.closest(".spectrum-Modal") != null
|
const clickInModal = event.target.closest(".spectrum-Modal") != null
|
||||||
if (clickInModal && !sourceInModal) {
|
if (clickInModal && !sourceInModal) {
|
||||||
return
|
return
|
||||||
|
@ -33,10 +33,10 @@ document.documentElement.addEventListener("click", handleClick, true)
|
||||||
/**
|
/**
|
||||||
* Adds or updates a click handler
|
* Adds or updates a click handler
|
||||||
*/
|
*/
|
||||||
const updateHandler = (id, element, callback) => {
|
const updateHandler = (id, element, anchor, callback) => {
|
||||||
let existingHandler = clickHandlers.find(x => x.id === id)
|
let existingHandler = clickHandlers.find(x => x.id === id)
|
||||||
if (!existingHandler) {
|
if (!existingHandler) {
|
||||||
clickHandlers.push({ id, element, callback })
|
clickHandlers.push({ id, element, anchor, callback })
|
||||||
} else {
|
} else {
|
||||||
existingHandler.callback = callback
|
existingHandler.callback = callback
|
||||||
}
|
}
|
||||||
|
@ -51,12 +51,22 @@ const removeHandler = id => {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Svelte action to apply a click outside handler for a certain element
|
* Svelte action to apply a click outside handler for a certain element
|
||||||
|
* opts.anchor is an optional param specifying the real root source of the
|
||||||
|
* component being observed. This is required for things like popovers, where
|
||||||
|
* the element using the clickoutside action is the popover, but the popover is
|
||||||
|
* rendered at the root of the DOM somewhere, whereas the popover anchor is the
|
||||||
|
* element we actually want to consider when determining the source component.
|
||||||
*/
|
*/
|
||||||
export default (element, callback) => {
|
export default (element, opts) => {
|
||||||
const id = Math.random()
|
const id = Math.random()
|
||||||
updateHandler(id, element, callback)
|
const update = newOpts => {
|
||||||
|
const callback = newOpts?.callback || newOpts
|
||||||
|
const anchor = newOpts?.anchor || element
|
||||||
|
updateHandler(id, element, anchor, callback)
|
||||||
|
}
|
||||||
|
update(opts)
|
||||||
return {
|
return {
|
||||||
update: newCallback => updateHandler(id, element, newCallback),
|
update,
|
||||||
destroy: () => removeHandler(id),
|
destroy: () => removeHandler(id),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
<Icon name={icon} />
|
<Icon name={icon} />
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
|
<slot name="icon" />
|
||||||
<div>
|
<div>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -68,7 +68,10 @@
|
||||||
<div
|
<div
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
use:positionDropdown={{ anchor, align, maxWidth, useAnchorWidth }}
|
use:positionDropdown={{ anchor, align, maxWidth, useAnchorWidth }}
|
||||||
use:clickOutside={handleOutsideClick}
|
use:clickOutside={{
|
||||||
|
callback: handleOutsideClick,
|
||||||
|
anchor,
|
||||||
|
}}
|
||||||
on:keydown={handleEscape}
|
on:keydown={handleEscape}
|
||||||
class={"spectrum-Popover is-open " + (tooltipClasses || "")}
|
class={"spectrum-Popover is-open " + (tooltipClasses || "")}
|
||||||
role="presentation"
|
role="presentation"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/builder",
|
"name": "@budibase/builder",
|
||||||
"version": "2.2.12-alpha.41",
|
"version": "2.2.12-alpha.43",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -71,10 +71,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "2.2.12-alpha.41",
|
"@budibase/bbui": "2.2.12-alpha.43",
|
||||||
"@budibase/client": "2.2.12-alpha.41",
|
"@budibase/client": "2.2.12-alpha.43",
|
||||||
"@budibase/frontend-core": "2.2.12-alpha.41",
|
"@budibase/frontend-core": "2.2.12-alpha.43",
|
||||||
"@budibase/string-templates": "2.2.12-alpha.41",
|
"@budibase/string-templates": "2.2.12-alpha.43",
|
||||||
"@sentry/browser": "5.19.1",
|
"@sentry/browser": "5.19.1",
|
||||||
"@spectrum-css/accordion": "^3.0.24",
|
"@spectrum-css/accordion": "^3.0.24",
|
||||||
"@spectrum-css/page": "^3.0.1",
|
"@spectrum-css/page": "^3.0.1",
|
||||||
|
|
|
@ -20,7 +20,8 @@
|
||||||
$isActive,
|
$isActive,
|
||||||
$tables,
|
$tables,
|
||||||
$queries,
|
$queries,
|
||||||
$views
|
$views,
|
||||||
|
openDataSources
|
||||||
)
|
)
|
||||||
$: openDataSource = enrichedDataSources.find(x => x.open)
|
$: openDataSource = enrichedDataSources.find(x => x.open)
|
||||||
$: {
|
$: {
|
||||||
|
@ -36,7 +37,8 @@
|
||||||
isActive,
|
isActive,
|
||||||
tables,
|
tables,
|
||||||
queries,
|
queries,
|
||||||
views
|
views,
|
||||||
|
openDataSources
|
||||||
) => {
|
) => {
|
||||||
if (!datasources?.list?.length) {
|
if (!datasources?.list?.length) {
|
||||||
return []
|
return []
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/cli",
|
"name": "@budibase/cli",
|
||||||
"version": "2.2.12-alpha.41",
|
"version": "2.2.12-alpha.43",
|
||||||
"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": {
|
||||||
|
@ -26,9 +26,9 @@
|
||||||
"outputPath": "build"
|
"outputPath": "build"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/backend-core": "2.2.12-alpha.41",
|
"@budibase/backend-core": "2.2.12-alpha.43",
|
||||||
"@budibase/string-templates": "2.2.12-alpha.41",
|
"@budibase/string-templates": "2.2.12-alpha.43",
|
||||||
"@budibase/types": "2.2.12-alpha.41",
|
"@budibase/types": "2.2.12-alpha.43",
|
||||||
"axios": "0.21.2",
|
"axios": "0.21.2",
|
||||||
"chalk": "4.1.0",
|
"chalk": "4.1.0",
|
||||||
"cli-progress": "3.11.2",
|
"cli-progress": "3.11.2",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/client",
|
"name": "@budibase/client",
|
||||||
"version": "2.2.12-alpha.41",
|
"version": "2.2.12-alpha.43",
|
||||||
"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": "2.2.12-alpha.41",
|
"@budibase/bbui": "2.2.12-alpha.43",
|
||||||
"@budibase/frontend-core": "2.2.12-alpha.41",
|
"@budibase/frontend-core": "2.2.12-alpha.43",
|
||||||
"@budibase/string-templates": "2.2.12-alpha.41",
|
"@budibase/string-templates": "2.2.12-alpha.43",
|
||||||
"@spectrum-css/button": "^3.0.3",
|
"@spectrum-css/button": "^3.0.3",
|
||||||
"@spectrum-css/card": "^3.0.3",
|
"@spectrum-css/card": "^3.0.3",
|
||||||
"@spectrum-css/divider": "^1.0.3",
|
"@spectrum-css/divider": "^1.0.3",
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/frontend-core",
|
"name": "@budibase/frontend-core",
|
||||||
"version": "2.2.12-alpha.41",
|
"version": "2.2.12-alpha.43",
|
||||||
"description": "Budibase frontend core libraries used in builder and client",
|
"description": "Budibase frontend core libraries used in builder and client",
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"svelte": "src/index.js",
|
"svelte": "src/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/bbui": "2.2.12-alpha.41",
|
"@budibase/bbui": "2.2.12-alpha.43",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"svelte": "^3.46.2"
|
"svelte": "^3.46.2"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/sdk",
|
"name": "@budibase/sdk",
|
||||||
"version": "2.2.12-alpha.41",
|
"version": "2.2.12-alpha.43",
|
||||||
"description": "Budibase Public API SDK",
|
"description": "Budibase Public API SDK",
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/server",
|
"name": "@budibase/server",
|
||||||
"email": "hi@budibase.com",
|
"email": "hi@budibase.com",
|
||||||
"version": "2.2.12-alpha.41",
|
"version": "2.2.12-alpha.43",
|
||||||
"description": "Budibase Web Server",
|
"description": "Budibase Web Server",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -43,11 +43,11 @@
|
||||||
"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": "2.2.12-alpha.41",
|
"@budibase/backend-core": "2.2.12-alpha.43",
|
||||||
"@budibase/client": "2.2.12-alpha.41",
|
"@budibase/client": "2.2.12-alpha.43",
|
||||||
"@budibase/pro": "2.2.12-alpha.41",
|
"@budibase/pro": "2.2.12-alpha.43",
|
||||||
"@budibase/string-templates": "2.2.12-alpha.41",
|
"@budibase/string-templates": "2.2.12-alpha.43",
|
||||||
"@budibase/types": "2.2.12-alpha.41",
|
"@budibase/types": "2.2.12-alpha.43",
|
||||||
"@bull-board/api": "3.7.0",
|
"@bull-board/api": "3.7.0",
|
||||||
"@bull-board/koa": "3.9.4",
|
"@bull-board/koa": "3.9.4",
|
||||||
"@elastic/elasticsearch": "7.10.0",
|
"@elastic/elasticsearch": "7.10.0",
|
||||||
|
|
|
@ -14,6 +14,7 @@ import { invalidateDynamicVariables } from "../../threads/utils"
|
||||||
import { db as dbCore, context, events } from "@budibase/backend-core"
|
import { db as dbCore, context, events } from "@budibase/backend-core"
|
||||||
import { UserCtx, Datasource, Row } from "@budibase/types"
|
import { UserCtx, Datasource, Row } from "@budibase/types"
|
||||||
import sdk from "../../sdk"
|
import sdk from "../../sdk"
|
||||||
|
import { mergeConfigs } from "../../sdk/app/datasources/datasources"
|
||||||
|
|
||||||
export async function fetch(ctx: UserCtx) {
|
export async function fetch(ctx: UserCtx) {
|
||||||
// Get internal tables
|
// Get internal tables
|
||||||
|
@ -152,17 +153,16 @@ export async function update(ctx: UserCtx) {
|
||||||
const auth = datasource.config?.auth
|
const auth = datasource.config?.auth
|
||||||
await invalidateVariables(datasource, ctx.request.body)
|
await invalidateVariables(datasource, ctx.request.body)
|
||||||
|
|
||||||
if (!sdk.datasources.isValid(datasource)) {
|
|
||||||
ctx.throw(400, "Environment variables binding format incorrect")
|
|
||||||
}
|
|
||||||
|
|
||||||
const isBudibaseSource = datasource.type === dbCore.BUDIBASE_DATASOURCE_TYPE
|
const isBudibaseSource = datasource.type === dbCore.BUDIBASE_DATASOURCE_TYPE
|
||||||
|
|
||||||
const dataSourceBody = isBudibaseSource
|
const dataSourceBody = isBudibaseSource
|
||||||
? { name: ctx.request.body?.name }
|
? { name: ctx.request.body?.name }
|
||||||
: ctx.request.body
|
: ctx.request.body
|
||||||
|
|
||||||
datasource = { ...datasource, ...dataSourceBody }
|
datasource = {
|
||||||
|
...datasource,
|
||||||
|
...sdk.datasources.mergeConfigs(dataSourceBody, datasource),
|
||||||
|
}
|
||||||
if (auth && !ctx.request.body.auth) {
|
if (auth && !ctx.request.body.auth) {
|
||||||
// don't strip auth config from DB
|
// don't strip auth config from DB
|
||||||
datasource.config!.auth = auth
|
datasource.config!.auth = auth
|
||||||
|
@ -198,10 +198,6 @@ export async function save(ctx: UserCtx) {
|
||||||
...ctx.request.body.datasource,
|
...ctx.request.body.datasource,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sdk.datasources.isValid(datasource)) {
|
|
||||||
ctx.throw(400, "Environment variables binding format incorrect")
|
|
||||||
}
|
|
||||||
|
|
||||||
let schemaError = null
|
let schemaError = null
|
||||||
if (fetchSchema) {
|
if (fetchSchema) {
|
||||||
const { tables, error } = await buildSchemaHelper(datasource)
|
const { tables, error } = await buildSchemaHelper(datasource)
|
||||||
|
|
|
@ -2,7 +2,8 @@ jest.mock("pg")
|
||||||
import * as setup from "./utilities"
|
import * as setup from "./utilities"
|
||||||
import { checkBuilderEndpoint } from "./utilities/TestFunctions"
|
import { checkBuilderEndpoint } from "./utilities/TestFunctions"
|
||||||
import { checkCacheForDynamicVariable } from "../../../threads/utils"
|
import { checkCacheForDynamicVariable } from "../../../threads/utils"
|
||||||
import { events } from "@budibase/backend-core"
|
import { context, events } from "@budibase/backend-core"
|
||||||
|
import sdk from "../../../sdk"
|
||||||
|
|
||||||
let { basicDatasource } = setup.structures
|
let { basicDatasource } = setup.structures
|
||||||
const pg = require("pg")
|
const pg = require("pg")
|
||||||
|
@ -184,4 +185,37 @@ describe("/datasources", () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe("check secret replacement", () => {
|
||||||
|
async function makeDatasource() {
|
||||||
|
datasource = basicDatasource()
|
||||||
|
datasource.datasource.config.password = "testing"
|
||||||
|
const res = await request
|
||||||
|
.post(`/api/datasources`)
|
||||||
|
.send(datasource)
|
||||||
|
.set(config.defaultHeaders())
|
||||||
|
.expect("Content-Type", /json/)
|
||||||
|
.expect(200)
|
||||||
|
return res.body.datasource
|
||||||
|
}
|
||||||
|
|
||||||
|
it("should save a datasource with password", async () => {
|
||||||
|
const datasource = await makeDatasource()
|
||||||
|
expect(datasource.config.password).toBe("--secret-value--")
|
||||||
|
})
|
||||||
|
|
||||||
|
it("should not the password on update with the --secret-value--", async () => {
|
||||||
|
const datasource = await makeDatasource()
|
||||||
|
await request
|
||||||
|
.put(`/api/datasources/${datasource._id}`)
|
||||||
|
.send(datasource)
|
||||||
|
.set(config.defaultHeaders())
|
||||||
|
.expect("Content-Type", /json/)
|
||||||
|
.expect(200)
|
||||||
|
await context.doInAppContext(config.getAppId(), async () => {
|
||||||
|
const dbDatasource: any = await sdk.datasources.get(datasource._id)
|
||||||
|
expect(dbDatasource.config.password).toBe("testing")
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -2,7 +2,7 @@ import TestConfig from "../../../../tests/utilities/TestConfiguration"
|
||||||
import * as syncRows from "../syncRows"
|
import * as syncRows from "../syncRows"
|
||||||
import { quotas } from "@budibase/pro"
|
import { quotas } from "@budibase/pro"
|
||||||
import { QuotaUsageType, StaticQuotaName } from "@budibase/types"
|
import { QuotaUsageType, StaticQuotaName } from "@budibase/types"
|
||||||
const { db: dbCore } = require("@budibase/backend-core")
|
import { db as dbCore, context } from "@budibase/backend-core"
|
||||||
|
|
||||||
describe("syncRows", () => {
|
describe("syncRows", () => {
|
||||||
let config = new TestConfig(false)
|
let config = new TestConfig(false)
|
||||||
|
@ -24,13 +24,17 @@ describe("syncRows", () => {
|
||||||
|
|
||||||
// app 1
|
// app 1
|
||||||
const app1 = config.app
|
const app1 = config.app
|
||||||
await config.createTable()
|
await context.doInAppContext(app1.appId, async () => {
|
||||||
await config.createRow()
|
await config.createTable()
|
||||||
|
await config.createRow()
|
||||||
|
})
|
||||||
// app 2
|
// app 2
|
||||||
const app2 = await config.createApp("second-app")
|
const app2 = await config.createApp("second-app")
|
||||||
await config.createTable()
|
await context.doInAppContext(app2.appId, async () => {
|
||||||
await config.createRow()
|
await config.createTable()
|
||||||
await config.createRow()
|
await config.createRow()
|
||||||
|
await config.createRow()
|
||||||
|
})
|
||||||
|
|
||||||
// migrate
|
// migrate
|
||||||
await syncRows.run()
|
await syncRows.run()
|
||||||
|
|
|
@ -47,14 +47,6 @@ export async function getWithEnvVars(datasourceId: string) {
|
||||||
return enrichDatasourceWithValues(datasource)
|
return enrichDatasourceWithValues(datasource)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isValid(datasource: Datasource) {
|
|
||||||
const blocks = findHBSBlocks(JSON.stringify(datasource))
|
|
||||||
const validList = blocks.filter(
|
|
||||||
block => block.includes(ENV_VAR_PREFIX) || block.includes(USER_PREFIX)
|
|
||||||
)
|
|
||||||
return blocks.length === validList.length
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function removeSecrets(datasources: Datasource[]) {
|
export async function removeSecrets(datasources: Datasource[]) {
|
||||||
const definitions = await getDefinitions()
|
const definitions = await getDefinitions()
|
||||||
for (let datasource of datasources) {
|
for (let datasource of datasources) {
|
||||||
|
@ -87,3 +79,20 @@ export async function removeSecrets(datasources: Datasource[]) {
|
||||||
export async function removeSecretSingle(datasource: Datasource) {
|
export async function removeSecretSingle(datasource: Datasource) {
|
||||||
return (await removeSecrets([datasource]))[0]
|
return (await removeSecrets([datasource]))[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function mergeConfigs(update: Datasource, old: Datasource) {
|
||||||
|
if (!update.config) {
|
||||||
|
return update
|
||||||
|
}
|
||||||
|
for (let [key, value] of Object.entries(update.config)) {
|
||||||
|
if (value !== PASSWORD_REPLACEMENT) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if (old.config?.[key]) {
|
||||||
|
update.config[key] = old.config?.[key]
|
||||||
|
} else {
|
||||||
|
delete update.config[key]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return update
|
||||||
|
}
|
||||||
|
|
|
@ -1273,13 +1273,13 @@
|
||||||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||||
|
|
||||||
"@budibase/backend-core@2.2.12-alpha.41":
|
"@budibase/backend-core@2.2.12-alpha.43":
|
||||||
version "2.2.12-alpha.41"
|
version "2.2.12-alpha.43"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.41.tgz#9fa210c3c94481c38af5aad71ac246451dda6e43"
|
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.43.tgz#c7d64564730a9ea443e9351eff79218163e510f3"
|
||||||
integrity sha512-vYb8x6JgncYdT8VqVi/WfScg4Ng0O1wtt9SspNPKnOX2CR7rA8VH6PW1QMRa5uUYvBFupg6UbY9jFqu2XXtujg==
|
integrity sha512-0oRoXK0SL14fzl38zoX+8j4jFWvl3LGjBvTTvOzsbvLifyCT76bAGaZdTLOgaAIKR2NfwpglS+qKiM5sQmvcQA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/nano" "10.1.1"
|
"@budibase/nano" "10.1.1"
|
||||||
"@budibase/types" "2.2.12-alpha.41"
|
"@budibase/types" "2.2.12-alpha.43"
|
||||||
"@shopify/jest-koa-mocks" "5.0.1"
|
"@shopify/jest-koa-mocks" "5.0.1"
|
||||||
"@techpass/passport-openidconnect" "0.3.2"
|
"@techpass/passport-openidconnect" "0.3.2"
|
||||||
aws-cloudfront-sign "2.2.0"
|
aws-cloudfront-sign "2.2.0"
|
||||||
|
@ -1374,13 +1374,13 @@
|
||||||
qs "^6.11.0"
|
qs "^6.11.0"
|
||||||
tough-cookie "^4.1.2"
|
tough-cookie "^4.1.2"
|
||||||
|
|
||||||
"@budibase/pro@2.2.12-alpha.41":
|
"@budibase/pro@2.2.12-alpha.43":
|
||||||
version "2.2.12-alpha.41"
|
version "2.2.12-alpha.43"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.41.tgz#c1923d52d7cd2ace665e44b196c91578b1b50bbe"
|
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.43.tgz#11e3a138f33b67ac0866bb760a14925ddf9d08cf"
|
||||||
integrity sha512-J1yN74Gixa8UzkD44Ydzj2iR+5WRbJtjZzn7NFI3VB1A2sTLxmilSBRyCALzhF3UMpueaBRjwWBovbF/De106A==
|
integrity sha512-U2QjEqCEKO7l9FZZcU2TAK0I+M3dHDzMm9HEzGvjcCK72LlMlRy0ca8sYjxhzqhpSxLrQuI22hfyf6wDzgHo5g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/backend-core" "2.2.12-alpha.41"
|
"@budibase/backend-core" "2.2.12-alpha.43"
|
||||||
"@budibase/types" "2.2.12-alpha.41"
|
"@budibase/types" "2.2.12-alpha.43"
|
||||||
"@koa/router" "8.0.8"
|
"@koa/router" "8.0.8"
|
||||||
bull "4.10.1"
|
bull "4.10.1"
|
||||||
joi "17.6.0"
|
joi "17.6.0"
|
||||||
|
@ -1405,10 +1405,10 @@
|
||||||
svelte-apexcharts "^1.0.2"
|
svelte-apexcharts "^1.0.2"
|
||||||
svelte-flatpickr "^3.1.0"
|
svelte-flatpickr "^3.1.0"
|
||||||
|
|
||||||
"@budibase/types@2.2.12-alpha.41":
|
"@budibase/types@2.2.12-alpha.43":
|
||||||
version "2.2.12-alpha.41"
|
version "2.2.12-alpha.43"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.41.tgz#662115c5ba09f3c2057a96321e233c819cfae84b"
|
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.43.tgz#2ddbbc2c3f3e9dedcba57eacd5648e012faba46d"
|
||||||
integrity sha512-+uzr668cuvDTMqy7roWiG/qQzOzQO7uWYtysaHPsQQG5PxA0ZuwixJOvvX1qOr1rgv9Is54p9J7dvzvtKW/wAw==
|
integrity sha512-u/i25rO7pSqzbs5YrO47KVQp65jhD71udnFmUbwNgs1XBIeivilqbFdxk5DCKbBrTA04McuOZ3nxI9JNZG6qMw==
|
||||||
|
|
||||||
"@bull-board/api@3.7.0":
|
"@bull-board/api@3.7.0":
|
||||||
version "3.7.0"
|
version "3.7.0"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/string-templates",
|
"name": "@budibase/string-templates",
|
||||||
"version": "2.2.12-alpha.41",
|
"version": "2.2.12-alpha.43",
|
||||||
"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",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/types",
|
"name": "@budibase/types",
|
||||||
"version": "2.2.12-alpha.41",
|
"version": "2.2.12-alpha.43",
|
||||||
"description": "Budibase types",
|
"description": "Budibase types",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@budibase/worker",
|
"name": "@budibase/worker",
|
||||||
"email": "hi@budibase.com",
|
"email": "hi@budibase.com",
|
||||||
"version": "2.2.12-alpha.41",
|
"version": "2.2.12-alpha.43",
|
||||||
"description": "Budibase background service",
|
"description": "Budibase background service",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -36,10 +36,10 @@
|
||||||
"author": "Budibase",
|
"author": "Budibase",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@budibase/backend-core": "2.2.12-alpha.41",
|
"@budibase/backend-core": "2.2.12-alpha.43",
|
||||||
"@budibase/pro": "2.2.12-alpha.41",
|
"@budibase/pro": "2.2.12-alpha.43",
|
||||||
"@budibase/string-templates": "2.2.12-alpha.41",
|
"@budibase/string-templates": "2.2.12-alpha.43",
|
||||||
"@budibase/types": "2.2.12-alpha.41",
|
"@budibase/types": "2.2.12-alpha.43",
|
||||||
"@koa/router": "8.0.8",
|
"@koa/router": "8.0.8",
|
||||||
"@sentry/node": "6.17.7",
|
"@sentry/node": "6.17.7",
|
||||||
"@techpass/passport-openidconnect": "0.3.2",
|
"@techpass/passport-openidconnect": "0.3.2",
|
||||||
|
|
|
@ -470,13 +470,13 @@
|
||||||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||||
|
|
||||||
"@budibase/backend-core@2.2.12-alpha.41":
|
"@budibase/backend-core@2.2.12-alpha.43":
|
||||||
version "2.2.12-alpha.41"
|
version "2.2.12-alpha.43"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.41.tgz#9fa210c3c94481c38af5aad71ac246451dda6e43"
|
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.12-alpha.43.tgz#c7d64564730a9ea443e9351eff79218163e510f3"
|
||||||
integrity sha512-vYb8x6JgncYdT8VqVi/WfScg4Ng0O1wtt9SspNPKnOX2CR7rA8VH6PW1QMRa5uUYvBFupg6UbY9jFqu2XXtujg==
|
integrity sha512-0oRoXK0SL14fzl38zoX+8j4jFWvl3LGjBvTTvOzsbvLifyCT76bAGaZdTLOgaAIKR2NfwpglS+qKiM5sQmvcQA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/nano" "10.1.1"
|
"@budibase/nano" "10.1.1"
|
||||||
"@budibase/types" "2.2.12-alpha.41"
|
"@budibase/types" "2.2.12-alpha.43"
|
||||||
"@shopify/jest-koa-mocks" "5.0.1"
|
"@shopify/jest-koa-mocks" "5.0.1"
|
||||||
"@techpass/passport-openidconnect" "0.3.2"
|
"@techpass/passport-openidconnect" "0.3.2"
|
||||||
aws-cloudfront-sign "2.2.0"
|
aws-cloudfront-sign "2.2.0"
|
||||||
|
@ -521,23 +521,23 @@
|
||||||
qs "^6.11.0"
|
qs "^6.11.0"
|
||||||
tough-cookie "^4.1.2"
|
tough-cookie "^4.1.2"
|
||||||
|
|
||||||
"@budibase/pro@2.2.12-alpha.41":
|
"@budibase/pro@2.2.12-alpha.43":
|
||||||
version "2.2.12-alpha.41"
|
version "2.2.12-alpha.43"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.41.tgz#c1923d52d7cd2ace665e44b196c91578b1b50bbe"
|
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.12-alpha.43.tgz#11e3a138f33b67ac0866bb760a14925ddf9d08cf"
|
||||||
integrity sha512-J1yN74Gixa8UzkD44Ydzj2iR+5WRbJtjZzn7NFI3VB1A2sTLxmilSBRyCALzhF3UMpueaBRjwWBovbF/De106A==
|
integrity sha512-U2QjEqCEKO7l9FZZcU2TAK0I+M3dHDzMm9HEzGvjcCK72LlMlRy0ca8sYjxhzqhpSxLrQuI22hfyf6wDzgHo5g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@budibase/backend-core" "2.2.12-alpha.41"
|
"@budibase/backend-core" "2.2.12-alpha.43"
|
||||||
"@budibase/types" "2.2.12-alpha.41"
|
"@budibase/types" "2.2.12-alpha.43"
|
||||||
"@koa/router" "8.0.8"
|
"@koa/router" "8.0.8"
|
||||||
bull "4.10.1"
|
bull "4.10.1"
|
||||||
joi "17.6.0"
|
joi "17.6.0"
|
||||||
jsonwebtoken "8.5.1"
|
jsonwebtoken "8.5.1"
|
||||||
node-fetch "^2.6.1"
|
node-fetch "^2.6.1"
|
||||||
|
|
||||||
"@budibase/types@2.2.12-alpha.41":
|
"@budibase/types@2.2.12-alpha.43":
|
||||||
version "2.2.12-alpha.41"
|
version "2.2.12-alpha.43"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.41.tgz#662115c5ba09f3c2057a96321e233c819cfae84b"
|
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.12-alpha.43.tgz#2ddbbc2c3f3e9dedcba57eacd5648e012faba46d"
|
||||||
integrity sha512-+uzr668cuvDTMqy7roWiG/qQzOzQO7uWYtysaHPsQQG5PxA0ZuwixJOvvX1qOr1rgv9Is54p9J7dvzvtKW/wAw==
|
integrity sha512-u/i25rO7pSqzbs5YrO47KVQp65jhD71udnFmUbwNgs1XBIeivilqbFdxk5DCKbBrTA04McuOZ3nxI9JNZG6qMw==
|
||||||
|
|
||||||
"@cspotcode/source-map-support@^0.8.0":
|
"@cspotcode/source-map-support@^0.8.0":
|
||||||
version "0.8.1"
|
version "0.8.1"
|
||||||
|
|
Loading…
Reference in New Issue