tediousjs / node-mssql

Microsoft SQL Server client for Node.js
https://tediousjs.github.io/node-mssql
MIT License
2.23k stars 468 forks source link

Request support for tedious >14.4.0 #1395

Closed richardcarrigan closed 2 years ago

richardcarrigan commented 2 years ago

The Tedious NPM package added an azure-active-directory-default authentication option in v14.4.0, which allows direct use of the DefaultAzureCredential within the connection config, rather than either conditionally using one of: azure-active-directory-msi-app-service, azure-active-directory-service-principal-secret, or azure-active-directory-password, or creating a token using credential.getToken and then using azure-active-directory-access-token.

Until mssql supports this version or greater, anyone using mssql will be forced to continue using the workarounds mentioned above.

Expected behaviour:

Updated version of mssql available through NPM which depends on tedious v14.4.0 or greater.

Actual behaviour:

Current version of mssql available through NPM (v8.1.1) depends on tedious v14.0.0.

Configuration:

What I currently have to do:

const credential = new DefaultAzureCredential();
const token  = credential.getToken('https://database.windows.net/.default');

const config = {
  authentication: {
    type: 'azure-active-directory-access-token',
    options: {
      token: token
    }
  },
  ...
}

What I would like to do:

const credential = new DefaultAzureCredential();

const config = {
  authentication: {
    type: 'azure-active-directory-default'
  },
  ...
};

Software versions

dhensby commented 2 years ago

The dependency is ^14.0.0

That means any 14.x version is acceptable.

richardcarrigan commented 2 years ago

The dependency is ^14.0.0

That means any 14.x version is acceptable.

Thanks so much for confirming support, @dhensby ! I knew that the dependency was written as such, but I thought that the package would have had to explicitly add handlers/wrappers in order to support it. However, I just tested it and it is indeed supported, so that's great!