@cubejs-backend/base-driver
Advanced tools
Comparing version 0.32.25 to 0.32.26
@@ -7,3 +7,5 @@ /** | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import * as stream from 'stream'; | ||
import type { ConnectionOptions as TLSConnectionOptions } from 'tls'; | ||
import { ExternalCreateTableOptions, DownloadQueryResultsOptions, DownloadQueryResultsResult, DownloadTableCSVData, DownloadTableData, DownloadTableMemoryData, DriverInterface, ExternalDriverCompatibilities, IndexesSQL, QueryOptions, TableColumn, TableQueryResult, TableStructure, DriverCapabilities } from './driver.interface'; | ||
@@ -27,6 +29,3 @@ /** | ||
protected informationSchemaQuery(): string; | ||
/** | ||
* Returns SSL options. | ||
*/ | ||
protected getSslOptions(dataSource: string): any; | ||
protected getSslOptions(dataSource: string): TLSConnectionOptions | undefined; | ||
abstract testConnection(): Promise<void>; | ||
@@ -33,0 +32,0 @@ abstract query<R = unknown>(_query: string, _values?: unknown[], _options?: QueryOptions): Promise<R[]>; |
@@ -106,35 +106,31 @@ "use strict"; | ||
} | ||
/** | ||
* Returns SSL options. | ||
*/ | ||
getSslOptions(dataSource) { | ||
let ssl; | ||
const sslOptions = [{ | ||
name: 'ca', | ||
canBeFile: true, | ||
envKey: (0, shared_1.keyByDataSource)('CUBEJS_DB_SSL_CA', dataSource), | ||
validate: shared_1.isSslCert, | ||
}, { | ||
name: 'cert', | ||
canBeFile: true, | ||
envKey: (0, shared_1.keyByDataSource)('CUBEJS_DB_SSL_CERT', dataSource), | ||
validate: shared_1.isSslCert, | ||
}, { | ||
name: 'key', | ||
canBeFile: true, | ||
envKey: (0, shared_1.keyByDataSource)('CUBEJS_DB_SSL_KEY', dataSource), | ||
validate: shared_1.isSslKey, | ||
}, { | ||
name: 'ciphers', | ||
envKey: (0, shared_1.keyByDataSource)('CUBEJS_DB_SSL_CIPHERS', dataSource), | ||
}, { | ||
name: 'passphrase', | ||
envKey: (0, shared_1.keyByDataSource)('CUBEJS_DB_SSL_PASSPHRASE', dataSource), | ||
}, { | ||
name: 'servername', | ||
envKey: (0, shared_1.keyByDataSource)('CUBEJS_DB_SSL_SERVERNAME', dataSource), | ||
}]; | ||
if ((0, shared_1.getEnv)('dbSsl', { dataSource }) || | ||
(0, shared_1.getEnv)('dbSslRejectUnauthorized', { dataSource })) { | ||
ssl = sslOptions.reduce((agg, { name, envKey, canBeFile, validate }) => { | ||
const sslOptions = [{ | ||
name: 'ca', | ||
canBeFile: true, | ||
envKey: (0, shared_1.keyByDataSource)('CUBEJS_DB_SSL_CA', dataSource), | ||
validate: shared_1.isSslCert, | ||
}, { | ||
name: 'cert', | ||
canBeFile: true, | ||
envKey: (0, shared_1.keyByDataSource)('CUBEJS_DB_SSL_CERT', dataSource), | ||
validate: shared_1.isSslCert, | ||
}, { | ||
name: 'key', | ||
canBeFile: true, | ||
envKey: (0, shared_1.keyByDataSource)('CUBEJS_DB_SSL_KEY', dataSource), | ||
validate: shared_1.isSslKey, | ||
}, { | ||
name: 'ciphers', | ||
envKey: (0, shared_1.keyByDataSource)('CUBEJS_DB_SSL_CIPHERS', dataSource), | ||
}, { | ||
name: 'passphrase', | ||
envKey: (0, shared_1.keyByDataSource)('CUBEJS_DB_SSL_PASSPHRASE', dataSource), | ||
}, { | ||
name: 'servername', | ||
envKey: (0, shared_1.keyByDataSource)('CUBEJS_DB_SSL_SERVERNAME', dataSource), | ||
}]; | ||
const ssl = sslOptions.reduce((agg, { name, envKey, canBeFile, validate }) => { | ||
const value = process.env[envKey]; | ||
@@ -166,4 +162,5 @@ if (value) { | ||
ssl.rejectUnauthorized = (0, shared_1.getEnv)('dbSslRejectUnauthorized', { dataSource }); | ||
return ssl; | ||
} | ||
return ssl; | ||
return undefined; | ||
} | ||
@@ -170,0 +167,0 @@ // eslint-disable-next-line @typescript-eslint/no-unused-vars |
@@ -5,3 +5,3 @@ { | ||
"author": "Cube Dev, Inc.", | ||
"version": "0.32.25", | ||
"version": "0.32.26", | ||
"repository": { | ||
@@ -66,3 +66,3 @@ "type": "git", | ||
}, | ||
"gitHead": "377e123c1f4e6db89b369b4baff9664918dbf5b2" | ||
"gitHead": "5e552433ab582d8f41f272bbee0fd439cc52f8cc" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
67469
707