don't strip secrets from DB and only hide from client
This commit is contained in:
parent
328aef00e1
commit
875a577561
|
@ -101,8 +101,13 @@ exports.update = async function (ctx) {
|
||||||
const db = new CouchDB(ctx.appId)
|
const db = new CouchDB(ctx.appId)
|
||||||
const datasourceId = ctx.params.datasourceId
|
const datasourceId = ctx.params.datasourceId
|
||||||
let datasource = await db.get(datasourceId)
|
let datasource = await db.get(datasourceId)
|
||||||
|
const auth = datasource.config.auth
|
||||||
await invalidateVariables(datasource, ctx.request.body)
|
await invalidateVariables(datasource, ctx.request.body)
|
||||||
datasource = { ...datasource, ...ctx.request.body }
|
datasource = { ...datasource, ...ctx.request.body }
|
||||||
|
if (auth && !ctx.request.body.auth) {
|
||||||
|
// don't strip auth config from DB
|
||||||
|
datasource.config.auth = auth
|
||||||
|
}
|
||||||
|
|
||||||
const response = await db.put(datasource)
|
const response = await db.put(datasource)
|
||||||
datasource._rev = response.rev
|
datasource._rev = response.rev
|
||||||
|
|
Loading…
Reference in New Issue