diff --git a/package.json b/package.json index 2a60855..a7fa003 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,6 @@ "xvfb-maybe": "^0.2.1" }, "dependencies": { - "abort-controller": "^3.0.0", "express": "^4.18.2", "open": "^9.1.0", "openid-client": "^5.6.4" diff --git a/src/plugin.spec.ts b/src/plugin.spec.ts index 1506986..b6899e8 100644 --- a/src/plugin.spec.ts +++ b/src/plugin.spec.ts @@ -22,7 +22,6 @@ import { oktaBrowserAuthCodeFlow, oktaBrowserDeviceAuthFlow, } from '../test/oidc-test-provider'; -import { AbortController, AbortSignal } from './util'; import { MongoLogWriter } from 'mongodb-log-writer'; import { PassThrough } from 'stream'; import { verifySuccessfulAuthCodeFlowLog } from '../test/log-hook-verification-helpers'; @@ -59,7 +58,7 @@ function requestToken( abortSignal?: OIDCAbortSignal ): ReturnType { return plugin.mongoClientOptions.authMechanismProperties.OIDC_HUMAN_CALLBACK({ - timeoutContext: abortSignal ?? new AbortController().signal, + timeoutContext: abortSignal, version: 1, idpInfo: oidcParams, }); diff --git a/src/plugin.ts b/src/plugin.ts index 54cb372..66eb75a 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -8,7 +8,6 @@ import type { } from './types'; import { MongoDBOIDCError } from './types'; import { - AbortController, errorString, messageFromError, normalizeObject, diff --git a/src/rfc-8252-http-server.spec.ts b/src/rfc-8252-http-server.spec.ts index e03bb8f..104c9f4 100644 --- a/src/rfc-8252-http-server.spec.ts +++ b/src/rfc-8252-http-server.spec.ts @@ -7,7 +7,6 @@ import type { AddressInfo } from 'net'; import { createConnection } from 'net'; import type { SinonSandbox } from 'sinon'; import sinon from 'sinon'; -import { AbortController } from './util'; import { promisify } from 'util'; import { randomBytes } from 'crypto'; diff --git a/src/types.ts b/src/types.ts index 3238c05..cb6fd65 100644 --- a/src/types.ts +++ b/src/types.ts @@ -99,7 +99,7 @@ export interface IdPServerResponse { */ export interface OIDCCallbackParams { refreshToken?: string; - timeoutContext: OIDCAbortSignal; + timeoutContext?: OIDCAbortSignal; version: 1; username?: string; idpInfo?: IdPServerInfo; diff --git a/src/util.ts b/src/util.ts index e7ee5d7..af6c1eb 100644 --- a/src/util.ts +++ b/src/util.ts @@ -45,13 +45,6 @@ export function errorString(err: unknown): string { ); } -export const AbortController = - // eslint-disable-next-line @typescript-eslint/no-var-requires - globalThis.AbortController ?? require('abort-controller').AbortController; -export const AbortSignal = - // eslint-disable-next-line @typescript-eslint/no-var-requires - globalThis.AbortSignal ?? require('abort-controller').AbortSignal; - // AbortSignal.timeout, but consistently .unref()ed export function timeoutSignal(ms: number): AbortSignal { const controller = new AbortController();