Skip to content

Commit 47e9450

Browse files
committed
test: remove SASL authentication tests
1 parent 9bb7ef7 commit 47e9450

File tree

5 files changed

+23
-4
lines changed

5 files changed

+23
-4
lines changed

packages/pg-protocol/src/inbound-parser.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,10 @@ const testForMessage = function (buffer: Buffer, expectedMessage: any) {
194194

195195
const plainPasswordBuffer = buffers.authenticationCleartextPassword()
196196
const md5PasswordBuffer = buffers.authenticationMD5Password()
197-
const SASLBuffer = buffers.authenticationSASL()
198-
const SASLContinueBuffer = buffers.authenticationSASLContinue()
199-
const SASLFinalBuffer = buffers.authenticationSASLFinal()
197+
// SASL authentication is no longer supported
198+
// const SASLBuffer = buffers.authenticationSASL()
199+
// const SASLContinueBuffer = buffers.authenticationSASLContinue()
200+
// const SASLFinalBuffer = buffers.authenticationSASLFinal()
200201

201202
const expectedPlainPasswordMessage = {
202203
name: 'authenticationCleartextPassword',
@@ -207,6 +208,8 @@ const expectedMD5PasswordMessage = {
207208
salt: Buffer.from([1, 2, 3, 4]),
208209
}
209210

211+
// SASL authentication is no longer supported
212+
/*
210213
const expectedSASLMessage = {
211214
name: 'authenticationSASL',
212215
mechanisms: ['SCRAM-SHA-256'],
@@ -221,6 +224,7 @@ const expectedSASLFinalMessage = {
221224
name: 'authenticationSASLFinal',
222225
data: 'data',
223226
}
227+
*/
224228

225229
const notificationResponseBuffer = buffers.notification(4, 'hi', 'boom')
226230
const expectedNotificationResponseMessage = {
@@ -245,6 +249,9 @@ describe('PgPacketStream', function () {
245249
testForMessage(authOkBuffer, expectedAuthenticationOkayMessage)
246250
testForMessage(plainPasswordBuffer, expectedPlainPasswordMessage)
247251
testForMessage(md5PasswordBuffer, expectedMD5PasswordMessage)
252+
253+
// SASL authentication tests are commented out as SASL is no longer supported
254+
/*
248255
testForMessage(SASLBuffer, expectedSASLMessage)
249256
testForMessage(SASLContinueBuffer, expectedSASLContinueMessage)
250257
@@ -261,6 +268,7 @@ describe('PgPacketStream', function () {
261268
// and adds a test which is deterministic, rather than relying on network packet chunking
262269
const extendedSASLFinalBuffer = Buffer.concat([SASLFinalBuffer, Buffer.from([1, 2, 4, 5])])
263270
testForMessage(extendedSASLFinalBuffer, expectedSASLFinalMessage)
271+
*/
264272

265273
testForMessage(paramStatusBuffer, expectedParameterStatusMessage)
266274
testForMessage(backendKeyDataBuffer, expectedBackendKeyDataMessage)

packages/pg-protocol/src/outbound-serializer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ describe('serializer', () => {
1212
actual,
1313
new BufferList()
1414
.addInt16(3)
15-
.addInt16(0)
15+
.addInt16(0x33) // this is for gaussdb
1616
.addCString('user')
1717
.addCString('brian')
1818
.addCString('database')

packages/pg-protocol/src/testing/test-buffers.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ const buffers = {
2121
.join(true, 'R')
2222
},
2323

24+
// SASL authentication is no longer supported - commented out
25+
/*
2426
authenticationSASL: function () {
2527
return new BufferList().addInt32(10).addCString('SCRAM-SHA-256').addCString('').join(true, 'R')
2628
},
@@ -32,6 +34,7 @@ const buffers = {
3234
authenticationSASLFinal: function () {
3335
return new BufferList().addInt32(12).addString('data').join(true, 'R')
3436
},
37+
*/
3538

3639
parameterStatus: function (name: string, value: string) {
3740
return new BufferList().addCString(name).addCString(value).join(true, 'S')

packages/pg/test/test-buffers.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ buffers.authenticationMD5Password = function () {
2323
.join(true, 'R')
2424
}
2525

26+
// SASL authentication is no longer supported - commented out
27+
/*
2628
buffers.authenticationSASL = function () {
2729
return new BufferList().addInt32(10).addCString('SCRAM-SHA-256').addCString('').join(true, 'R')
2830
}
@@ -34,6 +36,7 @@ buffers.authenticationSASLContinue = function () {
3436
buffers.authenticationSASLFinal = function () {
3537
return new BufferList().addInt32(12).addString('data').join(true, 'R')
3638
}
39+
*/
3740

3841
buffers.parameterStatus = function (name, value) {
3942
return new BufferList().addCString(name).addCString(value).join(true, 'S')

packages/pg/test/unit/client/sasl-scram-tests.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// SASL authentication is no longer supported in this repository
2+
// All SASL tests have been commented out
3+
4+
/*
15
'use strict'
26
const helper = require('./test-helper')
37
const assert = require('assert')
@@ -312,3 +316,4 @@ suite.test('sasl/scram', function () {
312316
})
313317
})
314318
})
319+
*/

0 commit comments

Comments
 (0)