|
2 | 2 |
|
3 | 3 | var EventEmitter = require('events').EventEmitter
|
4 | 4 | var utils = require('./utils')
|
5 |
| -var sasl = require('./crypto/sasl') |
6 | 5 | var TypeOverrides = require('./type-overrides')
|
7 | 6 |
|
8 | 7 | var ConnectionParameters = require('./connection-parameters')
|
@@ -178,10 +177,6 @@ class Client extends EventEmitter {
|
178 | 177 | con.on('authenticationCleartextPassword', this._handleAuthCleartextPassword.bind(this))
|
179 | 178 | // password request handling
|
180 | 179 | con.on('authenticationMD5Password', this._handleAuthMD5Password.bind(this))
|
181 |
| - // password request handling (SASL) |
182 |
| - con.on('authenticationSASL', this._handleAuthSASL.bind(this)) |
183 |
| - con.on('authenticationSASLContinue', this._handleAuthSASLContinue.bind(this)) |
184 |
| - con.on('authenticationSASLFinal', this._handleAuthSASLFinal.bind(this)) |
185 | 180 | con.on('backendKeyData', this._handleBackendKeyData.bind(this))
|
186 | 181 | con.on('error', this._handleErrorEvent.bind(this))
|
187 | 182 | con.on('errorMessage', this._handleErrorMessage.bind(this))
|
@@ -255,35 +250,6 @@ class Client extends EventEmitter {
|
255 | 250 | })
|
256 | 251 | }
|
257 | 252 |
|
258 |
| - _handleAuthSASL(msg) { |
259 |
| - this._checkPgPass(() => { |
260 |
| - try { |
261 |
| - this.saslSession = sasl.startSession(msg.mechanisms) |
262 |
| - this.connection.sendSASLInitialResponseMessage(this.saslSession.mechanism, this.saslSession.response) |
263 |
| - } catch (err) { |
264 |
| - this.connection.emit('error', err) |
265 |
| - } |
266 |
| - }) |
267 |
| - } |
268 |
| - |
269 |
| - async _handleAuthSASLContinue(msg) { |
270 |
| - try { |
271 |
| - await sasl.continueSession(this.saslSession, this.password, msg.data) |
272 |
| - this.connection.sendSCRAMClientFinalMessage(this.saslSession.response) |
273 |
| - } catch (err) { |
274 |
| - this.connection.emit('error', err) |
275 |
| - } |
276 |
| - } |
277 |
| - |
278 |
| - _handleAuthSASLFinal(msg) { |
279 |
| - try { |
280 |
| - sasl.finalizeSession(this.saslSession, msg.data) |
281 |
| - this.saslSession = null |
282 |
| - } catch (err) { |
283 |
| - this.connection.emit('error', err) |
284 |
| - } |
285 |
| - } |
286 |
| - |
287 | 253 | _handleBackendKeyData(msg) {
|
288 | 254 | this.processID = msg.processID
|
289 | 255 | this.secretKey = msg.secretKey
|
|
0 commit comments