@mashroom/mashroom-utils
Advanced tools
Changelog
2.7.0 (July 8, 2024)
"authenticationExpiration": {
"warnBeforeExpirationSec": 60,
"autoExtend": false,
"onExpiration": {
"strategy": "reload"
}
},
Changelog
2.6.1 (Nay 12, 2024)
Changelog
2.6.0 (April 6, 2024)
export default class MyInterceptor implements MashroomHttpProxyInterceptor {
async interceptRequest(targetUri) {
if (targetUri.startsWith('https://my-backend-server.com')) {
return {
addHeaders: {
'content-encoding': 'gzip',
},
streamTransformers: [
zlib.createGzip(),
],
};
}
}
async interceptResponse(targetUri, existingHeaders) {
if (targetUri.startsWith('https://my-backend-server.com') && existingHeaders['content-encoding'] === 'gzip') {
return {
removeHeaders: [
'content-encoding',
],
streamTransformers: [
zlib.createGunzip(),
],
};
}
}
}
Changelog
2.5.4 (January 28, 2024)
Changelog
2.5.3 (January 22, 2024)
Changelog
2.5.2 (January 19, 2024)
Changelog
2.5.1 (January 17, 2024)
Changelog
2.5.0 (January 10, 2024)
PM2 Metric Exporter: Allows it now to grab the OpenTelemetry metrics from PM2 workers via inter-process communication. Works similar to the approach previously implemented in the Prometheus Metric Exporter, only the serialization to Prometheus format is not done automatically
Prometheus Metric Exporter: BREAKING CHANGE Removed the possibility to fetch prometheus metrics via inter-process communication within a PM2 cluster
Metrics Collector: Uses now OpenTelemetry to gather and export metrics. Changes:
Due to the API structure of OpenTelemetry there are also BREAKING CHANGES if you use the metrics collector service in your custom plugins:
const collectorService: MashroomMonitoringMetricsCollectorService = pluginContext.services.metrics.service;
collectorService.addObservableCallback((asyncCollectorService) => {
// ... somehow get the value to measure
asyncCollectorService.gauge('http_pool_active_connections', 'HTTP Pool Active Connections').set(theValue);
});
Portal: Added metrics for remote resource requests (mashroom_portal_remote_resources_), like request count, error count and pool stats
HTTP Proxy: The proxies do no longer automatically add x-forwarded- headers, because if you are using public APIs you might not want to disclose details of your internal network. Added a new config property createForwardedForHeaders to explicitly turn this feature on again. Also fixed the implementation, it takes now existing headers from reverse proxies into consideration and keeps them or extends them (which means x-forwarded-for contains now the IP address of the original client as well if there are reverse proxies).
HTTP Proxy: Added metrics:
BREAKING CHANGE Renamed metrics:
HTTP Proxy: The pool properties like poolMaxSocketsPerHost are now only for HTTP requests, WebSockets are handled separately and can be limited by wsMaxConnectionsPerHost
HTTP Proxy: Added a new implementation based on the Node.js Stream API, which is also the default now. It deliberately does not use any 3rd party libraries, because those available (like request and node-http-server) are either deprecated or unmaintained. It uses the Stream.pipeline API introduced in Node.js 10 which has an improved error handling and cleanup mechanisms compared to the old Readable.pipe used by most libraries. The performance and resource usage characteristics are very similar to the node-http-proxy based implementation. According to our tests you can even expect slightly improved throughput. If you run into to troubles here you can switch back to the previous implementation like this:
"Mashroom Http Proxy Services": {
"proxyImpl": "nodeHttpProxy"
}
HTTP Proxy: Return HTTP 502 (Bad Gateway) instead of 503 if the target does not respond or is not available
HTTP Proxy: Fixed target URL in metrics (protocol part contained two colons)
Portal: Fetching and delivering App resources (js/css) improved
"Mashroom Portal WebApp": {
"resourceFetchConfig": {
"fetchTimeoutMs": 3000,
"httpMaxSocketsPerHost": 10,
"httpRejectUnauthorized": true
}
}
mashroom-utils refactoring: Added an index file that should be used exclusively to import utils BREAKING CHANGE: If you have used mashroom-utils in your custom plugins you have to change the imports
LDAP Security Provider: Fixed escaping of special characters in the DN. Didn't work if the same special character occurred multiple times.
Dropped support for Node.js 16 - required is now >= 18
All 3rd party libraries upgrades and switched to npm workspaces for dependency management BREAKING CHANGE: The request.session type no longer accept any property, you have to declare your session properties like this now:
declare module 'express-session' {
interface SessionData {
foo?: string;
}
}
File Storage: Performance improvements:
HTTP Proxy: fixed deprecated API usages
Changelog
2.4.5 (November 29, 2023)