diff --git a/server/drivers/presto/_presto.js b/server/drivers/presto/_presto.js index d865be75e..edd5e48f4 100644 --- a/server/drivers/presto/_presto.js +++ b/server/drivers/presto/_presto.js @@ -10,7 +10,12 @@ function wait(ms) { // Get Presto headers from config function getHeaders(config) { - const headers = { 'X-Presto-User': config.user }; + const headers = { + 'X-Presto-User': config.user, + Authorization: + 'Basic ' + + Buffer.from(`${config.user}:${config.password}`).toString('base64'), + }; if (config.catalog) { headers['X-Presto-Catalog'] = config.catalog; } diff --git a/server/drivers/presto/index.js b/server/drivers/presto/index.js index a1a6aa649..b48058dfc 100644 --- a/server/drivers/presto/index.js +++ b/server/drivers/presto/index.js @@ -35,8 +35,9 @@ function runQuery(query, connection) { const rows = []; const port = connection.port || 8080; const prestoConfig = { - url: `http://${connection.host}:${port}`, + url: `${connection.host}:${port}`, user: connection.username, + password: connection.password, catalog: connection.prestoCatalog, schema: connection.prestoSchema, }; @@ -100,6 +101,11 @@ const fields = [ formType: 'TEXT', label: 'Database Username', }, + { + key: 'password', + formType: 'PASSWORD', + label: 'Database Password', + }, { key: 'prestoCatalog', formType: 'TEXT',