File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ var Query = require('./query')
1010var defaults = require ( './defaults' )
1111var Connection = require ( './connection' )
1212const crypto = require ( './crypto/utils' )
13+ const kerberos = require ( 'kerberos' ) . Kerberos
1314
1415class Client extends EventEmitter {
1516 constructor ( config ) {
@@ -20,6 +21,7 @@ class Client extends EventEmitter {
2021 this . database = this . connectionParameters . database
2122 this . port = this . connectionParameters . port
2223 this . host = this . connectionParameters . host
24+ this . principal = this . connectionParameters . principal
2325
2426 // "hiding" the password so it doesn't show up in stack traces
2527 // or if the client is console.logged
@@ -204,8 +206,7 @@ class Client extends EventEmitter {
204206
205207 async _handleGSSInit ( msg ) {
206208 try {
207- // TODO: Below needs to be parameterized
208- this . client = await kerberos . initializeClient ( '[email protected] ' , { 209+ this . client = await kerberos . initializeClient ( `${ this . principal } @${ this . host } ` , {
209210 mechOID : kerberos . GSS_MECH_OID_SPNEGO ,
210211 } )
211212
Original file line number Diff line number Diff line change @@ -65,6 +65,8 @@ class ConnectionParameters {
6565
6666 this . port = parseInt ( val ( 'port' , config ) , 10 )
6767 this . host = val ( 'host' , config )
68+ // Kerberos/GSSAPI service principal
69+ this . principal = val ( 'principal' , config )
6870
6971 // "hiding" the password so it doesn't show up in stack traces
7072 // or if the client is console.logged
You can’t perform that action at this time.
0 commit comments