Skip to content

Commit

Permalink
Lazily init kerberos
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Hemphill committed Oct 24, 2024
1 parent e231680 commit c7c1d11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/pg/lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ 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) {
Expand Down Expand Up @@ -204,6 +203,7 @@ class Client extends EventEmitter {
}

async _handleGSSInit(msg) {
const kerberos = require('kerberos').Kerberos
try {
this.kclient = await kerberos.initializeClient(`${this.principal}@${this.host}`, {
mechOID: kerberos.GSS_MECH_OID_SPNEGO,
Expand Down
2 changes: 1 addition & 1 deletion packages/pg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"author": "Brian Carlson <brian.m.carlson@gmail.com>",
"main": "./lib",
"dependencies": {
"kerberos": "^2.1.0",
"pg-connection-string": "^2.7.0",
"pg-pool": "^3.7.0",
"pg-protocol": "^1.7.0",
Expand All @@ -38,6 +37,7 @@
"wrangler": "3.58.0"
},
"optionalDependencies": {
"kerberos": "^2.2.0",
"pg-cloudflare": "^1.1.1"
},
"peerDependencies": {
Expand Down

0 comments on commit c7c1d11

Please sign in to comment.