Skip to content

Commit 4d6257d

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

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/cmap/auth/gssapi.ts

Lines changed: 1 addition & 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,10 +174,7 @@ 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) => {

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)