Skip to content

Commit 14e8f88

Browse files
committed
fix(NODE-3777): remove dead code
1 parent 41135e4 commit 14e8f88

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/cmap/auth/gssapi.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import { Callback, ns } from '../../utils';
1313
import { AuthContext, AuthProvider } from './auth_provider';
1414

1515
type MechanismProperties = {
16-
// TODO: Remove in 5.0
17-
gssapiCanonicalizeHostName?: boolean;
1816
CANONICALIZE_HOST_NAME?: boolean;
1917
SERVICE_NAME?: string;
2018
SERVICE_REALM?: string;
@@ -176,17 +174,16 @@ function performGssapiCanonicalizeHostName(
176174
mechanismProperties: MechanismProperties,
177175
callback: Callback<string>
178176
): void {
179-
if (
180-
!mechanismProperties.gssapiCanonicalizeHostName &&
181-
!mechanismProperties.CANONICALIZE_HOST_NAME
182-
) return callback(undefined, host);
177+
if (!mechanismProperties.CANONICALIZE_HOST_NAME) return callback(undefined, host);
183178

184179
// Attempt to resolve the host name
185180
dns.resolveCname(host, (err, r) => {
186181
if (err) return callback(err);
187182

188183
// Get the first resolve host id
189184
if (Array.isArray(r) && r.length > 0) {
185+
/* eslint no-console: 0 */
186+
console.log('######################', host, r);
190187
return callback(undefined, r[0]);
191188
}
192189

test/manual/kerberos.test.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,17 @@ describe('Kerberos', function () {
5151
});
5252
});
5353

54-
it('validate that SERVICE_REALM and CANONICALIZE_HOST_NAME can be passed in', function (done) {
54+
it('validate that CANONICALIZE_HOST_NAME can be passed in', function (done) {
55+
const client = new MongoClient(
56+
`${krb5Uri}&authMechanismProperties=SERVICE_NAME:mongodb,CANONICALIZE_HOST_NAME:true&maxPoolSize=1`
57+
);
58+
client.connect(function (err, client) {
59+
expect(err).to.not.exist;
60+
verifyKerberosAuthentication(client, done);
61+
});
62+
});
63+
64+
it.skip('validate that SERVICE_REALM and CANONICALIZE_HOST_NAME can be passed in', function (done) {
5565
const client = new MongoClient(
5666
`${krb5Uri}&authMechanismProperties=SERVICE_NAME:mongodb,CANONICALIZE_HOST_NAME:false,SERVICE_REALM:windows&maxPoolSize=1`
5767
);

0 commit comments

Comments
 (0)