Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mongodb-js/oidc-plugin

Package Overview
Dependencies
Maintainers
30
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mongodb-js/oidc-plugin - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

1

dist/rfc-8252-http-server.d.ts

@@ -16,2 +16,3 @@ import type { MongoDBOIDCLogEventsMap, OIDCAbortSignal, TypedEventEmitter } from './types';

private servers;
private clientConnections;
private readonly expressApp;

@@ -18,0 +19,0 @@ private readonly redirects;

@@ -19,2 +19,3 @@ "use strict";

this.servers = [];
this.clientConnections = [];
this.redirects = new Map();

@@ -347,2 +348,10 @@ this._handleSuccess = (req, res, next) => {

});
server.on('connection', (socket) => {
this.clientConnections.push(socket);
socket.on('close', () => {
const index = this.clientConnections.indexOf(socket);
if (index !== -1)
this.clientConnections.splice(index, 1);
});
});
return server;

@@ -364,8 +373,24 @@ }

});
const servers = this.servers;
// Node.js servers emit 'close' events in response to .close(),
// but we are not waiting for that here, because:
// - Those events are not actually correlated to the server closing, Node.js
// just closes the underlying handle and ignores that that is an async operation
// (https://github.com/nodejs/node/blob/38b82b0604d6515b281c6586d6999d2c67248e7f/lib/net.js#L2178)
// - Node.js does, however, wait for all incoming connections to be closed
// before emitting the event. That can be convenient sometimes, but browsers
// can keep idle connections open for a while as a sort of 'connection cache',
// so waiting for the 'close' event would potentially delay this event indefinitely.
for (const server of this.servers)
server.close();
this.servers = [];
await Promise.all(servers.map(async (server) => {
server.close();
await (0, events_1.once)(server, 'close');
}));
for (const socket of this.clientConnections) {
// Close the open sockets. Not much point in waiting for a 'close'
// event here.
socket.on('error', () => {
/* ignore */
});
socket.destroy();
}
this.clientConnections = [];
return Promise.resolve(); // Keeping this async in case we ever need it to be.
}

@@ -372,0 +397,0 @@ /**

2

package.json

@@ -16,3 +16,3 @@ {

"homepage": "https://github.com/mongodb-js/oidc-plugin",
"version": "0.1.5",
"version": "0.1.6",
"repository": {

@@ -19,0 +19,0 @@ "type": "git",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc