@mongodb-js/oidc-plugin 0.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +1 -0
- package/dist/.esm-wrapper.mjs +4 -0
- package/dist/api.d.ts +159 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +26 -0
- package/dist/api.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +23 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +465 -0
- package/dist/plugin.js.map +1 -0
- package/dist/rfc-8252-http-server.d.ts +68 -0
- package/dist/rfc-8252-http-server.d.ts.map +1 -0
- package/dist/rfc-8252-http-server.js +426 -0
- package/dist/rfc-8252-http-server.js.map +1 -0
- package/dist/types.d.ts +115 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +22 -0
- package/dist/types.js.map +1 -0
- package/dist/util.d.ts +22 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +53 -0
- package/dist/util.js.map +1 -0
- package/dist/webdriverio.js +0 -0
- package/index.d.ts +287 -0
- package/package.json +92 -0
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RFC8252HTTPServer = void 0;
|
|
7
|
+
const http_1 = require("http");
|
|
8
|
+
const dns_1 = require("dns");
|
|
9
|
+
const events_1 = require("events");
|
|
10
|
+
const express_1 = __importDefault(require("express"));
|
|
11
|
+
const util_1 = require("util");
|
|
12
|
+
const crypto_1 = require("crypto");
|
|
13
|
+
const types_1 = require("./types");
|
|
14
|
+
const util_2 = require("./util");
|
|
15
|
+
/** @internal */
|
|
16
|
+
class RFC8252HTTPServer {
|
|
17
|
+
constructor(options) {
|
|
18
|
+
this.servers = [];
|
|
19
|
+
this.redirects = new Map();
|
|
20
|
+
this._handleSuccess = (req, res, next) => {
|
|
21
|
+
const { oidcParams } = this;
|
|
22
|
+
if (!oidcParams) {
|
|
23
|
+
return next();
|
|
24
|
+
}
|
|
25
|
+
this.redirectServerHandler({
|
|
26
|
+
req,
|
|
27
|
+
res,
|
|
28
|
+
result: 'accepted',
|
|
29
|
+
status: 200,
|
|
30
|
+
});
|
|
31
|
+
res.on('finish', () => {
|
|
32
|
+
this.oidcParamsResolve?.(oidcParams);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
this._handleRedirectToExternal = (req, res, next) => {
|
|
36
|
+
const entry = this.redirects.get(req.params.id);
|
|
37
|
+
if (!entry)
|
|
38
|
+
return next();
|
|
39
|
+
this.logger.emit('mongodb-oidc-plugin:local-redirect-accessed', {
|
|
40
|
+
id: req.params.id,
|
|
41
|
+
});
|
|
42
|
+
// This can be helpful for figuring out whether a browser was
|
|
43
|
+
// opened successfully.
|
|
44
|
+
entry.onAccessed();
|
|
45
|
+
res.status(307);
|
|
46
|
+
res.set('Location', entry.targetUrl);
|
|
47
|
+
res.send();
|
|
48
|
+
};
|
|
49
|
+
this._handleOIDCCallback = (req, res) => {
|
|
50
|
+
const baseUrl = this.listeningRedirectUrl;
|
|
51
|
+
if (!baseUrl) {
|
|
52
|
+
throw new types_1.MongoDBOIDCError('Received HTTP request while not listening');
|
|
53
|
+
}
|
|
54
|
+
let isAcceptedOIDCResponse = false;
|
|
55
|
+
const reject = (info) => {
|
|
56
|
+
this.logger.emit('mongodb-oidc-plugin:oidc-callback-rejected', {
|
|
57
|
+
method: req.method,
|
|
58
|
+
hasBody,
|
|
59
|
+
errorCode: info.error ?? 'unknown_error',
|
|
60
|
+
isAcceptedOIDCResponse,
|
|
61
|
+
});
|
|
62
|
+
this.redirectServerHandler({
|
|
63
|
+
req,
|
|
64
|
+
res,
|
|
65
|
+
result: 'rejected',
|
|
66
|
+
...info,
|
|
67
|
+
});
|
|
68
|
+
if (isAcceptedOIDCResponse) {
|
|
69
|
+
this.oidcParamsReject?.(new types_1.MongoDBOIDCError(`${info.error || 'unknown_code'}: ${info.errorDescription || '[no details]'}`));
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const url = new URL(req.url, baseUrl);
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
74
|
+
const hasBody = Object.keys(req.body || {}).length > 0;
|
|
75
|
+
if (req.method === 'POST' && hasBody) {
|
|
76
|
+
// Convert the POST body to a querystring.
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
78
|
+
url.search = new URLSearchParams(Object.entries(req.body)).toString();
|
|
79
|
+
}
|
|
80
|
+
else if (req.method !== 'GET') {
|
|
81
|
+
reject({
|
|
82
|
+
status: 405,
|
|
83
|
+
error: 'invalid_method',
|
|
84
|
+
errorDescription: 'Invalid HTTP Method',
|
|
85
|
+
});
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
// If `state` does not match the expected value, this might be a CSRF request.
|
|
89
|
+
// Even if we did progress from here, the OIDC library would reject this
|
|
90
|
+
// request, but bailing out early here means that after this conditional
|
|
91
|
+
// we know we are dealing with a genuine response from the auth server and
|
|
92
|
+
// can reject the `oidcParamsPromise` if there is an error.
|
|
93
|
+
if (url.searchParams.get('state') !== this.oidcStateParam) {
|
|
94
|
+
reject({
|
|
95
|
+
status: 403,
|
|
96
|
+
error: 'state_mismatch',
|
|
97
|
+
errorDescription: '',
|
|
98
|
+
});
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
isAcceptedOIDCResponse = true;
|
|
102
|
+
const oidcParams = url.toString();
|
|
103
|
+
if (this.oidcParams !== undefined && this.oidcParams !== oidcParams) {
|
|
104
|
+
// This should not happen in practice...
|
|
105
|
+
reject({
|
|
106
|
+
status: 409,
|
|
107
|
+
error: 'already_received_code',
|
|
108
|
+
errorDescription: 'A different authentication code was already received by the application',
|
|
109
|
+
});
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this.oidcParams = oidcParams;
|
|
113
|
+
this.logger.emit('mongodb-oidc-plugin:oidc-callback-accepted', {
|
|
114
|
+
method: req.method,
|
|
115
|
+
hasBody,
|
|
116
|
+
errorCode: url.searchParams.get('error') ?? undefined,
|
|
117
|
+
});
|
|
118
|
+
if (url.searchParams.get('error')) {
|
|
119
|
+
reject({
|
|
120
|
+
status: 200,
|
|
121
|
+
// Standard params from https://www.rfc-editor.org/rfc/rfc6749.html#section-4.1.2.1
|
|
122
|
+
error: ensureNQSChar(url.searchParams.get('error')) ?? 'invalid_error_param',
|
|
123
|
+
errorDescription: ensureNQSChar(url.searchParams.get('error_description')),
|
|
124
|
+
errorURI: ensureURI(url.searchParams.get('error_uri')),
|
|
125
|
+
});
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
// https://mailarchive.ietf.org/arch/msg/oauth/RqlUvseG_RnOWrEV_WJACW8oUdU/
|
|
129
|
+
// > Callback URL pages SHOULD redirect to a trusted page immediately after
|
|
130
|
+
// > receiving the authorization code in the URL. This prevents the
|
|
131
|
+
// > authorization code from remaining in the browser history, or from
|
|
132
|
+
// > inadvertently leaking in a referer header.
|
|
133
|
+
void (async () => {
|
|
134
|
+
// `nonce` does not have any special security properties here, it is only
|
|
135
|
+
// there to avoid collisions with a redirect_url that happens to start
|
|
136
|
+
// with `/success`
|
|
137
|
+
const nonce = (await (0, util_1.promisify)(crypto_1.randomBytes)(16)).toString('hex');
|
|
138
|
+
res.status(303); // 'See Other', turns a potential POST into GET
|
|
139
|
+
res.set('Location', `/success/${nonce}`);
|
|
140
|
+
res.send();
|
|
141
|
+
})();
|
|
142
|
+
};
|
|
143
|
+
this._fallbackHandler = (req, res) => {
|
|
144
|
+
this.logger.emit('mongodb-oidc-plugin:unknown-url-accessed', {
|
|
145
|
+
method: req.method,
|
|
146
|
+
path: req.url,
|
|
147
|
+
});
|
|
148
|
+
this.redirectServerHandler({
|
|
149
|
+
req,
|
|
150
|
+
res,
|
|
151
|
+
result: 'unknown-url',
|
|
152
|
+
status: 404,
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
this.redirectUrl = new URL(options.redirectUrl);
|
|
156
|
+
this.oidcStateParam = options.oidcStateParam;
|
|
157
|
+
this.redirectServerHandler =
|
|
158
|
+
options.redirectServerRequestHandler ?? defaultRedirectServerHandler;
|
|
159
|
+
this.logger = options.logger ?? new events_1.EventEmitter();
|
|
160
|
+
this.oidcParamsPromise = new Promise((resolve, reject) => ([this.oidcParamsResolve, this.oidcParamsReject] = [resolve, reject]));
|
|
161
|
+
this.expressApp = (0, express_1.default)();
|
|
162
|
+
// Identity providers are not strictly required to use the query string to
|
|
163
|
+
// pass tokens and can also use the body as a form POST, even though the
|
|
164
|
+
// former is the common mechanism.
|
|
165
|
+
// This makes it a lot more convenient to use a HTTP framework like
|
|
166
|
+
// express here, which handles cases that require POST body parsing for us.
|
|
167
|
+
this.expressApp.use(express_1.default.urlencoded({ extended: false }));
|
|
168
|
+
this.expressApp.use(express_1.default.json());
|
|
169
|
+
this.expressApp.use((req, res, next) => {
|
|
170
|
+
// Set some default HTTP security headers. The CSP here is fairly strict,
|
|
171
|
+
// but specific handlers can override these as necessary.
|
|
172
|
+
res.setHeader('Content-Security-Policy', "default-src 'self'");
|
|
173
|
+
res.setHeader('Referrer-Policy', 'no-referrer');
|
|
174
|
+
next();
|
|
175
|
+
});
|
|
176
|
+
// Redirect to external server:
|
|
177
|
+
this.expressApp.get('/redirect/:id', this._handleRedirectToExternal);
|
|
178
|
+
// Redirect from external server:
|
|
179
|
+
this.expressApp.all(this.redirectUrl.pathname, this._handleOIDCCallback);
|
|
180
|
+
// Success page:
|
|
181
|
+
this.expressApp.get('/success/:nonce', this._handleSuccess);
|
|
182
|
+
// Everything else:
|
|
183
|
+
this.expressApp.all('*', this._fallbackHandler);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Add a redirect from a local URL served on the server to an external URL.
|
|
187
|
+
*/
|
|
188
|
+
async addRedirect(targetUrl) {
|
|
189
|
+
const baseUrl = this.listeningRedirectUrl;
|
|
190
|
+
if (!baseUrl) {
|
|
191
|
+
throw new Error('Cannot add redirect URL before server is listening');
|
|
192
|
+
}
|
|
193
|
+
const hash = (await (0, util_1.promisify)(crypto_1.randomBytes)(16)).toString('hex');
|
|
194
|
+
const onAccessed = new Promise((resolve) => {
|
|
195
|
+
this.redirects.set(hash, { targetUrl, onAccessed: resolve });
|
|
196
|
+
});
|
|
197
|
+
const localUrl = new URL('/redirect/' + hash, baseUrl).toString();
|
|
198
|
+
return {
|
|
199
|
+
localUrl,
|
|
200
|
+
onAccessed,
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Returns the port that this server is listening on if
|
|
205
|
+
* listen() was successfully called and undefined otherwise.
|
|
206
|
+
*/
|
|
207
|
+
get listeningPort() {
|
|
208
|
+
if (this.servers.length === 0)
|
|
209
|
+
return undefined;
|
|
210
|
+
const ports = new Set(this.servers.map((srv) => srv.address()?.port));
|
|
211
|
+
const port = ports.size === 1 && [...ports][0];
|
|
212
|
+
if (typeof port !== 'number') {
|
|
213
|
+
// Should never happen
|
|
214
|
+
throw new types_1.MongoDBOIDCError(`Server is listening in inconsistent state: ${[...ports].join(',')}`);
|
|
215
|
+
}
|
|
216
|
+
return port;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Returns the full redirectURL passed to the constructor, with
|
|
220
|
+
* a possible unspecified port resolved to the actual port,
|
|
221
|
+
* or undefined if this server is not listening.
|
|
222
|
+
*/
|
|
223
|
+
get listeningRedirectUrl() {
|
|
224
|
+
const port = this.listeningPort;
|
|
225
|
+
if (!port)
|
|
226
|
+
return undefined;
|
|
227
|
+
const url = new URL(this.redirectUrl.toString());
|
|
228
|
+
url.port = String(port);
|
|
229
|
+
return url.toString();
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Create HTTP servers and listen on them corresponding to the redirect URL
|
|
233
|
+
* provided to the constructor.
|
|
234
|
+
*/
|
|
235
|
+
async listen() {
|
|
236
|
+
if (this.listeningPort !== undefined) {
|
|
237
|
+
throw new types_1.MongoDBOIDCError(`Already listening on ${this.redirectUrl.toString()}`);
|
|
238
|
+
}
|
|
239
|
+
if (this.redirectUrl.protocol !== 'http:') {
|
|
240
|
+
throw new types_1.MongoDBOIDCError(`Cannot handle listening on non-HTTP URL, got ${this.redirectUrl.protocol}`);
|
|
241
|
+
}
|
|
242
|
+
this.logger.emit('mongodb-oidc-plugin:local-listen-started', {
|
|
243
|
+
url: this.redirectUrl.toString(),
|
|
244
|
+
});
|
|
245
|
+
// https://www.rfc-editor.org/rfc/rfc8252#section-7.3 states:
|
|
246
|
+
// > It is RECOMMENDED that clients attempt to bind to the loopback
|
|
247
|
+
// > interface using both IPv4 and IPv6 and use whichever is available.
|
|
248
|
+
// Practically speaking, `hostname` here is almost always going to
|
|
249
|
+
// be 'localhost'. Doing a dns lookup with ADDRCONFIG is the easiest
|
|
250
|
+
// way to get IPv4 and IPv6 addresses and whichever else 'localhost'
|
|
251
|
+
// resolves to while taking into account their respective availability
|
|
252
|
+
// on the current host. While we could theoretically hardcode 'localhost'
|
|
253
|
+
// here, there doesn't seem to be any reason to do so, and doing so
|
|
254
|
+
// would remove the ability to configure IPv4 or IPv6 explicitly
|
|
255
|
+
// (by specifying 127.0.0.1/::1 as hosts). Finally, we also don't want
|
|
256
|
+
// to do what Node.js does by default when only a host is provided,
|
|
257
|
+
// namely listening on all interfaces.
|
|
258
|
+
let hostname = this.redirectUrl.hostname;
|
|
259
|
+
if (hostname.startsWith('[') && hostname.endsWith(']'))
|
|
260
|
+
hostname = hostname.slice(1, -1);
|
|
261
|
+
const dnsResults = await dns_1.promises.lookup(hostname, {
|
|
262
|
+
all: true,
|
|
263
|
+
hints: dns_1.ADDRCONFIG,
|
|
264
|
+
});
|
|
265
|
+
if (dnsResults.length === 0) {
|
|
266
|
+
throw new types_1.MongoDBOIDCError(`DNS query for ${this.redirectUrl.hostname} returned no results`);
|
|
267
|
+
}
|
|
268
|
+
try {
|
|
269
|
+
const urlPort = this.redirectUrl.port === '' ? 80 : +this.redirectUrl.port;
|
|
270
|
+
// Two scenarios: Either we are listening on an arbitrary port here,
|
|
271
|
+
// or listening on a specific port. Using an arbitrary port has the
|
|
272
|
+
// advantage that the OS will allocate a free one for us, while a
|
|
273
|
+
// specific port may or may not be available.
|
|
274
|
+
// If we listen on an arbitrary port and the URL hostname resolved
|
|
275
|
+
// to multiple distinct addresses, we need to listen to the same port
|
|
276
|
+
// on all of these addresses. This is extremely unlikely to be an issue
|
|
277
|
+
// in practice, but nevertheless something that should be handled.
|
|
278
|
+
// (We cannot just listen on one address and let a program that happens
|
|
279
|
+
// to listen on the same port on another address receive our secret
|
|
280
|
+
// OIDC tokens...)
|
|
281
|
+
// We handle that case by first listening one on address, receiving the
|
|
282
|
+
// port there, and then trying to listen on all other addresses on the
|
|
283
|
+
// same port. We repeat this as necessary.
|
|
284
|
+
const kMaxAttempts = urlPort === 0 ? 10 : 1;
|
|
285
|
+
for (let attempts = 1;; attempts++) {
|
|
286
|
+
let port = urlPort;
|
|
287
|
+
let offset = 0;
|
|
288
|
+
if (urlPort === 0) {
|
|
289
|
+
offset = 1;
|
|
290
|
+
// Listen on an arbitrary port on a single interface first...
|
|
291
|
+
const firstServer = this.createServerAndListen(dnsResults[0], 0);
|
|
292
|
+
this.servers = [firstServer];
|
|
293
|
+
await (0, events_1.once)(firstServer, 'listening');
|
|
294
|
+
port = firstServer.address()?.port;
|
|
295
|
+
if (typeof port !== 'number') {
|
|
296
|
+
// Should never happen
|
|
297
|
+
throw new types_1.MongoDBOIDCError(`Listening on ${dnsResults[0].address} did not return a port`);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
try {
|
|
301
|
+
// ... and then listen on all remaining interfaces on the same port.
|
|
302
|
+
const otherServers = dnsResults
|
|
303
|
+
.slice(offset)
|
|
304
|
+
.map((dnsResult) => this.createServerAndListen(dnsResult, port));
|
|
305
|
+
this.servers.push(...otherServers);
|
|
306
|
+
await Promise.all(otherServers.map((server) => (0, events_1.once)(server, 'listening')));
|
|
307
|
+
break;
|
|
308
|
+
}
|
|
309
|
+
catch (err) {
|
|
310
|
+
await this.close();
|
|
311
|
+
if (attempts === kMaxAttempts)
|
|
312
|
+
throw err;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
catch (err) {
|
|
317
|
+
await this.close();
|
|
318
|
+
this.logger.emit('mongodb-oidc-plugin:local-listen-failed', {
|
|
319
|
+
url: this.redirectUrl.toString(),
|
|
320
|
+
});
|
|
321
|
+
throw err;
|
|
322
|
+
}
|
|
323
|
+
this.logger.emit('mongodb-oidc-plugin:local-listen-succeeded', {
|
|
324
|
+
url: this.listeningRedirectUrl || '',
|
|
325
|
+
interfaces: dnsResults.map((dnsResult) => dnsResult.address),
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
createServerAndListen(dnsResult, port) {
|
|
329
|
+
const { address: host, family } = dnsResult;
|
|
330
|
+
const server = (0, http_1.createServer)((req, res) => this.expressApp(req, res));
|
|
331
|
+
server.listen({
|
|
332
|
+
host,
|
|
333
|
+
port,
|
|
334
|
+
// This code isn't really expected to run inside a Node.js cluster
|
|
335
|
+
// fork, but if it does, we should not allow external handlers.
|
|
336
|
+
exclusive: true,
|
|
337
|
+
// Should not be making a difference in practice since `host` is
|
|
338
|
+
// almost never the listen-on-all IPv6 address (`::`), but if it is,
|
|
339
|
+
// this is the correct thing to do.
|
|
340
|
+
ipv6Only: family === 6 ? true : undefined,
|
|
341
|
+
});
|
|
342
|
+
return server;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Returns the OIDC params as the full URL used to access them
|
|
346
|
+
* (regardless of whether OIDC params were passed as URL params or not)
|
|
347
|
+
*/
|
|
348
|
+
async waitForOIDCParams() {
|
|
349
|
+
return await this.oidcParamsPromise;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Close all resources associated with this server.
|
|
353
|
+
*/
|
|
354
|
+
async close() {
|
|
355
|
+
this.logger.emit('mongodb-oidc-plugin:local-server-close', {
|
|
356
|
+
url: this.redirectUrl.toString(),
|
|
357
|
+
});
|
|
358
|
+
const servers = this.servers;
|
|
359
|
+
this.servers = [];
|
|
360
|
+
await Promise.all(servers.map(async (server) => {
|
|
361
|
+
server.close();
|
|
362
|
+
await (0, events_1.once)(server, 'close');
|
|
363
|
+
}));
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Convenience method to wait until a single successful OIDC parameter
|
|
367
|
+
* request is received or abort early, and close the server in any case.
|
|
368
|
+
*/
|
|
369
|
+
async waitForOIDCParamsAndClose({ signal, } = {}) {
|
|
370
|
+
try {
|
|
371
|
+
return await (0, util_2.withAbortCheck)(signal, async ({ signalPromise }) => {
|
|
372
|
+
return await Promise.race([this.waitForOIDCParams(), signalPromise]);
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
finally {
|
|
376
|
+
await this.close();
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
exports.RFC8252HTTPServer = RFC8252HTTPServer;
|
|
381
|
+
function defaultRedirectServerHandler(info) {
|
|
382
|
+
const { res, result, status } = info;
|
|
383
|
+
res.statusCode = status;
|
|
384
|
+
res.setHeader('Content-Type', 'text/plain');
|
|
385
|
+
switch (result) {
|
|
386
|
+
case 'accepted':
|
|
387
|
+
res.end('Authentication successful! You can close this window now.');
|
|
388
|
+
return;
|
|
389
|
+
case 'rejected': {
|
|
390
|
+
const { error, errorDescription, errorURI } = info;
|
|
391
|
+
let text = 'Authentication failed!\n';
|
|
392
|
+
if (error)
|
|
393
|
+
text += `Error: ${error}\n`;
|
|
394
|
+
if (errorDescription)
|
|
395
|
+
text += `Details: ${errorDescription}\n`;
|
|
396
|
+
if (errorURI)
|
|
397
|
+
text += `More information: ${errorURI}\n`;
|
|
398
|
+
res.end(text);
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
case 'unknown-url':
|
|
402
|
+
res.end('Not found');
|
|
403
|
+
return;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
// Ensure that `str` confirms to the `NQSCHAR` definition used in RFC6749 (OAuth 2.0)
|
|
407
|
+
// and return `undefined` if it is empty or non-conforming.
|
|
408
|
+
// (This deviates from the spec slightly in that it allows characters outside of ASCII).
|
|
409
|
+
function ensureNQSChar(str) {
|
|
410
|
+
// eslint-disable-next-line no-control-regex
|
|
411
|
+
if (!str || /[\x00-\x1f\x22\x5c\x7f]/.test(str))
|
|
412
|
+
return undefined;
|
|
413
|
+
return str;
|
|
414
|
+
}
|
|
415
|
+
function ensureURI(str) {
|
|
416
|
+
if (!str)
|
|
417
|
+
return undefined;
|
|
418
|
+
try {
|
|
419
|
+
new URL(str);
|
|
420
|
+
return str;
|
|
421
|
+
}
|
|
422
|
+
catch {
|
|
423
|
+
return undefined;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
//# sourceMappingURL=rfc-8252-http-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rfc-8252-http-server.js","sourceRoot":"","sources":["../src/rfc-8252-http-server.ts"],"names":[],"mappings":";;;;;;AAAA,+BAAwD;AAGxD,6BAAkD;AAClD,mCAA4C;AAE5C,sDAA8B;AAC9B,+BAAiC;AACjC,mCAAqC;AAMrC,mCAA2C;AAC3C,iCAAwC;AAgBxC,gBAAgB;AAChB,MAAa,iBAAiB;IAqB5B,YAAY,OAAiC;QAhBrC,YAAO,GAAiB,EAAE,CAAC;QAElB,cAAS,GAAG,IAAI,GAAG,EAGjC,CAAC;QAgDI,mBAAc,GAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;YAC1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,yBAAyB,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IAClE,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,SAAS,CAAC,GAA8B;IAC/C,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAC3B,IAAI;QACF,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QACb,OAAO,GAAG,CAAC;KACZ;IAAC,MAAM;QACN,OAAO,SAAS,CAAC;KAClB;AACH,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/** @public */
|
|
2
|
+
export interface MongoDBOIDCLogEventsMap {
|
|
3
|
+
'mongodb-oidc-plugin:local-redirect-accessed': (event: {
|
|
4
|
+
id: string;
|
|
5
|
+
}) => void;
|
|
6
|
+
'mongodb-oidc-plugin:oidc-callback-accepted': (event: {
|
|
7
|
+
method: string;
|
|
8
|
+
hasBody: boolean;
|
|
9
|
+
errorCode?: string;
|
|
10
|
+
}) => void;
|
|
11
|
+
'mongodb-oidc-plugin:oidc-callback-rejected': (event: {
|
|
12
|
+
method: string;
|
|
13
|
+
hasBody: boolean;
|
|
14
|
+
errorCode: string;
|
|
15
|
+
isAcceptedOIDCResponse: boolean;
|
|
16
|
+
}) => void;
|
|
17
|
+
'mongodb-oidc-plugin:unknown-url-accessed': (event: {
|
|
18
|
+
method: string;
|
|
19
|
+
path: string;
|
|
20
|
+
}) => void;
|
|
21
|
+
'mongodb-oidc-plugin:local-listen-started': (event: {
|
|
22
|
+
url: string;
|
|
23
|
+
}) => void;
|
|
24
|
+
'mongodb-oidc-plugin:local-listen-failed': (event: {
|
|
25
|
+
url: string;
|
|
26
|
+
}) => void;
|
|
27
|
+
'mongodb-oidc-plugin:local-listen-succeeded': (event: {
|
|
28
|
+
url: string;
|
|
29
|
+
interfaces: string[];
|
|
30
|
+
}) => void;
|
|
31
|
+
'mongodb-oidc-plugin:local-server-close': (event: {
|
|
32
|
+
url: string;
|
|
33
|
+
}) => void;
|
|
34
|
+
'mongodb-oidc-plugin:open-browser': (event: {
|
|
35
|
+
customOpener: boolean;
|
|
36
|
+
}) => void;
|
|
37
|
+
'mongodb-oidc-plugin:notify-device-flow': () => void;
|
|
38
|
+
'mongodb-oidc-plugin:auth-attempt-started': (event: {
|
|
39
|
+
flow: string;
|
|
40
|
+
}) => void;
|
|
41
|
+
'mongodb-oidc-plugin:auth-attempt-succeeded': () => void;
|
|
42
|
+
'mongodb-oidc-plugin:auth-attempt-failed': (event: {
|
|
43
|
+
error: string;
|
|
44
|
+
}) => void;
|
|
45
|
+
'mongodb-oidc-plugin:refresh-failed': (event: {
|
|
46
|
+
error: string;
|
|
47
|
+
}) => void;
|
|
48
|
+
'mongodb-oidc-plugin:skip-auth-attempt': (event: {
|
|
49
|
+
reason: string;
|
|
50
|
+
}) => void;
|
|
51
|
+
'mongodb-oidc-plugin:auth-failed': (event: {
|
|
52
|
+
error: string;
|
|
53
|
+
}) => void;
|
|
54
|
+
'mongodb-oidc-plugin:auth-succeeded': (event: {
|
|
55
|
+
hasRefreshToken: boolean;
|
|
56
|
+
expiresAt: string | null;
|
|
57
|
+
}) => void;
|
|
58
|
+
}
|
|
59
|
+
/** @public */
|
|
60
|
+
export interface TypedEventEmitter<EventMap extends object> {
|
|
61
|
+
on<K extends keyof EventMap>(event: K, listener: EventMap[K]): this;
|
|
62
|
+
once<K extends keyof EventMap>(event: K, listener: EventMap[K]): this;
|
|
63
|
+
emit<K extends keyof EventMap>(event: K, ...args: EventMap[K] extends (...args: infer P) => any ? P : never): unknown;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* A copy of the Node.js driver's `OIDCMechanismServerStep1`
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
export interface OIDCMechanismServerStep1 {
|
|
70
|
+
authorizationEndpoint?: string;
|
|
71
|
+
tokenEndpoint?: string;
|
|
72
|
+
deviceAuthorizationEndpoint?: string;
|
|
73
|
+
clientId: string;
|
|
74
|
+
clientSecret?: string;
|
|
75
|
+
requestScopes?: string[];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* A copy of the Node.js driver's `OIDCRequestTokenResult`
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
export interface OIDCRequestTokenResult {
|
|
82
|
+
accessToken: string;
|
|
83
|
+
expiresInSeconds?: number;
|
|
84
|
+
refreshToken?: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A copy of the Node.js driver's `OIDCRequestFunction`
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
export type OIDCRequestFunction = (principalName: string | undefined, idl: OIDCMechanismServerStep1, abortSignal?: OIDCAbortSignal | number) => Promise<OIDCRequestTokenResult>;
|
|
91
|
+
/**
|
|
92
|
+
* A copy of the Node.js driver's `OIDCRefreshFunction`
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
export type OIDCRefreshFunction = (principalName: string | undefined, idl: OIDCMechanismServerStep1, result: OIDCRequestTokenResult, abortSignal?: OIDCAbortSignal | number) => Promise<OIDCRequestTokenResult>;
|
|
96
|
+
/** @public */
|
|
97
|
+
export type OIDCAbortSignal = {
|
|
98
|
+
aborted: boolean;
|
|
99
|
+
reason?: unknown;
|
|
100
|
+
addEventListener(type: 'abort', callback: () => void, options?: {
|
|
101
|
+
once: boolean;
|
|
102
|
+
}): void;
|
|
103
|
+
removeEventListener(type: 'abort', callback: () => void): void;
|
|
104
|
+
};
|
|
105
|
+
/** @internal */
|
|
106
|
+
declare const MongoDBOIDCErrorTag: unique symbol;
|
|
107
|
+
/** @public */
|
|
108
|
+
export declare class MongoDBOIDCError extends Error {
|
|
109
|
+
/** @internal */
|
|
110
|
+
private [MongoDBOIDCErrorTag];
|
|
111
|
+
constructor(message: string);
|
|
112
|
+
static isMongoDBOIDCError(value: unknown): value is MongoDBOIDCError;
|
|
113
|
+
}
|
|
114
|
+
export {};
|
|
115
|
+
//# source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B,SAAQ,KAAK;IACzC,gBAAgB;IAChB,OAAO,CAAC,CAAC,mBAAmB,CAAC,CAAQ;gBAEzB,OAAO,EAAE,MAAM;IAI3B,MAAM,CAAC,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB;CAMrE"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.MongoDBOIDCError = void 0;
|
|
5
|
+
/** @internal */
|
|
6
|
+
const MongoDBOIDCErrorTag = Symbol.for('@@mdb.oidcplugin.MongoDBOIDCErrorTag');
|
|
7
|
+
/** @public */
|
|
8
|
+
class MongoDBOIDCError extends Error {
|
|
9
|
+
constructor(message) {
|
|
10
|
+
super(message);
|
|
11
|
+
/** @internal */
|
|
12
|
+
this[_a] = true;
|
|
13
|
+
}
|
|
14
|
+
static isMongoDBOIDCError(value) {
|
|
15
|
+
return (
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
value && typeof value === 'object' && value[MongoDBOIDCErrorTag]);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.MongoDBOIDCError = MongoDBOIDCError;
|
|
21
|
+
_a = MongoDBOIDCErrorTag;
|
|
22
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;;AAsHA,gBAAgB;AAChB,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;AAC/E,cAAc;AACd,MAAa,gBAAiB,SAAQ,KAAK;IAIzC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QAJjB,gBAAgB;QACR,QAAqB,GAAG,IAAI,CAAC;IAIrC,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAC,KAAc;QACtC,OAAO;QACL,8DAA8D;QAC9D,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAK,KAAa,CAAC,mBAAmB,CAAC,CAC1E,CAAC;IACJ,CAAC;CACF;AAdD,4CAcC;KAZU,mBAAmB"}
|
package/dist/util.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { OIDCAbortSignal } from './types';
|
|
3
|
+
export declare function throwIfAborted(signal?: OIDCAbortSignal): void;
|
|
4
|
+
interface AbortCheckArgs {
|
|
5
|
+
signalCheck: () => void;
|
|
6
|
+
signalPromise: Promise<never>;
|
|
7
|
+
}
|
|
8
|
+
export declare function withAbortCheck<T extends (abortCheck: AbortCheckArgs) => Promise<any>>(signal: OIDCAbortSignal | undefined, fn: T): Promise<ReturnType<T>>;
|
|
9
|
+
export declare function errorString(err: unknown): string;
|
|
10
|
+
export declare const AbortController: {
|
|
11
|
+
new (): AbortController;
|
|
12
|
+
prototype: AbortController;
|
|
13
|
+
};
|
|
14
|
+
export declare const AbortSignal: {
|
|
15
|
+
new (): AbortSignal;
|
|
16
|
+
prototype: AbortSignal;
|
|
17
|
+
abort(reason?: any): AbortSignal;
|
|
18
|
+
timeout(milliseconds: number): AbortSignal;
|
|
19
|
+
};
|
|
20
|
+
export declare function timeoutSignal(ms: number): AbortSignal;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=util.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAQ/C,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAE7D;AAED,UAAU,cAAc;IACtB,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CAC/B;AACD,wBAAsB,cAAc,CAElC,CAAC,SAAS,CAAC,UAAU,EAAE,cAAc,KAAK,OAAO,CAAC,GAAG,CAAC,EACtD,MAAM,EAAE,eAAe,GAAG,SAAS,EAAE,EAAE,EAAE,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAoBpE;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAIhD;AAED,eAAO,MAAM,eAAe;;;CAE+C,CAAC;AAC5E,eAAO,MAAM,WAAW;;;;;CAE2C,CAAC;AAGpE,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,CAIrD"}
|