-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parametrize service principal and host
handle accept token return if no token step
- Loading branch information
1 parent
93f30ed
commit afb7d9d
Showing
2 changed files
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ var Query = require('./query') | |
var defaults = require('./defaults') | ||
var Connection = require('./connection') | ||
const crypto = require('./crypto/utils') | ||
const kerberos = require('kerberos').Kerberos | ||
|
||
class Client extends EventEmitter { | ||
constructor(config) { | ||
|
@@ -20,6 +21,7 @@ class Client extends EventEmitter { | |
this.database = this.connectionParameters.database | ||
this.port = this.connectionParameters.port | ||
this.host = this.connectionParameters.host | ||
this.principal = this.connectionParameters.principal | ||
|
||
// "hiding" the password so it doesn't show up in stack traces | ||
// or if the client is console.logged | ||
|
@@ -204,8 +206,7 @@ class Client extends EventEmitter { | |
|
||
async _handleGSSInit(msg) { | ||
try { | ||
// TODO: Below needs to be parameterized | ||
this.client = await kerberos.initializeClient('[email protected]', { | ||
this.client = await kerberos.initializeClient(`${this.principal}@${this.host}`, { | ||
mechOID: kerberos.GSS_MECH_OID_SPNEGO, | ||
}) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters