cube-js/cube

NTLM support in mssql

开放

#609 创建于 2020年4月23日

 (1 条评论) (1 个反应) (0 位负责人)Rust (1,965 个派生)batch import
driver:mssqlhelp wanted

仓库指标

星标
 (19,563 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Is your feature request related to a problem? Please describe. Most production implementations of SQL Server today use windows authentication aka NTLM. Today the support for it is missing in cube.js although the underlying tedious library supports it.

Describe the solution you'd like An ability to set the authentication type in .env file which is used in MSSqlDriver.js appropriately. CUBEJS_DB_AUTHTYPE=takes options supported by tedious e.g. default, ntlm. Below I have used hardcoding as variables did not give the right behaviour and that is what needs solving.

class MSSqlDriver extends BaseDriver { constructor(config) { super(); this.config = { server: process.env.CUBEJS_DB_HOST, database: process.env.CUBEJS_DB_NAME, port: process.env.CUBEJS_DB_PORT && parseInt(process.env.CUBEJS_DB_PORT, 10), user: process.env.CUBEJS_DB_USER, authentication: { type: 'ntlm',
options: { userName: 'hardcodedusername', password: 'hardcodedpassword', domain: 'hardcodeddomain' } },

Describe alternatives you've considered This has been the only way I have been able to get ntlm working.

Additional context I am not a javascript developer and will probably break something. So I thought it better to share the way I managed to get it working.

贡献者指南