Skip to content

Commit

Permalink
Added support for parsing authentication along with utilizing active …
Browse files Browse the repository at this point in the history
…directory access token and service principals
  • Loading branch information
Shin-Aska authored and dhensby committed Oct 31, 2022
1 parent 655f439 commit 9e1fc42
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion lib/base/connection-pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ class ConnectionPool extends EventEmitter {
case 'attachdbfilename':
break
case 'authentication':
Object.assign(config.authentication, {
type: value
})
break
case 'column encryption setting':
break
Expand All @@ -133,6 +136,16 @@ class ConnectionPool extends EventEmitter {
break
case 'context connection':
break
case 'client id':
Object.assign(config.authentication.options, {
clientId: value
})
break
case 'client secret':
Object.assign(config.authentication.options, {
clientSecret: value
})
break
case 'current language':
Object.assign(config.options, {
language: value
Expand Down Expand Up @@ -222,6 +235,16 @@ class ConnectionPool extends EventEmitter {
break
case 'replication':
break
case 'tenant id':
Object.assign(config.authentication.options, {
tenantId: value
})
break
case 'token':
Object.assign(config.authentication.options, {
token: value
})
break
case 'transaction binding':
Object.assign(config.options, {
enableImplicitTransactions: value.toLowerCase() === 'implicit unbind'
Expand Down Expand Up @@ -278,7 +301,7 @@ class ConnectionPool extends EventEmitter {
break
}
return config
}, { options: {}, pool: {} })
}, { authentication: { options: {} }, options: {}, pool: {} })
}

/**
Expand Down

0 comments on commit 9e1fc42

Please sign in to comment.