node_modules: update (#338)

Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
Dawid Dziurlaanddawidd6 authored and GitHub committed 2026-10-03 10:23:35 +02:00
1 parent e1936242ed
commit a9c5eb6c35
39 files changed
+799 -388

No files matched your search

+11 -3
View File
@@ -74,12 +74,14 @@ class XOAuth2 extends node_stream_1.Stream {
constructor(options, logger) {
super();
this.options = options || {};
this.configError = false;
if (options && options.serviceClient) {
if (!options.privateKey || !options.user) {
// reported through getToken() rather than an 'error' event: the transports forward
// that event up to the Mail object, where nothing may be listening
const err = new Error('Options "privateKey" and "user" are required for service account!');
err.code = errors.EOAUTH2;
setImmediate(() => this.emit('error', err));
return;
this.configError = err;
}
const serviceRequestTimeout = Math.min(Math.max(Number(this.options.serviceRequestTimeout) || 0, 0), 3600);
this.options.serviceRequestTimeout = serviceRequestTimeout || 5 * 60;
@@ -113,6 +115,9 @@ class XOAuth2 extends node_stream_1.Stream {
getToken(renew, callback) {
// the error paths hand over the error alone
const done = callback;
if (this.configError) {
return done(this.configError);
}
if (!renew && this.accessToken && (!this.expires || this.expires > Date.now())) {
this.logger.debug({
tnx: 'OAUTH2',
@@ -349,7 +354,10 @@ class XOAuth2 extends node_stream_1.Stream {
method: 'post',
headers: params.customHeaders,
body: payload,
allowErrorResponse: true
allowErrorResponse: true,
// unset falls back to the fetch default, a stalled token endpoint would otherwise keep
// `renewing` set and queue every later request
timeout: params.requestTimeout
};
// OAuth2 token endpoints are credential-bearing. src/fetch already
// validates certs by default; pin rejectUnauthorized:true here so the